SMSCON
digitalvoid (Talk | contribs) |
digitalvoid (Talk | contribs) |
||
Line 1: | Line 1: | ||
SMSCON provides complete control of your [[Nokia N900|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 provides complete control of your [[Nokia N900|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; <code>smscon</code> & <code>smscon_daemon</code>. Smscon is the CLI control part and <code>smscon_daemon</code> is the "running in the background" part. The | + | Smscon is a two part Python script running in CLI; <code>smscon</code> & <code>smscon_daemon</code>. Smscon is the CLI control part and <code>smscon_daemon</code> is the "running in the background" part. The configuration file for all the user settings is in the <code>smscon_config</code> file. |
- | + | ||
- | configuration file for all the user settings is <code>smscon_config</code>. | + | |
=What can it do= | =What can it do= | ||
Line 9: | Line 7: | ||
Smscon can: | Smscon can: | ||
- | * autoload at boot (this is default set at install of smscon package); | + | * autoload at boot (this is default set at install of smscon package); when device reboots it loads smscon_daemon in the background. |
- | when device reboots it loads smscon_daemon in the background. | + | |
* creates a log file (on the device) | * 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; | + | * 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. |
- | 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 location on it). | * send current GPS location coordinates (returns SMS or EMAIL with GoogleMaps picture with location on it). | ||
- | * reboot the phone; | + | * reboot the phone; only works if your SIM card hasn't a lock code. |
- | only works if your SIM card hasn't a lock code. | + | |
* shutdown the phone. | * shutdown the phone. | ||
- | * open a reverse ssh connection to your own server (GPRS connection); | + | * open a reverse ssh connection to your own server (GPRS connection); control the device at CLI level from your own home. |
- | control the device at CLI level from your own home. | + | * email a frontcam picture to your email address (GPRS connection); to see where your phone is or who is using it. |
- | * 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). | * send the current remaining battery charge (returns SMS). | ||
- | * make the phone call you; | + | * make the phone call you; you can listen where your phone is (returns phonecall) |
- | you can listen where your phone is (returns phonecall) | + | * lock the device; nobody can control your device anymore. |
- | * lock the device; | + | |
- | nobody can control your device anymore. | + | |
=Installation= | =Installation= |
Revision as of 15:01, 9 September 2010
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; smscon
& smscon_daemon
. Smscon is the CLI control part and smscon_daemon
is the "running in the background" part. The configuration file for all the user settings is in the smscon_config
file.
Contents |
What can it do
Smscon can:
- autoload at boot (this is default set at install of smscon package); when device reboots it loads smscon_daemon 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 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 device at CLI level from your own home.
- 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 device; nobody can control your device anymore.
Installation
Smscon is writen in Python and needs the following packages installed on your device to install and run:
apt-get install maemo-python-device-env (the Python language package) apt-get install python-location apt-get install pexpect apt-get install gstreamer-tools apt-get install openssh
The two (smscon, smscon_daemon) are placed in de [B]/usr/bin[/B] directory.
Also you need a fixed IP address on your remote server for the reverse-ssh (port 22) connection, if you want to use the 'Remoteon' / 'Remoteoff' function.
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 with the information.
The default commands are:
Nokia-N900:~# smscon -sms Check Reboot Poweroff Power Location Remoteon Remoteoff Camera Call Lock Unlock Trackon Trackoff
These commands can be altered in smscon_config file:
# smscon_daemon user settings (v0.4.0) # edit the settings below! # Sms settings SENDERNUMBER = '+XXXXXXXXXXX' # Sms commands CHECK = 'Check' REBOOT = 'Reboot' POWEROFF = 'Poweroff' POWER = 'Power' LOCATION = 'Location' REMOTEON = 'Remoteon' REMOTEOFF = 'Remoteoff' CAMERA = 'Camera' CALL = 'Call' LOCK = 'Lock' UNLOCK = 'Unlock' TRACKON = 'Trackon' TRACKOFF = 'Trackoff' # Email settings # (only works for smtp access without secure authentication!) EMAILADDRESS = 'XXXXX@XXXXXXXXXXX.XX' USER = 'XXXXXXXX' PASSWORD = 'XXXXXXXX' EMAILFROM = 'XXXXXXXX@XXXXXX.XX' MAILSERVER = 'XXXX.XXXXXX.XX' MAILPORT = 25 # Reverse-ssh settings REMOTEHOST = 'XXXXXXXXXXX.XX' REMOTEPORT = 22 REMOTEUSER = 'XXXXXXXXXXXXX' REMOTEPASSWORD = 'XXXXXXXXXX' # Send acknowledge sms # (send acknowledge sms after receiving valid sms command: 'yes' / 'no') COMMANDREPLY = 'no' # Device lock # (lock device after receiving valid sms command: 'yes' / 'no') AUTODEVICELOCK = 'no' # Gps setings # (if no gps coordinates acquired after 600 seconds then stop) GPSTIMEOUT = 600 # (number of gps coordinates to acquire and use the most accurate in "Location" mode) GPSPOLLING = 4 # (time between sending coordinate sms in 'Trackon' mode: 10 / 20 / 30 / 60 / 120) GPSINTERVAL = 60 # (method to send gps coordinates: 'email' / 'sms') GPSSEND = 'email'
Options for smscon are:
Nokia-N900:~# smscon == smscon v0.4.0 - 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 -help : this help menu Special options: -boot : start smscon_daemon at device boot -unboot : remove start of smscon_daemon at device boot -reset : factory default -imsi : show imsi code file -del imsi : delete smscon_code file -init : create default smscon_config -del config : delete smscon_config file
Smscon is intended for people who have Python programming / Linux experience so you can adjust the script to your own needs.
After installation
After installation smscon will generate a new config file (/usr/bin/smscon_config) which you *must* edit to your own needs (change all "xxxxxxx"'s). I use Putty / WinSCP on Windows for this. Don't use a Windows editor, this may break the config file! Smscon will also be installed to autoload at boot, this can be disabled with the command "smscon -unboot" and re-enabled by "smscon -boot" The first time you start smscon (smscon -start) it loads the configured user settings file and is now active. Smscon_dameon then stores your valid IMSI code in a file (/usr/bin/smscon_code) if the file doesn't exists. When later a new SIM card is inserted the new IMSI code is verified with the code in the stored file. This is the "SIM card change detect".
Nokia-N900:~# smscon -start smscon_daemon started.
All user action and behavior of smscon_daemon will be logged in the log file:
Nokia-N900:~# smscon -log SMSCON INFO: smscon_daemon active (09-09-2010 11:00:48) DAEMON INFO: user settings succesfully loaded from "smscon_config" file (09-09-2010 11:00:49) DAEMON INFO: reading valid IMSI code (XXXXXXXXXXXXXXX) from file (09-09-2010 11:00:49) DAEMON INFO: authorized IMSI code found (09-09-2010 11:00:49) DAEMON INFO: smscon autoloads at boot (09-09-2010 11:00:49)
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
Tester 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 & networks in other countries...
Current version v0.4.0
- bug fixes, bug fixes, bug fixes in data connection handeling (I hope, you test it).
- sms commands have changed; you can now use spaces in commands.
- smscon_dameon will use only GPRS connection for sending email & reverse-ssh connection.
- smscon_daemon will lock the device after first valid sms command is received (user configurable).
- smscon_daemon now stores the phonenumber where you send your control sms's from into smscon_config (SENDERNUMBER).
- added new control command "Lock" & "Unlock"; you now can lock & unlock your device so nobody can use your device.
- added new control command "Trackon" & "Trackoff"; continiously send (after GPSINTERVAL time) sms's (with current location) or email messages (with current location as a GoogleMaps picture).
- at the moment smscon can only connect to a smtp server (for sending email) without secure authentication. (will be solved in the future I hope).
- email sending & ssh connection -only works- through GPRS connection.
- when installing future updates of smscon user settings file (smscon_config) is not deleted or overwritten.
- command smscon -reset resets your complete configuration to the state after your smscon package installation. (deleting boot, config, code & log file)
- smscon_daemon will stop if no SIM card is found at boot. No sms sending/receiving capability --> no control.
- changed the way the log file is shown.
Future development
- saving all smscon_config user variables in gconf database. No need for smscon_config file anymore.
- only send camera picture (command "Camera") when keyboard slider is opened.
Disclaimer
If this software does harmfull/unwanted things (not to be expected) to your device in any way I can't be responsible for this.