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)

tHMZ 2010-08-25 17:02

Re: [Announce] SMScon (control your device with SMS)
 
How easy is this? Can I backup my applications before I help you test it? What apps do I have to have pre-installed? I don't code, I like tech but I dunno how to use the X terminal etc. so do I need to know how to?

AlexV12 2010-08-25 17:22

Re: [Announce] SMScon (control your device with SMS)
 
i myself am very much a beginner in Xterminal, i know my way around some codes, but not allot.

I somehow can't get it to work while i've done everything that i'm supposed to do...

to give you a simple guide, all you have to do is type these codes in xterminal. Make sure you've installed Rootsh (from the cataloges in the app manager

Open Xterminal and type:
Code:

root
apt-get install maemo-python-device-env
apt-get install python-location
apt-get install pexpect
apt-get install ncftp (cli ftp client)
apt-get install gstreamer-tools
apt-get install openssh

close xterminal

open smscon_daemon (from where you downloaded it to) with "notes"

and edit these lines into the appropriate lines

Code:

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

after this save the file and close "notes"

now move both the files to N900/newfolder (create the newfolder if you don't have it yet)

open Xterminal: note some letters are Capitals!
Code:

sudo gainroot
cd /home/user/MyDocs
cp /home/user/MyDocs/newfolder/* /usr/bin

close Xterminal

open Xterminal again:
Code:

root
cd /usr/bin
chmod 755 smscon
chmod 755 smscon_daemon

after that smscon should work.

you can run smscon by opening Xterminal:
Code:

root
smscon -start

for other commands use this code:
Code:

root
smscon -help

use your up arrow to get the last input you entered in Xterminal, and change it if it's easier than retyping the whole code.

Good luck, however somehow my phone doesn't recognise python :( hope yours does.

evilsquelch 2010-08-25 18:07

Re: [Announce] SMScon (control your device with SMS)
 
Has anyone tried to build this stuff on top of IAMHERE instead of starting from scratch? We had this in the works for a while but it was basically abandoned.

http://wiki.maemo.org/I_am_here

it could be idea to combine these projects

just a thought

digitalvoid 2010-08-25 18:24

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

It's smscon -help (no space between minus and command)

I am currently rewriting the code, so new version is comming soon.

AlexV12 2010-08-25 18:47

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

Originally Posted by evilsquelch (Post 798144)
Has anyone tried to build this stuff on top of IAMHERE instead of starting from scratch? We had this in the works for a while but it was basically abandoned.

http://wiki.maemo.org/I_am_here

it could be idea to combine these projects

just a thought

Iamhere doesn't support PR1.2 so i think it would be much more of a hassle to build it on top of Iamhere and looking at the progress Digitalvoid has made it would be stupid to start all over now.

It would have been a great idea, as Iamhere worked perfect including sending an email with the frontcam image etc. too bad it got abandoned

digitalvoid 2010-08-25 19:26

Re: [Announce] SMScon (control your device with SMS)
 
I like to implement email sending of frontcam picture (is a beter idea, easier) but at the moment I don't know how. I.m trying to find out.

knypek3 2010-08-25 20:32

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

Originally Posted by digitalvoid (Post 797876)
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.


Yes, it can check website. But what when my site have adress http://asgarmy.ovh.org and to send to it any file i must log to ftp - ftp.60free.ovh.org ?
I can't send throw ftp.asgarmy.ovh.org.
So i can't use it script becouse when i type in remotehost asgarmy.ovh.org smscon don't send anything.
When i type ftp adress (ftp.60free.ovh.org) in remote host the
function def StatusRemoteHost(): check this adress and send my error, becouse on this adress (ftp.60free.ovh.org) aren't any site. It is only ftp.
I think you now know what is my problem...
So can you help me now? :D

Mabye this link can help You:
http://docs.python.org/library/email

digitalvoid 2010-08-25 21:21

Re: [Announce] SMScon (control your device with SMS)
 
I have changed the StatusRemoteHost() to use the ping command, then it would work for you. (is much better solution)

Smtplib in Python can indeed send emails, I will implement this in favor of ftp sending of frontcam picture.

In a couple of days I will post a new version of smscon...

digitalvoid 2010-08-26 20:02

Re: [Announce] SMScon (control your device with SMS)
 
Updated the first post, new version coming soon!

digitalvoid 2010-08-28 19:15

Re: [Announce] SMScon (control your device with SMS)
 
Updated the first post, new version (v2.1) is out!

joshv06 2010-08-28 19:37

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

Do you plan to push your project to Extras-Devel?

digitalvoid 2010-08-28 21:24

Re: [Announce] SMScon (control your device with SMS)
 
If i figured it out, yes.

Saturn 2010-08-28 21:54

Re: [Announce] SMScon (control your device with SMS)
 
Just came back.

The SMS messages work nice.

Here are the error messages from your log when i sent 'Camera'

Code:

(Sat Aug 28 23:34:59 2010) DAEMON: camera picture acquired
(Sat Aug 28 23:35:00 2010) DAEMON: current network (WLAN) disconnected
ERROR:dbus.connection:Exception in handler for D-Bus signal:
Traceback (most recent call last):
  File "/usr/lib/pymodules/python2.5/dbus/connection.py", line 214, in maybe_handle_message
    self._handler(*args, **kwargs)
  File "/usr/bin/smscon_daemon", line 221, in SMSreceive
    ExecuteCommand(Message, Number) # execute valid sms command
  File "/usr/bin/smscon_daemon", line 290, in ExecuteCommand
    EnableCamera()
  File "/usr/bin/smscon_daemon", line 319, in EnableCamera
    EnableConnection('GPRS')
  File "/usr/bin/smscon_daemon", line 390, in EnableConnection
    IAPid = E.findall(Output)[0].replace('@32@', ' ')
ndexError: list index out of range

I think it disconnected the working wlan connection it had already and tried to connect to gprs and failed. Btw, i have a gprs connection already defined in my internet connections which is working when i'm away from available wlan.

hope it helps

edit: using version 2.1

jakiman 2010-08-28 22:15

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

Originally Posted by digitalvoid (Post 800974)
If i figured it out, yes.

Can someone please help OP and get this pushed out to extras-devel? :(

knypek3 2010-08-28 22:20

Re: [Announce] SMScon (control your device with SMS)
 
i've got problem with camera option

Code:

INFO:root:(Sun Aug 29 00:08:54 2010) DAEMON: user settings succesfully loaded from "smscon_config" file
INFO:root:(Sun Aug 29 00:08:54 2010) DAEMON: reading valid IMSI code (2600196032xxxxx) from file
INFO:root:(Sun Aug 29 00:08:54 2010) DAEMON: authorized IMSI code found
INFO:root:(Sun Aug 29 00:08:54 2010) DAEMON: smscon autoloads at boot
INFO:root:(Sun Aug 29 00:08:54 2010) DAEMON: no test arguments passed for smscon_daemon
INFO:root:(Sun Aug 29 00:09:41 2010) DAEMON: received valid SMS message with command [Camera] from "+485021xxxxx"
INFO:root:(Sun Aug 29 00:09:49 2010) DAEMON: camera picture acquired
INFO:root:(Sun Aug 29 00:09:50 2010) DAEMON: current network (WLAN) disconnected
INFO:root:(Sun Aug 29 00:09:59 2010) DAEMON: network detected (GPRS)
INFO:root:(Sun Aug 29 00:09:59 2010) DAEMON: new network connected (GPRS)
INFO:root:(Sun Aug 29 00:10:10 2010) DAEMON ERROR: failed to send email message to "'marcin@xxxxxxx.pl'"
INFO:root:(Sun Aug 29 00:10:10 2010) DAEMON: camera picture send to email address ('marcin@xxxxxxxx.pl')


I try VALIDEMAILADDRESS the same as EMAILFROM but i don't get any messages :( why?


to create deb use:
http://easy-deb.sourceforge.net/

digitalvoid 2010-08-29 06:24

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

Please show me the output of this command (it's a one line command). Run as root in X Terminal:

Code:

Nokia-N900:~# gconftool -R /system/osso/connectivity/IAP | grep "/system/osso/connectivity/IAP/" | grep GPRS
Should be like this:

Code:

/system/osso/connectivity/IAP/xxxxxxxxxxxxx@GPRS:
@ knypek3:

Are you sure that your email settings are correct?

knownothing 2010-08-29 06:52

Re: [Announce] SMScon (control your device with SMS)
 
i am crazy waiting for this nice app appear in repos.

erniadeldesktop 2010-08-29 07:29

Re: [Announce] SMScon (control your device with SMS)
 
maybe I've missed it, but have you implemented some sort of pwd checking for the incoming sms? "friends" rebooting your device after they know they can can be quite annoying
2nd: can you setup a "play ringtone" funct? in case you lost it in your car..
thank you for the great idea, I will wait 'till on extras-devel.

digitalvoid 2010-08-29 08:11

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

Originally Posted by erniadeldesktop (Post 801209)
maybe I've missed it, but have you implemented some sort of pwd checking for the incoming sms? "friends" rebooting your device after they know they can can be quite annoying
2nd: can you setup a "play ringtone" funct? in case you lost it in your car..
thank you for the great idea, I will wait 'till on extras-devel.

The sms commands can be changed in the Python script, but I will make it a new user setting in the 'smscon_config' file in the next version of smscon.

I'm working on it to get it in extra-devel repository.

Saturn 2010-08-29 10:02

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

Originally Posted by digitalvoid (Post 801184)
@ Saturn:

Please show me the output of this command (it's a one line command). Run as root in X Terminal:

Code:

Nokia-N900:~# gconftool -R /system/osso/connectivity/IAP | grep "/system/osso/connectivity/IAP/" | grep GPRS
Should be like this:

Code:

/system/osso/connectivity/IAP/xxxxxxxxxxxxx@GPRS:

Hi,

There's no IAP with GPRS at the name. The one responsible for giving me internet connection is:
Code:

/system/osso/connectivity/IAP/Web@32@Vodafone:
Thanks for your time.

Saturn 2010-08-29 10:22

Re: [Announce] SMScon (control your device with SMS)
 
Hi digitalvoid,
Something for you to consider;

You can send the gps coordinates in a click-able google maps URL.
eg: http://maps.google.com/maps?q=52.350693,4.800796

Saturn 2010-08-29 11:26

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

One more case for you :)
Haven't checked the code but i get the impression that you are doing some kind of averaging from the last 4 coordinates.

IMHO, you should choose the one with the best accuracy instead.

Here is an example of how the best location guess has not been given back but instead one with 50km error. (the effect might be also augmented as I am traveling at the moment and the first lock is way out in accuracy but I think is a good example to show the issue).

Code:

(Sat Aug 28 23:40:39 2010) DAEMON: starting GPS device
(Sat Aug 28 23:40:39 2010) DAEMON: waiting for accurate GPS lock
(Sat Aug 28 23:40:41 2010) DAEMON: waiting for accurate GPS lock
(Sat Aug 28 23:40:42 2010) DAEMON: waiting for accurate GPS lock
(Sat Aug 28 23:40:44 2010) DAEMON: waiting for accurate GPS lock
(Sat Aug 28 23:41:15 2010) DAEMON: waiting for accurate GPS lock
(Sat Aug 28 23:41:31 2010) DAEMON: start collecting multiple GPS coordinates
(Sat Aug 28 23:41:31 2010) DAEMON: GPS coordinate acquired (#1, 51.8 sec, 46.500000, 8.200000, 200000.0 meter)
(Sat Aug 28 23:41:32 2010) DAEMON: GPS coordinate acquired (#2, 52.9 sec, 46.209886, 6.139363, 3034.8 meter)
(Sat Aug 28 23:41:35 2010) DAEMON: GPS coordinate acquired (#3, 56.5 sec, 46.209886, 6.139363, 3034.8 meter)
(Sat Aug 28 23:41:36 2010) DAEMON: GPS coordinate acquired (#4, 57.0 sec, 46.209886, 6.139363, 3034.8 meter)
(Sat Aug 28 23:41:36 2010) DAEMON: accurate GPS coordinate calculated (46.282414, 6.654522, 52276.1, 57.0)
(Sat Aug 28 23:41:37 2010) DAEMON: stopping GPS device


digitalvoid 2010-08-29 13:36

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

This is true, It's averaging, but I think I will change this to your idea ('best accuracy out of 4'). This is more logical. It will also be a user setting in config file.

About the '/system/osso/connectivity/IAP/Web@32@Vodafone:' issue;
I have rewritten this part (bit of a hack) and I should work now for you and also others.

About your 'click-able google maps URL' idea, I like it. I will implement this. (send it with sms and/or email)

@ knypek3:

I have no idea why it's not working; it could be port or firwall related or the way your smtp server is authenticating (more likely). I will look into it.

knypek3 2010-08-29 13:58

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

Originally Posted by digitalvoid (Post 801427)
@ Saturn:

This is true, It's averaging, but I think I will change this to your idea ('best accuracy out of 4'). This is more logical. It will also be a user setting in config file.

About the '/system/osso/connectivity/IAP/Web@32@Vodafone:' issue;
I have rewritten this part (bit of a hack) and I should work now for you and also others.

About your 'click-able google maps URL' idea, I like it. I will implement this. (send it with sms and/or email)

@ knypek3:

I have no idea why it's not working; it could be port or firwall related or the way your smtp server is authenticating (more likely). I will look into it.

hmn. My email server requires Authentication. may this doing this error?
Heh
is it any way to bypass it? Or i must search account without smtp authentication?

Saturn 2010-08-29 14:58

Re: [Announce] SMScon (control your device with SMS)
 
How about adding a 'send a test mail' option in the smscon?

It would help testing if settings have been entered correctly in the config file easier.

digitalvoid 2010-08-29 15:54

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

Already there :), use:
Code:

smscon -stop (if it was running)
smscon -test email

Could please you give me the result of this:

Code:

gconftool -R /system/osso/connectivity/IAP | grep " name = "
I want to verify something for my code.


@ knypek3:

I will look if I can make it auto detect the authentication, but you can use another smtp server without secure authentication.

knypek3 2010-08-29 20:57

Re: [Announce] SMScon (control your device with SMS)
 
when i type test email the connection don't end so, or it connecting or i don't know why. I have my email server. I try with and without auth. Nothing happen. with and without i have error :(
i try gconf.
it send me:
name = linksys
name = Moja_siec
name = Plus gsm internet gprs

digitalvoid 2010-08-30 07:29

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

There was a bug in my code which has to do with the detection of the connection name , which I have fixed. (Thanks Saturn).

New code coming soon.

PS: The secure smtp authentication will not be fix in this code. I have to examine this further...

knypek3 2010-08-30 08:19

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

Originally Posted by digitalvoid (Post 802050)
@ knypek3:

There was a bug in my code which has to do with the detection of the connection name , which I have fixed. (Thanks Saturn).

New code coming soon.

PS: The secure smtp authentication will not be fix in this code. I have to examine this further...

I try without smtp authentication. But with error too.
It's strange becouse smtplib should operate smtp authentication.

I'm the only one whom it is not working email func??

zimon 2010-08-30 11:56

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

Originally Posted by jakiman (Post 801001)
Can someone please help OP and get this pushed out to extras-devel? :(

Would be good next step before new features is added.

http://wiki.maemo.org/Extras-devel

digitalvoid 2010-08-30 13:21

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

Originally Posted by zimon (Post 802195)
Would be good next step before new features is added.

http://wiki.maemo.org/Extras-devel

I have made a deb file (yeah!) with PyPackager, but I have some trouble with the dependancy files (they won't automatically install). If the dependancy files are already on the device it will install fine. Some option I missed?

Code:

p.author = 'Digitalvoid'
p.maintainer = 'Digitalvoid'
p.email = xxxx@xxxxxxxx.nl'
p.depends = 'maemo-python-device-env, python-location, pexpect, openssh'
p.section = 'user/utilities'
p.arch = 'armel'                   
p.urgency = 'low'                             
p.distribution = 'fremantle'               
p.repository = 'extras-devel'


AlexV12 2010-08-30 18:36

Re: [Announce] SMScon (control your device with SMS)
 
what happens if i change the code:
Code:

Comlist                                                          = ['location'
]

and all of the other comlist codes to a different word.

say for example, i'd want to change the smstrigger: 'location' to 'where are you'

as that wouldn't trigger the thiefs attention so much when you send a tekstmessage with "where are you"

digitalvoid 2010-08-30 18:56

Re: [Announce] SMScon (control your device with SMS)
 
New version is out (v0.2.2).

@ AlexV12:

In the new version you can customize this in the smscon_config file.

AlexV12 2010-08-30 20:04

Re: [Announce] SMScon (control your device with SMS)
 
and where do i find/edit the smscon_config file after i've installed the .deb?

digitalvoid 2010-08-30 20:47

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

Originally Posted by AlexV12 (Post 802585)
and where do i find/edit the smscon_config file after i've installed the .deb?

In /usr/bin

See first post (has all the new information)

knypek3 2010-08-30 21:03

Re: [Announce] SMScon (control your device with SMS)
 
hmn...
when i install deb and try call nothing happen.
and in log write
Code:

INFO:root:(Mon Aug 30 22:57:16 2010) DAEMON: user settings succesfully loaded from "smscon_config" file
INFO:root:(Mon Aug 30 22:57:16 2010) DAEMON: reading valid IMSI code (260019603296619) from file
INFO:root:(Mon Aug 30 22:57:16 2010) DAEMON: authorized IMSI code found
INFO:root:(Mon Aug 30 22:57:16 2010) DAEMON: smscon autoloads at boot
INFO:root:(Mon Aug 30 22:57:16 2010) DAEMON: no test arguments passed for daemon
ERROR:dbus.connection:Exception in handler for D-Bus signal:
Traceback (most recent call last):
  File "/usr/lib/pymodules/python2.5/dbus/connection.py", line 214, in maybe_handle_message
    self._handler(*args, **kwargs)
  File "/usr/bin/smscon_daemon", line 207, in SMSreceive
    ExecuteCommand(Message, Number) # execute valid sms command
  File "/usr/bin/smscon_daemon", line 247, in ExecuteCommand
    if Com in ComList:
NameError: global name 'ComList' is not defined
ERROR:dbus.connection:Exception in handler for D-Bus signal:
Traceback (most recent call last):
  File "/usr/lib/pymodules/python2.5/dbus/connection.py", line 214, in maybe_handle_message
    self._handler(*args, **kwargs)
  File "/usr/bin/smscon_daemon", line 207, in SMSreceive
    ExecuteCommand(Message, Number) # execute valid sms command
  File "/usr/bin/smscon_daemon", line 247, in ExecuteCommand
    if Com in ComList:
NameError: global name 'ComList' is not defined

To author.
When you giving a new version in deb, can you give a version in py also? I want python version more then deb.

AlexV12 2010-08-31 05:50

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

Originally Posted by digitalvoid (Post 802626)
In /usr/bin

See first post (has all the new information)

i understand that, but how do i edit it, as normally you would edit the file before putting it in /usr/bin

Saturn 2010-08-31 06:21

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

Originally Posted by AlexV12 (Post 802931)
i understand that, but how do i edit it, as normally you would edit the file before putting it in /usr/bin

Hi,

install leafpad from the application manager
Open xterm
type:
root
leafpad /usr/bin/smscon_config

You are ready to edit & save.

Hope it helps.

digitalvoid 2010-08-31 07:10

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

version 0.2.2 will be replaced by 0.2.3.

There is a bug in 0.2.2; I have forgotten to change the name of a variable. Sorry.

knypek3 2010-08-31 08:39

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

Originally Posted by digitalvoid (Post 802974)
@ knypek3:

version 0.2.2 will be replaced by 0.2.3.

There is a bug in 0.2.2; I have forgotten to change the name of a variable. Sorry.

OK, thanks. I send You a priv.
Can you write a func when sms with command example "ssh" arrived
n900 connect to gprs and send to xterm command
"ssh -p 22 user-name@IP -R 1201:localhost:22" ??

But this command should be mod, to can manualy type IP and password.

It work's great and give a full control anywhere your n900 is.
http://www.youtube.com/watch?v=3msLEENRUcM


All times are GMT. The time now is 18:21.

vBulletin® Version 3.8.8