I am running a simple script on the Arduino that is supposed to output to serial (/dev/ttyACM0). It works great in the Arduino IDE and can even been seen by running: sudo tail -f /dev/ttyACM0 However, whenever I reboot the board and try to run sudo tail -f /dev/ttyACM0 without first running in the IDE, nothing shows up. If I open the IDE and open the serial monitor tool, it works fine. I can then close that window and run the tail command and it works. It appears that nothing is written to the serial port until the serial monitor tool is run in the IDE. Everything I can find in the Arduino and Udoo docs seem to indicate that the Arduino will run the last loaded script on boot. What's going on here? Is there something the IDE is doing to activate the serial port?
This is a Linux issue. Tail is not that usefully. See also for example this old discussion: https://forum.arduino.cc/index.php?topic=15985.0 My advise would be to use minicom to read a serial device in Linux. There is also a section in the documentation how to set up and programm a serial communication protocol between the Arduino and the Linux part of the Udoo with C, Java, php or python: https://www.udoo.org/docs-x86/Serial_Libraries/index.html
Thank you! I'm about to try the Udoo libraries. If that doesn't work I'm going to try using the PHP direct IO libraries installed through PECL (https://www.php.net/manual/en/function.dio-tcsetattr.php). Will post with results!
Just tried the libraries and the PHP class works great! Also, after playing with minicom I see why just using cat doesn't work on the serial port, especially without using stty which is sketchy at best. I did not try the PHP direct IO libraries since the Udoo Serial Libraries worked so easily.