I'm stuck on this one...
I'm trying to use the command line to send serial data to the arduino and can't get it to work. I have a sketch that will take a number from serial and make an LED blink the number of the serial communication, and I can't seem to get the integer to the arduino. I've tried the C and python scripts I found as well as SerialPort X and nothing will communicate. Would some kind person be willing to walk me through this?
To give a little more detail, the command:
echo "9" > /dev/tty.usbserial-A800ewFw
works perfectly in terminal as long as the arduino software is running and the serial communication window is open. When the arduino software is closed, I send the command via terminal and the light flickers, then the terminal hangs and I have to control+c.
The Arduino resets and passes some time in the bootloader when you open the serial port. During this time it is not able to listen to your commands. If you send a command during this time, it will be lost.
A small delay after opening the serial port before sending data usually helps. See this thread:
Thank you, it looks like the reset was part of the problem. The serial light now shows it is receiving data, but the arduino is not responding to the data properly (properly being the way it responds to the arduino software serial comm, as opposed to the terminal serial communication).
Is there some other communication standard it is using? Someone mentioned ascii vs something else. Any ideas?
Think I figured it out...tell me if this sounds right.
The arduino reboots when a serial connection is created, then there is a delay/reboot when the connection terminates as well. The arduino software's serial connection keeps the connection open the whole time, allowing other programs to send data. The other programs need precise timing for the opening and closing of connections to allow for the arduino to reboot.