SMSCON

SMSCON provides complete control of your N900 by sending SMS messages to it. This is particularly handy in case you cannot find your phone, for example if it has been lost or stolen. SMSCON is a two part Python script running in CLI;  and. is the CLI control part and  is the "running in the background" part. The configuration file for all the user settings is in the  file. =Functionality=

SMSCON can:


 * autoload at boot (this is default set at install of smscon package); when device reboots it loads  in the background.
 * creates a log file (on the device).
 * detect SIM card change and sends new phonenumber and IMSI code (returns SMS) to other known mobile number; if somebody has stolen your phone and put his/hers own SIM card in it.
 * send current GPS location coordinates (returns SMS or EMAIL with GoogleMaps picture with your phone's location on it).
 * reboot the phone; only works if your SIM card hasn't a lock code.
 * shutdown the phone.
 * open a reverse ssh connection to your own server (GPRS connection); control the phone at CLI level from your own home server.
 * email a frontcam picture to your email address (GPRS connection); to see where your phone is or who is using it.
 * send the current remaining battery charge (returns SMS).
 * make the phone call you; you can listen where your phone is (returns phonecall)
 * lock the phone; nobody can use your phone anymore.
 * detect keyboardslider use; when somebody has found your phone and uses the keyboard. (only after one of the valid SMS commands is send to you phone) (returns SMS)
 * send all valid SMS commands to you if you forgotten it (returns SMS's)

=Installation=

SMSCON & SMSCON Editor can be found in the Extra-devel repository (if enabled on your phone).

SMSCON is writen in Python and needs the following packages, besides python2.5, being installed on your device to install and run:

python-crypto /* NEW IN VERSION 0.5-5 */ python-gobject python-location python-dbus pexpect gstreamer-tools openssh-client openssh-server

The two ( and  ) are placed by the installer in the   directory /* NEW IN VERSION 0.5-5 */ .

The installer will also generate a  file in   for autoloading at boot of the device.

Finally SMSCON generates a default template file with all the user settings of SMSCON. This *must* be edited by SMSCON Editor before use of SMSCON. Also you need a fixed IP address on your remote server for the SSH (port 22) connection, if you want to use the 'Remoteon' / 'Remoteoff' function of SMSCON.

=Usage= SMSCON is triggered by a SMS message with a predefined known command and then will execute the task in the background. If so it will send a reply SMS or email with the information.

Commands
The (default) predefined 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_LOCK     = 'Lock' COM_UNLOCK   = 'Unlock' COM_TRACKON  = 'Trackon' COM_TRACKOFF = 'Trackoff'

NOTE: These commands can be changed using the SMSCON Editor


 * 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 device. 'Unlock' will remove the lock.
 * Sending 'Trackon' will continiously send SMS or email (or both) with location of the device & 'Trackoff' will disable this.

USAGE EXAMPLE: The  file:
 * To trigger any of the commands the phone should receive an SMS having in the subject its defined name. E.g. to trigger the  command the phone should receive:.
 * The commands can use spaces in them and can be altered in a command only you know what it is and what it means.


 * 1) smscon user settings (v0.5-5)
 * 2) (DO NOT edit the user settings below, use SMSCON-editor!)

SENDERNUMBER     = '+XXXXXXXXXXX'
 * 1) SMS settings

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'
 * 1) SMS commands

EMAILADDRESS     = 'XXXXX@XXXXXXXXXXX.XX' USER             = '' PASSWORD         = '' EMAILFROM        = 'XXXXXXXX@XXXXXX.XX' MAILSERVER       = 'XXXX.XXXXXX.XX' MAILPORT         = XXX
 * 1) Email settings

REMOTEHOST       = 'XXXXXXXXXXX.XX' REMOTEPORT       = 22 REMOTEUSER       = '' REMOTEPASSWORD   = ''
 * 1) SSH settings

COMMANDREPLY     = 'yes'
 * 1) Send acknowledge SMS
 * 2) (send acknowledge sms after receiving valid sms command: 'yes' / 'no')

KEYBOARDDETECT   = 'yes'
 * 1) Detect keyboard use
 * 2) (send acknowledge sms if keyboard is used: 'yes' / 'no')

AUTODEVICELOCK   = 'yes'
 * 1) Device lock
 * 2) (lock device after receiving valid sms command: 'yes' / 'no')

GPSTIMEOUT       = 600 GPSPOLLING       = 3 GPSINTERVAL      = 60 GPSSEND          = 'email'
 * 1) GPS setings
 * 2) (if no GPS coordinates acquired after 600 seconds then stop)
 * 1) (number of GPS coordinates to acquire and use the most accurate in "Location"-mode)
 * 1) (time between sending coordinate sms in "Trackon"-mode: 10 / 20 / 30 / 60 / 120)
 * 1) (method to send GPS coordinates: 'email' / 'sms' / 'both')

Options
The available options for SMSCON are: Nokia-N900:~# smscon

smscon v0.5-5 - Nokia N900 remote control utility
Options: -start     : start smscon_daemon -stop      : stop smscon_daemon -status    : get smscon_daemon status -log       : show log file -del log   : erase log file -sms       : show sms commands -config    : show smscon_config file -boot      : start smscon_daemon at device boot -unboot    : remove start of smscon_daemon at device boot -help      : this help menu Special options (normally not needed!): -reset     : factory default -imsi      : show imsi code file -del imsi  : delete smscon_code file -init      : create default smscon_config file -del config : delete smscon_config file

SMSCON is intended for people who have Python programming / Linux experience so you can adjust the script to their own needs.

After installation
After installation  will generate a new configuration file  which you *must* edit to your own needs (i.e. change all xxxxxxx's). To edit this only use SMSCON Editor, which will assist in the configuration setup.

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

The first time you start SMSCON it loads the configured user settings file and is now active. then stores your valid IMSI code in a file 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  file. This is how the "SIM card change" will be detected.

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

All user action and behavior of  will be logged in the log file:

Nokia-N900:/# smscon -log SMSCON INFO: smscon_daemon is running (17-09-2010 00:29:14) DAEMON INFO: succesfully loaded "smscon_config" file DAEMON INFO: reading valid IMSI code (XXXXXXXXXXXXXXX) from file DAEMON INFO: authorized IMSI code found DAEMON INFO: smscon autoloads at boot

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

=Current version v0.5-5=

Completely remove previous version (v0.4.4-x) from your Nokia phone before using v0.5 or higher

(reason: due to change in settings of  file)!


 * NEW: in reply SMS from COM_LOCATION command is http link added to GoogleMaps.
 * NEW/CHANGE: optification of SMSCON; new install path of package is now /opt/smscon.
 * REFACTORING: improved the way SMS is send (more stable & controlled).
 * REFACTORING/FIX: execption in email sending code failed.
 * CHANGE: in SMSCON test modes usage of WLAN connection only if already connected, otherwise usage of GPRS connection.
 * CHANGE: in SMSCON test modes if usage of GPRS connection, previous connection is saved & re-enabled after GPRS connection usage.
 * CHANGE: if usage of GPRS connection, force Internet connections to GPRS connection (needed for keeping the connection alive/stable).
 * CHANGE: new SMSCON icon (meets requirements of maemo package)
 * CHANGE: new package description (meets requirements of maemo Extra-testing package)
 * FIX: internal fixes (better consistency in logging).
 * FIX: email attachment (camera picture or Google map) is displayed completely wrong (alt text was wrong/mixed etc.)
 * FIX: remove unused variable in ConfigVars list.
 * FIX: syntax bug fixed which could crash SMSCON.

=Known Issues=

v0.4.4-6

 * email attachment (camera picture or Google map) is displayed wrong. (confirmed by creator)

v0.4.4-5

 * COM_REBOOT & COM_POWEROFF command fail when used. (confirmed by creator)
 * alt text of email image in email is wrong.

v0.4.4-4

 * COM_REBOOT & COM_POWEROFF fails if changed. (confirmed by creator)
 * COM_CALL fails. (confirmed by creator)

v0.4.4-3

 * if default COM_REBOOT & COM_POWEROFF commands are changed command fails to execute (confirmed by Saturn) Fix in 0.4.4-4.

v0.4.4-2

 * dependancy list of SMSCON installer is incorrect (confirmed by creator)

v0.4.4-1
REMOVE PREVIOUS VERSION FROM NOKIA BEFORE USING 0.4.4-1 or higher (reason: major change in  file)!


 * smscon won't autoload at boot (confirmed by creator). Fix in 0.4.4-2.

v0.4.3

 * command "Trackon" is reported not to work (confirmed by creator)
 * does not start at boot when requested (confirmed by creator)
 * sms commands cannot accept spaces (confirmed by creator)
 * smscon doesn't load at boot. (confirmed by creator)
 * "Trackon" (& "Trackoff") command doesn't work. (confirmed by creator)
 * bug in selecting the right GPS mode if GPRS data network is available (usage of AGPS (faster) or GPS (slower)). (confirmed by creator)
 * when using command "Location" GPRS data network is not automatically enabled.
 * GPSTIMEOUT routine doesn't work as expected/intended. (confirmed by creator)
 * when "Location" & "Trackon" commands are used, internal smscon events are discarted/hold until GPS is finished. (confirmed by creator)
 * discovered a initial GPS control design flaw in smscon. (confirmed by creator)

v0.4.2

 * the default number is replaced by every mail received and not only those requesting a command. (confirmed & fixed in version 0.4.3)

v0.4.1

 * command "Trackon" is reported not to work (confirmed)
 * Reply command sends duplicates (unconfirmed)

v0.4.0

 * will not work due to a typo in variable name (confirmed and fixed in version 0.4.1)

=Future release=

v0.5-6


 * Added new command-line option for smscon to set encrypted user settings in  file.

=Future development ideas=

Feel free to add requests below.


 * saving all  user variables in gconf database. No need for   file anymore.
 * when sending test email (using GPRS data connection), previous connection state should be restored. (AVAILABLE from v0.4.4-6)
 * when SMSCON stops, Internet connection preference (Settings --> Internet connections) should be restored to previous state before running SMSCON. (AVAILABLE from v0.5-5)
 * extend setting GPSSEND to take option "both" (and not only sms or email). (AVAILABLE from v0.4.4-6)
 * 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.
 * add setting to choose the default internet connection (WLAN, GPRS, or ANY). At the moment hardcoded to GPRS. (WONT FIX)
 * 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.

=Testers needed= Please test this software, I like to hear if it works for you or not. I only could test it 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.