2

I have a simple serial device that I need to talk to (but not listen to) periodically via command.

The device is connected OK as /dev/usbxxx.

What is the simplest/easiest way to do this?

Installing software (python, minicom, whatever) is fine.

The exact scenario is I have an arduino device (a Cube4) that I want to use as a build light. Periodically, I will poll the CI server or use RSS etc and need to tell it what color to display. Using session-based solutions (like screen) seems like they won't work because the terminal command runs elsewhere (although I suppose I could remote to the screen session, send the chars via who knows what, then disconnect).

Bohemian
  • 303
  • 3
  • 9
  • A related question was asked on [SuperUser](http://superuser.com/questions/144751/sending-ascii-characters-on-mac-usb-rs232-cable?rq=1) that lists some good tools. – MMB Jan 09 '15 at 04:40

1 Answers1

0

echo "characters" > /dev/usbxxx

Simplest I can think of, and should work in zsh

Foosh
  • 1,144
  • 5
  • 13
  • Don't you have to set the baud rate, stop bits, and parity bits? – LawrenceC Apr 08 '22 at 18:06
  • @LawrenceC Depends on the device. I certainly didn't have to when I was doing something similar to OP. But if you're trying to use *real* RS-232 then yeah, you have to account for everything the standard expects. – Foosh Apr 08 '22 at 18:56
  • 1
    `echo "0xAA 0xBB 0x03 0x01 0x01 0xEE" > /dev/tty.usbserial-FT8YXN7Z 9600` isn't working for me. The terminal just freezes – spuder Jul 16 '22 at 04:32