# Serialport device

**URL:** <https://discourse.nodered.org/t/serialport-device/7014>\
**Category:** General\
**Created:** [19 January 2019 11:33 UTC](https://discourse.nodered.org/t/serialport-device/7014 "2019-01-19T11:33:26Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Juhputti](https://avatars.discourse-cdn.com/v4/letter/j/71c47a/32.png) [@Juhputti](https://discourse.nodered.org/u/Juhputti)\
**Post date:** [19 January 2019 11:33 UTC](https://discourse.nodered.org/t/serialport-device/7014/1 "2019-01-19T11:33:26Z")

</div>

Hi,

I have this usb GPIO board.

> **[32 Channel USB GPIO Module With Analog Inputs | Numato Lab](https://numato.com/product/32-channel-usb-gpio-module-with-analog-inputs)**
>
> Numato Lab’s 32 Channel USB GPIO Module allows you for connecting your PC to other electronic circuitry through USB without any USB specific knowledge.

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?

 ![22](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/4/4fdb0af5770e952943591eb888692deb275cc3ab.png)

---

<div class="post-metadata">

**Author:** ![thatcadguy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/thatcadguy/32/5273_2.png) [@thatcadguy](https://discourse.nodered.org/u/thatcadguy)\
**Post date:** [19 January 2019 19:28 UTC](https://discourse.nodered.org/t/serialport-device/7014/2 "2019-01-19T19:28:44Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Juhputti](https://avatars.discourse-cdn.com/v4/letter/j/71c47a/32.png) [@Juhputti](https://discourse.nodered.org/u/Juhputti)\
**Post date:** [20 January 2019 07:17 UTC](https://discourse.nodered.org/t/serialport-device/7014/3 "2019-01-20T07:17:20Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [20 January 2019 08:03 UTC](https://discourse.nodered.org/t/serialport-device/7014/4 "2019-01-20T08:03:29Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Juhputti](https://avatars.discourse-cdn.com/v4/letter/j/71c47a/32.png) [@Juhputti](https://discourse.nodered.org/u/Juhputti)\
**Post date:** [20 January 2019 17:04 UTC](https://discourse.nodered.org/t/serialport-device/7014/5 "2019-01-20T17:04:26Z")

</div>

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

Thanks for help!

![29](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/b/b72cb9aaf57518ff6bcd7b9ceb793a2d01321ea2.png)

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [20 January 2019 19:10 UTC](https://discourse.nodered.org/t/serialport-device/7014/6 "2019-01-20T19:10:22Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![shrickus](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/shrickus/32/517_2.png) [@shrickus](https://discourse.nodered.org/u/shrickus)\
**Post date:** [22 January 2019 16:40 UTC](https://discourse.nodered.org/t/serialport-device/7014/7 "2019-01-22T16:40:54Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [22 January 2019 16:56 UTC](https://discourse.nodered.org/t/serialport-device/7014/8 "2019-01-22T16:56:35Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![shrickus](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/shrickus/32/517_2.png) [@shrickus](https://discourse.nodered.org/u/shrickus)\
**Post date:** [22 January 2019 16:58 UTC](https://discourse.nodered.org/t/serialport-device/7014/9 "2019-01-22T16:58:45Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [22 January 2019 17:02 UTC](https://discourse.nodered.org/t/serialport-device/7014/10 "2019-01-22T17:02:34Z")

</div>

same trick - output JSON string instead

```auto
[{"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":[]}]

```

---

<div class="post-metadata">

**Author:** ![YannickBisschoff](https://avatars.discourse-cdn.com/v4/letter/y/e19adc/32.png) [@YannickBisschoff](https://discourse.nodered.org/u/YannickBisschoff)\
**Post date:** [26 July 2021 09:58 UTC](https://discourse.nodered.org/t/serialport-device/7014/11 "2021-07-26T09:58:07Z")

</div>

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

Thanks in regard

---

<div class="post-metadata">

**Author:** ![Juhputti](https://avatars.discourse-cdn.com/v4/letter/j/71c47a/32.png) [@Juhputti](https://discourse.nodered.org/u/Juhputti)\
**Post date:** [26 July 2021 16:01 UTC](https://discourse.nodered.org/t/serialport-device/7014/12 "2021-07-26T16:01:37Z")

</div>

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."

> **[32 Channel USB GPIO Module With Analog Inputs | Numato Lab](https://numato.com/product/32-channel-usb-gpio-module-with-analog-inputs/)**
>
> Numato Lab’s 32 Channel USB GPIO Module allows you for connecting your PC to other electronic circuitry through USB without any USB specific knowledge.

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.
