PostmarketOS - uConsole CM4

I have a working 4G LTE connection

This is what I did to get there

Start by getting the uconsole-4g , and uconsole-4g-cm4.sh files from @Rex via the Mega cloud folder he has posted above. Save these files under /usr/local/bin and ensure you set the permissions to executable with doas chmod +x /usr/local/bin/uconsole-4*

There are a couple prerequisites that I truly don’t understand why they are not already in the image when it is built with pmbootstrap, but you need to install them or you can’t enable the modem.

doas apk add raspberrypi-utils
doas apk add modemmanager

Then you need to enable ModemManager to run as a service in the default runlevel. You can also start it manually right now if you don’t want to reboot.

rc-update add modemmanager default
rc-service modemmanager start

Now when you run mmcli commands they will actually work.

Now that your prerequisites are out of the way, we can build the service file for uconsole-4g-cm4 to run automatically on boot. Create the following file - /etc/init.d/uconsole-4g-cm4

#!/sbin/openrc-run

description="uConsole raspberry pi cm4 4G control daemon"
command="/usr/local/bin/uconsole-4g-cm4.sh"
command_args=""
pidfile="/run/${RC_SVCNAME}.pid"

depend() {
    after net
    need net
}

start() {
    if [ -x "$command" ]; then
        ebegin "Starting uconsole-4g-cm4"
        $command enable
        eend $?
    else
        eerror "$command is not executable"
        return 1
    fi
}

stop() {
    if [ -x "$command" ]; then
        ebegin "Stopping uconsole-4g-cm4"
        $command disable
        eend $?
    else
        eerror "$command is not executable"
        return 1
    fi
}

Make the service file executable: doas chmod +x /etc/init.d/uconsole-4g-cm4

Add the service to the default run level: doas rc-update add uconsole-4g-cm4 default

Start the service manually if you don’t want to reboot to test: rc-service uconsole-4g-cm4 start

Now give it a minute for the modem to enable and be findable, then you should see it if you run mmcli -L on mine it showed up as:

/org/freedesktop/ModemManager1/Modem/0 [QUALCOMM INCORPORATED] SIMCOM_SIM7600G-H

At this point I could see the 4G option in the Network Manger control in the taskbar. It showed my carrier, but I did not yet have a connection. You can left click the icon and there should now be an option to use the GUI to create a new 4G connection. Just run through the wizard, and at least for me it worked.

Now might be a good time to reboot and see if it enables the modem automatically based on the service working or not. YMMV, but for me after reboot I had the following when I left clicked the Network Manager icon in the taskbar:

  • ETHERNET NETWORK
    – disconected
  • Wi-Fi NETWORK
    – (My connected SSID) {SIGNAL BAR}
    – Disconnect
    – Available networks :arrow_forward:
  • MOBILE BROADBAND
    – (My Carrier) {SIGNAL BAR greyed out}
    --------------- Available --------------------------
  • (My Connection)
  • Connect to Hidden Wi-Fi Network …
  • Create New Wi-Fi Network …
    .------------------------------------------------------
    VPN Connections :arrow_forward:

When I clicked on (My Connection) in the “Available” list it connected immediately and the “MOBILE BROADBAND” now showed the active connection in parenthesis after it. Also the signal bar now reflected the current signal strength.

I hope this helps anyone else trying to get this working.

1 Like