EM05-G , debian, and modemmanager

Hello,

I’ve been tasked with getting the EM05-G working inside a device running debian 11, supporting software the relies on modemmanager. I am a bit lost!

I have taken inspiration from Quectel Linux USB Drivers Troubleshooting and made some headway (changing the pid to 030e), but I’m not sure how to create a qmi device, which I think is what I need to do to allow modemmanager to see it. I would gratefully welcome and help or advice on the subject. I have basic proficiency with linux so this is all a bit of a struggle and while I am learning quickly, I need to have this solved quicker!

Revert all your changes and show output of cat /sys/kernel/debug/usb/devices

Hello!

This is what it looks like before any changes:

T:  Bus=01 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#=  1 Spd=480  MxCh=12
B:  Alloc=  0/800 us ( 0%), #Int=  0, #Iso=  0
D:  Ver= 2.00 Cls=09(hub  ) Sub=00 Prot=01 MxPS=64 #Cfgs=  1
P:  Vendor=1d6b ProdID=0002 Rev= 5.10
S:  Manufacturer=Linux 5.10.0-0.bpo.9-amd64 xhci-hcd
S:  Product=xHCI Host Controller
S:  SerialNumber=0000:00:14.0
C:* #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=  0mA
I:* If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub
E:  Ad=81(I) Atr=03(Int.) MxPS=   4 Ivl=256ms

T:  Bus=01 Lev=01 Prnt=01 Port=08 Cnt=01 Dev#=  2 Spd=480  MxCh= 0
D:  Ver= 2.00 Cls=ef(misc ) Sub=02 Prot=01 MxPS=64 #Cfgs=  1
P:  Vendor=2c7c ProdID=030e Rev= 3.18
S:  Manufacturer=Quectel
S:  Product=Quectel EM05-G
C:* #Ifs= 5 Cfg#= 1 Atr=a0 MxPwr=500mA
I:* If#= 0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=(none)
E:  Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
I:* If#= 1 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=(none)
E:  Ad=83(I) Atr=03(Int.) MxPS=  10 Ivl=32ms
E:  Ad=82(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
I:* If#= 2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=(none)
E:  Ad=85(I) Atr=03(Int.) MxPS=  10 Ivl=32ms
E:  Ad=84(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=03(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
I:* If#= 3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=(none)
E:  Ad=87(I) Atr=03(Int.) MxPS=  10 Ivl=32ms
E:  Ad=86(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=04(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
I:* If#= 4 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=(none)
E:  Ad=89(I) Atr=03(Int.) MxPS=   8 Ivl=32ms
E:  Ad=88(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=05(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms

T:  Bus=02 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#=  1 Spd=10000 MxCh= 6
B:  Alloc=  0/800 us ( 0%), #Int=  0, #Iso=  0
D:  Ver= 3.10 Cls=09(hub  ) Sub=00 Prot=03 MxPS= 9 #Cfgs=  1
P:  Vendor=1d6b ProdID=0003 Rev= 5.10
S:  Manufacturer=Linux 5.10.0-0.bpo.9-amd64 xhci-hcd
S:  Product=xHCI Host Controller
S:  SerialNumber=0000:00:14.0
C:* #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=  0mA
I:* If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub
E:  Ad=81(I) Atr=03(Int.) MxPS=   4 Ivl=256ms

After running
modprobe option
modprobe cdc_mbim
echo “2c7c 030e ff” > /sys/bus/usb-serial/drivers/option1/new_id

I get

T:  Bus=01 Lev=01 Prnt=01 Port=08 Cnt=01 Dev#=  2 Spd=480  MxCh= 0
D:  Ver= 2.00 Cls=ef(misc ) Sub=02 Prot=01 MxPS=64 #Cfgs=  1
P:  Vendor=2c7c ProdID=030e Rev= 3.18
S:  Manufacturer=Quectel
S:  Product=Quectel EM05-G
C:* #Ifs= 5 Cfg#= 1 Atr=a0 MxPwr=500mA
I:* If#= 0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option
E:  Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
I:* If#= 1 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
E:  Ad=83(I) Atr=03(Int.) MxPS=  10 Ivl=32ms
E:  Ad=82(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
I:* If#= 2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
E:  Ad=85(I) Atr=03(Int.) MxPS=  10 Ivl=32ms
E:  Ad=84(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=03(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
I:* If#= 3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
E:  Ad=87(I) Atr=03(Int.) MxPS=  10 Ivl=32ms
E:  Ad=86(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=04(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
I:* If#= 4 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=option
E:  Ad=89(I) Atr=03(Int.) MxPS=   8 Ivl=32ms
E:  Ad=88(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=05(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms

mmcli --scan-modems and then list modems is run and I get nothing. Removing the ff from the echo line works better, and eventually scanning and listing returns this

 /org/freedesktop/ModemManager1/Modem/15 [Quectel] EM05-G

However, listing again shows no modems. I need to rerun the scan and then it will reappear with a newer index number or not reappear at all.

I can still communicate with the device using minicom and ttyUSB2, althoguh it will go offline at times.

OK
Quectel
OK
EM05-G
OK
EM05GFAR07A07M1G
OK
869283050663659
OK
Quectel
EM05-G
Revision: EM05GFAR07A07M1G
OK
*CNTI: 2, GSM, GPRS, EDGE, UMTS, HSDPA, HSUPA
OK
+CGDCONT: (1-24,100-179),"IP",,,(0-2),(0-4),(0-1),(0-1)
+CGDCONT: (1-24,100-179),"PPP",,,(0-2),(0-4),(0-1),(0-1)
+CGDCONT:
+CFUN: 1
OK
+CPIN: READY
OK
OK
OK
+CRSM: 144,0,"98161028000131372125"
OK

Any advice would be welcomed!

Normally it should be ProdID=030a here, but it looks like you have what is called EM05GV2 in the driver sources. Your kernel is relatively old and this Vid:Pid is not recognized by the driver(s).
Your modem is in QMI configuration, so there is no point in trying out the MBIM driver.
If you cannot update your OS, you can switch the modem to MBIM (that is not dependant on vid:pid) and manually add it to option driver as you did earlier.

Thank you for the advice, I will try this when I get back to the office. Another problem we’re having is that the device seems to disconnect and reconnect quite frequently. Is this a known issue that I can resolve with an update somewhere?

Please open a separate thread on disconnection issues. Attach your dmesg output or another log illustrating the disconnect.

I’m willing to bet it’s the older kernel version that’s causing problems. What version kernel has proper support?

Just try
echo “2c7c 030e ff” > /sys/bus/usb-serial/drivers/option1/new_id
won’t work.
The option will take the place of the QMI interface.

You should try set the EM05-G to MBIM mode by :slight_smile:

echo -ne “at+qcfg="usbnet",2\r\n” > /dev/ttyUSB2

Obviously that the EM05-G is still in RMNET mode.

Hello

Thank you for the reply.

We found that the hardware implementation we were supplied did not properly detect SIM changes. Using a v6.x kernel and completely power cycling the device were required - otherwise, once the sim was changed (and insertion counted as a change) the module was being reset by modem manager continuously.