How to change mode(or product ID) of SIMCOM module (SIM8262E-M2)

740 Views Asked by At

I messed up. I got this SIMCOM module recently, with 5G support. SIM8262E-M2
This is based on Snapdragon X62 Modem.

It has 4 modes(or product IDs) of operation: at+cusbcfg=? gives the following: 9001,9003,9011,901e
The default factory mode is 9001. All the modes (except 901E) provide /dev/ttyUSB (I learnt the hard way!) and you can issue AT commands via those(using minicom etc.)
I mistakenly changed the mode to 901E, now I'm unable to get any serial ports from this!

however this still has /dev/cdc-wdm0 I can use qmicli and mbimcli to interact:

[xplore@fedora ~]$ sudo qmicli --device=/dev/cdc-wdm0 --device-open-proxy --dms-get-operating-mode
[/dev/cdc-wdm0] Operating mode retrieved:
    Mode: 'online'
    HW restricted: 'no'

My question: How do I change the mode back to one of (9001,9003,9011) ? OR is there any way to issue AT commands via qmicli/mbimcli ?

I have also tried the following(refer this post or this):

[root@fedora xplore]# modprobe option
[root@fedora xplore]# echo 1e0e 9011 > /sys/bus/usb-serial/drivers/option1/new_id

But after running this I don't see any /dev/ttyUSB* devices. (do I need to do anything else here?, I'm clearly not an expert in Linux)

Currently it shows up as:

[root@fedora xplore]# lsusb
Bus 008 Device 003: ID 1e0e:901e Qualcomm / Option SDXLEMUR-LITE-MTP _SN:1505A7A0

dmesg output:

[ 2449.622442] usb 8-2: new SuperSpeed USB device number 5 using xhci_hcd
[ 2449.635211] usb 8-2: LPM exit latency is zeroed, disabling LPM.
[ 2449.636702] usb 8-2: New USB device found, idVendor=1e0e, idProduct=901e, bcdDevice= 5.04
[ 2449.636704] usb 8-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 2449.636704] usb 8-2: Product: SDXLEMUR-LITE-MTP _SN:1505A7A0
[ 2449.636705] usb 8-2: Manufacturer: SIMCOM
[ 2449.636706] usb 8-2: SerialNumber: 0123456789ABCDEF
[ 2449.803329] cdc_mbim 8-2:1.2: setting rx_max = 16384
[ 2449.803997] cdc_mbim 8-2:1.2: cdc-wdm0: USB WDM device
[ 2449.804219] cdc_mbim 8-2:1.2 wwan0: register 'cdc_mbim' at usb-0000:6b:00.0-2, CDC MBIM, 16:dd:bf:a1:af:08
[ 2449.816224] cdc_mbim 8-2:1.2 wwp107s0u2i2: renamed from wwan0

I also tried the following:
Enabled debug mode for ModemManager

sudo mmcli -m 0 --command="AT"
error: command failed: 'GDBus.Error:org.freedesktop.ModemManager1.Error.Core.Connected: No AT port available to run command'

But it shows that AT port isn't exposed.

Please help me out here, this devices is expensive for me and the device has extensive AT commands documentation, without which I cannot use it much.

More Documentation:
https://www.waveshare.com/w/upload/c/c6/SIM82XX_SIM83XX_Series_AT_Command_Manual_V1.02.pdf
https://www.waveshare.com/wiki/USB_TO_M.2_B_KEY#Working_With_SIM82XX_Module
https://www.waveshare.com/wiki/SIM8262E-M2_5G_HAT
https://github.com/torvalds/linux/commit/5417a7e482962952e622eabd60cd3600dd65dedf

2

There are 2 best solutions below

0
On BEST ANSWER

This is fixed! However the fix isn't a solution to this problem.
I fixed it by getting latest drivers for Windows, after installing them I could see COM ports open!
I used putty to connect to serial port and change the mode back:

AT+CUSBCFG=USBID,1E0E,9003
2
On

OR is there any way to issue AT commands via qmicli/mbimcli?

I do not know about those two programs, however I have written a program atinout for the sole purpose of running AT commands from the command line. Based on example given in the documentation1 and assuming /dev/cdc-wdm0 is the serial device for AT commands you should be able to run

echo AT+CUSBCFG=usbid,1e0e,9011 | atinout - /dev/cdc-wdm0 -

1 Looking at the documentation for this command I cringe over how fundamentally broken and incorrect the syntax for this command is because string parameters shall always be enclosed with double quote characters, which for zero good reasons is not the case here. The person(s) implementing the AT+CUSBCFG command clearly did not properly understand AT commands.

The documentation references V.25ter which is sort of correct, but still not a great sign since the reference ought to be V.250 which V.25ter was renamed to "just" 24 years ago after only 3 years of existence:

The ITU-T established a standard in its V-Series Recommendations, V.25ter, in 1995 in an attempt to establish a standard for the command set again. It was renamed V.250 in 1998

And V.250 is crystal clear on what proper syntax is:

5.4.2 Values

... value shall consist of either a numeric constant or a string constant.

5.4.2.1 Numeric constants

Numeric constants are expressed in decimal, hexadecimal, or binary. ...

5.4.2.2 String constants

String constants shall be bounded at the beginning and end by the double-quote character ...

and the above was definitely present from the very start in V.25ter so there is no excuse for this terrible wrong AT command syntax.