Closed huzeifa closed 2 years ago
Very sorry about the very slow response. The problem is that the shell is not sending the \r as part of the argument.
You should be able to do this: grabserial -d /dev/ttyUSB0 -b 2000000 -c $'adc\r'
The extra $'...' should work in bash, and may work in other shells. It causes the shell to treat argument as a string to be literally printed. If you are calling this from a shell script, you can check which shell the script uses, and adjust that, if needed.
Or, this should work in most shell scripts: grabserial -d /dev/ttyUSB0 -b 2000000 -c $(printf 'adc\r')
Sorry again that this took me so long to get to. Ultimately, this is not an issue with grabserial, but with the calling environment, so I'm closing this.
Hi,
I am trying to send a command ending with
\r\n
, however it doesn't work.my command: grabserial -d /dev/ttyUSB0 -b 2000000 -c adc\r
Some troubleshooting notes: I print the output of the command variable from line 681 of the grabserial code
my output: adcr
It seems the \r character is not recognized
My temporary fix: add \r character together with \n character on line 681 to
Kindly advise if there are any other solutions for this