[Update: Mar 25th] Testing Quectel EM12-G WWAN 4G Modem on Librem 5

ok gotcha, i did not check and was just crossing my fingers, i can communicate with the modem, and it is possible there is an issue with the hardware configuration since the modem does not work properly - but my feeling at least is that it should be working based on what i have been seeing, since it briefly and actually connects to 4G…

I think I am right in saying that the actual Librem 5 software doesn’t typically use AT commands to communicate with the modem, but that’s what you are doing, right? The ttyUSB device that you are using will respond normally to AT commands but I think the software will use QMI, which will be a different ttyUSB device (and I suspect is not intended for use by humans).

Note also that audio is a whole extra ball game. That M.2 configuration sets aside pins for audio to come in as PCM, separately from any control commands. (I would have to check the schematics to find out where it is coming from.) And then there are questions as to how the modem’s audio source is configured, if configuration is needed.

Tested the same EM12-G Quectel Modem with the following.

Environment:
Ubuntu 22.10, EM12-G Quectel External Housing External M.2 Housing, kernel `Linux amiga 5.19.0-38-generic #39-Ubuntu SMP PREEMPT_DYNAMIC Fri Mar 17 17:33:16 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux’, Network Manager v1.40.0, Modem Manager v1.20.0, Mobile Data = on, Data Roaming = on, AWESIM APN provider NXTGENPHONE, EM12-G with latest available Quectel firmware loaded (as of March 2023).

Modem Configuration (shows quite a bit more detail):
sudo mmcli -m any | grep -v 'imei\ |Numbers\ |equipment id\ |device id: ' >>imei.txt

General , path: /org/freedesktop/ModemManager1/Modem/2
, device id: 4d06d7696187563570c234cba86############
Hardware , manufacturer: Quectel
, model: EM12-G
, firmware revision: EM12GPAR01A21M4G
, carrier config: default
, h/w revision: EM12-G
, supported: gsm-umts, lte
, current: gsm-umts, lte
, equipment id: 869710032######
System , device: /sys/devices/pci0000:00/0000:00:01.0/0000:10:00.0/0000:11:02.0/0000:14:00.0/0000:15:03.0/0000:17:00.0/0000:18:00.0/0000:19:00.0/0000:1a:03.0/0000:1b:00.2/usb2/2-1/2-1.1
, drivers: cdc_mbim, option
, plugin: quectel
, primary port: cdc-wdm6
, ports: cdc-wdm6 (mbim), ttyUSB0 (qcdm), ttyUSB1 (ignored),
, ttyUSB2 (at), ttyUSB3 (at), wwan0 (net)
Numbers , own: 1##########
Status , lock: sim-pin2
, unlock retries: sim-pin2 (10)
, state: connected
, power state: on
, access tech: lte
, signal quality: 9% (cached)
Modes , supported: allowed: 3g; preferred: none
, allowed: 4g; preferred: none
, allowed: 3g, 4g; preferred: 4g
, allowed: 3g, 4g; preferred: 3g
, current: allowed: 3g, 4g; preferred: 4g
Bands , supported: utran-1, utran-3, utran-4, utran-6, utran-5, utran-8,
, utran-9, utran-2, eutran-1, eutran-2, eutran-3, eutran-4, eutran-5,
, eutran-7, eutran-8, eutran-9, eutran-12, eutran-13, eutran-14,
, eutran-17, eutran-18, eutran-19, eutran-20, eutran-21, eutran-25,
, eutran-26, eutran-28, eutran-29, eutran-30, eutran-32, eutran-38,
, eutran-39, eutran-40, eutran-41, eutran-66, utran-19
, current: utran-1, utran-3, utran-4, utran-5, utran-8, utran-9,
, utran-2, eutran-1, eutran-2, eutran-3, eutran-4, eutran-5, eutran-7,
, eutran-8, eutran-9, eutran-12, eutran-13, eutran-14, eutran-18,
, eutran-19, eutran-20, eutran-21, eutran-25, eutran-26, eutran-28,
, eutran-29, eutran-30, eutran-32, eutran-38, eutran-39, eutran-40,
, eutran-41, eutran-66, utran-19
IP , supported: ipv4, ipv6, ipv4v6
3GPP , imei: theimeinumbernotshownhere
, enabled locks: fixed-dialing
, operator id: 310260
, operator name: Wireless
, registration: home
, packet service state: attached
3GPP EPS , ue mode of operation: csps-2
, initial bearer path: /org/freedesktop/ModemManager1/Bearer/8
, initial bearer ip type: ipv4v6
SIM , primary sim path: /org/freedesktop/ModemManager1/SIM/2
, sim slot paths: slot 1: /org/freedesktop/ModemManager1/SIM/2 (active)
, slot 2: none
Bearer , paths: /org/freedesktop/ModemManager1/Bearer/7
, /org/freedesktop/ModemManager1/Bearer/6

Functionality:

  • Connected to desktop computer via usb cable and tried both USB-B, and USB-C
  • it just works, while the signal is only 9% it immediately recognizes the modem and i am writing this post over the Quectel EM12-G, which excludes the possibility that the modem did not work when trying it in the L5
  • There are three antenna ports on the modem, one is for GPS, so its possible i connected the 5G antenna to the GPS port not the 5G port, I will switch it over and see if that improves anything
  • Data connection works and it lets me browse the internet, with VPN and there is not ipv4, 6 IP leakage

Things Tried:

  • Tried Gnome-Calls but no cigar it just seems to dial but no ringing sound and will not connect, plus on my desktop ubuntu the microphone in the external monitor isn’t properly recognized and its way too quiet.
  • Tried to install chatty sudo apt install chatty to my surprise its not in the Ubuntu package repository any longer, not sure why since it is a XMPP, and Matrix chat client?? Getting the following error when installing from git:

dpkg: dependency problems prevent configuration of chatty-dbgsym:
chatty-dbgsym depends on chatty (= 0.7.2+librem5ci82984.0e6da9f0); however:
Package chatty is not configured yet

So that leaves the question if it works over USB on a desktop running stock linux and stock kernel, and the modem is supported since kernel ~5.15 around, why does it not work with the L5?

Observations, Issues to be resolved:

  • Fix antenna connection reception issue
  • Get chatty, or gnome-calls to work
2 Likes

If not already, you could check if an FCC unlock is needed and is what’s able to make your modem respond.

You could also try to find out more with qmicli.

That is interesting, the modem was bought by itself so I don’t think it was keyed to any manufacturer so at least I do not think there could have been a lock, but might be wrong.

Hm, yes would be strange then, but who knows. You could try to connect the modem to the phone using the external housing. If that works it could maybe hint at problems with the “unused” default internal m.2 pin levels.

I don’t know what the steps for the general setup procedure are, but you could maybe attempt to do it manually, also comparing with how it works on your computer or corresponding to other software stacks like [OpenWrt Wiki] How to use LTE modem in QMI mode for WAN connection .

Would be great to find out if this modem has better power saving defaults or options like AT+QSCLK=1 and can allow for much better stand-by times than the stock Broadmobi BM818 is able to until now, but of course that would first require to get it working at all.

There seems to exist one more (a newer) protocol to try with modems: MBIM

1 Like

That is an awesome writeup and something to get people starting with trying out different modems on the L5. I will have to take another stab at it.

1 Like

Hi,

Did you had any luck with that? Did you made it work ?

Have a nice day.

1 Like

The EM12-G pin out (page 18) does seem to match the J3 M.2 connector. So they should be compatible

1 Like

The EM12-G does fit nicely in the phone.

The only issue I have is that the antenna cables are then too long, so I can’t push the modem down into the phone with the antennas connected.


I suspect the antenna cables could probably be re-routed a bit to take some of the slack out though.

On pmOS I just need one udev file added (working on upstreaming that now) and then modem manager detects the modem. Data didn’t work though and although I can make VoLTE calls the audio is distorted. I’m guessing that’s because there is no eg25-manager equivalent to setup the phone.

I have an external USB connector as well, which seems to mostly work (I need an antenna still) so I’m hoping I can use that to test the audio and data issues.

7 Likes

Quick update on this.

The modem fits fine in the phone, it does require some re-routing of the antenna cables though. I haven’t actually done this yet, but it all seems to be possible.

The modem works as a drop in replacement for texts and data. For calls initiating a call works fine, but the audio is distorted and has lots of static. I suspect it’s a codec issue, which is described in the device tree.

I have no idea how to fix the audio though. So unfortunately we are stuck

5 Likes

For cable routing, idea from what i did with another modem: Simcom SIM7600G-H alternative modem for L5 tested

3 Likes

I didn’t have much to go on (I’d need journalctl logs at least) but I did post this question to AI and it suggested some things to try:

"When using a Quectel EM12-G WWAN 4G Modem on Librem 5 Linux phone running PureOS, there’s an error or bug that makes the audio distorted and with lots of static when making and audio phone call. What is needed to make this modem work, how to troubleshoot and fix? Also, suggest terminal commands to get relevant information to understand better what may be wrong and to verify what the problem is."

Suggestions

To troubleshoot and fix the audio distortion and static issue with the Quectel EM12-G WWAN 4G Modem on a Librem 5 Linux phone running PureOS, you can follow these steps:

  1. Check the Modem Configuration: Use the command sudo mmcli -m any | grep -v 'imei\\ |Numbers\\ |equipment id\\ |device id: ' to get the modem configuration1.
  2. Check the Firmware Version: Ensure that the firmware version of the modem is EM12GPAR01A21M4G1. If not, you may need to update the firmware.
  3. Check the Serial Configuration: The expected modem serial configuration is as follows1:
  • /dev/ttyUSB0 - DM
  • /dev/ttyUSB1 - For GPS NMEA message output
  • /dev/ttyUSB2 - For AT command communication
  • /dev/ttyUSB3 - For PPP connection or AT command communication
  1. Check the Kernel Version: Test the modem with kernel 5.19.0 on Ubuntu using a M.2 to USB3 adapter to see if there is any difference in functionality that may point to required kernel updates on pureos101.
  2. Check the Modem Rules: Ensure that the modem rules are updated1.
  3. Check the Error Log: Repeat the following steps to get the error log1:
  • Turn the modem off
  • Turn the modem on
  • Wait for 4G bars to show in UI
  • Toggle mobile data
  • Send a message, or try to place a call
    [edit: use journalctl commands to select the relevant lines / timeframe of this step]
  1. Check the AT Commands: Use the command ATE in /dev/ttyUSB3 to see if it works with AT commands consistently2.
  2. Check the Network Connection: Use the command AT+CEREG? and AT+CGPADDR to check the current state2.

If the issue persists, you may need to downgrade the firmware to EM12GPAR01A20M4G3. If you’re still experiencing issues, it’s recommended to reach out to Quectel support for further assistance4.

Also, if you already get already some audio through it and are able to place a call - Hurray!! :boom:

4 Likes

Try using a headset with a built-in microphone inserted into the 3.5mm port.

1 Like

Same issue. It’s not an issue with the speakers but the PCM audio source decoding/encoding

2 Likes

Quick question, how did you get it to work? Can you share the pm rules, and commands? For me it certainly did not work out of the box.

1 Like

It’s just the default udev rules shipped with MM. I generally had to restart ModemManager, but otherwise it all worked. Note that I use pmOS not PureOS. PureOS might need some packages updated

2 Likes

Ah ok that would be the difference, I will give it a try again in pmOS and see what happens.

1 Like