On a sunny day (Tue, 29 Dec 2020 09:59:11 +0000) it happened Chris Green
wrote in :
>I guess that's part of my issue with all this. I don't need speed,
>all I need is something fast enough to handle interactive terminal
>usage. Neither do I need security, the remote system has no personal
>information on it at all, the only data to be stolen is temperatures,
>voltages and other measurements on my boat.
>
>All I need is a reliable piece of wet string between me and the SBC on
>the boat. :-)
Depends on your programing skills
I wrote
smsio.c
http://panteltje.com/panteltje/newsflex/download.html#smsio
it receives SMS with a Huawei 3G/4G modem and then executes a script (that
you will need to write to do things).
In that script (up to you) you should parse for YOUR phone number and some
commands (like "knock out pirates" or "stop motor").
The other way around, from boat to your phone via SMS, I wrote the script
'ssms'
it is part of xgpspc:
http://panteltje.com/panteltje/xgpspc/index.html
scroll down to
Anchor drift and water in boat alarm with SMS and PMR radio alert
Very basically it works like this, raspi measures things like GPS location,
water level in bilge, some other things, compares it to some setpoints,
and sends SMS to your phone every 15 minutes if an error condition persists.
It can notify over radio too if needed.
You can repy to that SMS from your phone with an other SMS with some predefined
commands as shown above.
But anyways ssms (send SMS part of xgpspc) is like this:
#!/bin/bash
# ssms
# sends SMS message to a Huawei G3 USB stick, stick must be in data mode with
usb_modeswitch
let error=0
if [ "$1" == "" ]
then
let error=1
fi
if [ "$2" == "" ]
then
let error=1
fi
if [ "$3" == "" ]
then
let error=1
fi
if [ "$4" == "" ]
then
let error=1
fi
if [ $error == "1" ]
then
echo "Usage:"
echo "ssms PIN phone_number device_name message"
echo "Example:"
echo "ssms 1234 31612345678 /dev/ttyUSB4 \"hello there\""
echo " WARNING ssms WILL NOT WARN IF WRONG PIN IS ENTERED!!!!"
exit 1
fi
# For now we ignore any response from the USB modem
# so if it does not work you don't know why.
# send PIN
echo -en "AT+CPIN=\"$1\"\r" > $3
sleep 1
# request text mode
echo -en "AT+CMGF=1\r" >> $3
sleep 1
# send phone number
echo -en "AT+CMGS=\"+$2\"\r" >> $3
sleep 1
# send SMS message 0, terminated with ctrl Z
echo -en "$4\x1a\r" >> $3
echo "ready SMS send"
exit 0
This then runs on your boat with whatever data you want to send,
When nothing out of the ordinary happens no SMS is sent.
Not sure this helps, is more for programmers....
Some pseudo code:
while true
do
measure water_level
if( water_level >= up to chin)
ssms PIN YOUR_PHONENUMBER /dev/ttyUSB1 \"blub blub blub\"
sleep 10*60
done
while true
do
measure GPS_position
if(distance GPS_position - anchor_GPS_position >= 20 meter)
ssms PIN YOUR_PHONENUMBER /dev/ttyUSB1 \"adrift at $GPS_position\"
sleep 10*60
done
--- SoupGate-Win32 v1.05
* Origin: Agency HUB, Dunedin - New Zealand | FidoUsenet Gateway (3:770/3)
|