<html>
  <head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  </head>
  <body>
<div dir="auto">Hi everyone,<br></div><div dir="auto"><br></div><div dir="auto">I hope this is the right place to post this request for help. If not, I apologise in advance.<br></div><div dir="auto"><br></div><div dir="auto">My Dell Latitude 5550 comes with a DW5825e LTE modem which actually is a Fibocom FM101R-GL card with a Qualcomm Snapdragon X12 chipset. The corresponding VID/PID is 413c:8213. <br></div><div dir="auto">The modem seems to be somewhat new / obscure as I couldn't find any online discussions on getting it to work on Linux at all.<br></div><div dir="auto"><br></div><div dir="auto">I've confirmed this modem working out of the box with Dell's OEM Ubuntu 22.04 image but not any other current Linux distribution.<br></div><div dir="auto">I've tried to find out how Dell manages to get it to work and think I've actually found the unlocking mechanism of action. I've re-built the required Fibocom tools for OpenSUSE Tumbleweed but I can't get the modem to connect. <br></div><div dir="auto">The actual unlock and mmcli --enable command seems to succeed  but it will time out when connecting to the network. I can see some errors when checking the systemd log of Fibocom's fibo_helper service which seems to be responsible for dbus communication, indicating GPIO and bus problems:<br></div><div dir="auto"><br></div><div dir="auto"><span style="font-family:monospace" class=""><span style="color:#000000;background-color:#ffffff;">Mai 04 11:01:13 localhost helper[1210]: </span><span style="color: rgb(255, 84, 84); background-color: rgb(255, 255, 255);"><b>[Critical]: fibocom_get_skuid:186: get_skuid_cmd == 0CB9</b></span><span style="color:#000000;background-color:#ffffff;"> </span><br><span style="color:#000000;background-color:#ffffff;">Mai 04 11:01:13 localhost helper[1210]: </span><span style="color: rgb(215, 215, 95); background-color: rgb(255, 255, 255);"><b>[Warning]: fibocom_hwreset_gpio_init_sub:254: /sys/class/gpio/export exists.</b></span><span style="color:#000000;background-color:#ffffff;"> </span><br><span style="color:#000000;background-color:#ffffff;">Mai 04 11:01:13 localhost helper[1210]: </span><span style="color: rgb(255, 84, 84); background-color: rgb(255, 255, 255);"><b>[Error]: bus_name_lost:663: bus_name_lost !!!!</b></span><span style="color:#000000;background-color:#ffffff;"> </span><br><span style="color:#000000;background-color:#ffffff;">Mai 04 11:01:13 localhost helper[1210]: </span><span style="color: rgb(255, 84, 84); background-color: rgb(255, 255, 255);"><b>[Error]: fibo_adapter_control_mbim_init:1444: Found cellular FM101-GL-00 added!</b></span><span style="color:#000000;background-color:#ffffff;"> </span><br><span style="color:#000000;background-color:#ffffff;">Mai 04 11:01:13 localhost helper[1210]: </span><span style="color: rgb(255, 84, 84); background-color: rgb(255, 255, 255);"><b>[Error]: fibo_helper_device_check:1218: variable is NULL, don't send cellular info signal!</b></span></span></div><div dir="auto"><br></div><div dir="auto">My questions now are twofold:<br></div><div dir="auto">1: Is it somehow possible to snoop the correct sequence of AT commands to get the DW5825e to fcc unlock via a "vanilla" ModemManager without resorting to Fibocom's tools (as those seem to be not quite trivial to build for current Linux distributions except Ubuntu)? <br></div><div dir="auto">I know that this has been done for the Intel XMM7560 where the AT commands necessary have been found out, as seen here: <a target="_blank" rel="noopener noreferrer" href="https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/merge_requests/1141">https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/merge_requests/1141</a><br></div><div dir="auto">I'm not the most proficient when it comes to hardware hacking but I'm grateful for any pointers.<br></div><div dir="auto">Fibocom's fibo_ma tool seems to be responsible for the actual unlocking magic, unfortunately it is closed-source. I've tried to snoop around the binary with Ghidra to see if my untrained eye can detect the necessary functions - unfortunately I can only see that some SHA256 shenanigans are going on and lack the knowledge to investigate further.<br></div><div dir="auto"><br></div><div dir="auto">2: Could someone with more knowledge than me regarding modems please check in on my build process for Fibocom's tools and the mechanism of action and maybe point out something I've missed? I'd appreciate any help a lot.<br></div><div dir="auto">I'll type out my build notes below. Any steps taken after the build process are based on Fibocom's CMake install script but adapted for OpenSUSE file locations. I'm unsure whether I've found out the right location for the dbus config though.</div><div dir="auto"><br></div><div dir="auto">Fibocom FM101 / Dell DW5825e OpenSUSE Build: <br></div><div dir="auto"><br></div><div dir="auto">### Source: ###<br></div><div dir="auto"><a target="_blank" rel="noopener noreferrer" href="https://github.com/fibocom-pc/linux_apps_opensource">https://github.com/fibocom-pc/linux_apps_opensource</a><br></div><div dir="auto"><br></div><div dir="auto">### How it works ###<br></div><div dir="auto">ModemManager calls fibo_ma (via the fcc unlock script corresponding to the modem's hardware id) which performs the necessary magic for a FCC unlock.<br></div><div dir="auto">The closed-source fibo_ma calls fibo_helper.service which provides a dbus interface for comms with the modem.<br></div><div dir="auto"><br></div><div dir="auto">fibo_flash.service is used to flash the firmware to the modem -> needs the OEM FwFlashSrv firmware file from Dell.<br></div><div dir="auto">fibo_config.service applies config settings from a provided fbwwanConfig.ini to the modem. The file provided by Dell is the same one as the one in the Fibocom Github repo.<br></div><div dir="auto"><br></div><div dir="auto">fibo_ma seems to check via dmidecode whether the modem and chassis are Dell devices and refuses to fcc unlock the modem if this check fails.<br></div><div dir="auto"><br></div><div dir="auto">### Files needed from Dell Ubuntu 22.04 OEM Install ###<br></div><div dir="auto">/opt/fibocom/fibo_flash_service/FwFlashSrv (Firmware)<br></div><div dir="auto">/opt/fibocom/fibo_ma_service/fcc-unlock.d (ModemManager FCCUnlock files)<br></div><div dir="auto">--> only 413c:8213 is needed but copy the other hw ids for future use as well<br></div><div dir="auto">--> needs to be made available to ModemManager in OpenSuse: Should be linked to /usr/lib64/ModemManager/fcc-unlock.d<br></div><div dir="auto"><br></div><div dir="auto">### Libraries & Tools: ###<br></div><div dir="auto">cmake<br></div><div dir="auto">dmidecode<br></div><div dir="auto">gcc<br></div><div dir="auto">gcc-c++<br></div><div dir="auto">pkgconf-pkg-config<br></div><div dir="auto">glib2<br></div><div dir="auto">glib2-devel<br></div><div dir="auto">libxml2<br></div><div dir="auto">libxml2-devel<br></div><div dir="auto">libmbim<br></div><div dir="auto">libmbim-devel<br></div><div dir="auto">libqmi-glib5<br></div><div dir="auto">libqmi-tools<br></div><div dir="auto">libdbus-glib-1-2<br></div><div dir="auto">ModemManager<br></div><div dir="auto">ModemManager-devel<br></div><div dir="auto">systemd-devel<br></div><div dir="auto"><br></div><div dir="auto">libudev0-shim (OpenSuse only ships with libudev1)</div><div dir="auto">--> compile from <a target="_blank" rel="noopener noreferrer" href="https://archlinux.org/packages/extra/x86_64/libudev0-shim/">https://archlinux.org/packages/extra/x86_64/libudev0-shim/</a><br></div><div dir="auto">--> set libdir in Makefile to lib64<br></div><div dir="auto">--> make install<br></div><div dir="auto">--> create symlink to /usr/lib64/libudev.so !!!messy!!!<br></div><div dir="auto">---> ln -s /usr/lib64/libudev.so.0.13.9999 /usr/lib64/libudev.so<br></div><div dir="auto"><br></div><div dir="auto">libdbus-glib-1-2<br></div><div dir="auto">--> create symlink from libdbus-1.so.3 to /usr/lib64/libdbus-1.so !!!messy!!!<br></div><div dir="auto">---> sudo ln -s /usr/lib64/libdbus-1.so.3 /usr/lib64/libdbus-1.so<br></div><div dir="auto"><br></div><div dir="auto">### Build ###<br></div><div dir="auto">cd to linux_apps_opensource directory<br></div><div dir="auto">cmake -S . -B build<br></div><div dir="auto">cmake --build build<br></div><div dir="auto"><br></div><div dir="auto">--> Create dbus config for fibocom helper: /usr/share/dbus-1/com.fibocom.helper.conf<br></div><div dir="auto"><!DOCTYPE busconfig PUBLIC<br></div><div dir="auto">"-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"<br></div><div dir="auto">"<a target="_blank" rel="noopener noreferrer" href="http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd</a>"><br></div><div dir="auto"><busconfig><br></div><div dir="auto">  <!-- This config allows anyone to control mcdm --><br></div><div dir="auto"><br></div><div dir="auto">  <policy context="default"><br></div><div dir="auto">    <allow send_destination="com.fibocom.helper"/><br></div><div dir="auto">  </policy><br></div><div dir="auto"><br></div><div dir="auto">  <policy user="root"><br></div><div dir="auto">    <allow own="com.fibocom.helper"/><br></div><div dir="auto">  </policy><br></div><div dir="auto"></busconfig><br></div><div dir="auto"><br></div><div dir="auto"><br></div><div dir="auto">--> Create fibo_config service /etc/systemd/system/fibo_config.service<br></div><div dir="auto">[Unit]<br></div><div dir="auto">Description=Firmware Config Service<br></div><div dir="auto">After=ModemManager.service fibo_helper.service<br></div><div dir="auto"><br></div><div dir="auto">[Service]<br></div><div dir="auto">EnvironmentFile=/lib/systemd/system/fibo_config.d/env.conf<br></div><div dir="auto">ExecStart=/opt/fibocom/fibo_config_service/fibo_config<br></div><div dir="auto">ExecReload=/bin/kill -HUP \$MAINPID<br></div><div dir="auto">Restart=on-abort<br></div><div dir="auto">Type=simple<br></div><div dir="auto">Restart=on-abort<br></div><div dir="auto">User=root<br></div><div dir="auto"><br></div><div dir="auto">[Install]<br></div><div dir="auto">WantedBy=multi-user.target<br></div><div dir="auto"><br></div><div dir="auto">--> Create fibo_flash service /etc/systemd/system/fibo_flash.service<br></div><div dir="auto">[Unit]<br></div><div dir="auto">Description=Firmware Flash Service<br></div><div dir="auto">After=ModemManager.service fibo_helper.service<br></div><div dir="auto"><br></div><div dir="auto">[Service]<br></div><div dir="auto">EnvironmentFile=/lib/systemd/system/fibo_flash.d/env.conf<br></div><div dir="auto">ExecStart=/opt/fibocom/fibo_flash_service/fibo_flash<br></div><div dir="auto">ExecReload=/bin/kill -HUP \$MAINPID<br></div><div dir="auto">Restart=on-abort<br></div><div dir="auto">Type=simple<br></div><div dir="auto">Restart=on-abort<br></div><div dir="auto">User=root<br></div><div dir="auto"><br></div><div dir="auto">[Install]<br></div><div dir="auto">WantedBy=multi-user.target<br></div><div dir="auto"><br></div><div dir="auto">--> Create fibo_helper service /etc/systemd/system/fibo_helper.service<br></div><div dir="auto">[Unit]<br></div><div dir="auto">Description=Firmware Helper Service<br></div><div dir="auto">After=ModemManager.service<br></div><div dir="auto"><br></div><div dir="auto">[Service]<br></div><div dir="auto">EnvironmentFile=/lib/systemd/system/fibo_helper.d/env.conf<br></div><div dir="auto">ExecStart=/opt/fibocom/fibo_helper_service/fibo_helperd<br></div><div dir="auto">ExecReload=/bin/kill -HUP \$MAINPID<br></div><div dir="auto">Restart=on-abort<br></div><div dir="auto">Type=simple<br></div><div dir="auto">Restart=on-abort<br></div><div dir="auto">User=root<br></div><div dir="auto"><br></div><div dir="auto">[Install]<br></div><div dir="auto">WantedBy=multi-user.target<br></div><div dir="auto"><br></div><div dir="auto">--> Create fibo_helper_mbim service /etc/systemd/system/fibo_helper_mbim.service<br></div><div dir="auto">[Unit]<br></div><div dir="auto">Description=Firmware Helper Service<br></div><div dir="auto">After=ModemManager.service fibo_helper.service<br></div><div dir="auto"><br></div><div dir="auto">[Service]<br></div><div dir="auto">EnvironmentFile=/lib/systemd/system/fibo_helper.d/env.conf<br></div><div dir="auto">ExecStart=/opt/fibocom/fibo_helper_service/fibo_helperm<br></div><div dir="auto">ExecReload=/bin/kill -HUP \$MAINPID<br></div><div dir="auto">Restart=on-abort<br></div><div dir="auto">Type=simple<br></div><div dir="auto">Restart=on-abort<br></div><div dir="auto">User=root<br></div><div dir="auto"><br></div><div dir="auto">[Install]<br></div><div dir="auto">WantedBy=multi-user.target<br></div><div dir="auto"><br></div><div dir="auto">--> Create systemd directories for environment files<br></div><div dir="auto">sudo mkdir /lib/systemd/system/fibo_config.d/<br></div><div dir="auto">sudo mkdir /lib/systemd/system/fibo_flash.d/<br></div><div dir="auto">sudo mkdir /lib/systemd/system/fibo_helper.d/<br></div><div dir="auto"><br></div><div dir="auto">--> Create environment files (as root)<br></div><div dir="auto">echo "LD_LIBRARY_PATH=\$LD_LIBRARY_PATH:/usr/local/lib64" > /lib/systemd/system/fibo_config.d/env.conf<br></div><div dir="auto">echo "LD_LIBRARY_PATH=\$LD_LIBRARY_PATH:/usr/local/lib64" > /lib/systemd/system/fibo_flash.d/env.conf<br></div><div dir="auto">echo "LD_LIBRARY_PATH=\$LD_LIBRARY_PATH:/usr/local/lib64" > /lib/systemd/system/fibo_helper.d/env.conf<br></div><div dir="auto"><br></div><div dir="auto">--> Create the following udev rule: /etc/udev/rules.d/76-mm-fibocom-linux-apps-port-types.rules<br></div><div dir="auto">--> Without this rule, the modem is visible to ModemManageron OpenSUSE but doesn't connect.<br></div><div dir="auto">--> With this rule, the modem is invisible to ModemManager and still doesn't connect.<br></div><div dir="auto">--> Why is this rule in the Fibocom install script? It's also present on Ubuntu 22.04 but there the modem is visible with the rule.<br></div><div dir="auto"># do not edit this file, it will be overwritten on update<br></div><div dir="auto">ACTION!="add|change|move|bind", GOTO="mm_fibocom_linux_apps_port_types_end"<br></div><div dir="auto">SUBSYSTEMS=="usb", ATTRS{bInterfaceNumber}=="?*", ENV{.MM_USBIFNUM}="$attr{bInterfaceNumber}"<br></div><div dir="auto"><br></div><div dir="auto">ATTRS{idVendor}=="2cb7", ATTRS{idProduct}=="01a2", ENV{.MM_USBIFNUM}=="02", SUBSYSTEM=="tty", ENV{ID_MM_PORT_IGNORE}="1"<br></div><div dir="auto">ATTRS{idVendor}=="2cb7", ATTRS{idProduct}=="01a2", ENV{.MM_USBIFNUM}=="03", SUBSYSTEM=="tty", ENV{ID_MM_PORT_IGNORE}="1"<br></div><div dir="auto">ATTRS{idVendor}=="2cb7", ATTRS{idProduct}=="01a2", ENV{.MM_USBIFNUM}=="04", ENV{ID_MM_PORT_IGNORE}="1"<br></div><div dir="auto">ATTRS{idVendor}=="2cb7", ATTRS{idProduct}=="01a2", ENV{.MM_USBIFNUM}=="05", ENV{ID_MM_PORT_IGNORE}="1"<br></div><div dir="auto"><br></div><div dir="auto">ATTRS{idVendor}=="413c", ATTRS{idProduct}=="8213", ENV{.MM_USBIFNUM}=="02", SUBSYSTEM=="tty", ENV{ID_MM_PORT_IGNORE}="1"<br></div><div dir="auto">ATTRS{idVendor}=="413c", ATTRS{idProduct}=="8215", ENV{.MM_USBIFNUM}=="02", SUBSYSTEM=="tty", ENV{ID_MM_PORT_IGNORE}="1"<br></div><div dir="auto"><br></div><div dir="auto">LABEL="mm_fibocom_linux_apps_port_types_end"<br></div><div dir="auto"><br></div><div dir="auto"><br></div><div dir="auto">--> Create fcc unlock script for the DW5825e (413c:8213) as /usr/share/ModemManager/fcc-unlock.available.d/413c:8213<br></div><div dir="auto">#!/bin/sh<br></div><div dir="auto"><br></div><div dir="auto"># SPDX-License-Identifier: CC0-1.0<br></div><div dir="auto"># 2023 Nero zhang <<a target="_blank" rel="noopener noreferrer" href="mailto:sinaro@sinaro.es">sinaro@sinaro.es</a>><br></div><div dir="auto">#<br></div><div dir="auto"># Fibocom FM101 FCC unlock mechanism<br></div><div dir="auto">#<br></div><div dir="auto"><br></div><div dir="auto"># run fcc-unlock binary<br></div><div dir="auto">/opt/fibocom/fibo_ma_service/fibo_ma<br></div><div dir="auto">exit $?<br></div><div dir="auto"><br></div><div dir="auto">--> Tell ModemManager to automatically activate available fcc unlocks<br></div><div dir="auto">ln -sft /usr/lib64/ModemManager/fcc-unlock.d /usr/share/ModemManager/fcc-unlock.available.d/*<br></div><div dir="auto"><br></div><div dir="auto">--> reload systemd to make fibocom services available<br></div><div dir="auto">systemctl daemon-reload<br></div><div dir="auto"><br></div><div dir="auto">--> activate fibocom services<br></div><div dir="auto">sudo systemctl enable fibo_helper.service<br></div><div dir="auto">sudo systemctl enable fibo_helper_mbim.service<br></div><div dir="auto">sudo systemctl enable fibo_flash.service<br></div><div dir="auto">sudo systemctl enable fibo_config.service<br></div><div dir="auto"><br></div><div dir="auto"><br></div><div dir="auto">--> Result:<br></div><div dir="auto">---> actual unlock works (when udev rule is not set)<br></div><div dir="auto">---> no connection<br></div><div dir="auto">---> errors in the logs of fibo_helper</div><div dir="auto"><br></div><div dir="auto">### Directory structure after build ###<br></div><div dir="auto">/opt/fibocom/<br></div><div dir="auto">|--> fibo_config_service<br></div><div dir="auto">|--> fibo_flash_service<br></div><div dir="auto">|--> fibo_helper_service<br></div><div dir="auto">|--> fibo_ma_service<br></div><div dir="auto"><br></div><div dir="auto">Thank you and best,<br></div><div dir="auto">Jo.<br></div>  </body>
</html>