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)

paai 2010-09-23 05:36

Re: [Announce] SMScon (control your device with SMS)
 
Looks like an useful application. However, I see that much of the functionality relies on the N900 /sending/ SMS messages. Does that imply that you need a second cellphone to receive them?

Paai

digitalvoid 2010-09-23 07:44

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

Yes, it can be any cellphone to send SMS commands to SMSCON.

Only if SMSCON has never been send messages to and phone is stolen
and swapped with other SIM card it will send SMS message to predefined cellphone number (user option SENDERNUMBER in "smscon_config" file).

After this, sending a SMS command to the new SIM card number ('thiefs' SIM card number) it will send return SMS's to your currently used cellphone (and this number is stored in SENDERNUMBER in "smscon_config" file).

zerocool2k 2010-09-23 10:27

Re: [Announce] SMScon (control your device with SMS)
 
Is the script activated if there is a bunch of coded words in the subject line? Like if my friend accidentally sends me a message with the subject line "Check out my new Power Lock...", does it execute the 3 corresponding commands?

digitalvoid 2010-09-23 11:20

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

Originally Posted by zerocool2k (Post 824205)
Is the script activated if there is a bunch of coded words in the subject line? Like if my friend accidentally sends me a message with the subject line "Check out my new Power Lock...", does it execute the 3 corresponding commands?

No, here is a example:

COM_LOCK = 'Lock'

If some message is: 'The Lock of my door is broken', SMSCON is not trigged.

Even 'LockLock' or ' Lock' or 'Lock ' (spaces!) doesn't trigger it.

Only with message: 'Lock'.

n900testa 2010-09-23 17:05

Re: [Announce] SMScon (control your device with SMS)
 
It would be nice to have an option to register a number that is the only valid to send the smscon commands.
I know the chances are pretty low that someone else will actually send a command to my n900, but they still exist. And i wouldn't be overly happy to expose my current location or a picture of myself/surrounding to someone that is pinging my phone.

Or did i somehow miss the point and my n900 only returns requests to a certain predefined number? Meaning that anybody (like 12345) can send a command, but the reply always goes to my defined number (i.e. 7890)...:confused:

digitalvoid 2010-09-23 19:34

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

Originally Posted by n900testa (Post 824550)
It would be nice to have an option to register a number that is the only valid to send the smscon commands.
I know the chances are pretty low that someone else will actually send a command to my n900, but they still exist. And i wouldn't be overly happy to expose my current location or a picture of myself/surrounding to someone that is pinging my phone.

Or did i somehow miss the point and my n900 only returns requests to a certain predefined number? Meaning that anybody (like 12345) can send a command, but the reply always goes to my defined number (i.e. 7890)...:confused:

No, it will send the reply to the cellphone it's send from. You can adjust the commands to any encrypted word/message, example: '7139035Location' or '85Whats12my67Location93' (for GPS location).

Nobody will ever gues this (possibilities are almost unlimited) and if choosen right nobody will 'hack' your phone...

nidO 2010-09-23 20:12

Re: [Announce] SMScon (control your device with SMS)
 
Hey there,

First off this is a really nice application, it's coming along very nicely.

A few bugs (and fixes) though:

Using version 0.4.4-5 in -testing, the reboot and poweroff commands currently fail.
Reboot fails because of line 714 of smscon_daemon:

Code:

    logging.info('executing command "%s"' % Com)
As "Com" is not a valid global, the command fails at the above logging line (before actually executing the reboot) - The line should be changed to:

Code:

    logging.info('executing command "%s"' % COM_REBOOT)
Similarly, poweroff currently fails for the same reason - Line 728 of smscon_daemon reads:

Code:

    logging.info('executing command "%s"' % Com)
And should be:

Code:

    logging.info('executing command "%s"' % COM_POWEROFF)
Additionally purely a cosmetic issue, emailed images are currently always sent with the alt text "map of location of Nokia N900", even if the image being emailed is a frontcam picture, not the location with google map image added.
This is set in line 377, imo the line should either have more generic alt text set, or the alt text should be set as part of the differing message bodies for different email reasons, rather than be set statically.

slewis1972 2010-09-23 21:46

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

Whenever I send a test email with picture, the picture is always black?

Checked no fingers in the way.

Any ideas?

Saturn 2010-09-23 21:54

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

Originally Posted by slewis1972 (Post 824791)
Hi

Whenever I send a test email with picture, the picture is always black?

Checked no fingers in the way.

Any ideas?

Try to take a picture of a lamp just to see if your camera works.

I assume you are inside a room when you are testing this with relatively low light.
If you go out in daylight and there is no issue with your camera it should take an ok picture.

What I'm trying to say is that is a known limitation of the front camera.

digitalvoid 2010-09-23 22:01

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

Thanks for pointing this out, will be fixed in next release.

Current changes/fixes for upcoming 0.4.4-6 release:
* FIX: COM_REBOOT & COM_POWEROFF command fail when used.
* FIX: alt text of email image is wrong.
* CHANGE: initial network connection will be restored after using test modes (in SMSCON-editor) and smscon will also stop running when finished in test mode.
* CHANGE: added time notation (again) in smscon log file.

Other:
* improved data connection handling (again).
* minor code cleanup

MasterZap 2010-09-24 08:16

Re: [Announce] SMScon (control your device with SMS)
 
This is AWESOME

One thing I really wish is that I could choose in the SMS I *send* if I want locations as email, or SMS.

If my phone gets lost inside my country, I probably want to use email, coz I get the map, and I know it has a data connection.

If my phone gets lost outside my country, I do not have a data connection, so email wouldn't work, and I would want to use SMS.

I think the suggestion earlier in the thread, where we could send

Location foo@somewhere.net
or
Location +4670123456

...would be PERFECT, so that the incoming SMS would guide where the message was sent (+ indicates phonenumber, lackthereof indicates email)

Many thanks for an AWESOME program!

(Oh and by the way, for those of you using GMAIL to send mail, a good idea is to set up a separate gmail email account for this reason alone, coz otherwise the stolen phone contains the cleartext of your google password - not a good thing .... )

/Z

cipper 2010-09-24 09:13

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

Originally Posted by digitalvoid (Post 824800)
* improved data connection handling (again).

hello everybody, this app is becoming greater as days passes on.

actually, I'm encountering an issue related to email transmission: if I'm connected to wlan and press the "email" or "email with picture" button in the test page of SMSCon-editor, it disconnects from wifi and tries to connect via gprs. This is very bad since I don't want to permit any data connection through mobile carrier. Why doesn't it send the email via wifi?

cipper 2010-09-24 09:23

Re: [Announce] SMScon (control your device with SMS)
 
A suggestion maybe already posted: the smscon_config file should be shomehow encrypted: too many sensitive data in there!
The editor would ask for the decryption password at start.

digitalvoid 2010-09-24 09:47

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

Originally Posted by cipper (Post 825043)
hello everybody, this app is becoming greater as days passes on.

actually, I'm encountering an issue related to email transmission: if I'm connected to wlan and press the "email" or "email with picture" button in the test page of SMSCon-editor, it disconnects from wifi and tries to connect via gprs. This is very bad since I don't want to permit any data connection through mobile carrier. Why doesn't it send the email via wifi?

The philosophy behind the app is that it creates a possibilty to retieve your phone when lost (or even stolen).

Crusial in this case is a reliable data connection for sending the requested data back (for email or SSH connection setup). I have chosen for this a cellular connection (GPRS), because this (almost) always will work if there is phone reception. When your phone is lying in some remote area, a WLAN will ever help you, because it has to little range and can be restricted by firewall, passwords etc.

When valid SMS commands are send to SMSCON and has to send an email (or it must setup the SSH connection) it will use the GPRS data connection. If you are persitent never to use any data connection through mobile carrier, this app won't work for you.

But for not completely ruling it out:

I can change the way the test email uses a data connection:
  • email test using WLAN if already connected.
  • email test using GPRS when not connected to any data connection.

paai 2010-09-24 10:18

Re: [Announce] SMScon (control your device with SMS)
 
What interests me most in this app is the fact that you can fire up a reverse ssh in this way. But then I'd need a second cell-phone to send the SMS.
Can anybody think of an alternative method to signal the N900?

Paai

Saturn 2010-09-24 10:20

Re: [Announce] SMScon (control your device with SMS)
 
For information, I have been working since the last version only in one new feature.

That is to add a password protection on opening the smscon-editor. It requires a couple of new dialog windows (one for entering the password and a second to change the password.), buttons here and there, some serious change on the code to not execute things before authorized etc, and of course new code to handle and make those actions (read, save, compare passwords etc).

I'm quite there but I'm missing one important library to make it perfect. :)

Does anyone has a pointer on a simple and nice crypto library to propose?

cipper 2010-09-24 10:49

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

Originally Posted by digitalvoid (Post 825063)
I can change the way the test email uses a data connection:
  • email test using WLAN if already connected.
  • email test using GPRS when not connected to any data connection.

that would be nice, especially because sms and GPRS connection aren't free ;)

cipper 2010-09-24 10:52

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

Originally Posted by paai (Post 825089)
But then I'd need a second cell-phone to send the SMS.
Paai

you can send sms in many ways, for example by webservices or by skype clients. But at the end is enough to borrow the phone from a friend/girlfriend/mom/dad. Not so complicated imho...

MasterZap 2010-09-24 11:17

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

Originally Posted by digitalvoid (Post 825063)
  • email test using WLAN if already connected.
  • email test using GPRS when not connected to any data connection.

That's a pretty good idea, i.e. using the currently working internet connection (you could even then send nice incriminating info such as the access point name, it's MAC address, and stuff ;) )

HOWEVER, there is one feature with the existing functionality that I like, which is why I would REALLY like you to keep the existing functionality as an option: This makes the phones IP public (well, on my ISP anyway) whereas it's IP on WLAN probably is private. So now after it has sent an email, I can then SSH directly into the phone (I have DYNDns set up for my phone)

Of course, one could also make this a new command:

"GetGPRSIP", would switch the phone to GPRS, try to connect, and sends that IP back in an SMS (or email, as configured).

Again, many thanks for glorious software. You should have a paypal tipjar!

/Z

Pigro 2010-09-24 12:55

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

Originally Posted by paai (Post 825089)
What interests me most in this app is the fact that you can fire up a reverse ssh in this way. But then I'd need a second cell-phone to send the SMS.
Can anybody think of an alternative method to signal the N900?

Paai

Nope, if you require to "signal" your phone to stat a remote ssh, then SMS would be the only simple way. However, (as cipper mentioned above) you can use free web based SMS sending utilities to avoid the need for a second phone if all you want is to turn the ssh on/off (I don't use this app, but according to the doc's REMOTEON and REMOTEOFF don't send any return SMS, and even if they do, any return would be info only?).

Alternatively, you could avoid the need for SMSCON if you only really want the reverse ssh bit - just leave a reverse ssh connection permanently active. I do this (via scripts triggered each time a network interface comes up), it works OK and doesn't appear to use noticably more battery when the tunnel is idling (my n900 is set for "always on" data connection). See eitama's wiki at http://wiki.maemo.org/Reverse_ssh for more info on how to set this up.

impeham 2010-09-24 17:18

Re: [Announce] SMScon (control your device with SMS)
 
Sms commands not working for me:
i tried smscon -status and got:
smscon_daemon is running.
smscon -log shows nothing about the SMSs i sent to the device. it ignored all commands i sent - Camera, Lock etc.
using the "Test" emails worked fine, but it currently seems that the application is not processing the SMS messages i send to the phone.

Any idea?

digitalvoid 2010-09-24 17:39

Re: [Announce] SMScon (control your device with SMS)
 
Which version are you using? (use latest: 0.4.4-6)

impeham 2010-09-24 19:24

Re: [Announce] SMScon (control your device with SMS)
 
yes the command line shows v0.4.4-6

zerocool2k 2010-09-25 01:47

Re: [Announce] SMScon (control your device with SMS)
 
This is kinda feature requests: Can you put password to access SMScon Editor? Just to protect those commands more effectively.

Also, can you configure it so that it tries wifi first and then if it's not available, switches to cellular data network?

DojwqIO 2010-09-25 02:56

Re: [Announce] SMScon (control your device with SMS)
 
Hi. I'm using version v0.4.4-6 and most things I've tried seem to work fine, including check, reboot, location, camera (have to test in daylight), and lock.

Not sure what 'power' does since I haven't tried it. Does it power on the device from an off state? I guess power off turns it off?

Does trackon continuously record the gps location?

However, even though I have set KEYBOARDDETECT = 'yes'
in the config file, I am not getting any notifications of keyboard use.
Any suggestions?

Also, for the ssh reverse tunnel, can I change the port in my server to which I connect to the N900? I already have a proxy server running on port 8080 on my home server. How about something like 12000 to connect to the N900 via:
ssh -p 12000 localhost -l root

Thanks for a great application.

DojwqIO 2010-09-25 06:25

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

Originally Posted by fnordianslip (Post 793202)
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.

This would work great, I think. Do you know how to create an ssh user with no privileges and, especially, no login shell?
I tried reading about chroot jail and rssh, but these options still give the user some type of limited shell, don't they? I googled but did not find how to allow only tunnelling with no shell access. Any pointers?

Thanks,

digitalvoid 2010-09-25 07:51

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

Saturn is busy with the password access for SMSCON-editor, so I will come in near future.

"Also, can you configure it so that it tries wifi first and then if it's not available, switches to cellular data network?
"

To implement this not as easy as it sound and makes things quite complicated, but I think in theory it can be done.

@ DojwqIO:

COM_POWER show you the current battery charge percentage (returns SMS).

COM_TRACKON will continiously send the GPS coordinates with SMS or email to you.

The port can be adjusted in the smscon_daemon file (look at "LocalPort" under "variables")

Keyboard use is opening/closing the keyboard slider.

zerocool2k 2010-09-25 09:10

Re: [Announce] SMScon (control your device with SMS)
 
Thanks for the reply. I don't know what happened but when I upgraded SMScon Editor earlier (when newer SMScon wasn't up), it automatically uninstalled SMScon. Is this normal?

Saturn 2010-09-25 09:24

Re: [Announce] SMScon (control your device with SMS)
 
Find the new version of the SMSCON Editor v. 0.4.4-12 in extras.
http://maemo.org/packages/view/smscon-editor/

Cumulative updates since previous version:
* Added support for new option to send GPS coordinates to both email and sms.
* Increased the size of the username fields - useful with gmail and such.
* Removed smscon from the dependencies (to allow promotion in extras)

Some more information and screenshots in the wiki page of SMSCON Editor (needs work still!)

Feel free to report issues.

On other news:
-I have found how to password protect the startup of the editor in a simple and nice way. It needs still quite some work to be fully integrated but will come in a future version eventually.

- Don't forget to vote in testing for the packages promotion. Here are the links:
SMSCON ,
SMSCON-Editor

n900testa 2010-09-25 13:28

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

Originally Posted by impeham (Post 825400)
Sms commands not working for me:
i tried smscon -status and got:
smscon_daemon is running.
smscon -log shows nothing about the SMSs i sent to the device. it ignored all commands i sent - Camera, Lock etc.
using the "Test" emails worked fine, but it currently seems that the application is not processing the SMS messages i send to the phone.

Any idea?

Same for me. None of the commands trigger a reply (sms or email). The "test" works just fine for gps, call and picture...
Version: 0.4.4-6
Status: Daemon is running
Log: No incoming (received) sms commands are listed

Any ideas what this might be up to?

impeham 2010-09-25 13:42

Re: [Announce] SMScon (control your device with SMS)
 
still also waiting for this - if it works it'll be a great tool for me

Saturn 2010-09-25 14:09

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

Originally Posted by n900testa (Post 825994)
Same for me. None of the commands trigger a reply (sms or email). The "test" works just fine for gps, call and picture...
Version: 0.4.4-6
Status: Daemon is running
Log: No incoming (received) sms commands are listed

Any ideas what this might be up to?

Some questions to both to help debug this:
1. Did you change/rename the commands?
2. Did you check you didn't put any space after the command sms?
3. What is your default language.
4. do you see the sms you have sent to the messages and does it have more than just the command?

impeham 2010-09-25 14:35

Re: [Announce] SMScon (control your device with SMS)
 
i didn't change the commands - stayed with default names.
i did not put a space or enter after the command in the SMS message, however, when i open the SMS message in the N900, the message looks as if there is a new line (as if i also added an ENTER key to the end of the message).
my device language is English(United Kingdom).
One more thing is that i did not use another cellular to send the SMS - i used a windows application called "TextMe" - i don't have another cellular to use for sending.
i also tried to copy the message content from the N900 after i got it to clipboard and paste it to a new sent SMS message and it didn't work also.

Thanks.

faf 2010-09-25 21:45

Re: [Announce] SMScon (control your device with SMS)
 
1 Attachment(s)
hi. first of all, thank you, this is an awesome application. :)

i found potential trouble with grps connection handling. there could be situations when there are more than one such connection available. for example, one for internet-over-gprs and one for mms (via fmms / fapn pair).

in such case smscon-daemon, as far as i can understand, will use the first gprs connection he found, and if it will be the one for mms only then email just will not be sent.

actually, i haven't any clue about how to define the exact subtype of the grps connection. the only solution that came to my mind was to check gprs_accesspointname param in the gconftool output for whether it contains "mms." substring. (patch attached.)

but it's a kind of quick-and-dirty hacks. has anybody any better suggestions? :confused:

Saturn 2010-09-25 23:21

Re: [Announce] SMScon (control your device with SMS)
 
1 Attachment(s)
Find the new version of the SMSCON Editor v. 0.4.4-14 in extras-devel.
http://maemo.org/packages/view/smscon-editor/

This version brings a feature requested by several people already.
It allows the prefixing of a common string all the commands on the window in one go.
There isn't much to explain - just try it. The changes are registered only after pressing the "Update Settings" button. To remove the prefix (before updating them) just re-prefix with nothing in the box.

See for more information and screenshots in the wiki page of SMSCON Editor (still needs work! documentation is always boring :))

- Feel free to report issues.
- Feel free to thank the developers. There's a button for it!
- Don't forget to vote in testing for the packages promotion if you find them functional. Here are the links:
SMSCON ,
SMSCON-Editor

DojwqIO 2010-09-26 03:50

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

Originally Posted by SaintGermain (Post 820902)
I just added "passphrase" to the regexp for making smscon compatible with 'public key authentication' (the password you provide in smscon_config will be processed as the passphrase to your private key):

Code:

(Output, ExitStatus) = pexpect.run( 'ssh -n -N -T -f -p %s -R %s:%s:%s %s@%s &' % (REMOTEPORT, LocalPort, LocalHost, REMOTEPORT, REMOTEUSER, REMOTEHOST), events = { '(?i)(password|passphrase)':REMOTEPASSWORD + '\n', '(?i)(yes/no) ?':'yes' + '\n' }, withexitstatus = True )

With that, I managed to make reverse-SSH works with public key authentication !

Does the above setup work with an empty passphrase?
I have set up the keys and I'm able to connect via ssh and open the tunnel from the command line as root in the N900, but smscon fails to establish the connection.


Update: I added a passphrase to my private key on the N900 and added it to smscon_config and it didn't work either. The ssh connection cannot be established with smscon but it is possible from the command line.

Any suggestions? The smscon -log output does not provide a lot of information.

More information: the remoteuser in my ssh server does not have shell access but it is able to forward ports.

DojwqIO 2010-09-26 04:19

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

Originally Posted by digitalvoid (Post 825864)

@ DojwqIO:

COM_POWER show you the current battery charge percentage (returns SMS).

COM_TRACKON will continiously send the GPS coordinates with SMS or email to you.

The port can be adjusted in the smscon_daemon file (look at "LocalPort" under "variables")

Keyboard use is opening/closing the keyboard slider.

Thanks, I tried power and poweroff and they work.
I do not however get any sms updates about keyboard use.

See my other post about issues with remote ssh connections.
smscon is not able to establish the reverse tunnel with public key authorization.

n900testa 2010-09-26 10:12

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

Originally Posted by Saturn (Post 826011)
Some questions to both to help debug this:
1. Did you change/rename the commands?
2. Did you check you didn't put any space after the command sms?
3. What is your default language.
4. do you see the sms you have sent to the messages and does it have more than just the command?


1. I tried with the default commands and also with custom commands
2. Yep. No spaces or new lines in the sms. Only the command.
3. English
4. The message that i receive on my n900 only displays my command (i.e. Check) with no other signs, whitespaces or similar.
When i receive the message, the notification window pops up, but nothing else happens. The message is sent from another cellphone (using the same network - o2).

Thanks for your support...:rolleyes:

[update] I also do not receive any command reply sms. So it looks like smscon can't handle the received sms (which would also confirm the "empty" logfile)

DojwqIO 2010-09-26 22:19

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

Originally Posted by DojwqIO (Post 826409)
smscon is not able to establish the reverse tunnel with public key authorization.

OK, found out what was going on. When trying to make the ssh connection, smscon first pings the ssh server, and if there is no response, it does not even attempt to establish the connection. My server does not respond to pings and that's why I was able to ssh using the command line, but smscon was not working.

I changed the code in smscon_daemon to try to connect even after a failed ping:

Code:

    if StatusSSH() == False:
        if StatusRemoteHost() == False:
            logging.error('ssh ping failure to "%s". Will try connect anyway' % REMOTEHOST)
            StartSSH()
            return
        else:
            StartSSH()
            return
    else:
        logging.info('ssh connection is already active')
        return

and now smscon can establish the connection.
Hope this helps.

digitalvoid 2010-09-27 08:13

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

Originally Posted by DojwqIO (Post 826924)
OK, found out what was going on. When trying to make the ssh connection, smscon first pings the ssh server, and if there is no response, it does not even attempt to establish the connection. My server does not respond to pings and that's why I was able to ssh using the command line, but smscon was not working.

I changed the code in smscon_daemon to try to connect even after a failed ping:

Code:

    if StatusSSH() == False:
        if StatusRemoteHost() == False:
            logging.error('ssh ping failure to "%s". Will try connect anyway' % REMOTEHOST)
            StartSSH()
            return
        else:
            StartSSH()
            return
    else:
        logging.info('ssh connection is already active')
        return

and now smscon can establish the connection.
Hope this helps.

I implement this in release 0.5-1 (see SMSCON wiki in "future release" section, lots of changes in SMSCON!


All times are GMT. The time now is 05:42.

vBulletin® Version 3.8.8