Xplore
Xplore

Reputation: 381

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

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

Upvotes: 0

Views: 1561

Answers (3)

user8472
user8472

Reputation: 113

I ran into exactly the same problem and I found that I could enable the /dev/ttyUSB0 through /dev/ttyUSB2 using the option driver.

With the device showing up as 1e0e:901e you can use this command (as the root user) to enable the COM ports.

echo "1e0e 901e ff" > /sys/bus/usb-serial/drivers/option1/new_id

lsusb -t -v before:

/:  Bus 001.Port 001: Dev 001, Class=root_hub, Driver=xhci_hcd/5p, 480M              
    ID 1d6b:0002 Linux Foundation 2.0 root hub                                       
    |__ Port 002: Dev 002, If 0, Class=Hub, Driver=hub/4p, 480M                      
        ID 05e3:0610 Genesys Logic, Inc. Hub                                         
        |__ Port 002: Dev 031, If 0, Class=Vendor Specific Class, Driver=[none], 480M
            ID 1e0e:901e Qualcomm / Option                                           
        |__ Port 002: Dev 031, If 1, Class=Vendor Specific Class, Driver=[none], 480M
            ID 1e0e:901e Qualcomm / Option                                           
        |__ Port 002: Dev 031, If 2, Class=Communications, Driver=cdc_mbim, 480M
            ID 1e0e:901e Qualcomm / Option 
        |__ Port 002: Dev 031, If 3, Class=CDC Data, Driver=cdc_mbim, 480M
            ID 1e0e:901e Qualcomm / Option 
        |__ Port 002: Dev 031, If 4, Class=Vendor Specific Class, Driver=[none], 480M
            ID 1e0e:901e Qualcomm / Option 

lsusb -t -v after:

/:  Bus 001.Port 001: Dev 001, Class=root_hub, Driver=xhci_hcd/5p, 480M              
    ID 1d6b:0002 Linux Foundation 2.0 root hub                                       
    |__ Port 002: Dev 002, If 0, Class=Hub, Driver=hub/4p, 480M                      
        ID 05e3:0610 Genesys Logic, Inc. Hub                                         
        |__ Port 002: Dev 031, If 0, Class=Vendor Specific Class, Driver=option, 480M
            ID 1e0e:901e Qualcomm / Option                                           
        |__ Port 002: Dev 031, If 1, Class=Vendor Specific Class, Driver=option, 480M
            ID 1e0e:901e Qualcomm / Option                                           
        |__ Port 002: Dev 031, If 2, Class=Communications, Driver=cdc_mbim, 480M
            ID 1e0e:901e Qualcomm / Option 
        |__ Port 002: Dev 031, If 3, Class=CDC Data, Driver=cdc_mbim, 480M
            ID 1e0e:901e Qualcomm / Option 
        |__ Port 002: Dev 031, If 4, Class=Vendor Specific Class, Driver=option, 480M
            ID 1e0e:901e Qualcomm / Option 

I then used MiniCom to open /dev/ttyUSB1 and send the AT command to switch the PID back to 9001 to enable QMI with AT ports

AT+CUSBCFG=USBID,1E0E,9001      # QMI 
AT+CUSBCFG=USBID,1E0E,9003      # MBIM with AT ports
AT+CUSBCFG=USBID,1E0E,9011      # RNDIS 
AT+CUSBCFG=USBID,1E0E,901e      # MBIM without AT ports by default

Sending the AT command causes the modem to reboot and now I'm back to QMI mode with an AT port on /dev/ttyUSB2

/:  Bus 001.Port 001: Dev 001, Class=root_hub, Driver=xhci_hcd/5p, 480M                
    ID 1d6b:0002 Linux Foundation 2.0 root hub                                         
    |__ Port 002: Dev 002, If 0, Class=Hub, Driver=hub/4p, 480M                        
        ID 05e3:0610 Genesys Logic, Inc. Hub                                           
        |__ Port 002: Dev 035, If 0, Class=Vendor Specific Class, Driver=option, 480M  
            ID 1e0e:9001 Qualcomm / Option                                             
        |__ Port 002: Dev 035, If 1, Class=Vendor Specific Class, Driver=option, 480M  
            ID 1e0e:9001 Qualcomm / Option                                             
        |__ Port 002: Dev 035, If 2, Class=Vendor Specific Class, Driver=option, 480M  
            ID 1e0e:9001 Qualcomm / Option                                             
        |__ Port 002: Dev 035, If 3, Class=Vendor Specific Class, Driver=option, 480M  
            ID 1e0e:9001 Qualcomm / Option                                             
        |__ Port 002: Dev 035, If 4, Class=Vendor Specific Class, Driver=option, 480M  
            ID 1e0e:9001 Qualcomm / Option                                             
        |__ Port 002: Dev 035, If 5, Class=Vendor Specific Class, Driver=qmi_wwan, 480M
            ID 1e0e:9001 Qualcomm / Option 

Credit to jhend on the whirlpool forums. https://forums.whirlpool.net.au/archive/3vx1k1r3-39#r72187847

Upvotes: 0

hlovdal
hlovdal

Reputation: 28248

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.

Upvotes: 2

Xplore
Xplore

Reputation: 381

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

Upvotes: 0

Related Questions