-
Notifications
You must be signed in to change notification settings - Fork 0
07 LTE NETWORK MANAGER
This guide is required for image version < 1.1. If you have nmcli already installed, you can skip this.
This tutorial was tested with Quectel EC21 LTE module and ZTE ME3630.
Network Manager will automatically handle different kind of connection and switch between them if one goes down.
Let's remove connman and install NetworkManager.
apt-get update
apt-get install network-manager modemmanager ppp resolvconf
systemctl disable dnsmasq
systemctl disable connman
systemctl disable pppd-dns
systemctl disable NetworkManager-wait-online.service
systemctl disable systemd-resolved
systemctl enable NetworkManager
systemctl enable ModemManager
reboot
# To start with a clean configuration, delete default wired connection
nmcli connection delete id "Wired connection 1"
Check if the modem is detected:
mmcli -m 0
If you see a modem correctly, run:
nmcli dev
and check if you have a cdc-wdmx device, or a ttyUSBx device.
Add the gsm connection:
nmcli con add type gsm ifname cdc-wdm0 con-name <connection_name> apn <apn>
or
nmcli con add type gsm ifname ttyUSB2 con-name 4G apn ibox.tim.it
then
nmcli r wwan on
During reboot some PCIE modules get stuck, we need to manually toggle the enable PIN at boot.
vi /usr/bin/reboot_pcie
# !/bin/sh
echo 64 > /sys/class/gpio/export
cd /sys/class/gpio/gpio64
echo out > direction
echo 0 > value
sleep 0.5
echo 1 > value
vi /etc/systemd/system/pcie.service
[Unit]
Description=reboot pcie
Wants=network-pre.target
Before=network-pre.target
[Service]
ExecStart=/usr/bin/reboot_pcie
Type=oneshot
[Install]
WantedBy=multi-user.target
systemctl enable pcie
There is an issue with nexell mac driver carrier detection, we need to make eth0 up before NetworkManager starts.
vi /usr/bin/macchanger
change:
#!/bin/sh
cd /sys/devices/platform/c0000000.soc/c00a6000.i2c/i2c-2/2-0050
ifconfig eth0 hw ether $(od -tx1 -j 250 -An < eeprom | cut -c 2- | tr ' ' ':')
HWaddr=`ifconfig -a | grep eth0 | grep HWaddr | sed 's/.*HWaddr //'`
echo "ETH0_HWaddr: $HWaddr"
exit 0
to
#!/bin/sh
cd /sys/devices/platform/c0000000.soc/c00a6000.i2c/i2c-2/2-0050
ifconfig eth0 hw ether $(od -tx1 -j 250 -An < eeprom | cut -c 2- | tr ' ' ':')
ifconfig eth0 up # Needed for nm carrier detection
HWaddr=`ifconfig -a | grep eth0 | grep HWaddr | sed 's/.*HWaddr //'`
echo "ETH0_HWaddr: $HWaddr"
exit 0
You should check if the connection priority fits, you requirements.
For example:
nmcli c s "Wired connection 1" | grep connection
by default you have autoconnect-priority: -999, that means that has the lowest priority.
To change it:
nmcli c mod "Wired connection 1" connection.autoconnect-priority 100
Try to send the at command:
AT+ZSWITCH=X
on /dev/ttyUSB2 to switch internal mode.
systemctl stop ModemManager && ModemManager --debug
For more information check NetworkManager documentation or the next document in Github wiki.