-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
C++ Implementation not communicating #5
Comments
Hello,
Why didn't you use the examples from https://github.com/araffin/cpp-arduino-serial/tree/2075fd8f203483af9c82caffba4bdbc84024ea63/examples ? EDIT: your implementation looks like the same as in the examples |
To be honest, I have no idea... I usually had trouble reading packets coming from the Arduino, not the opposite way. |
Hello @araffin
I used the code from file_read_write.cpp example.
Yes, I'm using exacly the same implementation used in slave.cpp. But I'm not keeping the connected flag, I'm receiving the messages direcly in arduino loop funcition, first receiving the order and then the data. What I found weird is that if interceptty is running all works normal. It seems like some configuration of the serial port interfere in the communication, and that service applies it when running. |
as a sanity check, can you send/receive something using Arduino IDE? |
Yes, if I send anything the Serial Monitor returns my error NotFound order (I couldn't manage to send data not encoded in ASCII using the Serial Monitor to see if it responds correctly send my data). |
I'm having a problem running code from the C++ implementation.
I copied robust_serial.hpp to my project and implemented a class to read and write information to the serial port using std::fstream.
The implementation in my arduino is like that:
So I adjust the stty from the terminal:
stty 115200 -F /dev/ttyACM0
But the data is not arriving to the arduino board, but i noticed that if I use a sniffer like interceptty like that:
interceptty /dev/ttyACM0
That create a bind to the /dev/pts/3, and if I connect to that port the data is Ok and is arriving to arduino. But if I remove the interceptty and connect direct to the /dev/ttyACM0 it stop working again. And if I start interceptty and kept it running I can communicate either, even with the /dev/ttyACM0 port.
What could be intercepting my communication with the board?
The text was updated successfully, but these errors were encountered: