EC25 USB Interfaces crash

We are trying to implement scheduled calls with the Modem Quectel EC25. For achieving this, we send AT commands to the modem via the ttyUSB2 serial interfaces (4 interfaces from ttyUSB0-3 are available in general). To send these commands we use the python serial library.

lsusb shows the following usb devices:

lsusb
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 040: ID 2c7c:0125 Quectel Wireless Solutions Co., Ltd. EC25 LTE modem
Bus 001 Device 002: ID 2109:3431 VIA Labs, Inc. Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Unfortunately, after only a few successful outgoing calls, we get an error from our application (specifically from the serial library):

DEBUG - Error returned: device reports readiness to read but returned no data (device disconnected or multiple access on port?)
DEBUG - Error returned: write failed: [Errno 5] Input/output error

After this error appears, we observed that the /dev/ttyUSB2 interface was missing, but now a /dev/ttyUSB4 interface appeared.

ls -al /dev/ttyUSB*
crw-rw---- 1 root dialout 188, 0 Jun 1 17:50 /dev/ttyUSB0
crw-rw---- 1 root dialout 188, 1 Jun 1 17:50 /dev/ttyUSB1
crw-rw---- 1 root dialout 188, 3 Jun 1 17:50 /dev/ttyUSB3
crw-rw---- 1 root dialout 188, 4 Jun 1 17:50 /dev/ttyUSB4

There isn’t any other application which accesses this serial device.

In the dmesg log you canalso see that the USB device disconnects for some reason, and then connects again, with an error “-71”.

dmesg
[Thu Jun 1 16:06:14 2023] usb 1-1.3: USB disconnect, device number 6
[Thu Jun 1 16:06:14 2023] option1 ttyUSB0: GSM modem (1-port) converter now disconnected from ttyUSB0
[Thu Jun 1 16:06:14 2023] option 1-1.3:1.0: device disconnected
[Thu Jun 1 16:06:14 2023] option1 ttyUSB1: GSM modem (1-port) converter now disconnected from ttyUSB1
[Thu Jun 1 16:06:14 2023] option 1-1.3:1.1: device disconnected
[Thu Jun 1 16:06:14 2023] option1 ttyUSB2: GSM modem (1-port) converter now disconnected from ttyUSB2
[Thu Jun 1 16:06:14 2023] option 1-1.3:1.2: device disconnected
[Thu Jun 1 16:06:14 2023] option1 ttyUSB3: GSM modem (1-port) converter now disconnected from ttyUSB3
[Thu Jun 1 16:06:14 2023] option 1-1.3:1.3: device disconnected
[Thu Jun 1 16:06:14 2023] qmi_wwan 1-1.3:1.4 wwan0: unregister ‘qmi_wwan’ usb-0000:01:00.0-1.3, WWAN/QMI device
[Thu Jun 1 16:06:14 2023] usb 1-1.3: new high-speed USB device number 7 using xhci_hcd
[Thu Jun 1 16:06:14 2023] usb 1-1.3: new high-speed USB device number 8 using xhci_hcd
[Thu Jun 1 16:06:14 2023] usb 1-1-port3: attempt power cycle
[Thu Jun 1 16:06:15 2023] usb 1-1.3: new high-speed USB device number 9 using xhci_hcd
[Thu Jun 1 16:06:15 2023] usb 1-1.3: string descriptor 0 read error: -71
[Thu Jun 1 16:06:15 2023] usb 1-1.3: New USB device found, idVendor=2c7c, idProduct=0125, bcdDevice= 3.18
[Thu Jun 1 16:06:15 2023] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[Thu Jun 1 16:06:15 2023] option 1-1.3:1.0: GSM modem (1-port) converter detected
[Thu Jun 1 16:06:15 2023] usb 1-1.3: GSM modem (1-port) converter now attached to ttyUSB0
[Thu Jun 1 16:06:15 2023] option 1-1.3:1.1: GSM modem (1-port) converter detected
[Thu Jun 1 16:06:15 2023] usb 1-1.3: GSM modem (1-port) converter now attached to ttyUSB1
[Thu Jun 1 16:06:15 2023] option 1-1.3:1.2: GSM modem (1-port) converter detected
[Thu Jun 1 16:06:15 2023] usb 1-1.3: GSM modem (1-port) converter now attached to ttyUSB3
[Thu Jun 1 16:06:15 2023] option 1-1.3:1.3: GSM modem (1-port) converter detected
[Thu Jun 1 16:06:15 2023] usb 1-1.3: GSM modem (1-port) converter now attached to ttyUSB4
[Thu Jun 1 16:06:15 2023] qmi_wwan: probe of 1-1.3:1.4 failed with error -71

Sending AT commands over the USB4 interface works the same as sending them on the USB2 interface. Do you have any idea what could cause this USB disconnect or how we could debug it?

Let me know if I can provide any further information for you and appreciate any help :slight_smile: .

The most common cause by far of modems which disappear in this way is an inadequate power supply.

After running tests, I can confirm that it was a power problem. How do you suggest. What do you suggest how I can solve this problem? Fir the 4G EC25 I have the Sixfab HAT connected via USB to the modem. How can I make sure that the HAT & Modem gets adequate power?

Thank you so much for the help.

There are two techniques commonly used to solve the USB power issue:

  1. Use a USB Y-cable between HAT and modem. These allow the modem to draw additional power from the secondary USB power source.

  2. Use a powered USB hub between HAT and modem.

You need a power supply with adequate power. Then just use one of the options offered by your HAT:

The HAT can be powered from an external 5V source by exposed power pins, directly from Raspberry Pi 5V GPIO headers, via micro USB, or optional JST connector on the bottom of the board. A specially designed 90-degree right angle micro USB cable is included to package.

The easiest option is probably a spare phone charger with micro USB cable.
You can check the modem voltage with AT+CBC

Do you maybe know such a hub that would provide sufficient power for the HAT and Pi. I have tried 3 y splitter, and that did not work.

And how would I establish the data connection between the RasPi and the HAT? Over the GPIO pins?
Thank you so much in advance.

My understanding that external USB connection is the only option [for data]. GPIO lines will give you access to UART only.
Assuming RPi cannot provide enough power on its USB connector you will probably need to consider other ways to power the Hat (and the modem).