Why echo "R" > /dev/ttyUSB0 doesn't work, but on the same PC Serial Monitor in Arduino IDE works? I have a strange problem. I am running Ubuntu and NodeMCU si plugged into USB. I have very simple sketch running on it, when it reads letter &quot;R&quot; on serial, it turns ON relay.
When I open Serial Monitor in Arduino IDE and I type letter &quot;R&quot; and send it, it works perfectly. However when I run commands below, it does nothing:
stty -F /dev/ttyUSB0 115200
echo &quot;R&quot; &gt; /dev/ttyUSB0

I tried running the same commands on different PC with Ubuntu and these system commands work just fine.
I also tried copying exact same configuration from stty -a -F /dev/ttyUSB from PC where it works to PC where it doesn't, but it didn't help either.
I don't think it's driver issue, because if it would, then I suppose it wouldn't work with Serial Monitor also.
Thank you for any help or hints in advance.
I had the same issue.
After entering command that Majenko suggested:
stty -F /dev/ttyUSB0 -hupcl

I still wasn't able to send commands to Arduino nano.
Strangely, when I open Arduino IDE Serial Monitor and send command it works.
When I close it, I can send commands in terminal to Arduino for some time. Then it stops working again :/