GSM Module to Node RED

1,529 views
Skip to first unread message

Stephen Ward

unread,
Apr 9, 2015, 5:35:01 PM4/9/15
to node...@googlegroups.com

Hey all.

Im a hobbiest who is conducting a small project where I am taking temperature sensor and moisture data from soil and sending it via sms using a Telit GSM module (Model GT864) now i have that working great but a friend mentioned connecting it to the cloud. I dont know too much about this sector but have being recommended to link it by using Node Red and then IBM Bluemix.

My question is firstly with regards Node red how can I connect it by sending data. Im assuming the data will be sent via TCP but can it be sent to Node Red via the TCP input node or can it be sent via MQTT through a broker. (im not sure can TCP be sent to a MQTT broker such as iot.eclipse. )

Then how best can it be connected to IBM bluemix.

Dave C-J

unread,
Apr 9, 2015, 5:49:43 PM4/9/15
to node...@googlegroups.com
Well.... it depends how you are driving the modem... if from some sort of microcontroller then (while indeed Node-RED IS the answer to everything)... it may not be in this instance... If you can generate MQTT then you can send that direct to Bluemix - https://developer.ibm.com/iot/ - and THEN use Node-RED at that end to mess with the data.... 

There are MQTT libraries for Arduino, MBed etc so it may be "easy" - but as I say depends how you are driving the modem.

Stephen Ward

unread,
Apr 10, 2015, 6:42:14 AM4/10/15
to node...@googlegroups.com
Thanks for getting back Dave

Its a stand alone module so not using a controller. its being run by a battery pack and sends the data via AT commands and a Python script.

Lawrence Griffiths

unread,
Apr 10, 2015, 12:01:46 PM4/10/15
to node...@googlegroups.com
Stephen does your Telelit support AT#SD as in socket dial?

If does I've created some nodeRed functions that do an http post to cloud end point using the IP stack of the Telit module.
I'm using a multitech device via USB to a Raspberry PI which in NR is a simple serial node so will work with RS232.

Also what type SIM are you using? PAY on one of the main telcos or an M2M SIM?

Lawrence

Stephen Ward

unread,
Apr 10, 2015, 12:30:39 PM4/10/15
to node...@googlegroups.com
Lawrence 

Yep it supports AT#SD and yea its just a basic SIM card. That is great I'm just kind of confusing myself I think with trying to subscribe to a MQTT broker.Is this viable??

Dave C-J

unread,
Apr 10, 2015, 1:27:13 PM4/10/15
to node...@googlegroups.com

There are various python mqtt clients available so you should be able to get something going direct to bluemix iot.

Lawrence Griffiths

unread,
Apr 10, 2015, 1:32:27 PM4/10/15
to node...@googlegroups.com
Yes but, no but...

OK using the ip stack of the modem means you've got to write the MQTT protocol handler :(
Doing http over an open socket is quite easy.

If your soil sensing is ruining on a Linux box?
Then best approach to use PPP from Linux
Then you can use PPP & chat to make the connection and then use the MQTT node in NR

Sorry to say I can't help with PPP on Linux.

Stephen Ward

unread,
Apr 10, 2015, 2:34:18 PM4/10/15
to node...@googlegroups.com

Ok thanks guys.

So is there no way of inputting the data to nodered via the TCP input? Or what do you guys think is my best option?

Thanks a million for your time

Lawrence Griffiths

unread,
Apr 10, 2015, 3:51:37 PM4/10/15
to node...@googlegroups.com
Yes there is you can use a TCP input node.
I made an assumption that your sensor device would run nodeRED (NR).
So is your device posting to NR in the cloud?
And your using Python to send SMS now want to us it to make IP con & post to cloud NR?

Stephen Ward

unread,
Apr 10, 2015, 4:03:23 PM4/10/15
to node...@googlegroups.com


Yes sorry Lawrence should have clarified that. Im just using Python to send SMS at the moment and Yes I want to post to the cloud via IP.

Lawrence Griffiths

unread,
Apr 10, 2015, 4:08:41 PM4/10/15
to node...@googlegroups.com
OK one more do you want to replace Python with nodeRED?

Stephen Ward

unread,
Apr 10, 2015, 4:22:41 PM4/10/15
to node...@googlegroups.com

Yep that was the hope. So then the idea was to have my temperature or humidity data on the cloud so that if an issue occurs i.e. needs watering that a SMS, an email and/or a tweet could be sent out via Node Red to any interested parties.

 Like I said I dont know a whole lot about the area unfortunately so I apologise for my lack of knowledge but I really appreciate your time

Lawrence Griffiths

unread,
Apr 10, 2015, 4:55:25 PM4/10/15
to node...@googlegroups.com
Ok I will post my JavaScript for the AT cmds to do an IP connect & then a socket dial.
Then you can convert it to Python, 
I've done it the other way so not too hard. 

Have you looked at https://fred.sensetecnic.com/ it's free hosted NR.
I will also document how you can send a string of sensor data to NR tcp node typically in JSON format.

BTW what soil moisture sensor are you using?
I've used vegetronix in the past.

Stephen Ward

unread,
Apr 10, 2015, 5:26:32 PM4/10/15
to node...@googlegroups.com
That would be Brilliant thanks. Appretiate it.

And no hadn't heard of FRED but must look into it too.

Ah its a simple analog output Sensor I have similar to http://www.amazon.co.uk/Generic-Moisture-Hygrometer-Detection-Mega2560/dp/B00HFQEJTK. Not as fancy as yours I'm afraid.

Stephen Ward

unread,
Apr 12, 2015, 6:08:08 AM4/12/15
to node...@googlegroups.com
Lawrence.

Sorry to disturb you again. I don't want to ruin your weekend. but did you get a chance to look up that script code?? and a quick introduction on how to connect to tcp node?

I will be in contact with your local pub to put a few pints on tab for you if you do. haha

Thanks 



On Friday, April 10, 2015 at 9:55:25 PM UTC+1, Lawrence Griffiths wrote:

Lawrence Griffiths

unread,
Apr 12, 2015, 1:34:13 PM4/12/15
to node...@googlegroups.com
Stephen sorry Easter School hols. no bandwith
I've put the AT commands and steps that need to be executed

My code is so NR specific it's not much use to you.
I'm away till Thurs so can'y help till then.

Lawrence

Stephen Ward

unread,
Apr 13, 2015, 5:31:37 AM4/13/15
to node...@googlegroups.com
Thanks for that Lawrence. I'll have a mess about with it myself and see where that gets me. 

Thanks for your help and info.

Cheers.

Stephen 
Reply all
Reply to author
Forward
0 new messages