Serialport device

Hi,

I have this usb GPIO board.

I can send commands to that by using screen in mac terminal.
In node red I can see, that it is connected, but when using same commands, nothing happens. I only get back the same command I send.

Can anyone help what I do wrong?

Might not make a difference, but have you tried using the serial request node instead of the separate serial in/out nodes?

Thanks for the suggestion, I tried also serial request, but result is the same.

When you send a command to the serial port do you have the correct line ending (enter) that the board requires ?

Got it working. I added function node and entered command and \r.

Thanks for help!

29

1 Like

Great - yes sometimes it's \n and sometimes \r.
Well done. Onwards !

At one time there was a suggestion to allow the inject and maybe change nodes to allow the \r string to represent a carriage return... +1 for that feature, especially if it could be added to the template node as well.

"hello\r" is valid JSON so you can set the inject to JSON mode and use that if you wish

Aha, tricky -- I guess I never tried using JSON mode...
Do you have a trick like that for including returns in the string generated by the template node?

same trick - output JSON string instead

[{"id":"8391e8de.aa36d8","type":"inject","z":"9da3d17d.f408","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":120,"y":120,"wires":[["23a2da8d.6a8896"]]},{"id":"23a2da8d.6a8896","type":"template","z":"9da3d17d.f408","name":"","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"\"This is the time: {{payload}}\\n and line two !\"","output":"json","x":280,"y":120,"wires":[["3a5187f5.671688"]]},{"id":"3a5187f5.671688","type":"debug","z":"9da3d17d.f408","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":450,"y":120,"wires":[]}]

Is it possible to send me the code you used to read the gpio pins on the numato?

Thanks in regard

Hi,

Sorry, I sold my node red equipment and I don't have this code anymore.

Visit this numato page and find "List of currently supported commands."

You can play with those commands and hope you find working method. Just make same kind of flow and play with it. Hope this helps.