I am attempting to send AT commands to a USB device in Node.js using shelljs and socat.
The following (2) commands executes successfully in Terminal:
$ sudo socat - /dev/ttyUSB0
AT+RESTART
Note: The first command connects to the device, and the second restarts it.
However, the following (2) commands do not execute successfully in Node.js:
shell.exec('sudo socat - /dev/ttyUSB0');
shell.exec('AT+RESTART');
How do I get the two commands to run in the same shell.exec instance?