Score:0

Serial device stops working when upgrade to 20.04

ru flag

I have a USB device with a serial interface. It worked great on 18.04 (and on Windows) but when I upgrade to 20.04 something is interfering with communications.

When I plug in the device, it shows up as /dev/ttyACM1 or /dev/ttyACM0, which is what I expect.

When I look at /var/log/syslog I see this :

Jun 10 11:58:39 andy-HP-ZBook-15u-G3 wpa_supplicant[864]: wlp2s0: CTRL-EVENT-SIGNAL-CHANGE above=1 signal=-58 noise=9999 txrate=200000
Jun 10 11:58:39 andy-HP-ZBook-15u-G3 kernel: [  309.817011] usb 1-2: new full-speed USB device number 7 using xhci_hcd
Jun 10 11:58:40 andy-HP-ZBook-15u-G3 kernel: [  309.967174] usb 1-2: New USB device found, idVendor=2988, idProduct=0302, bcdDevice= 2.00
Jun 10 11:58:40 andy-HP-ZBook-15u-G3 kernel: [  309.967178] usb 1-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
Jun 10 11:58:40 andy-HP-ZBook-15u-G3 kernel: [  309.967180] usb 1-2: Product: 3DSystems Virtual Serial Port
Jun 10 11:58:40 andy-HP-ZBook-15u-G3 kernel: [  309.967181] usb 1-2: Manufacturer: 3D Systems
Jun 10 11:58:40 andy-HP-ZBook-15u-G3 kernel: [  309.967183] usb 1-2: SerialNumber: 00000000050C
Jun 10 11:58:40 andy-HP-ZBook-15u-G3 kernel: [  309.968766] cdc_acm 1-2:1.0: ttyACM0: USB ACM device

That seems ok to me.

But when I try to communicate to the device, it doesn't work. The device's communication protocol is command/response structure, so I haven't determined yet if my commands aren't reaching the device, or if the responses aren't reaching my code. (or both), but I know that if I send a command, I get no response.

Update : I've connected my hardware to a debugger and discovered that outgoing data is getting through. When I send a command from my app to the hardware, the hardware does receive the command. The problem is that when my hardware replies, my app does not receive any data.

(It's also possible that if spurious commands are being sent, it could put the device into an unexpected state.)

Things I've tried :

  • Permissions : I've set the device's permissions to 777 just to be sure
  • ModemManager : I've removed this package
  • mtp_probe : I couldn't figure out how to disable this, so I temporarily removed the binary.

Any hints as to what's changed in serial device support from 18.04 to 20.04 would be greatly appreciated. Thank you.

Sebastian avatar
in flag
You may also need to belong to groups tty and dialout for it to work. Have you checked that? Also you may need to add some specific udev rules to be able to use the ports.
ru flag
I'm sure it's not a permissions problem. I did try adding a udev rule, I just copied the entry for a serial device and used my own VID/PID numbers. If there's something more than that I need to do, then I'd be interested to learn what it is.
Suthiro avatar
ng flag
Have you ever found what was wrong?
ru flag
@Suthiro, I don't claim to fully understand it, but I got it working yes. The short version was that the terminal settings were wrong. For some reason, for my device, Ubuntu 18 set the terminal settings correctly, but Ubuntu 20 set them wrong. I tried to figure out exactly why my communication was breaking, but I ran out of time, and instead I used stty on an Ubuntu 18 machine, and just copy/pasted the output to write a script for Ubuntu 20 machines. It wasn't pretty, and I never figured out the exact setting that was screwed up, but it worked.
Suthiro avatar
ng flag
Thank you very much! I've double checked the settings on different machines, this is not the case, unfortunately.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.