Setup

I am using RM500Q-GL 5G HAT module connected into PI 4 and PI 5. For my conditions I only need LTE signal, because it has better and more stable connection for my use. So I worked with this.

There is difference between setup RNDIS on PI 4 and PI 5. On PI 5 I have Kernel 16.6 and I find some major differences.

  • First is that newest Debian using for tethering port eth1 and oldest using usb0.
  • Second is, that for newest Debian it's not worked the automatic adding of DNS from Waveshare instruction. So I write my own service, which set it as well.

I have found many conflicts between RNDIS and GNSS. GNSS never worked if the RNDIS start before it. So it's important setup it correctly.

RNDIS

Before the connection the HAT, you need install following modules

sudo apt-get install minicom
sudo apt-get install udhcpc

Now you can set the HAT.

  1. Open the Minicom:
    sudo minicom -D /dev/ttyUSB2
  2. Check if there is a connection. Command is explained here instruction :
    AT+QENG="servingcell"
  3. Enable the tethering:
    AT+QCFG="usbnet",1
  4. Restart the module:
    AT+CFUN=1,1

Set DNS by this command

sudo dhclient -v usb0
sudo udhcpc -i usb0
sudo route add -net 0.0.0.0 usb0
  1. Create script for manual DNS config:
    sudo nano /usr/local/bin/hat_autorun.sh
  2. Put this code into the script:
    #!/bin/bash
    /sbin/dhclient -v eth1
    /sbin/udhcpc -i eth1
    /sbin/route add -net 0.0.0.0 eth1
  3. Make the script executable:
    sudo chmod +x /usr/local/bin/hat_autorun.sh
  4. Create the systemd service:
    sudo nano /etc/systemd/system/init-hat.service
  5. Put this code into the service file:
    [Unit]
    Description=Initialize LTE connection
    After=network-online.target
    
    [Service]
    ExecStart=/usr/local/bin/hat_autorun.sh
    RemainAfterExit=true
    
    [Install]
    WantedBy=multi-user.target
  6. Enable the service:
    sudo systemctl daemon-reexec
    sudo systemctl enable init-hat.service

GNSS

  1. Open the Minicom:
    sudo minicom -D /dev/ttyUSB2
  2. Set automatic turn-on of GPS:
    AT+QGPSCFG="autogps",1
  3. Reboot the module:
    AT+CFUN=1,1