# Unlocking the FM350-GL
> [!WARNING] Is this legal?
> If you are using a US based mobile provider with a US based SIM card, this might not be legal. Lenovo's own unlock tool continues to block any US based carrier SIM cards. If you do the unlock yourself, you can get around the region restriction, but you may enter a legal gray area in doing so. This is not legal advise. Talk to an actual lawyer :)
# FCC Unlock Script
You can find this included in the latest versions of [Modem Manager](https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/blob/main/data/dispatcher-fcc-unlock/14c3?ref_type=heads).
```bash
#!/bin/sh
# SPDX-License-Identifier: CC0-1.0
# 2023 Thilo-Alexander Ginkel <
[email protected]>
# 2025 Jongmin Kim <
[email protected]>
#
# Lenovo-shipped Fibocom FM350-GL (14c3:4d75) FCC unlock
[ "$FCC_UNLOCK_DEBUG_LOG" = '1' ] && {
exec 3>&1 4>&2
trap 'exec 2>&4 1>&3' 0 1 2 3
exec 1>>'/var/log/mm-fm350-fcc.log' 2>&1
}
# require program name and at least 2 arguments
[ $# -lt 2 ] && exit 1
# first argument is DBus path, not needed here
shift
# second and next arguments are control port names
for PORT in "$@"; do
# match port type in Linux 5.14 and newer
grep -q AT "/sys/class/wwan/$PORT/type" 2>/dev/null ||
# match port name in Linux 5.13
echo "$PORT" | grep -qi AT && {
AT_PORT="$PORT"
break
}
done
# fail if no AT port exposed
[ -n "$AT_PORT" ] || exit 2
DEVICE="/dev/$AT_PORT"
at_command() {
exec 9<>"$DEVICE"
printf "%s\r" "$1" >&9
read answer <&9
read answer <&9
echo "$answer"
exec 9>&-
}
log() {
echo "$1"
}
error() {
echo "$1" >&2
}
VENDOR_ID_HASH='3df8c719'
i=1
while [ "$i" -le 9 ]; do
log "Requesting challenge from WWAN modem (attempt #$i)"
RAW_CHALLENGE="$(at_command 'at+gtfcclockgen')"
CHALLENGE="$(echo "$RAW_CHALLENGE" | grep -o '0x[0-9a-fA-F]\+' | awk '{print $1}')"
[ -n "$CHALLENGE" ] && {
log "Got challenge from modem: $CHALLENGE"
HEX_CHALLENGE="$(printf '%08x' "$CHALLENGE")"
COMBINED_CHALLENGE="$HEX_CHALLENGE$(printf '%.8s' "$VENDOR_ID_HASH")"
RESPONSE_HASH="$(echo "$COMBINED_CHALLENGE" | xxd -r -p | sha256sum | cut -d ' ' -f 1)"
TRUNCATED_RESPONSE="$(printf '%.8s' "$RESPONSE_HASH")"
RESPONSE="$(printf '%d' "0x$TRUNCATED_RESPONSE")"
log "Sending response to WWAN modem: $RESPONSE"
UNLOCK_RESPONSE="$(at_command "at+gtfcclockver=$RESPONSE")"
echo "$UNLOCK_RESPONSE" | grep -q '^+GTFCCLOCKVER:' && {
UNLOCK_RESULT="$(echo "$UNLOCK_RESPONSE" | grep -o '[0-9]*')"
[ "$UNLOCK_RESULT" = '1' ] && {
log "FCC unlock succeeded"
exit 0
} || error "FCC unlock failed. Got result: $UNLOCK_RESULT"
} || error "Unlock failed. Got response: $UNLOCK_RESPONSE"
} || error "Failed to obtain FCC challenge. Got: $RAW_CHALLENGE"
sleep 0.5
i="$((i + 1))"
done
exit 2
```
# Manual FCC Unlock
After downloading the above script, save it locally. I named it `unlockme.sh`.
You can then run the following command, as root (or with sudo):
`chmod +x ./unlockme.sh; ./unlockme.sh dbus-path wwan0 wwan0at0`
If you see `FCC unlock succeeded` then the unlock script worked and you should now have a `wwan0` interface.
If you are using Network Manager, in Gnome for example, you should be able to see the Mobile Connection and actually succeed in connecting to your mobile network. To modify APN and other related settings, use the Network Manager Connection editor tool: `nm-connection-editor`.
You could also do something like this if you wanted:
`mcli connection add type gsm con-name "OwOMobile" apn "my.apn" ifname wwan0`
# Automatic FCC Unlock
Network Manager has builtin support with Modem Manager and can run FCC unlock scripts automatically.
Many Linux distros already ship FCC unlock scripts for various WWAN hardware, however [per the Modem Manager project](https://modemmanager.org/docs/modemmanager/fcc-unlock/), it is not advised to enable these. Instead the end user needs to make a symlink that points to these shipped unlock scripts (or just make the directory and manually add the scripts you want yourself).
Most common:
```bash
ln -sft /etc/ModemManager/fcc-unlock.d /usr/share/ModemManager/fcc-unlock.available.d/*
```
Fedora 42:
```bash
ln -sft /lib64/ModemManager/fcc-unlock.d /usr/share/ModemManager/fcc-unlock.available.d/*
```
On my system, running Fedora 42 with a [custom build of Modem Manager](https://copr.fedorainfracloud.org/coprs/evana/ModemManager-FM350-GL/) (so I could run a newer version), you can see that the FM350-GM FCC Unlock scripts are already shipped (`14c3`).
![[Pasted image 20250509202155.png]]
After you make this folder and add your own unlock scripts, or symlink to the ones already shipped with Modem Manager, reboot your system.
You should now see that your mobile radio is unlocked and you no longer need to run the script manually. Neat!
# Fedora Copr Modem Manager
If you want a newer version of Modem Manager, you can check out this Copr repo that bumps the version from 1.22 -> 1.23.4-dev.1. If you want an even newer version, you can compile Modem Manager from [source ](https://gitlab.freedesktop.org/mobile-broadband/ModemManager).
https://copr.fedorainfracloud.org/coprs/evana/ModemManager-FM350-GL/
```bash
dnf copr enable evana/ModemManager-FM350-GL
dnf --refresh --allowerasing update
```
# Wanna go deeper?
## Modem Manager CLI Tool
### View Modem(s) and their info
`mmcli -m a`
`mmcli -m 0`
### Enable Enhanced Signal Quality Reporting
`mmcli -m 0 --signal-setup=10`
`mmcli -m 0 --signal-get`
You will also get additional info in Network Manager when viewing your signal strength on for your mobile connection.
## MBIM Tools
`mbimcli` and `mbim-network` are worth checking out. Below are some examples using `mbimcli`.
### Send AT commands to the FM350-GL hardware
Signal Quality
`mbimcli -d /dev/wwan0mbim0 --fibocom-set-at-command="AT+CSQ=?"`
Operator Info
`mbimcli -d /dev/wwan0mbim0 --fibocom-set-at-command="AT+COPS?"`
Manufacturer
`sudo mbimcli -d /dev/wwan0mbim0 --fibocom-set-at-command="AT+GMI"`
## Additional Reading
* https://wiki.archlinux.org/title/Mobile_broadband_modem
#notes #rf #linux #mobile #fcc