Hi,
So i try to describe what i did ...
The differents steps :
1/ Install USB Key on raspI just plug my USB key and it is recognize :
lsusb | grep Huawei
Bus 001 Device 006: ID 12d1:141b Huawei Technologies Co., Ltd.
2/ Install pythonsudo apt-get install python
sudo apt-get install python-setuptools3/ Install Gammusudo apt-get update
sudo apt-get install gammu
dmesg |grep ttyUSB*
sudo gammu-config
sudo gammu --identifyYou can test to send a sms with this command :
echo "testtttt" | /usr/bin/gammu --sendsms TEXT "+xxxxxx"xxxxxx = your phone number
4/ Install python scriptfrom this web site :
http://domotique-info.fr/2014/01/un-script-python-comme-serveur-sms/ (french site but the code is compliant
)
part 6 : "6 – Le script Python « passerelle SMS »" ("...import socket.....")
I use :
filename='/tmp/sms-gw.log'And on line 40 :
cmd = "echo " + chr(34) + data + chr(34)+ " | /usr/bin/gammu --sendsms TEXT " + numI use too the part 7 to create a bootable script
5/ Adapt C# script "90-Security_Alarm_System" to use the python script..........
var recipients = Program.InputField("Email.Recipients").Value;
////////////////////// Send SMS //////////////////////
var remoteserversms = "xx.xx.xx.xx"; //@IP of your server with python script
var tel1 = "xxxxxxxx"; // Your phone number
//////////////////// 1st SMS /////////////////////
TcpClient
.Service( remoteserversms ) // server
.Connect( 3000 ); // port of python script
TcpClient.SendMessage(tel1+"::Alarm //"+Program.Parameter("HomeGenie.SecurityTriggerSource").Value+" //");
Pause(3);
TcpClient.Disconnect();
Pause(3);
////////////////////////////////////////////////////////////if (recipients != "")
....
I want to send 2 SMS so i copy the code between "1st SMS" and "//////////" with a new variable "tel2".
So it work fine for me. There is some more advance solutions than gammu which use php (and compatible with older version of HG), but i doesn't want to install php on my raspberry (i think so heavy).
Perhaps, there is better way to code in C#, but i am not a expert in C#, and i am more useful to code simple code in bash, perl, or VB.
Bye