# Serial Data (\`/dev/ttyACMx\`) works unreliably on ResinOS - No problems on Raspbian host

**URL:** <https://forums.balena.io/t/serial-data-dev-ttyacmx-works-unreliably-on-resinos-no-problems-on-raspbian-host/1450>\
**Category:** Product support\
**Tags:** support, raspberrypi3, serial\
**Created:** [July 13, 2017, 9:16pm UTC](https://forums.balena.io/t/serial-data-dev-ttyacmx-works-unreliably-on-resinos-no-problems-on-raspbian-host/1450 "2017-07-13T21:16:09Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![che](https://avatars.discourse-cdn.com/v4/letter/c/d78d45/32.png) [@che](https://forums.balena.io/u/che)\
**Post date:** [July 13, 2017, 9:16pm UTC](https://forums.balena.io/t/serial-data-dev-ttyacmx-works-unreliably-on-resinos-no-problems-on-raspbian-host/1450/1 "2017-07-13T21:16:09Z")

</div>

Our setup can be described as follows:

- Two measurement devices are connected to a Raspberry 3 via USB Serial connection
- Serial devices run at 1000000 baud
- A NodeJS based application is able to read out serial data from the two measurement devices
- The serial devices are correctly recognised within the application as `/dev/ttyACM2` and `/dev/ttyACM3`

This setup **works reliably** in the following situations:

- NodeJS code deployed on Barebone Pi (Raspbian Image)
- NodeJS deployed using Docker Image (based on Resin docker templates) on Raspbian OS (installed docker)

**However** , when I try to deploy the application (and hence the image) using a ResinOS on the pi and upload it through [Resin.IO](http://Resin.IO) it starts working very unreliably. Serial data comes in mixed up, causing the app to be unable to parse incoming data and ultimately no serial data input anymore…

I’m unable to find the root cause of this issue. As the docker image on a Raspbian host device works like a charm, and the physical setup was left unchanged (only switched SD cards) this might be an issue on the underlying ResinOS.

Hopefully someone on this forum can lead me the way how to get this to work reliably on Resin.

Thanks!

---

<div class="post-metadata">

**Author:** ![sqweelygig](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/sqweelygig/32/150_2.png) [@sqweelygig](https://forums.balena.io/u/sqweelygig)\
**Post date:** [July 14, 2017, 3:08pm UTC](https://forums.balena.io/t/serial-data-dev-ttyacmx-works-unreliably-on-resinos-no-problems-on-raspbian-host/1450/5 "2017-07-14T15:08:46Z")

</div>

Could you confirm what version of ResinOS you’re using, we’ve got some notes in our knowledge base that might help with certain versions.

---

<div class="post-metadata">

**Author:** ![che](https://avatars.discourse-cdn.com/v4/letter/c/d78d45/32.png) [@che](https://forums.balena.io/u/che)\
**Post date:** [July 17, 2017, 6:39am UTC](https://forums.balena.io/t/serial-data-dev-ttyacmx-works-unreliably-on-resinos-no-problems-on-raspbian-host/1450/7 "2017-07-17T06:39:58Z")

</div>

Hi,

Using Resin OS 2.0.8+rev1 (dev)

---

<div class="post-metadata">

**Author:** ![floion](https://avatars.discourse-cdn.com/v4/letter/f/45deac/32.png) [@floion](https://forums.balena.io/u/floion)\
**Post date:** [July 17, 2017, 10:37am UTC](https://forums.balena.io/t/serial-data-dev-ttyacmx-works-unreliably-on-resinos-no-problems-on-raspbian-host/1450/8 "2017-07-17T10:37:49Z")

</div>

Hi, is this a .dev or a .prod image? If it is a .dev, could you use the serial console to login on the host OS and try to check some things? Like look in the kernel ring buffer (dmesg) for eventual errors?

---

<div class="post-metadata">

**Author:** ![che](https://avatars.discourse-cdn.com/v4/letter/c/d78d45/32.png) [@che](https://forums.balena.io/u/che)\
**Post date:** [July 28, 2017, 9:46am UTC](https://forums.balena.io/t/serial-data-dev-ttyacmx-works-unreliably-on-resinos-no-problems-on-raspbian-host/1450/9 "2017-07-28T09:46:34Z")

</div>

Hi,

After some more testing with ResinOS and Rasbian images, we were able to find the root cause of why our application stopped reporting serial events.

At some point the serial device is re-initialised by the OS and the baud is reset to the default baud rate. This was not detected by our application.

Our current solution is to force update the baud and flow control settings after opening the port and when we detect no input for a certain amount of time.

Currently this seems to fix our issues.
