Skip to content

Instantly share code, notes, and snippets.

@NiKiZe
Created September 2, 2021 19:19
Show Gist options
  • Save NiKiZe/cc80ba9689296568f03f823899d109c5 to your computer and use it in GitHub Desktop.
Save NiKiZe/cc80ba9689296568f03f823899d109c5 to your computer and use it in GitHub Desktop.
Start MC7700 LTE on Raspberry Pi
#!/bin/bash
# Connect a Raspberry Pi to LTE using MC7700 Mini PCI Modem with adapter to USB-C
sudo qmicli -d /dev/cdc-wdm0 -p --wds-stop-network
sudo cat /sys/class/net/wwan0/qmi/raw_ip
sudo ip link set dev wwan0 down
# Enable OS Raw IP Mode setting (not persistent)
sudo su -c "echo Y > /sys/class/net/wwan0/qmi/raw_ip"
sudo qmicli -d /dev/cdc-wdm0 -p --device-open-net="net-raw-ip|net-no-qos-header" --wds-start-network="ip-type=6" --client-no-release-cid
sudo qmicli -d /dev/cdc-wdm0 -p --device-open-net="net-raw-ip|net-no-qos-header" --wds-start-network="ip-type=4" --client-no-release-cid
sudo ip link set dev wwan0 up
sudo qmicli -d /dev/cdc-wdm0 -p --wds-get-current-settings
ip a
sudo ip r del default
sudo udhcpc -q -f -n -i wwan0
# -q exit after getting lease
# -f Foreground wait
# -n exit if no lease
# TODO fix no DNS
sudo qmicli -d /dev/cdc-wdm0 --nas-get-signal-info; \
sudo qmicli -d /dev/cdc-wdm0 --nas-get-signal-strength; \
sudo qmicli -d /dev/cdc-wdm0 --nas-get-home-network; \
sudo qmicli -d /dev/cdc-wdm0 --nas-get-serving-system; \
sudo qmicli -d /dev/cdc-wdm0 --nas-get-system-info
sudo qmi-network /dev/cdc-wdm0 status
sudo qmicli -d /dev/cdc-wdm0 --wds-get-packet-service-status
sudo qmicli -d /dev/cdc-wdm0 -p --nas-get-signal-info --nas-get-signal-strength --nas-get-home-network --nas-get-serving-system
sudo qmi-network /dev/cdc-wdm0 status
sudo qmicli -d /dev/cdc-wdm0 --wds-get-packet-service-status
@peterall
Copy link

Du är en klippa Christian @NiKiZe! 💪

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment