gsm0710muxd and OM 2008.12

Ed Kapitein ed at kapitein.org
Mon Dec 29 21:23:54 CET 2008


Jan Henkins wrote:
> ><SNIP><
>   
>> echo 1 > /sys/devices/platform/neo1973-pm-gsm.0/power_on
>>     
>
> Off-topic question: Is there something similar to this in order to get the
> GPS to start up?
>   
sure, 
echo 1 >/sys/bus/platform/drivers/neo1973-pm-gps/neo1973-pm-gps.0/pwron
for power on and
echo 0 >/sys/bus/platform/drivers/neo1973-pm-gps/neo1973-pm-gps.0/pwron
to power it back off again


>> Inspired by the [FSO/SHR/debian] SMS location app, i wrote some scripts
>> to check for an incomming SMS and send me the GPS location of my FR.
>> So i needed the gsm0710muxd to read the SMS, while still being able to
>> use the phone.
>>     
>
> Hmm, this sounds *very* interesting! Do you mind sharing? Maybe start a
> new thread for a discussion along these lines? Apart from some interesting
> security applications (in case somebody is stupid enough to steal my FR),
> I can think of a whole raft of interesting funky things I would like to
> play with in this regard (auto-jokes via fortune or something similarly
> hare-brained).
>
>
>   
It is great fun, and i don't mind sharing at all. but everything is in
dutch and in a real "developer" state.
(lots of files, dirty scripts, you know how it is...)

but the general outline is:

make a script to read all your sms text messages and grep for a cue line
( i use: please call +129876543)
Perhaps my phone is not stolen, but i just lost it. this way people who
find it, will know how to contact me.
restart the script with /etc/apm/resume.d/89checksms-resume, so the
incomming text message will wake the phone and triggers the script.
if the cue line is found, stop the phone from going to sleep (xset
-display :0 s off) and start the gps module.
use gpspipe -r and gpsbabel to translate the nmea track to a gpx track
so you will have normal lat long values.
after the gpx file has sane values, send an sms with those values to a
pre-configured number and look them up at:
http://www.openstreetmap.com/?mlat=51.980619167&mlon=4.358206833&zoom=19
i have the script waiting for an hour, and if no gps fix is obtained in
that time i stop the scripts and send a message that it didn't work out.

to read the sms text messages i use the following:

ptsvar=$(dbus-send --system --print-reply --type=method_call
--dest=org.pyneo.muxer /org/pyneo/Muxer
org.freesmartphone.GSM.MUX.AllocChannel string:$identvar | grep string |
awk -F '"' '{ print $2 }')
export MODEM=$ptsvar

chat -s -S -V -v -f  /my/chat/file > "${MODEM}" < "${MODEM}"

and the /my/chat/file contains:


        TIMEOUT 15
        "" "\K\K\K\d+++ATH"
        OK-AT-OK ATZ
        OK ATE0
        ABORT BUSY
        ABORT DELAYED
        ABORT "NO ANSWER"
        ABORT "NO DIALTONE"
        ABORT VOICE
        ABORT ERROR
        ABORT RINGING
        OK AT+CFUN=1
        OK AT+COPS
        OK AT+CMGF=1
        OK AT+CMGL="ALL"
        CLR_ABORT
        ABORT OK

Have fun with it and if  you can't make the scripts yourself, i will try
to clean mine up and translate them into english, but please try it
yourself first,
it is fun, it is educational and it is customized for *your* needs.

Kind regards,
Ed












More information about the community mailing list