I'm trying to communicate with NodeMCU (CP210x USB/UART) from command-line. However it does not respond to my commands. I have set the correct baudrate via
stty 9600 raw.
echo "gpio.write(0,gpio.LOW)" >/dev/ttyUSB0
It works when some other program is using / listening on the
screen or even
When no other program is using the tty, it does not work. I have confirmed the stty settings are the same all the time.
From the error messages from NodeMCU I confirmed that it receives only first 4 characters of my command (when no other prog is using the port), so as a workaround I have made this work:
echo -n "gpio" >/dev/ttyUSB0 echo -n ".wri" >/dev/ttyUSB0 echo -n "te(0" >/dev/ttyUSB0 echo -n ",gpi" >/dev/ttyUSB0 echo -n "o.LO" >/dev/ttyUSB0 echo "W)" >/dev/ttyUSB0
Can someone explain me what is happening and how to fix it?