Open danimasa opened 4 years ago
Hello,
I copied robust_serial.hpp to my project and implemented a class to read and write information to the serial port using std::fstream.
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
What could be intercepting my communication with the board?
To be honest, I have no idea... I usually had trouble reading packets coming from the Arduino, not the opposite way. Are you also using the arduino code from this repo?
Hello @araffin
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
I used the code from file_read_write.cpp example.
Are you also using the arduino code from this repo?
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?