You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
sleep(2); //required to make flush work, for some reason
Blocking code too long
Overflow in serial port (without this sleep)
Why ?
Only because write() method on my posix system (RPi 3 - Linux 3 - Raspbian 8) is asynchrone and doesn't wait entire writing of string on serial port (seem legit). The reason of flush()
Solution
The solution is easy, program should wait entire writing (some milliseconds) :
Hi,
Problem
I use this lib to do some tasks and this next line give me lot of problems :
arduino-serial/arduino-serial-lib.c
Line 148 in e5958dc
Why ?
Only because
write()
method on my posix system (RPi 3 - Linux 3 - Raspbian 8) is asynchrone and doesn't wait entire writing of string on serial port (seem legit). The reason offlush()
Solution
The solution is easy, program should wait entire writing (some milliseconds) :
usleep( millisecondsToWait );
instead ofsleep 2;
That give waiting of 6 milliseconds for a MySensors gateway with a speed of 38400 bauds.
This really works ?
Yeah, tested with sniffing our serial port from hardware, without
sleep()
The text was updated successfully, but these errors were encountered: