SMSCON
m (→Commands) |
(wikify slightly) |
||
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 | + | SMSCON is a two part Python script running in CLI; <code>smscon</code> and <code>smscon_daemon</code>. <code>smscon</code> 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 the <code>smscon_config</code>. |
- | + | ==Functionality== | |
- | + | ||
- | =Functionality= | + | |
SMSCON can: | SMSCON can: | ||
- | + | * autoload at boot (when set); | |
- | + | ** 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). | |
- | + | * 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) | |
- | =Installation= | + | ==Installation== |
Download the latest version of SMSCON from its [http://smscon.garage.maemo.org/ garage project] | Download the latest version of SMSCON from its [http://smscon.garage.maemo.org/ garage project] | ||
Line 40: | Line 38: | ||
apt-get install openssh | apt-get install openssh | ||
</pre> | </pre> | ||
- | The three files (smscon, smscon_daemon & smscon_config) are placed in the directory: < | + | The three files (smscon, smscon_daemon & smscon_config) are placed in the directory: <code>/usr/bin/</code> |
Also a fixed IP address is needed on the remote server for the reverse-ssh (port 22) connection, if you want to use the 'Remoteon' / 'Remoteoff' command. | Also a fixed IP address is needed on the remote server for the reverse-ssh (port 22) connection, if you want to use the 'Remoteon' / 'Remoteoff' command. | ||
- | =Usage= | + | ==Usage== |
- | SMSCON is triggered by a SMS message with a predefined known command and then will execute the task in the background. | + | 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. |
- | If so it will send a reply SMS with the information. | + | |
+ | ===Commands=== | ||
- | |||
The default commands are: | The default commands are: | ||
<pre> | <pre> | ||
Line 63: | Line 61: | ||
Call | Call | ||
</pre> | </pre> | ||
- | These commands can be altered (renamed) in the smscon_config file. | + | These commands can be altered (renamed) in the <code>smscon_config</code> file. |
+ | |||
+ | ===Options=== | ||
- | |||
Options for smscon are: | Options for smscon are: | ||
<pre> | <pre> | ||
Line 87: | Line 86: | ||
</pre> | </pre> | ||
- | ==First Time Usage== | + | ===First Time Usage=== |
- | The first time start SMSCON with the following command (smscon -init); it creates a new config file (usr/bin/smscon_config) which you must edit to your own needs (change all "xxxxxxx"'s). | + | The first time start SMSCON with the following command (<code>smscon -init</code>); it creates a new config file (<code>/usr/bin/smscon_config</code>) which you must edit to your own needs (change all "xxxxxxx"'s). I use Putty / WinSCP on Windows for this. Do not use a Windows editor! |
- | I use Putty / WinSCP on Windows for this. | + | |
- | The second time you start smscon (smscon -start) it loads the configured user settings file and is now active. | + | The second time you start smscon (<code>smscon -start</code>) it loads the configured user settings file and is now active. It then stores your valid IMSI code in a file (<code>smscon_code</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". |
- | It then stores your valid IMSI code in a file (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". | + | |
<pre> | <pre> | ||
Line 113: | Line 110: | ||
</pre> | </pre> | ||
- | ==Remote SSH Connection== | + | ===Remote SSH Connection=== |
When the (reverse-)SSH connection is made (default command 'Remoteon') you can from the server side (your own server) connect to your Nokia device with the following command: | When the (reverse-)SSH connection is made (default command 'Remoteon') you can from the server side (your own server) connect to your Nokia device with the following command: | ||
Line 121: | Line 118: | ||
</pre> | </pre> | ||
- | =Current Version | + | ==Current Version 0.3.0== |
- | + | * bug fixes, bug fixes, bug fixes in data connection handling. | |
- | + | * at the moment smscon can only connect to a SMTP server (for sending the email) without secure authentication. (will be solved in the future). | |
- | ==Changes from version | + | ===Changes from version 0.2.4=== |
- | + | * now email sending and SSH connection ''only works'' through GPRS connection because GPRS is always available. (a random WLAN access only works if preconfigured) | |
- | + | * when you install smscon package there is no more <code>smscon_config</code> template file installed; the first time you start smscon, | |
- | + | ** it creates a new config file at <code>/usr/bin/smscon_config</code> which you must edit. The next time you start smscon is loads this edited config file and is then active. (see also [First Time Usage]) | |
- | + | * when installing future updates of smscon settings file is not deleted. | |
- | + | * command <code>smscon -reset</code> resets your complete configuration to the state after your smscon package installation. (deleting boot, config, code and log file) | |
- | + | * <code>smscon_daemon</code> will stop if no SIM card is found. (smscon has no use then) | |
- | + | * For smscon to work properly set in Nokia menu Settings --> Internet connection to 'Any connection'. | |
- | + | ||
- | + | ||
+ | ==Future Development== | ||
- | + | * smscon will be set to load at boot at installation of smscon; | |
+ | ** this can later be undone with the <code>-unboot</code> option if needed. | ||
+ | * new commands: "Trackon" / "Trackoff"; smscon will continually send (after x time) a sms with current GPS coordinates. | ||
+ | * smscon will lock the device after first valid sms command is received (user configurable). | ||
+ | * rewriting connection handeling by smscon. | ||
+ | * storing all <code>smscon_config</code> user variables in gconf database. | ||
+ | * saving the phone number where you send your sms messages from in smscon_config (in <code>VALIDSENDERNUMBER</code>). At the moment it is lost after reboot and uses the initial number stored in <code>VALIDSENDERNUMBER</code>. | ||
+ | * add a configuration GUI. | ||
- | + | ==Testers Needed== | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
+ | SMSCON is (at the current state) intended for people who have Python programming / Linux experience to be able to adjust the script at their own needs. | ||
- | + | We'd like to hear if it works for you. We could only could test it with few SIM cards and want to know if it also works with other cards and networks in other countries. | |
- | + | ||
- | + | ||
- | + | ==Disclaimer== | |
- | |||
If this software does harmfull/unwanted things (not to be expected) to your device in any way the developers can't be responsible for this. | If this software does harmfull/unwanted things (not to be expected) to your device in any way the developers can't be responsible for this. | ||
[[Category:Software]] | [[Category:Software]] | ||
[[Category:N900]] | [[Category:N900]] |
Revision as of 10:26, 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
and 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 the smscon_config
.
Contents |
Functionality
SMSCON can:
- autoload at boot (when set);
- 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).
- 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)
Installation
Download the latest version of SMSCON from its garage project
(at a later stage will be delivered also through Extras)
SMSCON needs the following packages installed on your device to install and run:
apt-get install maemo-python-device-env apt-get install python-location apt-get install pexpect apt-get install gstreamer-tools apt-get install openssh
The three files (smscon, smscon_daemon & smscon_config) are placed in the directory: /usr/bin/
Also a fixed IP address is needed on the remote server for the reverse-ssh (port 22) connection, if you want to use the 'Remoteon' / 'Remoteoff' command.
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.
Commands
The default commands are:
Nokia-N900:~# smscon -sms Check Reboot Poweroff Power Location Remoteon Remoteoff Camera Call
These commands can be altered (renamed) in the smscon_config
file.
Options
Options for smscon are:
Nokia-N900:~# smscon == smscon v0.3.0 - Nokia N900 remote control utility == Options: -init : create smscon_config -start : start smscon_daemon -stop : stop smscon_daemon -status : get smscon_daemon status -log : show the log file -clear : erase the 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 -delete : delete imsi code file
First Time Usage
The first time start SMSCON with the following command (smscon -init
); it creates 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. Do not use a Windows editor!
The second time you start smscon (smscon -start
) it loads the configured user settings file and is now active. It then stores your valid IMSI code in a file (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 -init creating new user config file in "/usr/bin/smscon_config". WARNING: first edit smscon_config before using smscon! Nokia-N900:~# smscon -start smscon_daemon started. Nokia-N900~# smscon -log (Thu Sep 2 22:10:24 2010) SMSCON: smscon_daemon active (Thu Sep 2 22:10:25 2010) DAEMON: user settings succesfully loaded from "smscon_config" file (Thu Sep 2 22:10:25 2010) DAEMON INIT: initalizing new IMSI file with current valid IMSI code (Thu Sep 2 22:10:25 2010) DAEMON: current valid IMSI code (XXXXXXXXXXXXXXX) saved to file (Thu Sep 2 22:10:25 2010) DAEMON: authorized IMSI code found (Thu Sep 2 22:10:25 2010) DAEMON WARNING: smscon doesn't autoload at boot (Thu Sep 2 22:10:25 2010) DAEMON: no test arguments passed for daemon
Remote SSH Connection
When the (reverse-)SSH connection is made (default command 'Remoteon') 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 0.3.0
- bug fixes, bug fixes, bug fixes in data connection handling.
- at the moment smscon can only connect to a SMTP server (for sending the email) without secure authentication. (will be solved in the future).
Changes from version 0.2.4
- now email sending and SSH connection only works through GPRS connection because GPRS is always available. (a random WLAN access only works if preconfigured)
- when you install smscon package there is no more
smscon_config
template file installed; the first time you start smscon,- it creates a new config file at
/usr/bin/smscon_config
which you must edit. The next time you start smscon is loads this edited config file and is then active. (see also [First Time Usage])
- it creates a new config file at
- when installing future updates of smscon settings file is not deleted.
- command
smscon -reset
resets your complete configuration to the state after your smscon package installation. (deleting boot, config, code and log file) -
smscon_daemon
will stop if no SIM card is found. (smscon has no use then) - For smscon to work properly set in Nokia menu Settings --> Internet connection to 'Any connection'.
Future Development
- smscon will be set to load at boot at installation of smscon;
- this can later be undone with the
-unboot
option if needed.
- this can later be undone with the
- new commands: "Trackon" / "Trackoff"; smscon will continually send (after x time) a sms with current GPS coordinates.
- smscon will lock the device after first valid sms command is received (user configurable).
- rewriting connection handeling by smscon.
- storing all
smscon_config
user variables in gconf database. - saving the phone number where you send your sms messages from in smscon_config (in
VALIDSENDERNUMBER
). At the moment it is lost after reboot and uses the initial number stored inVALIDSENDERNUMBER
. - add a configuration GUI.
Testers Needed
SMSCON is (at the current state) intended for people who have Python programming / Linux experience to be able to adjust the script at their own needs.
We'd like to hear if it works for you. We could only could test it with few SIM cards and want to know if it also works with other cards and networks in other countries.
Disclaimer
If this software does harmfull/unwanted things (not to be expected) to your device in any way the developers can't be responsible for this.