ok
did some new test ...
The only thing I'm sure of is the story with stty thus I putted the following in the code:
Code:
if((system("/bin/stty -F /dev/ttyACM0 9600"))<0){
printf("error: cannot set port"); //
exit(-1);
}
not the most propper way but for now it helps me out and it keeps working calling the program with crontab every miniute to have a little temperature logger (code a bit different).
I've studied the source code of stty, used the same way as it opens the fd, it morely "reopens" it so I used the same way included playing with the nonblocking options --> no result, exactly the same result.
Next I've played with the O_ASYNC option (running stty first). A little difference ... With the option setted, nothing receives anymore, with the option explicity cleared, same result.
So for now, it works but only with the piece of code running stty.
An other thing came up rebooting the server this morning, after rebooting the interface doesn't get recognized automaticly, only after unplugging and replugging it 's all back in place.
Anything to get that part working? (the auto reconnect on booting)