4G modem (wwan0) on debian11 not working

Hello I would like to ask about my debian11 with 4G modem , it not connect to internet and not getting IP address

root@:~# mmcli -L
    /org/freedesktop/ModemManager1/Modem/0 [Quectel] Quectel EM05-G
root@:~#
root@:~#
root@:~# mmcli -m 0
  -----------------------------
  General  |              path: /org/freedesktop/ModemManager1/Modem/0
           |         device id: fbb3545aa04a3ccd0132e36e384
  -----------------------------
  Hardware |      manufacturer: Quectel
           |             model: Quectel EM05-G
           | firmware revision: EM05GFAR07A07M1G
           |      h/w revision: QUECTEL Mobile Broadband Modul
           |         supported: gsm-umts, lte
           |           current: gsm-umts, lte
           |      equipment id: 
  -----------------------------
  System   |            device: /sys/devices/platform/11200000.xhci/usb1/1-1/1-1.1
           |           drivers: option, cdc_mbim
           |            plugin: quectel
           |      primary port: cdc-wdm0
           |             ports: cdc-wdm0 (mbim), ttyUSB0 (at), wwan0 (net)
  -----------------------------
  Status   |             state: failed
           |     failed reason: sim-missing
           |       power state: low
  -----------------------------
  Modes    |         supported: allowed: 3g, 4g; preferred: none
           |           current: allowed: 3g, 4g; preferred: none
  -----------------------------
  IP       |         supported: ipv4, ipv6, ipv4v6
  -----------------------------
  SIM      |    sim slot paths: slot 1: none (active)
           |                    slot 2: /org/freedesktop/ModemManager1/SIM/0
root@:~#

the SIM card in inserted and I checked many time , I tried to use other SIM slot and change the mmcli , but it return as ESIM

Any one has information for resolve it ?

Thank you

you have to use the right sim-slot first

CN16(M.2 KEY) ā€“ SIM1
CN12 (mPCIE) ā€“ SIM2
CN14 (mPCIE) ā€“ SIM3

all others are not connectedā€¦is sim correctly inserted (not rotated or similar)?

afair there were some commands to check the sim-state, but i have not done much with modems and only on r3

noticed some steps in my wiki for r3 and my card

https://www.fw-web.de/dokuwiki/doku.php?id=en:bpi-r3:lte

maybe there is something that helps youā€¦be careful with the mode-switch

First, modem enumerates, so USB is OK, looks like a USB MBIM connection coz cdc_wdm / wwan0. Second, the SIM is not detected. Reason may be the hardware on BPI R4. The function of the SIM tray holder is inverse to what is stated in schematic. So following the described logic will always lead to indicating SIM not present in case of inserted SIM. With SIM removed, the logic tells SIM inserted, but there is no response from the removed SIM in case of init command. So dead end.

This is definitively an issue in the hardware of the produced BPI R4, a SIM tray holder with inverse switch was used instead of the one intended in the schematic.

To check the current logic, one may follow by measuring the level at a available pull-up resistor for the SIM Detect signal, or just measure level at the pad if resistor not mounted,

There are two ways to solve the issue:

  1. by the modem, some modems allow to disable SIM detection via the SIM Detect pin by command. In this case they will just follow the commands given to the SIM for reset. Some modem allow to change the logic of SIM detection by command, means switch open or closed when SIM inserted. Check your modem manual whether such options exist.

  2. isolate the SIM Detect pin in M.2 or miniPCIe module, so module likely will always assume SIM inserted and try to initialize it Do the tape at the module side, check whether other pins covered are functionally in use by checking the pinout. We did this successfully on M.2 EM9191 in PCIe mode. There is very thin polyimide isolation tape available, typically available for PCB work. This tape is heat resistant as well. Be careful not to break on of the pins/fingers in the connector. This happens if the tape is too thick.

Again, BananaPi manufacturing should check, whether right SIM holder is used and whether the logic of the builtin switch is according the schematic.

NB. there are modems which donā€™t care about the SIM detect pin or are configured ootb not to follow SIM Detect pin. These modems would work without issues. May be as well, that BPi R4 board are produced using different versions of the SIM holder. Recommendation is to measure at the available (resistor-)pad on the PCB of BPI R4 which logic is implemented on this exact BPI R4.

Konrad

1 Like

thank you very much, you are correct 100% I still trying find out how to do what you wrote, because I dont have good experience with Modems

There is a high probability that your issue is exactly what Konrad explained. The first thing you should try, as mentioned is disabling SIM detection via AT commands.

You can find the AT command manual for your module here:
:link: Quectel AT Command Manual

In section 5.10 (page 68), it details the steps you need to follow:

Disable SIM pin detection:

AT+QSIMDET=0,0

Restart the module:

AT+CFUN=1,1

Send these commands using minicom, picocom, or any other serial communication tool. This should most likely resolve your issue.

  1. Disable SIM PIN detection: AT+QSIMDET=0,0
  2. Restart the module: AT+CFUN=1,1

Iā€™ve tried using these commands through minicom, but Iā€™m encountering the following results:

  1. When I send AT+QSIMDET=0,0, I receive:
OK
  1. After sending AT+CFUN=1,1, I receive:
+CME ERROR: 3

Additional Details:

  • The modem responds to basic AT commands like AT and AT+CSQ, but it fails to change the functionality when sending the restart command (AT+CFUN=1,1).
  • The SIM is not PIN-locked, and Iā€™ve confirmed this with AT+CPIN? which returns READY.
  • Iā€™m using a Banana Pi R4 and have connected the modem through /dev/ttyUSB0.

What Iā€™ve Tried:

  • Ensured the SIM card is not locked (by checking AT+CPIN?).
  • Sent AT+QSIMDET=0,0 to disable PIN detection.
  • Tried restarting the module with AT+CFUN=1,1, but encountered the error +CME ERROR: 3.

Questions:

  1. What could be causing the +CME ERROR: 3 when trying to restart the module with AT+CFUN=1,1?
  2. Is there any alternative command to properly restart or reset the module without encountering errors?
  3. Is there any additional configuration I might be missing on my setup (e.g., serial port configuration or modem drivers)?

Any help or suggestions would be greatly appreciated!

The +CME ERROR: 3 means the modem canā€™t perform the operation. Try rebooting the module manually. ItĀ“s not a big deal if the other AT commands are working properly.

  • First, turn off the BPi-R4 and power it back on. Make sure the SIM is in the SIM1 slot before turning it on.
  • After powering up, use the mmcli -L command to check if the sim is recognized in the right slot. If it shows up, thatā€™s it.
  • If the modem shows up but the SIM doesnā€™t, try checking the SIM status with AT commands. check if the SIM is properly registered and if the modem is picking up a signal. Using minicom, try sending AT+CREG? to check network registration and AT+CSQ for signal quality.

LetĀ“s see what you find after trying these steps.

Edit: After restarting, run the command mmcli -m 0 as well

Thank you very much for support

sudo mmcli -m 0

  Status   |                   lock: sim-puk2
           |         unlock retries: sim-puk2 (10)
           |                  state: disabled
           |            power state: low
  ----------------------------------
  Modes    |              supported: allowed: 3g, 4g; preferred: none
           |                current: allowed: 3g, 4g; preferred: none
  ----------------------------------
  IP       |              supported: ipv4, ipv6, ipv4v6
  ----------------------------------
  3GPP     |                 
           |          enabled locks: fixed-dialing
           |   packet service state: detached
  ----------------------------------
  3GPP EPS |   ue mode of operation: csps-2
           | initial bearer ip type: ipv4v6
  ----------------------------------
  SIM      |       primary sim path: /org/freedesktop/ModemManager1/SIM/0
           |         sim slot paths: slot 1: /org/freedesktop/ModemManager1/SIM/0 (active)
           |                         slot 2: /org/freedesktop/ModemManager1/SIM/1

AT+CREG?


+CREG: 0,0

OK

sim state: disabled

AT+CSQ

+CSQ: 99,99

OK

sudo mmcli -m 0 --enable

error: couldn't enable the modem: 'GDBus.Error:org.freedesktop.ModemManager1.Error.Core.Retry: Invalid transition'

Youā€™ve made great progress. After disabling SIM detection, ModemManager now correctly reads the SIM, and the ā€œSIM missingā€ error is gone, which is great news.

Just to make sure the new issue isnā€™t FCC lock, try the following:

  1. Open minicom and send the following command:

    AT+QCFG="fcc_enable",0
    
  2. Then, manually restart the BPi-R4.

  3. Try enabling the modem again:

    sudo mmcli -m 0 --enable
    
  4. Check the modem status with:

    sudo mmcli -m 0
    

Post the output here so we can take a look.

Edit: The more I think about it, the more convinced I am that your modem has the FCC lock. I suggest you take a look at the Modem Manager documentation (removed but still accessible through the internet cache) at the following link:

Modem Manager FCC Unlock Documentation (Archived)

The response from your modem to the AT command AT+CFUN=1,1 closely matches the behavior described for devices with the FCC lock and same goes for the response to sudo mmcli -m 0 --enable with an Invalid transition

from commands provided minicom


+CMTI: "ME",0

+CMTI: ,3

OK

OK

OK

OK

OK

+CCLK: "80/01/06,20:53:32"

OK
root@:# sudo mmcli -m 0 --enable
successfully enabled the modem
root@:# ping -I wwan0 google.com
ping: Warning: source address might be selected on device other than: wwan0
PING  (142.250.180.142) from 192.168.115.200 wwan0: 56(84) bytes of data.
^C
---  ping statistics ---
21 packets transmitted, 0 received, 100% packet loss, time 20485ms


the interface wwan0 not getting IP address after enable And ping 0 received, 100% packet loss,

From Network Mananger cdc-wdm0 gsm disconnected

root@:~# nmcli device
DEVICE         TYPE      STATE                   CONNECTION
lan0           ethernet  connected               Wired connection 4
wlan0          wifi      connected               wlan0
lo             loopback  connected (externally)  lo
eth0           ethernet  connected               Wired connection 1
lan1           ethernet  connected (externally)  lan1
ISP_Mikrotik   iptunnel  connected (externally)  ISP_Mikrotik
ipip_Mikrotik  iptunnel  connected (externally)  ipip_Mikrotik
cdc-wdm0       gsm       disconnected            --
p2p-dev-wlan0  wifi-p2p  disconnected            --
eth1           ethernet  unavailable             --
eth2           ethernet  unavailable             --
lan2           ethernet  unavailable             --
lan3           ethernet  unavailable             --
bond0          bond      unmanaged               --
erspan0        erspan    unmanaged               --
gre0           iptunnel  unmanaged               --
gre2           iptunnel  unmanaged               --
gretap0        iptunnel  unmanaged               --
tunl0          iptunnel  unmanaged               --
vlan18         vlan      unmanaged               --
wlan1          wifi      unmanaged               --
root@almaos:~#

Edited By using nmcli

root@almaos:~# sudo nmcli connection add type gsm ifname ā€œ*ā€ con-name ā€œ4G Connectionā€ apn ā€œAPNā€ sudo nmcli connection up ā€œ4G Connectionā€ Connection ā€˜4G Connectionā€™ successfully added. Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/10)

But ping not working

 ping -I wwan0 8.8.8.8
PING 8.8.8.8 (8.8.8.8) from 10.141.239.243 wwan0: 56(84) bytes of data.
^C
--- 8.8.8.8 ping statistics ---
62 packets transmitted, 0 received, 100% packet loss, time 62469ms

Last time you tried to enable the modem with:

sudo mmcli -m 0 --enable

You got this error:

error: couldn't enable the modem: 'GDBus.Error:org.freedesktop.ModemManager1.Error.Core.Retry: Invalid transition'

Now, after disabling the FCC lock, the response is:

successfully enabled the modem

Thatā€™s great! Now you were able to activate the modem.

Just to make sure everything is working correctly up to this point, please provide the output of:

sudo mmcli -m 0

This will help us easily compare with previous responses and see what has changed.

At this stage, I believe you only need to configure the APN, but Iā€™d still like to check the Modem Managerā€™s response to sudo mmcli -m 0 to confirm.

root@:~# sudo mmcli -m 0
  ----------------------------------
  General  |                   path: /org/freedesktop/ModemManager1/Modem/0
           |              
  ----------------------------------
  Hardware |           manufacturer: Quectel
           |                  model: Quectel EM05-G
           |      firmware revision: EM05GFAR07A07M1G
           |           h/w revision: QUECTEL Mobile Broadband Modul
           |              supported: gsm-umts, lte
           |                current: gsm-umts, lte
           |          
  ----------------------------------
  System   |                 device: /sys/devices/platform/11200000.xhci/usb1/1-1/1-1.1
           |                drivers: option, cdc_mbim
           |                 plugin: quectel
           |           primary port: cdc-wdm0
           |                  ports: cdc-wdm0 (mbim), ttyUSB0 (at), wwan0 (net)
  ----------------------------------
  Numbers  |                    own: 
  ----------------------------------
  Status   |                   lock: sim-puk2
           |         unlock retries: sim-puk2 (10)
           |                  state: connected
           |            power state: on
           |            access tech: lte
           |         signal quality: 70% (recent)
  ----------------------------------
  Modes    |              supported: allowed: 3g, 4g; preferred: none
           |                current: allowed: 3g, 4g; preferred: none
  ----------------------------------
  IP       |              supported: ipv4, ipv6, ipv4v6
  ----------------------------------
  3GPP     |                   
           |          enabled locks: fixed-dialing
           |           
           |          operator name: 
           |           registration: home
           |   packet service state: attached
  ----------------------------------
  3GPP EPS |   ue mode of operation: csps-2
           |    initial bearer path: /org/freedesktop/ModemManager1/Bearer/0
           | initial bearer ip type: ipv4v6
  ----------------------------------
  SIM      |       primary sim path: /org/freedesktop/ModemManager1/SIM/0
           |         sim slot paths: slot 1: /org/freedesktop/ModemManager1/SIM/0 (active)
           |                         slot 2: /org/freedesktop/ModemManager1/SIM/1
  ----------------------------------
  Bearer   |                  paths: /org/freedesktop/ModemManager1/Bearer/1
root@almaos:~#

Well, so far so good, everything seems fine with the modem being activated without issues.

At this point, I believe youā€™re not receiving data because the operatorā€™s settings might not be configured correctly. I noticed that you created a connection and only set the APN as ā€œAPNā€. Is just ā€œAPNā€ your apn data, donĀ“t also need to include a username and/or password?

Could you please share the complete carrier information? Not the ones youā€™re using right now, but the official ones your carrier provides to customers for internet connectivity.

The opertator is Ilaid


root@:~# sudo mmcli -m 0
  ----------------------------------
  General  |                   path: /org/freedesktop/ModemManager1/Modem/0
           |              device id: fbb3545aa050654a3ccd0132e3460f27f636e384
  ----------------------------------
  Hardware |           manufacturer: Quectel
           |                  model: Quectel EM05-G
           |      firmware revision: EM05GFAR07A07M1G
           |           h/w revision: QUECTEL Mobile Broadband Modul
           |              supported: gsm-umts, lte
           |                current: gsm-umts, lte
           |           equipment id: 869****************
  ----------------------------------
  System   |                 device: /sys/devices/platform/11200000.xhci/usb1/1-1/1-1.1
           |                drivers: option, cdc_mbim
           |                 plugin: quectel
           |           primary port: cdc-wdm0
           |                  ports: cdc-wdm0 (mbim), ttyUSB0 (at), wwan0 (net)
  ----------------------------------
  Numbers  |                    own: +3**************
  ----------------------------------
  Status   |                   lock: sim-puk2
           |         unlock retries: sim-puk2 (10)
           |                  state: connected
           |            power state: on
           |            access tech: lte
           |         signal quality: 70% (recent)
  ----------------------------------
  Modes    |              supported: allowed: 3g, 4g; preferred: none
           |                current: allowed: 3g, 4g; preferred: none
  ----------------------------------
  IP       |              supported: ipv4, ipv6, ipv4v6
  ----------------------------------
  3GPP     |                   imei: 869***********
           |          enabled locks: fixed-dialing
           |            operator id: 22***
           |          operator name: Iliad
           |           registration: home
           |   packet service state: attached
  ----------------------------------
  3GPP EPS |   ue mode of operation: csps-2
           |    initial bearer path: /org/freedesktop/ModemManager1/Bearer/0
           | initial bearer ip type: ipv4v6
  ----------------------------------
  SIM      |       primary sim path: /org/freedesktop/ModemManager1/SIM/0
           |         sim slot paths: slot 1: /org/freedesktop/ModemManager1/SIM/0 (active)
           |                         slot 2: /org/freedesktop/ModemManager1/SIM/1
  ----------------------------------
  Bearer   |                  paths: /org/freedesktop/ModemManager1/Bearer/1

For user name and password are not needed

Iā€™m not familiar with that carrier, but after searching online, I found that if your carrier is Iliad Italy, the APN you entered is definitely wrong. It should be ā€œiliadā€ instead of ā€œAPN.ā€ Itā€™s also recommended to include a number to dial.

You can modify both the APN and the phone number in a single command using nmcli.

sudo nmcli connection modify "4G Connection" gsm.apn "Iliad" gsm.number "*99#"

After modifying the connection, restart it to apply the new settings:

sudo nmcli connection down "4G Connection"
sudo nmcli connection up "4G Connection"

To check if the changes were applied correctly, use:

nmcli connection show "4G Connection"

This will display the current configuration, including the APN and phone number.

Edit: I just edited it because apparently the APN is Iliad, with the first ā€œIā€ in uppercase. If itā€™s not working, try both uppercase and lowercase.

I modified with uppercase and lowercase of ā€œiā€ and wrote phone numebr correctly but the same I interface wwan0 not reciving data from internet

    RX packets 0  bytes 0 (0.0 B)
    RX errors 0  dropped 0  overruns 0  frame 0
    TX packets 267  bytes 24112 (23.5 KiB)
    TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

even ping not working

Could you share the output of:

sudo nmcli connection show "4G Connection"

For the phone number, are you entering your own number? you donā€™t need to enter your actual number, just use the generic *99# which is the same for all countries.

Modify that please:

sudo nmcli connection modify "4G Connection" gsm.number "*99#"

then restart the connection:

sudo nmcli connection down "4G Connection"
sudo nmcli connection up "4G Connection"

Yes I tried in begaining using sudo nmcli connection modify ā€œ4G Connectionā€ gsm.number ā€œ*99#ā€

but it the same

I will delet connection and try from the very new step maybe somthing missed in routing and firewall rules