Node red sms app

Can we able to create a sms app using node red?

Doing a search on this forum or just use google to do your search might be a good place to start

This is my flow.
[{"id":"9e4b8b04.3e8ac8","type":"ui_form","z":"2fbc78e2.c769f8","name":"Get Input","label":"","group":"4df83d50.1ec864","order":0,"width":"0","height":"0","options":[{"label":"Number","value":"number","type":"number","required":true},{"label":"Message","value":"message","type":"text","required":true}],"formValue":{"number":"","message":""},"payload":"","topic":"","x":70,"y":187,"wires":[["615dec0.8e9dc14","2fd4afa4.390e3","301444fa.701d3c"]]},{"id":"615dec0.8e9dc14","type":"function","z":"2fbc78e2.c769f8","name":"Send 'To' Number","func":"var num = msg.payload.number;\nvar at_cmd = "AT+CMGS=\""+num+"\""; \n\nmsg.payload=at_cmd+"\r";\n//msg.payload.msg =msg.payload.message;\n\nreturn msg;","outputs":"1","noerr":0,"x":378,"y":140,"wires":[["9d70740a.bf6ab8"]]},{"id":"9d70740a.bf6ab8","type":"serial out","z":"2fbc78e2.c769f8","name":"Serail-Out","serial":"d831cf6b.f1c71","x":768,"y":80,"wires":[]},{"id":"6310d5f1.8754cc","type":"function","z":"2fbc78e2.c769f8","name":"Send Message","func":"var sms_msg = msg.payload.message;\n\nmsg.payload=sms_msg+"\x1A";\n//msg.payload.msg =msg.payload.message;\n\nreturn msg;","outputs":1,"noerr":0,"x":433,"y":457,"wires":[["9d70740a.bf6ab8"]]},{"id":"2fd4afa4.390e3","type":"delay","z":"2fbc78e2.c769f8","name":"Wait for > prompt","pauseType":"delay","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":255,"y":395,"wires":[["6310d5f1.8754cc"]]},{"id":"301444fa.701d3c","type":"delay","z":"2fbc78e2.c769f8","name":"","pauseType":"delay","timeout":"1","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":307,"y":308,"wires":[["5b06835.db6897c"]]},{"id":"5b06835.db6897c","type":"function","z":"2fbc78e2.c769f8","name":"Write newline","func":"msg.payload="\r\n";\nreturn msg;","outputs":1,"noerr":0,"x":476,"y":291,"wires":[["9d70740a.bf6ab8"]]},{"id":"5fe528d5.225868","type":"serial in","z":"2fbc78e2.c769f8","name":"Serial-In","serial":"d831cf6b.f1c71","x":799,"y":234,"wires":[["b86e6dc4.bd91c"]]},{"id":"b86e6dc4.bd91c","type":"debug","z":"2fbc78e2.c769f8","name":"","active":true,"console":"false","complete":"false","x":827,"y":424,"wires":[]},{"id":"4df83d50.1ec864","type":"ui_group","z":"","name":"SMS","tab":"c79420a4.f39c8","order":1,"disp":true,"width":"6"},{"id":"d831cf6b.f1c71","type":"serial-port","z":"","serialport":"192.168.1.35","serialbaud":"115200","databits":"8","parity":"none","stopbits":"1","newline":"\n\r","bin":"false","out":"char","addchar":false,"responsetimeout":""},{"id":"c79420a4.f39c8","type":"ui_tab","z":"","name":"SMS","icon":"dashboard"}]

Nice flow.

Now describe your problem and the steps you have taken to attempt to resolve it.

Your flow is not importable. Please see [1] for how to paste a flow here. You can edit your previous post and correct it.
[1] How to share code or flow json

my problem is where i can be able to communicate between my number and node-red. someone have used with usb modem. i am trying with the home wifi connection

[{"id":"9e4b8b04.3e8ac8","type":"ui_form","z":"2fbc78e2.c769f8","name":"Get Input","label":"","group":"4df83d50.1ec864","order":0,"width":"0","height":"0","options":[{"label":"Number","value":"number","type":"number","required":true},{"label":"Message","value":"message","type":"text","required":true}],"formValue":{"number":"","message":""},"payload":"","topic":"","x":70,"y":187,"wires":[["615dec0.8e9dc14","2fd4afa4.390e3","301444fa.701d3c"]]},{"id":"615dec0.8e9dc14","type":"function","z":"2fbc78e2.c769f8","name":"Send 'To' Number","func":"var num = msg.payload.number;\nvar at_cmd = \"AT+CMGS=\\\"\"+num+\"\\\"\"; \n\nmsg.payload=at_cmd+\"\\r\";\n//msg.payload.msg =msg.payload.message;\n\nreturn msg;","outputs":"1","noerr":0,"x":378,"y":140,"wires":[["9d70740a.bf6ab8"]]},{"id":"9d70740a.bf6ab8","type":"serial out","z":"2fbc78e2.c769f8","name":"Serail-Out","serial":"d831cf6b.f1c71","x":768,"y":80,"wires":[]},{"id":"6310d5f1.8754cc","type":"function","z":"2fbc78e2.c769f8","name":"Send Message","func":"var sms_msg = msg.payload.message;\n\nmsg.payload=sms_msg+\"\\x1A\";\n//msg.payload.msg =msg.payload.message;\n\nreturn msg;","outputs":1,"noerr":0,"x":433,"y":457,"wires":[["9d70740a.bf6ab8"]]},{"id":"2fd4afa4.390e3","type":"delay","z":"2fbc78e2.c769f8","name":"Wait for > prompt","pauseType":"delay","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":255,"y":395,"wires":[["6310d5f1.8754cc"]]},{"id":"301444fa.701d3c","type":"delay","z":"2fbc78e2.c769f8","name":"","pauseType":"delay","timeout":"1","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":307,"y":308,"wires":[["5b06835.db6897c"]]},{"id":"5b06835.db6897c","type":"function","z":"2fbc78e2.c769f8","name":"Write newline","func":"msg.payload=\"\\r\\n\";\nreturn msg;","outputs":1,"noerr":0,"x":476,"y":291,"wires":[["9d70740a.bf6ab8"]]},{"id":"5fe528d5.225868","type":"serial in","z":"2fbc78e2.c769f8","name":"Serial-In","serial":"d831cf6b.f1c71","x":799,"y":234,"wires":[["b86e6dc4.bd91c"]]},{"id":"b86e6dc4.bd91c","type":"debug","z":"2fbc78e2.c769f8","name":"","active":true,"console":"false","complete":"false","x":827,"y":424,"wires":[]},{"id":"4df83d50.1ec864","type":"ui_group","z":"","name":"SMS","tab":"c79420a4.f39c8","order":1,"disp":true,"width":"6"},{"id":"d831cf6b.f1c71","type":"serial-port","z":"","serialport":"192.168.1.35","serialbaud":"115200","databits":"8","parity":"none","stopbits":"1","newline":"\\n\\r","bin":"false","out":"char","addchar":false,"responsetimeout":""},{"id":"c79420a4.f39c8","type":"ui_tab","z":"","name":"SMS","icon":"dashboard"}]

The serial port node talks to.... serial ports... not to a wifi network. You need a (probably USB) modem. It may be possible to configure a mobile phone as a modem and connect it via a USB cable and use that for example.

Maybe see here - but a lot will depend on your phone and so on. https://thelunchtalk.wordpress.com/2012/04/14/how-to-use-your-android-mobile-phone-as-a-modem/

Is there any other way to send messages to mobile phones other than serial ports?

@amrutha there are lots of online services that provide SMS-as-a-service. Some of them have nodes available on flows.nodered.org - for example Twilio and Nemo. I'm sure a little time spent on Google will find something that fits your needs.

sure, thanks!

Looks like you have taken your flow from here, right ?

This subject has already been discussed in Node-RED forum. Please have a look here:

https://groups.google.com/forum/#!topic/node-red/nH75NwzBEFo

yeah i was following this guide. thanks

I use an old Android phone (5.0 or greater) on which I've installed Termux and Termux-api apps and then from Termux command prompt installed node-red.

I use this simple flow:
[ { "id": "31a22a85.9374a6", "type": "mqtt in", "z": "e737347b.d0f048", "name": "Send SMS Text", "topic": "Alarm/sendText", "qos": "2", "broker": "d7fb8552.4008e8", "x": 100, "y": 40, "wires": [ [ "1bb75a02.4d95c6", "64e9422c.853bdc" ] ] }, { "id": "64e9422c.853bdc", "type": "exec", "z": "e737347b.d0f048", "command": "termux-sms-send -n ", "addpay": true, "append": "", "useSpawn": "false", "timer": "", "oldrc": false, "name": "", "x": 340, "y": 100, "wires": [ [], [ "1bb75a02.4d95c6" ], [] ] }, { "id": "d7fb8552.4008e8", "type": "mqtt-broker", "z": "", "broker": "192.168.2.140", "port": "1883", "clientid": "", "usetls": false, "compatmode": true, "keepalive": "60", "cleansession": true, "willTopic": "Alarm/TingFona", "willQos": "2", "willRetain": "true", "willPayload": "AbnormalExit", "birthTopic": "Alarm/TingFona", "birthQos": "2", "birthRetain": "true", "birthPayload": "Running" } ]
It gets messages via MQTT from any device on my network. Using a no-contract service like Ting or Red Jacket costs me about $10 a month.

Main hassle is all the junk calls on the cell phone number which I've never given to anyone and have never answered or made an outgoing call from.

I tried the "free" phone service from FreedomPop but it uses a proprietary messaging app that doesn't work with Termux-api. This would be perfect as 500 texts and 100 MB of data for #0 monthly charge would be unbeatable -- I use the phone and service in my car to check Google Maps when I'm out and about. With offline maps updated over WiFi I've never exceeded my free data limit. I don't use it but maybe once a week, but its nice to keep in the car.

1 Like

Check with your normal mobile provider - they quite often provide an email to SMS gateway. They don't often advertise them though.

1 Like

Probably easier to google your provider name and sms gateway.

For example, searching for ting sms gateway found a lot of info, along with this interesting tidbit:

Our GSM network partner, in particular, aggressively filters messages that it thinks may be spam from common email domains like Gmail, Hotmail, Outlook, Aol, and elsewhere. Just like with email, there is no sure-fire way to get around a spam filter and our support team are not able to remove those filters.

If you depend on email-to-text service, we recommend a free Google Voice or Google Hangouts account. If you need to automate SMS delivery for your business, you could also consider an (inexpensive, but paid) service like Twilio.