uConsole LTE Modem How-To Guide (for A06 with 9001 stock firmware)

This guide will let you fully utilize the LTE module on the A06 model of uConsole.

This is a updated translated version of a part of my blog written in Chinese. For Chinese version, please visit this page.

This guide was written for uConsole A06 variant.

The CM4 variant of uConsole used a different way to manage the power of the LTE modem, and CM4 RaspberryOS system doesn’t have some quirk like A06 Armbian Ubuntu based system does. This guide is for A06 variant.

For some part of this guide, this guide still can be applied for the CM4 variant.

This guide was written for stock LTE modem 9001 firmware.

Please acknowledge that if your modem have upgraded to 9011 firmware (RNDIS mode, shown a usb0 network interface), then most part of this guide CANNOT work on your upgraded firmware. You need to downgrade it to stock 9001 firmware. However there is no information and firmware package for 9001 firmware downgrade from 9011 provided by ClockworkPi, maybe contact to uConsole dev team can help.

Powering on the modem

CM4: The stock way of powering on

Please use the official guide: https://github.com/clockworkpi/uConsole/wiki/How-to-use-the-4G-extension#cm4

A06: The stock way of powering on

The stock system image had a script to enable or disable the LTE modem.
For A06 variant this will be uconsole-4g.

Powering on the modem by running:

sudo uconsole-4g enable

9001: Workaround for not able to pick up the modem after powering on modem

It will be almost certain that if you have 9001 firmware on your LTE modem, the ModemManager won’t pick up the modem immediately due to how ModemManager detects the modem and how LTE modem power up sequence timing works.

Usually a manual restart for ModemManager service can solve the issue.

sudo systemctl restart ModemManager.service

A06: Use systemd to manage the LTE modem power

Also available on: https://gist.github.com/SuperMarioSF/baea9fc13fc320e5a002c58cf107bd10

Note: It is recommended to use this part AFTER you configured everything else in this guide.

It is tedious to power on the modem every time you need to use it. So powering on the LTE modem on boot may be useful. In this part you can configure your LTE modem to power on during the system boot and power off during system shutdown.

The downside of the approach is a 30s delay during system shutdown sequence, because there is no good way for systemd to ignore a service during shutdown when stop action is configured. But this will properly power off the LTE modem, so this should be a good thing.

For 9001 firmware user: The ModemManager will be started or restarted with the LTE modem automatically, so no need for manual restart ModemManager every time after powering on the LTE modem. If LTE modem service is stopped, the ModemManager service will also be stopped. This behavior won’t affect 9011 firmware user.

Installing

Became root, and write two files to systemd configuration.

  1. /etc/systemd/system/uConsoleLTE.service: A direct convert from uconsole-4g script to a systemd service unit file. Provide uConsoleLTE service for managing power of LTE modem.
/etc/systemd/system/uConsoleLTE.service
[Unit]
Description=uConsole LTE Module
After=polkit.service
Requires=polkit.service
Before=ModemManager.service
PropagatesReloadTo=ModemManager.service

[Service]
Type=oneshot
RemainAfterExit=yes
TimeoutStartSec=20  
TimeoutStopSec=35

# Setup PWRKEY pin
ExecStartPre=/usr/bin/gpio mode 34 out
# Setup RESET pin
ExecStartPre=/usr/bin/gpio mode 33 out
# Set RESET pin to high
ExecStartPre=/usr/bin/gpio write 33 1
# Set PWRKEY pin to high
ExecStartPre=/usr/bin/gpio write 34 1
# Delay for module to properly reseted
ExecStartPre=/usr/bin/sleep 2
# Set RESET pin to low
ExecStartPre=/usr/bin/gpio write 33 0
# Wait for module to boot up
ExecStart=/usr/bin/sleep 13

# Wait for ModemManager to properly shutdown.
ExecStop=/usr/bin/sleep 5
# Setup PWRKEY pin
ExecStop=/usr/bin/gpio mode 34 out
# Set PWRKEY pin to low
ExecStop=/usr/bin/gpio write 34 0
# Set PWRKEY pin to high
ExecStop=/usr/bin/gpio write 34 1
# Delay for module to properly send power off signal
ExecStop=/usr/bin/sleep 3
# Set PWRKEY pin to low
ExecStop=/usr/bin/gpio write 34 0
# Delay for module to power off
ExecStop=/usr/bin/sleep 20

[Install]
WantedBy=multi-user.target
  1. /etc/systemd/system/ModemManager.service : A modified ModemManager service configuration, added BindsTo to sync with the state with uConsoleLTE service given above.
/etc/systemd/system/ModemManager.service
[Unit]
Description=Modem Manager
After=polkit.service
Requires=polkit.service
ConditionVirtualization=!container
BindsTo=uConsoleLTE.service

[Service]
Type=dbus
BusName=org.freedesktop.ModemManager1
ExecStart=/usr/sbin/ModemManager
StandardError=null
Restart=on-abort
CapabilityBoundingSet=CAP_SYS_ADMIN CAP_NET_ADMIN
ProtectSystem=true
ProtectHome=true
PrivateTmp=true
RestrictAddressFamilies=AF_NETLINK AF_UNIX AF_QIPCRTR
NoNewPrivileges=true
User=root

[Install]
WantedBy=multi-user.target

Configure

After written the systemd configuration file, reload systemd configuration to apply.

sudo systemctl daemon-reload

Configuring LTE modem auto start on boot:

# Enable auto start and also start modem now
sudo systemctl enable --now uConsoleLTE

# Disable auto start
sudo systemctl disable

Manually control the power

Manually powering on and off the LTE modem:

# Powering on
sudo systemctl start uConsoleLTE

# Powering off
sudo systemctl stop uConsoleLTE

# Power cycle
sudo systemctl restart uConsoleLTE

Cellular Data Connection

If your LTE modem had already upgraded to 9011 firmware, then after you power on the modem, there will be a usb0 interface in your system. Configure it as a normal Ethernet interface with DHCP will just work.

For stock 9001 firmware there will be more settings involved.

9001: Configure mobile broadband configuration for stock 9001 firmware LTE modem

This part of settings is required only on 9001 firmware.

First, install the broadband provider information package for NetworkManager, and restart the NetworkManager to apply.

sudo apt install mobile-broadband-provider-info
sudo systemctl restart NetworkManager.service

After that, you can configure the LTE modem connection profile. Head to the network connection settings, add a “Mobile Broadband” network, then follow the setup wizard.

You should see your LTE modem is available, and you need to pick the correct Cellular Network Operator and the correct APN accordingly. If you don’t know what APN you should use, or your Cellular Network Operator is not in this list, ask your Cellular Network Operator for configuration, or just Google it.

After the configuration, enable the connection you just created, and you will be online.

9001: Phone Calling

This feature only work on stock 9001 firmware.

This should be an easy one.

Gnome provided a software called gnome-calls, a dial pad and caller UI.

sudo apt install gnome-calls

After installing the package, start the Gnome Calls software once, and it will be automatically registered as a auto startup (minimized) for your desktop session. Next time a phone call is incoming, the caller UI will show up and you can decide to pick it up or not.

Due to some missing settings currently there will be no ringtone, only the caller UI window will show up. If you missed a call there will be a notification shown.

You need to use a wired earphone connect to the 3.5mm earphone port on the LTE modem side (left side of machine). The earphone should be a 3.5mm TRRS plug, and wired like this:

T - Left
R - Right
R - Microphone
S - Ground

Depends on your region this wiring maybe different (usually the Microphone and Ground pin swapped for USA users on their earphone.) so you need to do some test about this.

You won’t able to be talking via system side of the audio, so if you plugged the earphone to the system side (right side of the machine), you won’t able to hear or talk to the other side of the phone. And for the exact reason you can’t use the Bluetooth audio for calling. The modem simply doesn’t have any audio connection to the system side, the I2S audio interface is directly connected to a DAC onboard the LTE modem module and wired to the earphone port on the module.

Plus, the system side doesn’t even have a microphone hardware (by default). This is about the maximum privacy you can get. :rofl:

By the way, if you prefer the dark theme, here is a command to turn all the Gnome application into dark theme:

gsettings set org.gnome.desktop.interface color-scheme prefer-dark

Please note, if you are not logged in (thus Gnome Call is not started) or your uConsole is in sleep state, you won’t able to have a phone call notification. If the system goes to sleep during a call, your call won’t be interrupted, but you need to wake up the system in order to hang up the call from your side.

9001: SMS

This feature only work on stock 9001 firmware.

You can use ModemManager-GUi for receiving and sending SMS.

Installing

Install the ModemManager-GUI.

sudo apt install modem-manager-gui

A06: Workaround for the NM09 plugin issue in Armbian Ubuntu system.

Due to a bug introduced in Ubuntu 22.04, ModemManager-GUI no longer properly launches by default. There is some workaround required.

After installed the ModemManager-GUI package, before launching it, run following commands first.

sudo mv /usr/lib/aarch64-linux-gnu/modem-manager-gui/modules/libmodcm_nm09.so /usr/lib/aarch64-linux-gnu/modem-manager-gui/modules/libmodcm_nm09.so_

This command will rename the NetworkManager 0.9 plugin for the ModemManager-GUI, and this plugin will not be loaded by ModemManager-GUI after this, avoiding the crash caused by this plugin.

Without this plugin, features like controlling the connection within ModemManager-GUI and traffic usage accounting will not available. You can still manage your LTE connection with NetworkManager directly.

Configuring

After the installation (and maybe some workaround), you can launch the ModemManager-GUI. The default settings can be used once the first-run wizard shown.

By default ModemManager-GUI won’t start with your desktop session. If you didn’t launch the ModemManager-GUI you won’t able to receive SMS. Further more, by default there is no notification feature configured for incoming SMS. Following steps will fix these.

From the main window, on the menu: Edit - Preferences

  1. In “Behavior” tab, check “Hide window to tray on close” and “Add program to autostart list”.
  2. In “SMS” tab, under “Custom command”, fill following content into “Command” textbox:
    notify-send --icon /usr/share/modem-manager-gui/pixmaps/sms-tb.png -t 60000 '%n' '%t'
    

Click “Apply” to save settings.

When closing the ModemManager-GUI window for the first time you will be asked for minimized to tray, choose the minimize to tray and select never ask again.

By default ModemManager-GUI tray icon is a totally transparent blank icon, this is due to the icon theme doesn’t have a proper icon for notification. Install and select another icon theme can solve this.

sudo apt install numix-icon-theme

In system appearance settings change to Numix icon theme, after this the tray will have a bell icon for ModemManager-GUI.

5 Likes

Is there a good compatible earbud type headset you can recommend?

Is there any way to get an audible notification from the Modem Manager GUI when an SMS is received?

this works, but whenever i send an sms to the uconsole i get +SMS FULL on serial – there appears to be nothing in any of the message stores

Usually a typical Apple EarBuds style earphone is good enough. They use a typical LRMG pinouts. Avoid old Nokia style earphones, they use LRGM instead. There are LRMG-LRGM converters you can buy if you are not sure about what pinout you will get.

About the notification sound… notify-send itself doesn’t provide audiable notification feature, you can call a customized script for doing that.

It looks like your modem is not properly configured how to receive or send message. maybe the AT command AT+CNMI related thing can give you some hint about this. Please refer to the AT command manual of SIM7500/SIM7600 series modem here: uConsole/SIM7500_SIM7600 Series_AT Command Manual_V3.00.pdf at master · clockworkpi/uConsole · GitHub (at page 224).

Someone else also encountered the same problem, maybe a good reference? Read SMS text filter for credit value - Programming Questions - Arduino Forum

Verified working on both the A-06 and the CM4 8/32 version.

As there anything needed to activate the AUX antenna port on the LTE module?
I added both GPS and an additional AUX LTE antenna in an attempt to boost performance.

There should be none extra step required for both extra antennas to work: it should just works.

Any luck getting GPS to work?

I get an error trying to enable the GPS with AT commands.

echo -en “AT+CGPS=1\r\n” | sudo socat - /dev/ttyUSB3,crnl

nets only “ERROR”

The reason this isn’t working because you are sending AT commands into modem data port (the one used for access the internet via PPP).

You should send those AT commands to AT command port (usually ttyUSB2) and get the NMEA messages from NMEA port (ttyUSB1).

btw here is the reference for all available ports:
(ref: https://www.waveshare.com/wiki/SIM7600G-H_4G_DTU#accordion27 )

1) /dev/ttyUSB0  -  diag port for output developing messages
2) /dev/ttyUSB1  -  NMEA port for GPS NMEA data output
3) /dev/ttyUSB2  -  AT port for AT commands
4) /dev/ttyUSB3  -  Modem port for ppp-dial
5) /dev/ttyUSB4  -  Audio port

(see message above for solution)

ok, I was going from this document.

I also tried ttyUSB2 and got the same ERROR return

What version of firmware are you using on your LTE module? 9001 or 9011?
(@SuperMarioSF maybe 9011 firmware break this behavior…)

Stayed on 9001 for the added benefit.

even using /dev/ttyUSB2 I still get “ERROR”

Wondering if some other process has USB2 open.