I've got an Arduino UNO connected via USB cable to a Raspberry Pi, where I'm running a NodeJS application to send commands to the Arduino. It seems to work except that I can't send a command to the Arduino without first having the Arduino send something to the Pi. As long as the Pi sends something first, then I can send something back, but I can't seem to initiate a send operation on its own - the lights on the Arduino blink (L and RX) but the program doesn't respond.
It seems to work except that I can't send a command to the Arduino without first having the Arduino send something to the Pi. As long as the Pi sends something first, then I can send something back,
It isn't clear which needs to send first. One point you say the Arduino. Later you say the PI.
It isn't at all clear what code is running on either end, either.
Sorry, my mistake. When the NodeJS app starts, and opens the serial port on /ttyACM0, it can't simply write to the serial port and have the Arduino react. The lights on the Arduino do flicker, but the Serial.available() doesn't emit. However, when I first write something to the serial port from the Arduino side, and in response to the "on data" event on the Pi side (in the Node app), it can write something to the serial port, and Serial.available() will emit.