USB Serial port fails on Linux

Status
Not open for further replies.

tjrob

Member
I have implemented a signal generator in a Teensy 4.0 sketch. It uses the USB Serial device: detecting a new connection, writing "SignalGenerator 1.0", and then reading the Serial device for commands and writing responses.

It works fine on my Mac laptop (Teensyduino IDE not running):
Code:
(plug in USB)
$ cat /dev/cu.usbmodem71506301 &
SignalGenerator 1.0
(accepts commands via "echo >/dev/cu.usbmodem71506301 command")
Note that putting the "cat" in the background keeps the serial device open and lets me see responses to commands.

On a Raspberry Pi 3B+ running Raspbian, after using lsusb to find it:
Code:
(plug in USB)
$ cat /dev/bus/usb/001/007 &
@??y	C?2	$$$$?

That looks like the wrong baud rate. How do I fix this?
 

Attachments

  • SignalGenerator.ino
    5.7 KB · Views: 36
  • readline.h
    952 bytes · Views: 37
  • readline.cpp
    1.1 KB · Views: 34
Perhaps the Pi doesn't have the needed USB serial driver installed. There should be a device like /dev/ttyACM0. You might also need to mess with stty to configure it or use a terminal emulator like screen, picoterm, nanoterm, etc. handle the baud rate, etc. I've been able to connect a Teensy to a Raspberry Pi Zero W, but it was a while ago and I don't remember the exact steps.
 
Status
Not open for further replies.
Back
Top