How to Change MBIM Mode to QMI, AT mode in EM7565

Hi,
I have changed MBIM mode by executing below AT commands for testing,

AT!ENTERCND=“A710”
AT!USBCOMP=1,3,100D
AT!RESET

Port 1: Dev 4, If 0, Class=Communications, Driver=cdc_mbim, 5000M
Port 1: Dev 4, If 1, Class=CDC Data, Driver=cdc_mbim, 5000M
Port 1: Dev 4, If 2, Class=Vendor Specific Class, Driver=GobiSerial, 5000M
Port 1: Dev 4, If 3, Class=Vendor Specific Class, Driver=GobiSerial, 5000M
Port 1: Dev 4, If 4, Class=Vendor Specific Class, Driver=GobiSerial, 5000M

Now, not responding for AT commands, i want to revert back to original QMI and AT mode, how can we do this? i tried changing USB composition with below qmicli command but getting error,

qmicli --device=/dev/cdc-wdm0 --device-open-proxy --dms-swi-get-usb-composition
error: couldn’t get USB composite modes: QMI protocol error (94): ‘NotSupported’

Any help is really appreciated!

Gobiserial driver is loaded, have you tried on usb 2.0 port?

Thanks for reply! i tried in USB 3.0

no problem is found on my side:

owner@CNHKG-EX-001367:~/Desktop/python_OpenCV$ minicom -s

Welcome to minicom 2.7

OPTIONS: I18n
Compiled on Jan 1 2014, 17:13:19.
Port /dev/ttyUSB2, 15:25:00

Press CTRL-A Z for help on special keys

ati3
Manufacturer: Sierra Wireless, Incorporated
Model: EM7565
Revision: SWI9X50C_01.12.01.00 980041 jenkins 2019/12/26 00:56:09
IMEI: 353533100134710
IMEI SV: 10
FSN: UF913580100215
+GCAP: +CGSM

OK

CTRL-A Z for help | 115200 8N1 | NOR | Minicom 2.7 | VT102 | Offline | ttyUSB2
owner@CNHKG-EX-001367:~/Desktop/python_OpenCV$ lsusb -t
/: Bus 04.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/6p, 5000M
/: Bus 03.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/15p, 480M
|__ Port 3: Dev 102, If 0, Class=Vendor Specific Class, Driver=GobiSerial, 480M
|__ Port 3: Dev 102, If 2, Class=Vendor Specific Class, Driver=GobiSerial, 480M
|__ Port 3: Dev 102, If 3, Class=Vendor Specific Class, Driver=GobiSerial, 480M
|__ Port 3: Dev 102, If 8, Class=Vendor Specific Class, Driver=GobiNet, 480M
|__ Port 7: Dev 3, If 0, Class=Vendor Specific Class, Driver=, 12M
|__ Port 11: Dev 4, If 0, Class=Wireless, Driver=btusb, 12M
|__ Port 11: Dev 4, If 1, Class=Wireless, Driver=btusb, 12M
|__ Port 12: Dev 5, If 0, Class=Video, Driver=uvcvideo, 480M
|__ Port 12: Dev 5, If 1, Class=Video, Driver=uvcvideo, 480M
/: Bus 02.Port 1: Dev 1, Class=root_hub, Driver=ehci-pci/3p, 480M
|__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/8p, 480M
/: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=ehci-pci/3p, 480M
|__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/6p, 480M

From your output it shows, your device is already QMI/AT mode. But My devices are changed to MBIM mode, but i’m unable to revert back to original state to support AT commands,

instead of GobiNet, please see below mine is MBIM driver,

Port 1: Dev 4, If 0, Class=Communications, Driver=cdc_mbim, 5000M
Port 1: Dev 4, If 1, Class=CDC Data, Driver=cdc_mbim, 5000M
Port 1: Dev 4, If 2, Class=Vendor Specific Class, Driver=GobiSerial, 5000M
Port 1: Dev 4, If 3, Class=Vendor Specific Class, Driver=GobiSerial, 5000M
Port 1: Dev 4, If 4, Class=Vendor Specific Class, Driver=GobiSerial, 5000M

qmicli --device=/dev/cdc-wdm0 --device-open-proxy --dms-swi-get-usb-composition
error: couldn’t get USB composite modes: QMI protocol error (94): ‘NotSupported’

you might try on USB2.0.
I don’t want to change my module’s setting to be MBIM.

This shows the MBIM mode where MBIM takes interfaces 0 and 1. You still have 3 serial ports, where one of tem is AT. But the order has probably changed. Just try all you ttyUSBx devices until you find the one with AT.

Hi, Thanks for reply! None of them responding for AT commands, 3 ttyUSB ports are shown but none of them responding AT commands

That’s strange. Maybe the GobiSerial driver is confused by the unexpected device layout? I don’t know this driver too well. You could make an attempt temporarily using the option driver, ref:

You’'ll obviously have to unload GobiSerial from memory first. I.e

rmmod GobiSerial
modprobe option
echo 1199 9091 > /sys/bus/usb-serial/drivers/option1/new_id

And connect to /dev/ttyUSB0

Hi, Same result after changing to option as well,

|__ Port 4: Dev 7, If 12, Class=Communications, Driver=cdc_mbim, 5000M
|__ Port 4: Dev 7, If 2, Class=Vendor Specific Class, Driver=option, 5000M
|__ Port 4: Dev 7, If 0, Class=Vendor Specific Class, Driver=option, 5000M
|__ Port 4: Dev 7, If 13, Class=CDC Data, Driver=cdc_mbim, 5000M
|__ Port 4: Dev 7, If 3, Class=Vendor Specific Class, Driver=option, 5000M

you might try on USB2.0 hub

Huh? That’s not the same device you showed us in How to Change MBIM Mode to QMI, AT mode in EM7565

This one has the MBIM function on interface 12 and 13, with serial functions on 0, 2 and 3, as expected if you really did
AT!USBCOMP=1,3,100D

So on this device, the AT function will be on ttyUSB2 (assuming that it is mapped to USB interface 3).

BAnyway… I can’t explain how you end up with different USB configurations like this from one test to another. That is completely unexpected behaviour, so I’ll just throw in the towel now.

Thanks!
Found the solution, login to the terminal using minicom and give the at!reset it won’t give any echo, but after reset modem port will come up and we can change back to original mode from MBIM using at!usbcomp=1,3,10D

Now, i’m seeing another issue, after closing the minicom session and reopen, again we need to give at!reset to gain the access, any suggestion please

You have some other application stealing the ttyUSBx device.

Hi, do we have some way to find out which application is stealing?

lsof /dev/ttyUSB2

or just check running processes and kill the suspects