Odd problems with serial connection

Status
Not open for further replies.

tsg

New member
Hi,

I have trouble setting up a serial connection between a Teensy LC and a PC (Thinkpad X220 with Linux Mint 19). For testing purpose i removed all wiring and uploaded the following sketch:

Code:
const int ledPin = 13;

void setup() {
  Serial.begin(9600);
  pinMode(ledPin, OUTPUT);
}

void loop() {
  Serial.println("Hello World");
  digitalWrite(ledPin, HIGH);
  delay(1000);
  digitalWrite(ledPin, LOW);
  delay(1000);
}

The LED is blinking, the device shows up as ttyACM0. I tried the Arduino IDE serial monitor, screen, picocom and moserial. Arduino IDE an moserial show what looks like buffered data but no new incoming data. The other simply show nothing. When trying to close the programs all of them hang and only close when I disconnect the Teensy from the PC.

Just as I am writing this: When I open the port within 2 seconds after connecting the Teensy it works...

The board was previously soldered to a PCB, could I have damaged it when I removed it? Beside the problems with the serial connection it seems to work fine.

I tested this with different USB cables and another PC running Ubuntu 18.04, same results.

It seems like a problem with the OS, but I don't remember any problems when trying this in the past. Anyway, I would really appreciate if you could help me.

dmesg output:
[ 3652.040219] usb 2-1.2: USB disconnect, device number 27
[ 3658.149540] usb 2-1.2: new full-speed USB device number 28 using ehci-pci
[ 3658.259656] usb 2-1.2: New USB device found, idVendor=16c0, idProduct=0483
[ 3658.259663] usb 2-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 3658.259667] usb 2-1.2: Product: USB Serial
[ 3658.259670] usb 2-1.2: Manufacturer: Teensyduino
[ 3658.259673] usb 2-1.2: SerialNumber: 5251090
[ 3658.260434] cdc_acm 2-1.2:1.0: ttyACM0: USB ACM device

And when trying to close picocom:
[ 3622.090680] cdc_acm 2-1.2:1.0: failed to set dtr/rts
 
Your Teensy is probably fine. I'm guessing ModemManager is interfering.

Check your udev rules against the latest.

https://www.pjrc.com/teensy/49-teensy.rules

We updated this udev file several months ago when Ubuntu (or maybe upstream Debian) changed the default filter policy for ModemManager, which exposed a long-dormant ModemManager bug where it would not respect ID_MM_DEVICE_IGNORE. The latest udev rules also add ID_MM_PORT_IGNORE. If you have the old udev and your distro is using that setting, ModemManager tries to open the port, causing other software to not get access to the device for the first few seconds after it's detected by the kernel & udev.

Another possible explanation is somehow 2 instances of "teensy_serialmon" are running. To check that, quit Arduino and run "killall teensy_serialmon". It should give an error that not such process exists.
 
Thank you for pointing that out. I updated my udev rules, but unfortunately, this didn't solve the issues. Also there are no instances of teensy_serialmon running.
 
Status
Not open for further replies.
Back
Top