Hello!
I cant make my Pololu USB 16 to work on Linux Ubuntu. I am quite sure that my problem is my port settings.
I have seen the example code using the termios structure, but I’m used to use open ports using fopen and I would like to do so in this project too (fopen opens streams).
I started testing my code on my macbook running osX. The program runs without problems, and it shows that the Pololu USB 16 Servo Controller is a great servo controller! Now i want it to work on my small linux computer too!
Once I run the program on the linux machine, the red LED is lit and the yellow led flashes, indicating too slow baudrate. Although, its not the baudrate. I have tried baudrates from 9600 up to 57600, and it works just fine with 9600 baud on my macbook.
I think the trick is to get all the flags correct using stty -F /dev/ttyUSB0.
Can anyone please post ALL the stty flags from a correct set up port, i.e. from a functional USB 16 Servo Controller.
This command gives ALL the stty flags:
stty -F /dev/ttyUSB0 -a
These are my current settings: (I’m using ttyUSB1)
rex@trex:~/ctl$ stty -F /dev/ttyUSB1 -a
speed 9600 baud; rows 0; columns 0; line = 0;
intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = <undef>; eol2 = <undef>; swtch = <undef>; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R;
werase = ^W; lnext = ^V; flush = ^O; min = 1; time = 0;
-parenb -parodd cs8 hupcl -cstopb cread clocal -crtscts
-ignbrk -brkint ignpar -parmrk -inpck -istrip -inlcr -igncr -icrnl -ixon -ixoff -iuclc -ixany -imaxbel -iutf8
-opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0
-isig -icanon -iexten -echo -echoe -echok -echonl -noflsh -xcase -tostop -echoprt -echoctl -echoke
Thank you in advance!
EDIT: I have tried the code snippet from lukelukeluke which is using the termios struchture with the same result. Red LED lit, yellow LED flashing.