maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Applications (https://talk.maemo.org/forumdisplay.php?f=41)
-   -   [Announce] SMScon (control your device with SMS) (https://talk.maemo.org/showthread.php?t=60729)

digitalvoid 2010-08-20 07:55

[Announce] SMScon (control your device with SMS)
 
NEW VERSION V0.8.1 AVAILABLE IN EXTRAS(13-6-2011)

UPDATE: VERSION 0.9 AVAILABLE IN EXTRAS-DEVEL (end of 2011)

SMSCON provides complete control of your Nokia N900 device 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.

If you like the application please vote for it.

Before using the application please read the whole wiki of SMSCON.

SMSCON can:

• autoload at boot (this is default set at install of smscon package); when device reboots it loads smscon_daemon silent in the background.
• creates a log file (on the device).
• detect SIM card change and sends new SIM card phonenumber, IMSI code & telecom operator name to other known mobile number (returns SMS message); if somebody has stolen your phone and put his/hers own SIM card in it.
• send current GPS location coordinates (returns SMS message 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 (home-)server (GPRS connection); control the phone at command-line level from your own home.
• email a frontcam picture to your email address (GPRS connection); to maybe see where your phone is or who is using it.
• send the current remaining battery charge (returns SMS message).
• 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 message)
• send all valid SMS commands to you if you forgotten it (returns one or more SMS message)
• run a predefined shell script to start other programs, delete files etc.
• run directly shell command through SMS message sending.
• turn the phone silent when SMSCON is set active with a SMS command.
• send automatically SMS messages about the current battery status when SMSCON is set active with a SMS command.
• use multiple SIM cards (the IMSI numbers are stored in smscon_code file)
play a sound file (only WAV) when SMS command is received (to localize your phone when lost). NEW IN 0.8.1
• restart itself by SMS command. NEW IN 0.8.1
• send a SMS/email message when it crashes. NEW IN 0.8.1
• be triggered (activated) by changing the contents of a file on your own server. NEW IN 0.8.1

NEW FEATURES IN 0.9!

droll 2010-08-20 08:05

Re: {Announce] SMScon (control your device with SMS)
 
wow, not bad. i would guess it would also come in useful when you leave your phone at home. sms it to ask for missed calls, unread sms-es...etc.

AlMehdi 2010-08-20 08:24

Re: {Announce] SMScon (control your device with SMS)
 
I might test this.. but it would be better if it mailed instead of sending to your own server.

DaSilva 2010-08-20 08:31

Re: {Announce] SMScon (control your device with SMS)
 
Do you have plans to release it to extras repository?

digitalvoid 2010-08-20 08:46

Re: {Announce] SMScon (control your device with SMS)
 
Quote:

Originally Posted by DaSilva (Post 792777)
Do you have plans to release it to extras repository?

No, not at the moment (I don't know how to do this yet).

DaSilva 2010-08-20 08:51

Re: {Announce] SMScon (control your device with SMS)
 
Because it is only Python you can use http://wiki.maemo.org/Py2deb

Saturn 2010-08-20 09:56

Re: {Announce] SMScon (control your device with SMS)
 
Hi,

nice work. thanks for sharing.

I have installed all dependencies you mention (had to enable extras-devel) and the files in the locations you mention. Have also added the info needed for the password, numbers etc in the demon.

here is the errors I get:
Code:

~ $ smscon -start
smscon_daemon started
~ $ Traceback (most recent call last):
  File "/usr/bin/smscon_daemon", line 16, in <module>
    import pexpect
ImportError: No module named pexpect

~ $ smscon -boot
smscon_boot doesn't excist.
Traceback (most recent call last):
  File "/usr/bin/smscon", line 172, in <module>
    f.close()
NameError: name 'f' is not defined
~ $

hope it's useful.

I will be away for the next days - so sorry if I dont follow your replies.

digitalvoid 2010-08-20 10:13

Re: {Announce] SMScon (control your device with SMS)
 
@ Saturn:

You should also install pexpect (it's not standard in Python environment):

apt-get install pexpect

MohammadAG 2010-08-20 10:17

Re: {Announce] SMScon (control your device with SMS)
 
Would be nice if you could tie this to phone-control :)
It has more commands than shown in the page, check the script's -h
http://talk.maemo.org/showpost.php?p=784834&postcount=1

digitalvoid 2010-08-20 10:24

Re: {Announce] SMScon (control your device with SMS)
 
@ MohammadAG:

I will look at it. I saw it's also possible to unlock the SIM card by cli, right?

Saturn 2010-08-20 11:34

Re: {Announce] SMScon (control your device with SMS)
 
Quote:

Originally Posted by digitalvoid (Post 792867)
@ Saturn:

You should also install pexpect (it's not standard in Python environment):

apt-get install pexpect

ok, thanks

here is the new messages:
Code:

~ $ smscon -start
smscon_daemon started
~ $ Traceback (most recent call last):
  File "/usr/bin/smscon_daemon", line 69, in <module>
    CAMcommand                  = 'gst-launch v4l2camsrc device=/dev/%s num-buffers=1 ! video/x-raw-yuv,width=%s,height=%s ! ffmpegcolorspace ! %s ! filesink location=%s%s' % (CamName, CamRes[0], CamRes[1], Encoding, PhotoPath, PhotoName)
NameError: name 'CamName' is not defined

~ $ smscon -boot
smscon_boot doesn't excist.
Traceback (most recent call last):
  File "/usr/bin/smscon", line 172, in <module>
    f.close()
NameError: name 'f' is not defined
~ $ smscon -log
(Fri Aug 20 13:31:52 2010) START: smscon_daemon active
~ $ smscon -status
smscon_daemon off.
~ $


digitalvoid 2010-08-20 11:43

Re: {Announce] SMScon (control your device with SMS)
 
@ Saturn:

Download the new file "smscon_V1.1.zip" (see above). The was a little bug.

maxximuscool 2010-08-20 11:44

Re: {Announce] SMScon (control your device with SMS)
 
Wow this is sweet!! It is hitting the sweet spot soon :D Keep it coming please :)

Saturn 2010-08-20 12:00

Re: {Announce] SMScon (control your device with SMS)
 
Quote:

Originally Posted by digitalvoid (Post 792926)
@ Saturn:

Download the new file "smscon_V1.1.zip" (see above). The was a little bug.

Thx, here are the new messages:

Code:

~ $ smscon -start
Traceback (most recent call last):
  File "/usr/bin/smscon", line 154, in <module>
    StopSMScon()
  File "/usr/bin/smscon", line 105, in StopSMScon
    PIDdaemon = Exp.search(Output).group(1)
AttributeError: 'NoneType' object has no attribute 'group'
~ $ smscon -log
(Fri Aug 20 13:31:52 2010) START: smscon_daemon active
(Fri Aug 20 13:53:23 2010) START: smscon_daemon active
~ $ smscon -status
smscon_daemon active.
~ $ smscon -stop
Traceback (most recent call last):
  File "/usr/bin/smscon", line 135, in <module>
    StopSMScon()
  File "/usr/bin/smscon", line 105, in StopSMScon
    PIDdaemon = Exp.search(Output).group(1)
AttributeError: 'NoneType' object has no attribute 'group'
~ $ smscon -status
smscon_daemon active.
~ $ smscon -log
(Fri Aug 20 13:31:52 2010) START: smscon_daemon active
(Fri Aug 20 13:53:23 2010) START: smscon_daemon active
~ $

it seems that it starts but cannot stop (?)

digitalvoid 2010-08-20 12:22

Re: {Announce] SMScon (control your device with SMS)
 
@ Saturn:

I think you are you running smscon as user. I only works from running as root...

Saturn 2010-08-20 12:27

Re: {Announce] SMScon (control your device with SMS)
 
Quote:

Originally Posted by digitalvoid (Post 792948)
@ Saturn:

I think you are you running smscon as user. I only works from running as root...

You're right. it works now. (maybe add it in the instructions?)

I'll do some testing in the next days.

tnx again.

arnoldux 2010-08-20 15:38

Re: {Announce] SMScon (control your device with SMS)
 
VERY NICE PROGRAM APP!!

Ive been waiting for this for some quite time, but i can see there are still some fixes and improvements you could do, has far has i can see its obviously in devel

I would request the following, if possible of course:

1.- Friendly-UI
2.- Settings option
3.- password protected options

Maybe im wrong but it looks like an n900 troyanhorse :rolleyes:

fnordianslip 2010-08-20 15:57

Re: {Announce] SMScon (control your device with SMS)
 
Quote:

Originally Posted by arnoldux (Post 793139)
Maybe im wrong but it looks like an n900 troyanhorse :rolleyes:

That's teh advantage of python. You can see and modify the source/script very easily, you don't even have to go and fetch a source package to have a look at what it is doing.

I'd be more worried if it was a binary, and even more worried if the source was closed.

Edit/Afterthought ...
I would say that the possibility of getting hacked/pwned/DOSed is quite high without some means of command authentication, though, but I've not looked at this yet to see what options are available in this respect. This is interesting though.

fnordianslip 2010-08-20 16:21

Re: {Announce] SMScon (control your device with SMS)
 
Quote:

Originally Posted by AlMehdi (Post 792772)
I might test this.. but it would be better if it mailed instead of sending to your own server.

Its a nice idea, but you never can tell what smtp server the network will allow you to access if the SIM gets swapped, and there's no wifi connection. Also, you'd probably have to embed your mail account password in the script or something in order to be able to send mail from it.

Another thing worth thinking about is to always use passphrases with the ssh private keys you store on the device, so that those in physical possession of it can't gain access to other machines over ssh. That might make use of the reverse ssh connection somewhat difficult.

A question I have, is does the inbound SMS message destined for SMScond with a command in it get subverted away from the user interface so no notifications are presented?

digitalvoid 2010-08-20 16:28

Re: {Announce] SMScon (control your device with SMS)
 
Quote:

Originally Posted by arnoldux (Post 793139)
VERY NICE PROGRAM APP!!

Ive been waiting for this for some quite time, but i can see there are still some fixes and improvements you could do, has far has i can see its obviously in devel

I would request the following, if possible of course:

1.- Friendly-UI
2.- Settings option
3.- password protected options

Maybe im wrong but it looks like an n900 troyanhorse :rolleyes:

It is still in devel (I like to hear your likes, dislikes & new ideas), some parts of the app work ok but I know it could be better done. I will make some changes that all the user settings can be made in a easy settings file (smscon_settings).

Password and user settings can be encrypted ofcoarse, but because it's a open scripting language you can always adapt and uncrypt it if you have the knowledge.

Maybe I will try to make a friendly-UI, I'm more CLI minded myself (it's easier to develop :))

digitalvoid 2010-08-20 16:32

Re: {Announce] SMScon (control your device with SMS)
 
Quote:

Originally Posted by fnordianslip (Post 793193)
....
A question I have, is does the inbound SMS message destined for SMScon with a command in it get subverted away from the user interface so no notifications are presented?

No, this is what i like to solve myself. I don't think is really possible.
Reply messages from smscon are done in the background and don't list in Conversations app.

fnordianslip 2010-08-20 16:33

Re: {Announce] SMScon (control your device with SMS)
 
Actually, a potentially good idea might be to set up an 'smscon' user on the server machine, with no privileges and no login shell.

Then, in the N900's /home/user/.ssh/config, specify for the server host the specific private key (with IdentityFile) to be used to connect to the server, and specify the User as smscon. You would then need to generate a special key pair for the smscon user, with no passphrase.

That way, your normal private keys can have passphrase protection, but the one used by SMScon to make the ssh connection to the server can't compromise accounts on other machines, but should be able to set up the tunnels.

I've not actually tried this, but I think it could work in practice.

AlexV12 2010-08-21 10:02

Re: {Announce] SMScon (control your device with SMS)
 
When i type:

sudo gainroot
smscon -start


i get:
/bin/sh: smscon: Permission denied

also, if i type smscon -start without root, i get -sh: smscon: not found


how come? what am i doing wrong?

i put both files in /usr/sbin via the code:

cp /home/user/MyDocs/Smscon/* /usr/sbin


after that i rebooted. but i have no idea how to activate it/ get into the options.

and do you need to change al the XXXXXXX in the file manually? or can you do this easily in the options once the program works?

digitalvoid 2010-08-21 14:12

Re: {Announce] SMScon (control your device with SMS)
 
Quote:

Originally Posted by AlexV12 (Post 793825)
When i type:

sudo gainroot
smscon -start


i get:
/bin/sh: smscon: Permission denied

also, if i type smscon -start without root, i get -sh: smscon: not found


how come? what am i doing wrong?

i put both files in /usr/sbin via the code:

cp /home/user/MyDocs/Smscon/* /usr/sbin


after that i rebooted. but i have no idea how to activate it/ get into the options.

and do you need to change al the XXXXXXX in the file manually? or can you do this easily in the options once the program works?

smscon & smscon_daemon must be in /usr/bin and both files must have the right permissions (755), do this as root in /usr/bin:

Code:

Nokia-N900:/usr/bin# chmod 755 smscon
Nokia-N900:/usr/bin# chmod 755 smscon_daemon

Smscon must be run as root:


Code:

Nokia-N900:/# smscon
== smscon - remote control utility ==
Options:
  -start  : start smscon
  -restart : clear & restart smscon
  -stop    : stop smscon
  -reset  : stop smscon & arase the log file
  -boot    : set start at device boot
  -unboot  : remove start at device boot
  -status  : get smscon_daemon status
  -log    : show the logfile
  -clear  : erase the log file
  -help    : this help menu
Nokia-N900:/#

To make it load at device boot:

Code:

Nokia-N900:/# smscon -boot
smscon_boot doesn't excist.
new smscon_boot created & active.
Nokia-N900:/#

And indeed you have to change all the XXXXX's before use.

AlexV12 2010-08-22 11:12

Re: {Announce] SMScon (control your device with SMS)
 
i think i got it working, smscon - boot worked, so i'm on the right track.

however if i type
Code:

smscon -start
i get about 70 "not found" errors. it also ends with:

Code:

/usr/bin/smscon_daemon: line 68: syntax error: word unexpected (expecting ")")
is that supposed to happen?

also if i send an sms to my phone with "check" nothing happens.

digitalvoid 2010-08-22 15:31

Re: {Announce] SMScon (control your device with SMS)
 
@ AlexV12:

Very strange, did you install the packages?

AlexV12 2010-08-23 09:58

Re: {Announce] SMScon (control your device with SMS)
 
yes i did, however i changed the 2 last codes from:


Code:

apt-get openssh
apt-get pexpect

to:
Code:

apt-get install openssh
apt-get install pexpect

otherwise i got an "invalid operation"

why you put in apt-get pexpect twice i don't know :)

i reinstalled all the packages again and rebooted, but i get the same. But you might be right, it looks like it hasn't (fully) installed all the packages. because the first error i get when typing smscon -start is:

Code:

/usr/bin/smscon_daemon: line 1: #!/usr/bin/python: not found
after that i get:

Code:

/usr/bin/smscon_daemon: line [NUMBER]: import: not found
strange

Soap77 2010-08-23 17:10

Re: {Announce] SMScon (control your device with SMS)
 
looks like a nice application,
How about take it a bit further.
Lets say you loose your "phone" and you have data stored on it that you dont want anyone to see:
A function to wipe the entire phone for such data. ( of course its one selfs own responsibility to have proper backup somewhere else.)

the wipe function should remove any connection to exchange/imap/pop accounts, delete entire phonebook (I have my phonebook synced with exchange, so its a POC to get all the contacts back) remove conversation history etc.
there is a similar function already in the exchange server. I have never tried it so I dont know if it΄s doing it properly.

AlexV12 2010-08-23 18:51

Re: {Announce] SMScon (control your device with SMS)
 
Quote:

Originally Posted by Soap77 (Post 796054)
looks like a nice application,
How about take it a bit further.
Lets say you loose your "phone" and you have data stored on it that you dont want anyone to see:
A function to wipe the entire phone for such data. ( of course its one selfs own responsibility to have proper backup somewhere else.)

the wipe function should remove any connection to exchange/imap/pop accounts, delete entire phonebook (I have my phonebook synced with exchange, so its a POC to get all the contacts back) remove conversation history etc.
there is a similar function already in the exchange server. I have never tried it so I dont know if it΄s doing it properly.

take in mind that it wouldn't be a good idea to combine it with the change of simcard, as for example a friend has to use his sim in your phone (for what ever reason).. it would erase all data, but it hasn't been stolen ;)

it is a nice idea though to trigger that via sms, but you'd have to be sure that the thief still has your simcard in the phone, otherwise it won't work

digitalvoid 2010-08-23 19:31

Re: {Announce] SMScon (control your device with SMS)
 
@ AlexV12:

Sorry for that, must indeed be apt-get install ...
and one install of pexpect is enough :). I corrected my first post...

Are the two scripts in /usr/bin and have the right permissions?
And did you install the Python packages?


"...
it is a nice idea though to trigger that via sms, but you'd have to be sure that the thief still has your simcard in the phone, otherwise it won't work"

--> smscon detects a SIM change at boot and then sends you the new provider name, new IMSI and new phonenumber. With this number you can SMS & control your phone again.

AlexV12 2010-08-23 20:53

Re: {Announce] SMScon (control your device with SMS)
 
Quote:

Originally Posted by digitalvoid (Post 796194)
@ AlexV12:

Sorry for that, must indeed be apt-get install ...
and one install of pexpect is enough :). I corrected my first post...

Are the two scripts in /usr/bin and have the right permissions?
And did you install the Python packages?


"...
it is a nice idea though to trigger that via sms, but you'd have to be sure that the thief still has your simcard in the phone, otherwise it won't work"

--> smscon detects a SIM change at boot and then sends you the new provider name, new IMSI and new phonenumber. With this number you can SMS & control your phone again.

any python package in specific? i've only installed the packages that you named in your first post. are there any other packages (maybe from the application manager) i need installed?

also i typed in the code:
Code:

root
cd usr/bin
chmod 755 smscon
chmod 755 smscon_daemon

however i don't get any response (as in 50% done or what so ever.) it just starts a new line saying:
Code:

Nokia-N900:/usr/bin#
which i think is ok, because it doesn't give an error, which normally means succes.

digitalvoid 2010-08-24 10:34

Re: {Announce] SMScon (control your device with SMS)
 
Can you show me all the errors you getting from starting smscon?

AlexV12 2010-08-24 12:40

Re: [Announce] SMScon (control your device with SMS)
 
http://img840.imageshack.us/img840/6...0082414350.png

http://img829.imageshack.us/img829/7...0082414351.png

http://img824.imageshack.us/img824/5...0082414352.png

http://img832.imageshack.us/img832/5...0082414352.png

http://img834.imageshack.us/img834/4...0082414353.png

digitalvoid 2010-08-24 13:25

Re: [Announce] SMScon (control your device with SMS)
 
It looks like maybe Python isn't installed on your device...

In X Terminal, if you do this:

Code:

Nokia-N900:~# python


you should get this:

Code:

Nokia-N900:~# python
Python 2.5.4 (r254:67916, May 17 2010, 21:00:32)
[GCC 4.2.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>



Use Ctrl + D to quit Python.

AlexV12 2010-08-24 13:50

Re: [Announce] SMScon (control your device with SMS)
 
Quote:

Originally Posted by digitalvoid (Post 796863)

Code:

Nokia-N900:~# python
Python 2.5.4 (r254:67916, May 17 2010, 21:00:32)
[GCC 4.2.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>



Use Ctrl + D to quit Python.

i get this code perfectly!, same date, time etc, so same version i guess

knypek3 2010-08-24 19:27

Re: [Announce] SMScon (control your device with SMS)
 
Do you edit this files on windows notepad? This is a fcking app.- it change a file, that n900 can't read it.
Try apt-get install nano
cd folder
nano smscon
And that try to edit.

To author this app:
It is possible to give o this app email function?
Photos can be easy send to email server.

Can anyone show me how to for example configure a server for smscon?? What i must write here

Code:

RemoteHost                  = 'ftp.60free.ovh.org'                        # remote server address
RemotePort                  = 22                                          # remote server port
RemotePath                  = '/XXXXXXXXXXXX'                              # remote server ftp path
RemoteUser                  = 'XXXXXXXXXXXXX'                              # remote user
RemotePassword


AlexV12 2010-08-24 20:23

Re: [Announce] SMScon (control your device with SMS)
 
either edit it with notepad on your pc, or open the file in "notes" on your n900 and edit the file there.

digitalvoid 2010-08-25 08:35

Re: [Announce] SMScon (control your device with SMS)
 
Quote:

Originally Posted by knypek3 (Post 797127)
Do you edit this files on windows notepad? This is a fcking app.- it change a file, that n900 can't read it.
Try apt-get install nano
cd folder
nano smscon
And that try to edit.

To author this app:
It is possible to give o this app email function?
Photos can be easy send to email server.

Can anyone show me how to for example configure a server for smscon?? What i must write here

Code:

RemoteHost = 'ftp.60free.ovh.org'  # remote server address
RemotePort = 22  # remote server port
RemotePath = '/XXXXXXXXXXXX'  # remote server ftp path
RemoteUser = 'XXXXXXXXXXXXX'  # remote user
RemotePassword = 'XXXXXXXXXXXXX' # remote password


RemoteHost is the name of your server address (example: myserver.com)
RemotePort is the port on your server for the ssh connection (normally this is port 22). Your server must have a running ssh server.
RemotePath is the path to connect to on your server for ftp. (example: /ftp/nokia). (ftp uses port 21 for connection)
RemoteUser is the username for the ssh connection & ftp access.
RemotePassword is the password for the RemoteUser for the ssh connection & ftp access.

I have a home server with a fixed IP adddress (and a website) so I can configure it all very easely. It's very funny to ssh your phone through GPRS connection from your home (it's not super fast but it works ok).

I will look into making smscon also have a email function.
I'm currently rewriting parts of smscon & smscon_daemon (code cleanup, using a settings file (smscon_config) instead of editing smscon_daemon.

knypek3 2010-08-25 11:31

Re: [Announce] SMScon (control your device with SMS)
 
hmn it's strange.
Why you using ssh?
I test this but in log write:
searching "ftp.60free.ovh.org"
failed to find "ftp.60free.ovh.org" (max retries reached)

But when i manualy try ncftpput -V -E -u user -p pass -P 21 ftp.60free.ovh.org / file
it send successfully the file.
So for what is the ssh necessary??

If i delete all ssh (ssh start, stop, status) and leave only function ncftpput it will work?

Edit:
I think it can't connect becouse in
def StatusRemoteHost():
p = urlparse('http://' + RemoteHost)
h = HTTP(p[1])
Have a http prefix.
I have only ftp.

Can anyone help?

digitalvoid 2010-08-25 13:08

Re: [Announce] SMScon (control your device with SMS)
 
Ssh (it's technically a reverse ssh connection) is only needed if you want to control you device (command 'Remote on' & 'Remote off').

Ftp is used for sending the frontcam photo to you own ftp server (command 'Camera').

I check if the connection is active (before ftping) by checking if my website can be reached. Why? I could use a simple ping to my IP address (server), but the ping is not always passed through GPRS or LAN networks with a strict firewall. Port 80 (website) is always passed, so smscon only works if a website is available on the server to connect to. I will look in to it; maybe I change this to a ping again with a fallback to website checking.

Does anybody know how I can compose & send a email by cli.
Python smtplib doesn't work either.


All times are GMT. The time now is 04:39.

vBulletin® Version 3.8.8