Note that there are some explanatory texts on larger screens.

plurals
  1. POCommunication over serial port using Bash
    text
    copied!<p>I'm trying to get a check-scanner to transmit image files to my Mac (the company only provides Windows drivers). I have the technical manual that specifies all the commands that can be sent to the device, and I'm trying the most basic commands first (blink the LED, print serial number, etc.).</p> <p>I have been able to successfully communicate with the device using "Serial Tools", but I'm trying to use bash for more control of the input/output and to eventually write an automated script.</p> <p>After reading a few other posts and trying several things, so far I've tried this: Opening the port with stty command and various flags, for example:<br> <code>stty -f /dev/tty.usbserial-A5002TeW speed 9600 cs8 cread clocal</code><br> <code>stty -f /dev/tty.usbserial-A5002TeW raw speed 9600 -cstopb -parity -echo</code> </p> <p>Trying to send commands over echo:<br> <code>echo $'LE 100\cM\cJ' &gt; /dev/tty.usbserial-A5002TeW</code><br> --Note that the serial device is connected through a USB adaptor, but responds (at least in Serial Tools) as a regular serial device after I installed the right drivers for it.<br> --I'm trying to use the \cM\cJ characters because as the device was intended for use by Windows boxes I figured I should use their control codes, I've tried multiple permutations of the code.</p> <p>The Problem: No matter what happens, the device never responds (no blinky LED lights, no output, etc) and my bash shell hangs until I stop it (^C). I know I can probably use a Python library, and I might wind up doing that, but I'd like to at least see some basic functionality with the bash shell.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload