Reading serial data from TeensyDuino not working on Ubuntu 16.04

Status
Not open for further replies.

Mantabit

New member
Hello everyone

I am currently using a sensor-board which uses TeensyDuino to send serial data to the USB port of a laptop. I followed the installation instructions given here: https://www.pjrc.com/teensy/td_download.html (installing the Arduino IDE 1.8.7) and I installed Teensy on Ubuntu 14.04. On 14.04, I was able to read data from the Sensor with the following python script:

Code:
import serial
import os


ports=os.listdir("/dev")
port=""
#if "ttyACM0" in ports:
#    port="/dev/ttyACM0"
#elif "ttyACM1" in ports:
#    port="/dev/ttyACM1"
port="/dev/ttyACM0"
    
baudrate=3000000
    
serialIO=serial.serial_for_url(port, baudrate, stopbits=2)

for i in range(0,100):
    print(str(serialIO.readline().decode()))

The issue is that when I did the exact same thing on Ubuntu 18.04, I can't read data from the same board. Basically, the script starts hanging and I have to stop the process.

What I noticed is, that on the working computer with 14.04, I see a single device file /dev/ttyACM0 with the following settings:

speed 3000000 baud; line = 0;
min = 0; time = 0;
-brkint -icrnl -imaxbel
-opost
-isig -icanon -iexten -echo -echoe -echok -echoctl -echoke

On the computer where the serial connection does not work (with 18.04 installed), I see two device files. The following device file /dev/ttyACM0 appears all the time, even if the Teensy board is not connected to the USB Port:

speed 3000000 baud; line = 0;
eof = ^A; min = 0; time = 0;
-brkint -icrnl -imaxbel
-opost -onlcr
-isig -icanon -iexten -echo -echoe -echok -echoctl -echoke

When I plug in the TeensyDuino board, a second device file /dev/ttyACM1 is shown which appears to have incorrect settings:

speed 9600 baud; line = 0;
-brkint -imaxbel

When I try to read the settings from /dev/ttyACM0 with stty -F /dev/ttyACM0, the command also starts hanging. I also can't set the baud-rate of this device-file with the command stty -F /dev/ttyACM0 3000000 since this command will hang as well.

Does anyone have an idea how I could resolve this issue?

Thanks very much!
 
Status
Not open for further replies.
Back
Top