-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Description
Operating System and Hardware: Raspberry Pi 2 B running Jessie
NodeJS Version: 4.2.6
Serialport version: 3.1.1
EDIT: Also reproduced on ASUS 64-bit desktop running Debian 8.4.0
NodeJS version: 4.4.4
Serialport version: 3.1.1
Problem description
Simultaneous network requests alongside serial port writes can cause large delays to the serial port communication. When the Raspberry Pi is on a high latency connection, the serial port communication can become significantly delayed, usually multiple seconds between writes or data events. All the code should be performed async, so it is unclear why there would be a delay.
Steps and/or code to reproduce the issue
Here is a small test case to reproduce the issue. Running this on a Raspberry Pi connected to a high latency network will cause significant delays. (There is an Arduino on the other side of the serial port connection that sends back responses.)
We were experiencing this issue as part of a larger system, but have isolated it down to node-serialport while there are network requests being made. Simply unplugging the network connection (ethernet cable or Wifi adapter, we have tested both) will cause the serial port communications to significantly speed up (dozens of read/writes per second).
Further reference
I have run across a couple other examples of people experiencing similar issues:
- Serialport together with Socket.IO is blocking event loop? #165
- http://stackoverflow.com/questions/22263094/node-js-node-serialport-has-significant-write-delays
Any suggestions on how to further isolate or debug this issue would be greatly appreciated.