I've been trying to send commands to an ESP8266 using the terminal on OSX. I've been able to open the nodemcu interface using screen and send commands successfully, but when I try and send commands via echo (turning the on board LED on):
echo "gpio.mode(3,gpio.OUTPUT) gpio.write(3,gpio.LOW)" > /dev/cu.SLAB_USBtoUART
the command executes but nothing happens. However if I have a second terminal running:
cat /dev/cu.SLAB_USBtoUART
to read the console the echo command executes and the light turns on.
I've been able to run the command on ubuntu (changing the /dev/ path) and it worked without the second terminal. I've found using screen that any command executed via echo without the cat terminal being open just sends the first letter. I've also found the same problem using printf instead of echo.