Hey everyone,
I started to play with Arduino (UNU)
I wanted to setup some test for sewrial communication with my pc.
I wrote a small and simple program to send some characters. the Arduino side seems to work fine, The serial monitor of the IDE shows the text the Arduino is sending, and also the test appears in "Screen" ( Linux minitoring program.
However trying to connect with my C++ program using LibSerial fails every time...
<Bad file descriptor>
Any Ideas ?
Thanks !
Are you running it with sudo priveliges?
No, but would that be necessary ?
Would be inconvenient to use sudo every time running this...
Maybe try .IsOpen() instead of .good() and see if an error message becomes apparent?
edit - also are you opening "/dev/ttyACMO" with a letter "O" or "/dev/ttyACM0" with a zero? I think the latter is correct.
Makes no difference, and yes the last char is a zero ;-)
Have you given yourself permission to acces the ports?
i.e.
sudo usermod -a -G dialout <your username>
sudo usermod -a -G plugdev <your username>
Surely if it works from screen and from the Arduino IDE, the permissions are OK?