SMSCON

Please Note: Update for 0.9.13++ is in progress for this page but will take another couple of days. The information up to, not including "Usage" is now updated already. The remaining parts is being worked on. -- yablacky 00:06, 13 January 2012 (UTC)

Contents

Introduction

SMSCON provides complete control of your N900 by sending SMS commands to it. Other methods are supported as well - we come this is later - but SMS is easiest way and it is the reason why this app is named SMSCON.

Remote controlling your phone is particularly handy in case you cannot find it, for example if it has been lost or even stolen. The first approach to find the phone is giving it a usual phone call awaiting to hear it ringing somewhere in your coat-pocket or the like. If this doesn't help, SMSCON comes into play.

SMSCON can't guarantee that you will find your phone again, but it will provide the maximum chance to recover it. If this application ever helps you to recover your phone please tell the story on Maemo.org! The best way is of course to never lose your phone or let it get stolen...

SMSCON Editor is a GUI helper application to configure and even test SMSCON operation. We recommend normal users of the phone to use SMSCON Editor. Note that this is a separate application that installs additionally to SMSCOM.

Configuring SMSCON without SMSCON Editor is possible but you need some experience in unix command line. As almost ever, the command line offers maximum possibilities to adjust the application to your own needs.

WARNING: This application can send (multiple) SMS messages automatically (in the background). Be aware that SMS sending is not free and it's costs depends on the used telephone subscription with your Nokia device. Sending many SMS might be a minor problem for those having a SMS-flat-rate...

Features

  • Autoloads at boot. This ensures that SMSCON is active (that means is listening for commands) even after device (re)boot. Autoload is enabled by default during installation of a smscon package.
  • Create and keep a log file on the device. The log file can be queried remotely by SMS command as well as locally via command line.
  • Looking for commands in received SMS messages and/or by polling a remote command server (maintained by you, the user).
  • Sending notifications, responses and query results by SMS and/or by EMAIL.
  • Detect SIM card change. It will send a notification containing the new SIM card's phone number, IMSI code & telecom operator name. This scenario happens if somebody has stolen your phone and replaces your SIM by his/hers own SIM.
  • Optionally unlock the phone on detection of SIM card change. -- Why unlocking? Well, unlocking makes sense when regular phone owner is more interested on finding the actual device than as keeping its private/sensitive phone data protected/locked. A locked phone prevents even to enter the SIM card PIN. Consequently telephone functions do not work either. This is very secure but makes it almost impossible to contact the phone after booting with unknown SIM card installed. Note that a finder may remove the SD-memory card to read its content.
  • Lock the phone by command. Nobody can use your locked phone until it receives an unlock command.
  • Send notification about current GPS location coordinates via SMS message and/or EMAIL. Those EMAIL have even attached a GoogleMaps picture with your phone's location on it.
  • Track the phone's GPS location and location changes by let it automatically send repeated notifications in a selectable time interval.
  • Reboot the phone. This is just possible but not generally recommended: if your SIM card has a lock code and nobody enters it correctly, it would boot but could not connect to GPRS network.
  • Shutdown the phone. Also just possible but not generally recommended.
  • Open a (reverse-)SSH connection to your own (home-)server to control the phone at command-line level from your own home (or any other) computer.
  • Let front camera take pictures and send them via email notification. With a some luck you may see where your phone is or who is using it.
  • Detect and send notification about the current battery charge level and status.
  • Let the phone make a voice call to your controlling phone. Once the call is established you can listen where your phone is.
  • Detect keyboard slider movement and send notification about that. Keyboard usage might indicate that somebody has found your phone.
  • Let the phone send all recognized SMS commands to you, e.g. if you've forgotten them. This way you need just to remember the code of one single command (the COM_CHECK command).
  • Run a pre- and user-defined shell script to start other programs, delete files etc. May be used to wipe out sensitive data from phone. Direct wipe commands are not provided by SMSCON. Writing (and testing) a script doing so is at your own risk.
  • Run directly a shell command through SMS message sending where result is immediately reported.
  • Optionally turn the phone silent after SMSCON receives a known command.
  • Automatically and optionally send notification about the current battery status when SMSCON receives a known command.
  • Use multiple SIM cards.
  • Play a pre- and user-defined sound file (only WAV supported). May be used instead of just let the phone ring and let it say a special message.
  • Can kill & restart the background daemon by SMS command. This might be preferred operation instead of rebooting the phone.
  • Send notifications if background daemon crashes. Should this ever happen, you're encouraged to forward them to the SMSCON developer team (make a bug report).

Files

This section is a description of what you get when installing SMSCON. This is not a must-read when getting in touch with SMSCON for the first time.

If not otherwise stated, the location of all files mentioned in this section is /opt/smscon.

SMSCON is a command line application whose executables parts are mainly:

  • smscon, the command-line control part and
  • smscon_daemon the daemon part, running in the background.

SMSCON is highly configurable and all the settings are stored in the smscon_config file. Many settings are stored encrypted, so - from version 0.9.3 on - do not edit the file directly. See below for how to change settings.

Files intended to be edited by user directly

  • smscon_script, a unix shell script to extend SMSCON functionality. This script is intended to be edited by the gentle user. The installation of SMSCON provides a file with some non-destructive example code. SMSCON executes the script in the background with root-rights when receiving a COM_CUSTOM command. You need to be root to change smscon_script.
  • alarm.wav, a WAV-format sound file. SMSCON plays the sound when receiving a COM_ALARM command. A special sound file (suitable to all languages) is provided by default. You're encuraged to replace it by your own sound. Write it to /opt/smscon/alarm.wav. Note: currently only WAV sound is supported by SMSCON.

Files used internally

None of these files are intended to be viewed or even edited by a user directly. So don't do it. Use SMSCON commands to view and change them in a consistent way:

  • application program files and libraries
  • several log files
  • internal configuration files
  • temporary files to hold camera pictures, google maps etc.
  • last not least, there are some internal files not stored in /opt/smscon.

Names of internal files are not mentioned here by design. They are matter to change without notice as is the existence of this files itself.

Files from other packages

The installation of SMSCON via application manager ("HAM") usually installs other software packages implicitly. They are also de-installed on SMSCON's de-installation (via HAM) in case they are no longer referenced otherwise.

Besides python2.5 this is:

python-crypto 
python-gobject
python-location
python-dbus
pexpect
gstreamer-tools 
openssh-client
openssh-server
alsa-utils   /* NEEDED IN >= 0.8.1 */

As said above, regular use of SMSCON does not require knowledge of files nor packages used.

Installation

The SMSCON & SMSCON Editor packages can be found in the Extras repository and can be installed using the Application Manager (HAM).

Always install the latest stable version on your phone; previous version can have bugs and have less functionality!

On very first installation, SMSCON generates

  • a default settings file with all the user settings of SMSCON.
  • an IMSI database to store IMSI numbers of SIM cards allowed. Other SIM cards will cause detection of SIM card change and optionally unlock of the device on boot.
  • a default smscon_script file with example code for COM_CUSTOM command.
  • a default alarm.wav file for COM_ALARM command.
  • a SMSCON logfile.

On installation of update versions (since 0.9.*) , SMSCON

  • updates the settings file to disable obsolete settings
  • updates the settings file to add new settings
  • leaves IMSI database untouched
  • leaves smscon_script file untouched
  • leaves alarm.wav file untouched
  • tries to repair previous SMSCON installation.
  • adds entries to SMSCON logfile.

Before using SMSCON the first time

It is highly recommended to review user settings and adjust them to your needs.

We recommend use of SMSCON Editor. Hackers may use the smscon command on unix command line.

Most important is to set up the so-called master number. This is a phone number, namely the phone number of the main controlling phone. It can but should not be number of your N900 being controlled - this would be nonsense. It can also be left empty if you don't want to use the functionallity that master-number offers. Best choice is to use the number of a second phone in your phone-portfolio. The number of your boy- or girlfriend's phone also does. No matter if that is a N900 as well.

Controlling your N900 is not restricted to the master number's phone. Any phone in the world can be used to send controlling SMS to your N900 and SMSCON sends SMS responses to it. One role of master numers's phone is to receive a blind copy of all SMS that SMSCON sends to other phones.

This is handy in case your N900 got lost and someone else concurrently tries to controll it. Your master number's phone will always be notified.

Another role of master number comes into play if you start to controll your N900 using different methods than SMS. We come to that later.

Setting the master number

  • A typo-aware way to set the master number to a particular phone's number is using SMSCON Editor version 0.9.8 or higher and it goes like this:
  1. Open SMSCON Editor, ensure daemon runs, quit SMSCON Editor.
  2. Send a SMS from the particular phone to your N900. The message text must be Check no more no less (provided all settings are default yet - otherwise use your own code).
  3. Wait until the SMS was received by your N900.
  4. Again open SMSCON Editor go to "General" settings page.
  5. Enter the "last sender" number exactly as shown in the "master number" field above.
  6. Close "General" settings page and quit SMSCON Editor
  • Set master number directly:
  1. Open SMSCON Editor go to "General" settings page, fill in "master number" field. Leave the field empty if you don't want to use master-number features.
  2. Hackers may do this:
$ smscon -set MASTERNUMBER +xxyyyyyyyyyy
$ smscon -set MASTERNUMBER "" # no master number

All phone numbers should be entered with country prefix. Not only ensures this that SMS are send successfully regardless where your phone actually is located. It further is essential to make phone numbers compareable.

Setting other options

  • if you want to use the SSH connection feature of SMSCON (i.e. 'Remoteon' and 'Remoteoff' commands), you also need a fixed IP address on your preconfigured remote server for the SSH (default port 22) connection.
  • to be continued...

Usage

This section explains how to operate in case you need to control your phone remotely. You need at least one of this:

  • the ability to send SMS to your phone, or
  • access to the remote command server your phone is polling.

To send SMS any phone does. Security note: From a foreign phone, remember to remove all SMS you sent from that phones SMS-sent-history. Otherwise someone else may send them later again. If you're lucky to hold your N900 in hands again, then defining different command prefix/suffix asap is a recommended alternative or additional security option.

Won't miss to say: For using a remote command server, SMSCON and the command server must be setup and configured accordingly before you lost your phone.

No matter if SMSCON is triggered by a SMS message or by remote command server, it will first and optionally reply an acknowledge message and then execute the command in the background.

Commands usually generate a reponse that SMSCON sends as an SMS-reply, EMAIL, both (SMS and EMAIL) or not et all. If SMS replies are enabled, they go to the phone that sent the command and to the master number if one is defined (only once if both numbers are the same). If the command comes from remote command server and SMS replies are enabled, they go to the master number if one is defined.

Commands

The (default) predefined SMS commands are:

Nokia-N900:~# smscon -sms
COM_CHECK         = 'Check'
COM_REBOOT        = 'Reboot'
COM_POWEROFF      = 'Poweroff'
COM_POWER         = 'Power'
COM_LOCATION      = 'Location'
COM_REMOTEON      = 'Remoteon'
COM_REMOTEOFF     = 'Remoteoff'
COM_CAMERA        = 'Camera'
COM_CALL          = 'Call'
COM_LOG           = 'Log'   /* NEW IN 0.9.x */
COM_LOCK          = 'Lock'
COM_UNLOCK        = 'Unlock'
COM_TRACKON       = 'Trackon'
COM_TRACKOFF      = 'Trackoff'
COM_CUSTOM        = 'Script'  
COM_CUSTOMLOG     = 'Script.log'   /* NEW IN 0.9.x */
COM_SHELL         = 'uptime'
COM_ALARM         = 'Alarm'   /* NEW IN 0.8.1 */
COM_RESTART       = 'Restart'  /* NEW IN 0.8.1 */

These commands can be changed using the SMSCON Editor and also at the command-line with the smscon -set command (see SMSCON command-line options).

  • When sending 'Check' to you phone it sends one or more SMS messages with all the available SMSCON commands.
  • Sending 'Reboot' it will reboot your phone.
  • Sending 'Poweroff' is will shutdown your phone.
  • Sending 'Location' is will send it's current position by SMS or EMAIL (or both).
  • Sending 'Remoteon' it will enable the SSH connection to your (home-)server. 'Remoteoff' will kill the connection.
  • Sending 'Camera' will send a frontcam picture by email.
  • Sending 'Call' will call you.
  • Sending 'Lock' will lock the device, so nobody can use your phone. 'Unlock' will remove the device lock.
  • Sending 'Trackon' will continiously send SMS or email (or both) with location of the device & 'Trackoff' will disable this.
  • Sending 'Script' will run a predefined by user shell script (/opt/smscon/smscon_script).
  • Sending 'uptime >> /tmp/shell_log' (an example shell command) will exectute the shell command on your phone (no checks & output are returned!)
  • Sending 'Alarm' will play once a user selectable file (only WAV format and must be named alarm.wav in /opt/smscon directory) NEW IN 0.8.1
  • Sending 'Restart' will kill the smscon_daemon and restart it. NEW IN 0.8.1

USAGE EXAMPLE:

  • To trigger any of the commands the phone should receive an SMS having in the subject its defined name. E.g. to trigger the COM_LOCATION command the phone should receive: Location.
  • The commands can use spaces in them and can be altered in a command only you know what it is and what it means.
  • the alarm audio file (only WAV format and must be named alarm.wav) must be placed, if the option is used, in /opt/smscon. NEW IN 0.8.1
  • To trigger any of the commands by a remote file on your own server (when option ENABLECHECKHOST is enabled), the file only must contain one of the following values from 00, 01 to 17 or -1:
01 = COM_CHECK
02 = COM_REBOOT
03 = COM_POWEROFF
04 = COM_POWER
05 = COM_LOCATION
06 = COM_REMOTEON
07 = COM_REMOTEOFF
08 = COM_CAMERA
09 = COM_CALL
10 = COM_LOCK
11 = COM_UNLOCK
12 = COM_TRACKON
13 = COM_TRACKOFF
14 = COM_CUSTOM
15 = COM_SHELL
16 = COM_ALARM
17 = COM_RESTART

When value is 00 smscon_daemon will not be activated (normal situation) and when value is -1 the smscon_daemon will be restarted. It is of course necessary that the file on your server publically can be reached by your Nokia device, otherwise it won't work. Check this! The default CHECKTIME is 15 minutes (this can be changed by user), so when you change the content of your file it can take a maximum CHECKTIME minutes to execute the command. NEW IN 0.8.1


The user editable settings of the smscon_config file:

# smscon user settings (v0.8.1)
# (DO NOT edit the encrypted user settings below, use SMSCON-editor or SMSCON!)

# SMS number
SENDERNUMBER      = '+1234567890'

# SMS commands
COM_CHECK         = 'Check'
COM_REBOOT        = 'Reboot'
COM_POWEROFF      = 'Poweroff'
COM_POWER         = 'Power'
COM_LOCATION      = 'Location'
COM_REMOTEON      = 'Remoteon'
COM_REMOTEOFF     = 'Remoteoff'
COM_CAMERA        = 'Camera'
COM_CALL          = 'Call'
COM_LOCK          = 'Lock'
COM_UNLOCK        = 'Unlock'
COM_TRACKON       = 'Trackon'
COM_TRACKOFF      = 'Trackoff'
COM_CUSTOM        = 'Script'
COM_SHELL         = 'uptime >> /tmp/commandlog'
COM_ALARM         = 'Alarm'   /* NEW IN 0.8.1 */
COM_RESTART       = 'Restart'   /* NEW IN 0.8.1 */

# REMOTE command   /* NEW IN 0.8.1 */
# (check server file at remote host to trigger smscon: 'yes', 'no')
ENABLECHECKHOST   = 'no'
# (check host)
CHECKHOST         = 'www.bla.com/filetocheck'
# (check interval in minutes)
CHECKTIME         = 15

# Email settings
EMAILADDRESS      = 'bla@bla.com'
# (encrypted setting)
USER              = '<ENCRYPTED>'
# (encrypted setting)
PASSWORD          = '<ENCRYPTED>'
EMAILFROM         = 'bla@bla.com'
MAILSERVER        = 'www.bla.com'
MAILPORT          = 25

# SSH settings
REMOTEHOST        = 'www.bla.com'
REMOTEPORT        = 22
# (encrypted setting)
REMOTEUSER        = '<ENCRYPTED>'
# (encrypted setting)
REMOTEPASSWORD    = '<ENCRYPTED>'

# Reply message settings
# (method to send reply messages: 'sms' / 'email' / 'both' / 'none')
MESSAGESEND       = 'sms'
# (enable resending of reply message after <RESENDTIME> minutes
#  until successful sending; 'yes' / 'no')
ENABLERESEND      = 'no'
# (resend waiting time in minutes)
RESENDTIME        = 15

# Send acknowledge SMS
# (send acknowledge SMS after receiving valid SMS command: 'yes' / 'no')
COMMANDREPLY      = 'no'

# Detect keyboard use
# (send acknowledge SMS if keyboard is sliding: 'yes' / 'no')
KEYBOARDDETECT    = 'no'

# Device lock
# (lock device after receiving valid SMS command: 'yes' / 'no')
AUTODEVICELOCK    = 'yes'

# Auto battery status SMS report
# (sends SMS when SMSCON is set active with a SMS command & battery
#  is depleting: 'yes' / 'no')
AUTOBATREPORT     = 'no'

# Auto device unlock
# (unlocks device when new SIM is inserted; 'yes' / 'no')
SIMUNLOCK         = 'no'

# Silence the phone 
# (disable all phone sounds when SMSCON is set active with a SMS command: 'yes' / 'no')
SILENCEDEVICE     = 'no'

# GPS settings
# (if no GPS coordinates after <GPSTIMEOUT> seconds then stop aquiring)
GPSTIMEOUT        = 1800
# (number of GPS coordinates to acquire and use the most accurate in "Location"-mode)
GPSPOLLING        = 3
# (time between sending GPS coordinate SMS in "Trackon"-mode: 10 / 20 / 30 / 60 / 120)
GPSINTERVAL       = 60
# (method to send GPS coordinates: 'email' / 'sms' / 'both')
GPSSEND           = 'sms'

Options

The available command-line options for SMSCON are:

Nokia-N900:~# smscon -help
== smscon v0.8.1 - Nokia N900 remote control utility ==
 Options:
   -start             : start smscon_daemon
   -restart           : stop & restart smscon_daemon
   -stop              : stop smscon_daemon
   -status            : get smscon_daemon status
   -log               : show log file
   -del log           : erase log file
   -sms               : show SMS commands
   -set name "value"  : set user setting (name = "value")
   -config            : show config file
   -script            : show script file
   -boot              : start smscon_daemon at device boot
   -unboot            : remove start of smscon_daemon at device boot
   -add imsi          : add current IMSI code to code file
   -remove imsi       : remove current IMSI code from code file
   -help              : this help menu
 Special options (normally not needed!):
   -reset             : factory default (delete boot, config, code & script file)
   -imsi              : show IMSI code file
   -del imsi          : delete code file
   -init              : create default config & script file
   -del config        : delete config file
   -del script        : delete script file

After installation

After installation smscon will generate a new configuration file (/opt/smscon/smscon_config) which you *must* edit to your own needs (i.e. change all xxxxxxx's). To edit this use SMSCON Editor, which will assist in the configuration setup, or use the command-line smscon -set option. Also a shell script file will be generated (/opt/smscon/smscon_script) were the user can predefine shell commands to run other programs, delete files etc.

SMSCON will also be installed to autoload at boot, this can be disabled with the command-line command smscon -unboot and re-enabled by smscon -boot or with SMSCON Editor.

The first time you start SMSCON (smscon -start) it loads the configured user settings file and is now active. smscon_daemon then stores your valid IMSI code in a file (/opt/smscon/smscon_code) if the file doesn't exist.

When later a new SIM card is inserted the new IMSI code is verified with the code in the stored smscon_code file. This is how the "SIM card change" will be detected.

Nokia-N900:~# smscon -start
smscon_daemon started.

All user action and behavior of smscon_daemon will be logged in the log file (at /opt/smscon/smscon.log):

Nokia-N900:~# smscon -log
SMSCON INFO: ----- smscon_daemon is started & running ----- 
DAEMON INFO: successfully loaded "smscon_config" file
DAEMON INFO: reading 1 valid IMSI code from "smscon_code" file
DAEMON INFO: authorized IMSI code found
DAEMON INFO: smscon auto-loads at boot

When having trouble with SMSCON always check the smscon.log file!

Remote SSH connection

When the (reverse-)SSH connection is made (default command 'Remoteon' / 'Remoteoff') you can from the server side (your own server) connect to your Nokia device with the following command:

ssh -p 8080 localhost -l root

Versions

0.9.11-2 Development

Availability: Extras-devel

Changelog

 FIX: Fixed repeated resending of sms or email in almost zero-time intervals in case resend-time interval was configured to less than 1 minute.
 ADD: Anonymized log files. Can be used to post logs in bug reports etc. Works like this: Logfile shown by command "smscon -log" is now anonymized by default (phone numbers, host names, IP-addresses)
  IMPORTANT NOTE(1): Anonymizing takes place with ABSOLUTELY NO guarantee!
  IMPORTANT NOTE(2): It is NOT A BUG if there is too much or "wrong" anonymizing. If new option "-pw password" was seen on command line before -log, then logfile is shown un-anonymized as before. And of course a super user has not limits anyway.
 CHANGE: Logfile is no longer readable by normal user.
 FIX(MINOR): Fixed typos and added more comments.	

0.9.10-1

Changelog

 FIX: If called in user mode, prevent -export or -export! option to create/write files that user has no permissin to create or write.
 FIX: Fix crash: TypeError: can only concatenate tuple (not "list") to tuple	

0.9.9-1

Changelog

 CHANGE: Deamon does no longer need to restart for switching between test mode and normal operation mode.
 FIX: Daemon now reads test command requests from a named pipe and works them off sequentially (allows to quickly start several tests in a short time).
 FIX: Fixed that COM_REMOTEOFF command did not work.
 FIX: Fixed daemon crash ("need more than 3 values to unpack")
 FIX (AGAIN): Force using busybox ps-command to ensure that process information like PID is at expected place.	

0.9.8-1

Changelog

 FIX: Fixed problems with daemon process ids on devices with extended "ps" command installed. This bug might prevent power users from using smscon. So this fix is reason for early release of new version.
 FIX: Fixed interchanged message parameters in smscon -init! command output.
 ADD: Added usage hints to initial smscon_script file (minor change).	


0.9.7-1

Changelog

 FIX: Send battery status notification if charge is below 10% AND discharging (not OR discharning). If devices can't tell change/discharge status; discharge is assumed.
 FIX: Don't check for bootloader if in test mode.
 FIX: Wrong error message that daemon did not start on devices with extended "ps" command installed.


0.9.3-1

Changelog

 REFACTURING:
          * Extracted common code to a library (smsconlib.py) which is now used by smscon_daemon, smscon control program and smscon-editor.
          * Added a lot of code comments.
          * Encapsulated many code into classes. E.g. the complete encyption stuff is now transparent to smscon control program and smsmcon editor.
          * Restructured code, written new and renamed a lot of old stuff.
          * Moved code from files "smscon" and "smscon_daemon" to pure python-modules (smscon_master.py and smscon_service.py respectively). The original files are now just jackets calling main() in associated python module. This allows to compile the modules and hiding source code.
 NEW:    Encryption now uses salt (formerly encrypted data can be read).
 FIX:    Encryption does no longer fail on text ending with curly open brace.
 NEW:    "MASTERNUMBER" concept: A SMS number stored in the config file that  does NOT change due to SMS commands like "SENDERNUMBER" does. Each SMS is send to both (only once if they are the same numbers, of course). SMS replies to commands which are not introduced by SMS (e.g. via CHECKHOST) are sent to the MASTERNUMBER only. On upgrading, the default MASTERNUMBER is set to the current SENDERNUMBER.
 NEW:    "COM_CUSTOMLOG" command: A SMS command to retreive the output of the last "COM_CUSTOM" command. Will be sent via email only - would send too much SMS...
 NEW:    "COM_LOG" command: A SMS command to retreive the smscon.log file. Will be sent via email only - would send too much SMS...
 NEW:    The output of "COM_SHELL" SMS command is now sent as a command reply. You may have to remove output redirections from your shell command to get non-empty reply.
 NEW:    "SMS_PARTS_LIMIT": A number to limit the number of single SMS that would otherwise be generated to send a too long SMS message. Zero means no limit.
 NEW:    "LOG_TIMEFORMAT": Format to be used in time stamps of SMS and EMAIL messages.
 NEW:    "SMS_COMPREFIX" and "SMS_COMSUFFIX": Instead of explicitly define all your SMS control commands (COM_xxx) to start with a unique prefix and/or suffix, you might now separately define a prefix and/or suffix that is implicitely used. While "SMS_COMPREFIX" and "SMS_COMSUFFIX" are empty, all your commands do as in older versions. Advantage of using "SMS_COMPREFIX" and "SMS_COMSUFFIX":
          * Prefix and suffix can be changed easyly while embedded COM_xxx remain unchanged.
          * Prefix and suffix apply to COM_SHELL command as well. Example:
              With the configuration set to:
                  COM_SHELL=uptime
                  SMS_COMPREFIX=aaa.
                  SMS_COMSUFFIX=.bbb
              The recognized SMS command to execute the shell command "uptime" is:
                  aaa.uptime.bbb
 FIX:    It is no longer possible to define two SMS commands as the same string except the empty string, which means to disable that command being given via SMS.
 FIX:    SMS command recognition is no longer restricted to ASCII characters. The complete GSM 7 bit default alphabet may be used now (but not unicode). This gives you a greather variete of chars to use for your SMS commands.
 NEW:    The config file will now upgrade automagically from any previous version. New options are set to their default, obsolete options are commented out.
 NEW:    New function to export and import settings to/from arbitrary file. (see smscon -export and -import options). smscon editor makes now use of this functions to retrieve a and deploy editable configuration.
 NEW:    The smscon_daemon does no longer need to be restarted explicitly if smscon changes a setting. The daemon detects changes automagically and will read and apply the new configuration automatically.
 NEW:    The smscon_daemon now maintains a "last known good" configuration and uses that as a fallback in case the "official" configuration of smscon can't properly loaded by the daemon.
 NEW:    Camera picture and GSP Location requests do no longer force unconditional switching to GPRS network connection. The current connection will be used if the internet is reachable. Should a GPRS connection be required to reach internet, the GPRS connection is established but the previous network is re-activated after picture and/or location has been replied.
 NEW:    A LOGGER is now used wherever possible. So the smscon.log file becomes really interesting.
 NEW:    The "CHECKHOST" URL is now extended by "?LASTMCD=nn&CHECKTIME=minutes" which will allow the URL being a script that may use this information.
 CHANGE: "CHECKHOST" now works more clear as follows: While polling for commands, a command is executed once, if it differs from the last polled command. The last polled command is initialized to "-1" on daemon start. Code "-1" is "restart daemon" and this obviously is what happened on daemon start. Code "17" (COM_RESTART) is deprecated as a CHECKHOST command. Since it is different from "-1" it may restart the daemon repeatedly. Use code "-1" to restart the daemon via CHECKHOST instead. Of course, before a change to code "-1" is recognized by the daemon, you must have give it a different command code. If in doubt use "01" (COM_CHECK) because it gives you feedback that the command has been seen.
 CHANGE: "CHECKTIME" may now be a float to specify fractional parts of a minute: 0.25 is 15 seconds.  
 NEW:    The "CHECKHOST" URL may now have a protocol prefix and it may be different from "http://". If the URL has no protocol prefix, then "http://" is supplied as default as in former versions (e.g. your config file remains valid in this point as well).
 NEW:    The battery status is logged before a command is about to be executed.
 NEW:    "REMOTELISTENIP", "REMOTELISTENPORT" and "REMOTE2LOCALPORT": These settings give you greather flexibility of setting up a tunnel to remote control your phone via a reverse ssh-connection: Use "REMOTELISTENIP" and "REMOTELISTENPORT" to define the tunnel entry maintained by the remote ssh-server (which must be setup to allow setting LISTENIP and PORT this way). "REMOTELISTENPORT" defaults to 8080 and "REMOTELISTENIP" defaults to "localhost" as in former versions. With these defaults you must be logged in at the ssh-server to start a remote control connection of your phone. While setting up "REMOTELISTENIP" you may even control the phone from somewhere else (in which case the ssh-server act as a proxy or relay). On the tunnel exit side, which is on your phone, the "REMOTE2LOCALPORT" is the port number where your phone's ssh-daemon is listening (usually 22).
 CHANGE: The "smscon -devconfig" command now requires a password to show the uncrypted configuration. The MASTERNUMBER is the password.
 NEW:    "RESENDMAXTRY": This option defines the maximum number of message re-send tries. Applies to SMS and EMAIL as well. (0=no limit) On configuration upgrade this is initialized to 10.
 NEW:    smscon now has a -sendsms option to send SMS immediately. Despite being a nice feature by itself, it makes smscon editor independent from smssend program which requires an extra package.
 NEW:    smscon now allows all options to start with the usual double dash as well.

0.8.1-3 (testing)

Changelog

  • CHANGE/FIX: bug in ENABLECHECKHOST option; would execute wrong command & updated wiki because of some changes. See WIKI/Usage!

Issues

  • Using Wrong 3G connection when fMMS is installed (MMS connection instead)(unconfirmed by Vanvan)
  • The "_" character does not get decoded correctly on reception and any command having this fails to execute. Recommended: until a fix is made avoid using this character in the commands. (confirmed)

0.8.1-2

Changelog

  • MINOR FIX: removed debug line in smscon code.

Issues

  • Using Wrong 3G connection when fMMS is installed (MMS connection instead)(unconfirmed by Vanvan)

0.8.1-1

Changelog

  • FIX: shutdown & reboot routine (EnablePoweroff & EnableReboot) give internal error.
  • NEW/CHANGE: expanded user setting MESSAGESEND ('sms', 'email', 'both' & 'none')
  • CHANGE: Removed DISABLESMS user setting. This is superseded by MESSAGESEND user setting!
  • CHANGE: with unauthorized SIM card change, SMS always will be send regardless of MESSAGESEND setting.
  • NEW: added smscon command (RESTART); user can restart smscon_daemon by SMS command.
  • NEW: added smscon command (COM_ALARM); phone will play user configurable sound file (only WAV format and must be named alarm.wav and placed in /opt/smscon directory) when command is received.
  • NEW: smscon_daemon sends SMS/email message if smscon_daemon crashes.
  • CHANGE: changed user setting ENABLERESEND ('yes', 'no'). Resending of messages will again be experimental feature!!!
  • CHANGE: removed MAXRESEND user setting (didn't work properly).
  • CHANGE: some log text changed/added.
  • CHANGE: removed updatechecker during installation of smscon (failed to work previously).
  • CHANGE: some changes in GPS message sending code.
  • CHANGE: AUTODEVICELOCK message is only send if COMMANDREPLY is enabled.
  • FIX: small bug in SMSsend().
  • FIX: bug in GPSINTERVAL handeling; GPSINTERVAL was always set at 60 sec. regardless of user setting.
  • CHANGE: The log file location changed from /tmp/smscon.log to /opt/smscon/smscon.log (whereas location of /tmp/smscon_boot.log did not change).

Issues

  • Using Wrong 3G connection when fMMS is installed (MMS connection instead)(unconfirmed by Vanvan)

0.7-2 (current extras)

Changelog

  • FIX: bug in RestoreNetwork(); restoring previous network could fail.
  • FIX: bug in CheckArguments(); execution of shell script could fail.

Issues

  • Using Wrong 3G connection when fMMS is installed (MMS connection instead)(unconfirmed by Vanvan)

0.7-1

Changelog

  • NEW: multiple IMSI codes are allowed in smscon_code file; use new option "smscon -add imsi" to store current IMSI code in smscon_code file.
  • NEW: added new user option (DISABLESMS); WARNING: disables ALL SMS sending in smscon program.
  • NEW: added new smscon command (COM_SHELL); run directly shell commands. (no check & feedback from command!).
  • NEW: added new user option (SIMUNLOCK); auto unlock phone after new SIM is inserted (to fool a possible thief of your phone).
  • NEW: added new user option (SILENCEDEVICE); disable all phone sounds (email alert, IM alert, ringing alert & SMS alert) in current active profile, if smscon is activated. All volume levels are set to zero.
  • NEW/CHANGE: new user option (AUTOBATREPORT); user can enable/disable sending automatically a SMS message when smscon is activated & device battery is depleting.
  • CHANGE: when initializing a new smscon_config file all user settings wil be set default to 'no'.
  • REFACTORING: some parts in both scripts.
  • FIX: better number handeling in SMSrecieve() routine (thanks to maemo.org user!).
  • FIX: small bug in GSMmodem() in smscon_daemon script.
  • FIX: small text bug in smscon script.
  • EXPERIMENTAL/CHANGE: when smscon fails to send SMS message (no cell reception) it will retry after 900 seconds.
  • EXPERIMENTAL/FIX: change in getting the right GPRS connections; MMS & WAP will be discarded in available GPRS network list.

Known issues

  • Bug in RestoreNetwork(); will be fixed in v0.7-2. (confirmed; thanks to Saturn)
  • Bug in CheckArguments(); will be fixed in v0.7-2. (confirmed; thanks to Saturn)
  • Please test & report on SMSCON thread on forum [1].


0.5 & 0.4 branch

  • Don't use these anymore and update to 0.7 or 0.8 branch!

Future release

  • CHANGE: for encryption of user settings in smscon_config file, now secret code key is based on device serial number (no more predefined key in script); this enhances security.

Future development ideas

Feel free to add requests below.

  • Add a provision for SMS reception without the UI being notified (so that SMSCON control is silent). INFO: Remote command server (CHECKHOST) already offers silent control.
  • saving all smscon_config user variables in gconf database. No need for smscon_config file anymore. (WONT IMPLEMENT)
  • add setting for user's country mobile number prefix.
  • add setting for alternative number (where alternative is a number sent a command and does not match the default) and option to choose where reply should be send, i.e. default number, alternative or both. Default number should not be replaced. INFO: Since 0.9.x there is a MASTERNUMBER concept. This is a default number that is never replaced
  • add setting to choose the default internet connection (WLAN, GPRS, or ANY).
  • when the "Camera" command is sent, the process should wait for keyboard action to capture a picture and send the mail. In that way, there will be more chances to get better face portrait of the "new" user.
  • Add the ability to run more than one custom command.
  • Application must be included in the ROM itself so that it cannot be removed. (CAN'T BE IMPLEMENTED)
  • Add a password so that no one else but the legitimate user can send an SMS to the phone and see where the phone is. (INFO: Use the prefix/suffix option in smscon editor application or set SMS_COMPREFIX/SMS_COMSUFFIX options via command-line)
  • Auto remove the received SMS from conversations.
  • Disable PhoneSpeakerSwitch on receipt of 'call' command.
  • EmailCON: check an specified email inbox, reading it with the program itself and not the built in default mail prog, at a given frequency, paying attention to commands written in the subject and/or body, accepting all the commands that are accepted via SMS. (WONT IMPLEMENT)
  • Improve handling of front camera to reduce the odds of crappy or plain blank black pictures being taken. (CAN'T BE IMPLEMENTED)
  • When in "stolen" mode, replace the front cam "recording" LED pattern with a on-lighting pattern for stealthiness.
  • Email, or post online somewhere you choose, any new photography taken with the main camera, geotagging whenever possible, preferably without showing any signs it's happening (if possible with an option to re-dimension the picture before sending).

Testers needed

Please test this software, I like to hear if it works for you or not. Please post on forum. I only can test the software with two Vodafone SIM cards from The Netherlands, I want to know if it also works with other cards and networks in other countries...

License

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 only.

Disclaimer

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.