I have a Twilio account (referral code in link, if you’d be so kind), in which I have subscribed to a phone number for $1/mo and a SIM for $2/mo. E33372 LTE/UMTS/GSM HiLink Modem/Networkcard ID 12d1:14dc Huawei Technologies Co., Ltd. It should be the following for the above to work: One thing I had to do, was make sure the Huawei E3531 was set to the right mode. I then use nodered to manipulate the data and send on to my alarm system to arm etc I am not a coder so this was bodged together, but it does work.īasically, when a new SMS is received, if it’s different from the last SMS received then the data will be sent to the specified MQTT topic. R = requests.post( " data=data, headers=headers )Ĭnnect(broker,port) #establish connection Shutil.move(newloc+"/new.txt", oldloc+"/old.txt") If not os.path.exists(newloc+"/new.txt"): R = requests.get(" root = ET.fromstring(r.content) Oldloc = "/home/pi/alarmsms/temp" #Location to store old.txt for comparisonĬlient1=paho.Client("control1") #create MQTT client object Newloc = "/home/pi/alarmsms/temp" #Location to store new.txt for comparison
I have it now working on a raspberry pi and had created the following that runs as a daemon: #!/usr/bin/pythonīroker = "192.168.7.1" #MQTT broker IP address
I purchased a Huawei E3531 not realising that is has problems receiving texts when using Gammu.