Send sms with node-RED

Hi everyone. I would like to use node-RED send the sms to my phone. My sms device is Maestro.

I write the format send sms to Maestro and they just display this.
I did not receive any message on my phone.

This is my code.

`[{"id":"b6b35c7e.3e30b","type":"tcp out","z":"cf481068.5cc7d","host":"","port":"22","beserver":"client","base64":false,"end":false,"name":"","x":590,"y":620,"wires":[]},{"id":"803eb305.439d6","type":"inject","z":"cf481068.5cc7d","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":220,"y":500,"wires":[["1ec5339b.4e72dc"]]},{"id":"7264934f.e3240c","type":"debug","z":"cf481068.5cc7d","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":670,"y":500,"wires":[]},{"id":"791ae714.afef28","type":"tcp request","z":"cf481068.5cc7d","server":"","port":"22","out":"time","splitc":"0","name":"","x":470,"y":500,"wires":[["7264934f.e3240c"]]},{"id":"1ec5339b.4e72dc","type":"function","z":"cf481068.5cc7d","name":"","func":"msg={payload:\"AT#SENDSMS=\"<+60182090000>\"This is a test from Ethernet SMS\"}\nreturn msg;","outputs":1,"noerr":0,"x":330,"y":620,"wires":[["791ae714.afef28","b6b35c7e.3e30b"]]}]`


It would be pretty unusual for a device to be at port 22 on - for many people that is their home gateway on their network

ALso based on your screenshot you have set the port to 22 (which is the port for SSH) - but it states that the default is 5555 - which is it ?


If the default is 5555 the node red will show connection failed. I dont know wheather is tcp got problems or the function node.


So what is the default gateway on your network - and what are your network details (i.e. IP range, DNS etc etc)

hi craig, i know my default gateway for pc one already. so what is the next step i show do?


I have no idea what you wre saying in that last sentence. ?

Is you default gateway on the network ?? if so then you can not do a TCP node to it (or you can but it will not do anything about sending an SMS for you !)

The reason why when you hit on port 22 that is responds is that you have SSH enabled on your Firewall/router.

Is the SMS solution you are trying to use - a piece of hardware that you plug into your network - or is this an Internet based service ?



Why I will get this type of error?
FYI, Below is the code in function node:
msg={payload:"AT#SENDSMS="<+60182090000>",This is a test from Ethernet SMS^"}
return msg;

Take a look at your function node

msg={payload:"AT#SENDSMS="<+60182090000>"This is a test from Ethernet SMS"}

You are confusing string start and end with quotes in your string, try

msg={payload:'AT#SENDSMS="<+60182090000>"This is a test from Ethernet SMS'}

But you also need to send it to the correct port.

If you add a debug node to check what you are sending...

What error are you refering to?

The debug output shows the TCP node has returned a Buffer object containing 362 bytes of data.

That is probably some text. If you click the button that says 'raw' it will try to display it as a string and you'll be able to read what it says.