[BPI-R3] Sim error OpenWrt SNAPSHOT, r21666-68f983ba41 003: ID 2c7c:0800 Quectel RM502Q-AE

You may help me with an sim error i got on my r3 model with an Bus 001 Device 003: ID 2c7c:0800 Quectel RM502Q-AE, installed with a adapter M.2 Key B to Mini PCI-e NGFF M2 “https://es.aliexpress.com/item/1005004251364071.html?spm=a2g0o.order_list.order_list_main.5.62d3194dZfPazn&gatewayAdapt=glo2esp

The issue is that i see the device, it seems to work till the point that it cant find the sim no matter the port i choose it keeps on this error, i will put some logs down:

OpenWrt SNAPSHOT, r21666-68f983ba41

<b>root@OpenWrt:~# gcom -d /dev/cdc-wdm0
***SIM ERROR***
Check device port configuration.
Check SIM is inserted
Test SIM in a mobile phone?</b>

**root@OpenWrt:~# dmesg | grep modem**
[   18.298631] usbserial: USB Serial support registered for GSM modem (1-port)
[   18.305706] option 1-1.1:1.0: GSM modem (1-port) converter detected
[   18.312115] usb 1-1.1: GSM modem (1-port) converter now attached to ttyUSB0
[   18.319221] option 1-1.1:1.1: GSM modem (1-port) converter detected
[   18.325608] usb 1-1.1: GSM modem (1-port) converter now attached to ttyUSB1
[   18.332706] option 1-1.1:1.2: GSM modem (1-port) converter detected
[   18.339112] usb 1-1.1: GSM modem (1-port) converter now attached to ttyUSB2
[   18.346185] option 1-1.1:1.3: GSM modem (1-port) converter detected
[   18.352581] usb 1-1.1: GSM modem (1-port) converter now attached to ttyUSB3
[   18.367564] usbserial: USB Serial support registered for Qualcomm USB modem
<b>root@OpenWrt:~# lsusb</b>
Bus 002 Device 001: ID 1d6b:0003 Linux 5.15.86 xhci-hcd xHCI Host Controller
Bus 001 Device  **003: ID 2c7c:0800 Quectel RM502Q-AE**
Bus 001 Device 002: ID 1a40:0101  USB 2.0 Hub
Bus 001 Device 001: ID 1d6b:0002 Linux 5.15.86 xhci-hcd xHCI Host Controller

<b>root@OpenWrt:~# ls -l /dev/</b>
crw-------    1 root     root       10, 234 Jan  4 23:19 btrfs-control
drwxr-xr-x    3 root     root            60 Jan  1  1970 bus
<b>crw-------    1 root     root      180, 176 Jan  4 23:19 cdc-wdm0</b>
crw-------    1 root     root        5,   1 Jan  1  1970 console
crw-rw-rw-    1 root     root        1,   7 Jan  1  1970 full
crw-------    1 root     root       10, 229 Jan  4 23:19 fuse
crw-------    1 root     root      254,   0 Jan  1  1970 gpiochip0
crw-------    1 root     root       10, 183 Jan  1  1970 hwrng
crw-------    1 root     root       89,   0 Jan  1  1970 i2c-0
crw-------    1 root     root       89,   1 Jan  4 23:19 i2c-1
crw-------    1 root     root       89,   2 Jan  4 23:19 i2c-2
crw-------    1 root     root        1,  11 Jan  1  1970 kmsg
srw-rw-rw-    1 root     root             0 Jan  4 23:19 log
crw-------    1 root     root       10, 237 Jan  1  1970 loop-control
brw-------    1 root     root        7,   0 Jan  1  1970 loop0
brw-------    1 root     root        7,   1 Jan  1  1970 loop1
brw-------    1 root     root        7,   2 Jan  1  1970 loop2
brw-------    1 root     root        7,   3 Jan  1  1970 loop3
brw-------    1 root     root        7,   4 Jan  1  1970 loop4
brw-------    1 root     root        7,   5 Jan  1  1970 loop5
brw-------    1 root     root        7,   6 Jan  1  1970 loop6
brw-------    1 root     root        7,   7 Jan  1  1970 loop7
brw-------    1 root     root      179,   0 Jan  1  1970 mmcblk0
brw-------    1 root     root      179,   8 Jan  1  1970 mmcblk0boot0
brw-------    1 root     root      179,  16 Jan  1  1970 mmcblk0boot1
brw-------    1 root     root      179,   1 Jan  1  1970 mmcblk0p1
brw-------    1 root     root      259,   0 Jan  1  1970 mmcblk0p128
brw-------    1 root     root      179,   2 Jan  1  1970 mmcblk0p2
brw-------    1 root     root      179,   3 Jan  1  1970 mmcblk0p3
brw-------    1 root     root      179,   4 Jan  1  1970 mmcblk0p4
brw-------    1 root     root      179,   5 Jan  1  1970 mmcblk0p5
crw-------    1 root     root      250,   0 Jan  1  1970 mmcblk0rpmb
crw-------    1 root     root       90,   0 Jan  1  1970 mtd0
crw-------    1 root     root       90,   1 Jan  1  1970 mtd0ro
crw-------    1 root     root       90,   2 Jan  1  1970 mtd1
crw-------    1 root     root       90,   3 Jan  1  1970 mtd1ro
crw-------    1 root     root       90,   4 Jan  1  1970 mtd2
crw-------    1 root     root       90,   5 Jan  1  1970 mtd2ro
crw-------    1 root     root       90,   6 Jan  1  1970 mtd3
crw-------    1 root     root       90,   7 Jan  1  1970 mtd3ro
brw-------    1 root     root       31,   0 Jan  1  1970 mtdblock0
brw-------    1 root     root       31,   1 Jan  1  1970 mtdblock1
brw-------    1 root     root       31,   2 Jan  1  1970 mtdblock2
brw-------    1 root     root       31,   3 Jan  1  1970 mtdblock3
crw-rw-rw-    1 root     root        1,   3 Jan  1  1970 null
crw-------    1 root     root        1,   4 Jan  1  1970 port
crw-------    1 root     root      108,   0 Jan  4 23:19 ppp
crw-rw-rw-    1 root     root        5,   2 Jan  5 06:50 ptmx
drwxr-xr-x    2 root     root             0 Jan  1  1970 pts
crw-rw-rw-    1 root     root        1,   8 Jan  1  1970 random
lrwxrwxrwx    1 root     root             8 Jan  1  1970 shm -> /tmp/shm
lrwxrwxrwx    1 root     root            15 Jan  1  1970 stderr -> /proc/self/fd/2
lrwxrwxrwx    1 root     root            15 Jan  1  1970 stdin -> /proc/self/fd/0
lrwxrwxrwx    1 root     root            15 Jan  1  1970 stdout -> /proc/self/fd/1
crw-rw-rw-    1 root     root        5,   0 Jan  1  1970 tty
crw-rw----    1 root     dialout     4,  64 Jan  1  1970 ttyS0
crw-rw----    1 root     dialout     4,  65 Jan  1  1970 ttyS1
crw-rw----    1 root     dialout     4,  74 Jan  1  1970 ttyS10
crw-rw----    1 root     dialout     4,  75 Jan  1  1970 ttyS11
crw-rw----    1 root     dialout     4,  76 Jan  1  1970 ttyS12
crw-rw----    1 root     dialout     4,  77 Jan  1  1970 ttyS13
crw-rw----    1 root     dialout     4,  78 Jan  1  1970 ttyS14
crw-rw----    1 root     dialout     4,  79 Jan  1  1970 ttyS15
crw-rw----    1 root     dialout     4,  66 Jan  1  1970 ttyS2
crw-rw----    1 root     dialout     4,  67 Jan  1  1970 ttyS3
crw-rw----    1 root     dialout     4,  68 Jan  1  1970 ttyS4
crw-rw----    1 root     dialout     4,  69 Jan  1  1970 ttyS5
crw-rw----    1 root     dialout     4,  70 Jan  1  1970 ttyS6
crw-rw----    1 root     dialout     4,  71 Jan  1  1970 ttyS7
crw-rw----    1 root     dialout     4,  72 Jan  1  1970 ttyS8
crw-rw----    1 root     dialout     4,  73 Jan  1  1970 ttyS9
<b>crw-rw----    1 root     dialout   188,   0 Jan  4 23:19 ttyUSB0
crw-rw----    1 root     dialout   188,   1 Jan  4 23:19 ttyUSB1
crw-rw----    1 root     dialout   188,   2 Jan  4 23:38 ttyUSB2
crw-rw----    1 root     dialout   188,   3 Jan  4 23:19 ttyUSB3</b>
crw-------    1 root     root      249,   0 Jan  1  1970 ubi0
crw-------    1 root     root      249,   1 Jan  1  1970 ubi0_0
crw-------    1 root     root      249,   2 Jan  1  1970 ubi0_1
crw-------    1 root     root      249,   3 Jan  1  1970 ubi0_2
crw-------    1 root     root      249,   4 Jan  1  1970 ubi0_3
crw-------    1 root     root      249,   5 Jan  1  1970 ubi0_4
crw-------    1 root     root      249,   6 Jan  1  1970 ubi0_5
crw-------    1 root     root       10, 127 Jan  1  1970 ubi_ctrl
brw-------    1 root     root      254,   0 Jan  1  1970 ubiblock0_2
brw-------    1 root     root      259,   1 Jan  1  1970 ubiblock0_2p1
crw-rw-rw-    1 root     root        1,   9 Jan  1  1970 urandom
crw-------    1 root     root       10, 130 Jan  1  1970 watchdog
crw-------    1 root     root      252,   0 Jan  1  1970 watchdog0
crw-rw-rw-    1 root     root        1,   5 Jan  1  1970 zero

<b>root@OpenWrt:~# comgt -v</b>
comgt 06:53:16 -> Verbose output enabled
comgt 06:53:16 -> argc:2
comgt 06:53:16 -> argv[0]=comgt
comgt 06:53:16 -> argv[1]=-v
comgt 06:53:16 ->  ---Script---
   1@0000 opengt
   2@0007     set com 115200n81
   3@0029     set senddelay 0.05
   4@0052     send "AT+CFUN=1^m"
   5@0075     waitquiet 1 0.2
   6@0095   :start
   7@0104     flash 0.1
   8@0118     send "AT+CPIN?^m"
   9@0140     waitfor 30 "SIM PUK","SIM PIN","READY","ERROR","ERR"
  10@0197     if % = -1 goto error
  11@0222     if % = 0 goto ready
  12@0246     if % = 1 goto getpin
  13@0271     if % = 2 goto ready
  14@0295     if % = 3 goto error
  15@0319     if % = 4 goto error
  16@0343   :error
  17@0352     print $s," ***SIM ERROR***
  18@0383 "
  19@0385     print "Check device port configuration.
  20@0429 Check SIM is inserted
  21@0451 Test SIM in a mobile phone?
  22@0479 "
  23@0481     exit 1
  24@0492   :getpin
  25@0502     #handle case where original Vodafone 3G generates wrong response
  26@0571     waitfor 1 "2"
  27@0589     if % = 0 goto ready
  28@0613     print "
  29@0625 Enter PIN number: "
  30@0645     input $x
  31@0658     let a=len($x)
  32@0676     if a<>5 goto getpin
  33@0700     let c=0
  34@0712   :test
  35@0720     let $c=$mid($x,c,1)
  36@0744     if $c<"0" goto getpin
  37@0770     if $c>"9" goto getpin
  38@0796     inc c
  39@0806     if c<4 goto test
  40@0827     let a=val($x)
  41@0845     if a<0 goto getpin
  42@0868     if a>9999 goto getpin
  43@0894     let $c=$left($x,4)
  44@0917   :enterpin
  45@0929     send "AT+CPIN=\""
  46@0951     send $c
  47@0963     send "\"^m"
  48@0979     waitfor 20 "OK","ERR"
  49@1005     if % = -1 goto timeerror
  50@1034     if % = 0 goto cont
  51@1057     if % = 1 goto pinerror
  52@1084   :pinerror
  53@1096   :timeerror
  54@1109     print "ERROR entering PIN code
  55@1144 "
  56@1146     print "Caution! - entering the wrong PIN code three times will lock the SIM
  57@1226 "
  58@1228     exit 1
  59@1239   :ready
  60@1248     print "SIM ready
  61@1269 "
  62@1271   :cont
  63@1279     print "Waiting for Registration..(120 sec max)"
  64@1331     let c = 0
  65@1345   :waitreg
  66@1356     send "AT+CREG?^m"
  67@1378     waitfor 2 "+CREG: 0,1","+CREG: 0,5"
  68@1418     if % = -1 goto regagain
  69@1446     if % = 0 goto homereg
  70@1472     if % = 1 goto roamreg
  71@1498   :regagain
  72@1510     if c > 120 goto regtimeout
  73@1541     let c=c+2
  74@1555     print "."
  75@1569     goto waitreg
  76@1586   :regtimeout
  77@1600     print "
  78@1612 Failed to register
  79@1631 "
  80@1633     exit 1
  81@1644   :homereg
  82@1655     print "
  83@1667 Registered on Home network: "
  84@1697     goto registered
  85@1717   :roamreg
  86@1728     print "
  87@1740 Registered on Roaming network: "
  88@1773     goto registered
  89@1793   :registered
  90@1807     waitquiet 1 0.1
  91@1827     send "AT+COPS?^m"
  92@1849     get 2 "^m" $s
  93@1867     get 2 "^m" $s
  94@1885     let a=len($s)
  95@1903     let b=a-12
  96@1918     if b < 1 goto regtimeout
  97@1947     let $c=$right($s,b)
  98@1971     print $c,"
  99@1986 "
 100@1988     let c=0
 101@2000   :signal
 102@2010     waitquiet 1 0.1
 103@2030     send "AT+CSQ^m"
 104@2050     get 2 "^m" $s
 105@2068     get 2 "^m" $s
 106@2086     let a=len($s)
 107@2104     let a=a-6
 108@2118     let $s=$right($s,a)
 109@2142     if $s <> "0,0" goto sigcont
 110@2174     if c > 3 goto sigexit
 111@2200     let c=c+1
 112@2214     pause 1
 113@2226     goto signal
 114@2242   :sigexit
 115@2253     print "Signal strength measure 0,0 too low!"
 116@2302     exit 1
 117@2313   :sigcont
 118@2324     print "Signal Quality:",$s,"\n"
 119@2360     waitquiet 1 0.1
comgt 06:53:16 ->  ---End of script---
comgt 06:53:16 -> @0000 opengt
Trying list of devices
comgt 06:53:16 -> Opened /dev/ttyUSB2 as FD 3
comgt 06:53:16 -> @0011 set com 115200n81
comgt 06:53:16 -> @0033 set senddelay 0.05
comgt 06:53:16 -> @0056 send "AT+CFUN=1^m"
comgt 06:53:17 -> @0079 waitquiet 1 0.2
comgt 06:53:17 -> @0097 :start
comgt 06:53:17 -> @0108 flash 0.1
comgt 06:53:17 -> @0122 send "AT+CPIN?^m"
comgt 06:53:18 -> @0144 waitfor 30 "SIM PUK","SIM PIN","READY","ERROR","ERR"

moderated by frank-w: format output as code, change title

this seems to be a 5G-Card, not sure it will work (at least for the usb2…most 5g cards need usb3), but maybe sim-pins are different to 4g-cards. adapter looks like the one i have and i had no sim-issue on debian.

pleas format logs/code as code for better reading

Thanks the very fast reply! yes its a 5G card, sorry for the code i dont know how to format it (how i do it?) and uhmm so you think it wont work then !? maybe move to a rockchip ?

you can select the text and format it with the “</>”-button

i’m not sure it can work…i have only a 4g-card and it is working, maybe it can work, but with limited bandwith, i thought sim-pins should be same for 4g/5g. your adapter passes sim-pins to pcie-slot? or does it have a sim-slot on the adapter itself (i do not always trust images :wink: )?

mtk-boards are better supported in mainline and for router purposes they have better bandwith and offloading-features. imho bpi have no board yet supporting 5g cards (should be m.2 slot with usb3, no pcie), maybe there comes a r3 with with modification (@sinovoip are there any plans?)

in theory, “3042/3052 M.2 key B card size” Adaptador-M-2-Key-B-a-Mini-PCI-e-NGFF-M2-a-Mini-PCI-Express-PCIe.jpg_Q90.webp (79.9 KB)

The issue somehow is that i work with IT on remote so i was wanted badly a 5G working in this router as its a very good router. what is your 4g model!?

i have a sierra em7455 card (dell-branded from ebay), which works in mbim-mode (have not yet got qmi mode completely working), but no issue with sim-card.

i see, they seems to be m.2 keyb aswell, what about those mpcie, any decent speed ?

i did as you said remove the qmi and left nbim-mode it give me diff errors like

root@OpenWrt:~# dmesg | grep modem
[   18.875727] usbserial: USB Serial support registered for GSM modem (1-port)
[   18.882851] option 1-1.1:1.0: GSM modem (1-port) converter detected
[   18.889253] usb 1-1.1: GSM modem (1-port) converter now attached to ttyUSB0
[   18.896351] option 1-1.1:1.1: GSM modem (1-port) converter detected
[   18.902753] usb 1-1.1: GSM modem (1-port) converter now attached to ttyUSB1
[   18.909860] option 1-1.1:1.2: GSM modem (1-port) converter detected
[   18.916266] usb 1-1.1: GSM modem (1-port) converter now attached to ttyUSB2
[   18.923367] option 1-1.1:1.3: GSM modem (1-port) converter detected
[   18.929767] usb 1-1.1: GSM modem (1-port) converter now attached to ttyUSB3
[   18.944822] usbserial: USB Serial support registered for Qualcomm USB modem


root@OpenWrt:~# dmesg | grep serial
[    0.069640] 11002000.serial: ttyS0 at MMIO 0x11002000 (irq = 122, base_baud = 2500000) is a ST16650V2
[    0.798303] 11003000.serial: ttyS1 at MMIO 0x11003000 (irq = 123, base_baud = 1625000) is a ST16650V2
[   14.285084] usbcore: registered new interface driver usbserial_generic
[   14.291690] usbserial: USB Serial support registered for generic
[   18.875727] usbserial: USB Serial support registered for GSM modem (1-port)
[   18.939044] usbcore: registered new interface driver qcserial
[   18.944822] usbserial: USB Serial support registered for Qualcomm USB modem

root@OpenWrt:~# comgt
Trying list of devices
SIM ready
Waiting for Registration..(120 sec max).

The mpcie slot has no pcie lanes,only usb2,so you will have only usb2 speed.

Here is what i had done (not yet cleaned): https://wiki.fw-web.de/doku.php?id=en:bpi-r3:lte

Thanks a lot, seems to not work with openwrt, however i bought a PCIe Quectel EC25-E as it works with usb 2.0 lets wait BPI upgrade this board if they do … !

Man thanks a lot for the help!! wish you a great weekend!

Also the newer Quectel modem should work fine with OpenWrt, and also when connected via USB 2.0 only (which will cap the speed).

However, I read that it only works when using modemmanager, and modemmanager has to be built with support for QMI enabled.

Also note that this modem supports two SIM cards and afaik also has a built-in eSIM. You may need to switch to the correct SIM slot before your SIM is recognized.

i need build my own image or just get one from oenwrt? how to correct sim card? i may try if you explain :slight_smile:

Yes, you need to build OpenWrt from source, as by default ModemManager is built without the necessary support for Qualcomm’s QMI protocol (CONFIG_MODEMMANAGER_WITH_QMI).

To find out which logical SIM slot represents the physical SIM slot on the BPi-R3 you can use qmicli which has a on option to switch the SIM card slot, but ModemManager will just handle that more or less automatically afaik.

--uim-switch-slot=[(slot number)]               Switch active physical slot

Hello, I use Quectel EC25-EUX without modemmanager.

root@BananaPI_R3:~# cat /etc/openwrt_release  
DISTRIB_ID='OpenWrt'
DISTRIB_RELEASE='SNAPSHOT'
DISTRIB_REVISION='r21666-68f983ba41'
DISTRIB_TARGET='mediatek/filogic'
DISTRIB_ARCH='aarch64_cortex-a53'
DISTRIB_DESCRIPTION='OpenWrt SNAPSHOT r21666-68f983ba41'
DISTRIB_TAINTS=''

root@BananaPI_R3:~# lsusb | grep -i ec25
Bus 001 Device 003: ID 2c7c:0125 Quectel EC25-EUX

root@BananaPI_R3:~# uci show network | grep wwan0
network.wwan0=interface
network.wwan0.proto='qmi'
network.wwan0.device='/dev/cdc-wdm0'
network.wwan0.auth='none'
network.wwan0.apn='internet'
network.wwan0.pdptype='ipv4'

I used this for the configuration.

hi guys, i will work on it at weekend then i give you all an feedback, however i got a ec25-e in case it dont work i will try with this one!

thanks!!!

Hey @thytum,

did you had any success. I am searching myself into madness for an actual instruction how to get WWAN (4G LTE for the keyword search) to work on the BPI-R3.

Cheers Mike