SIM820X RNDIS Dail-up
From Waveshare Wiki
- Check the connection between the SIM820X and the Raspberry Pi through the following commands, if the connection is OK, you can view the Qualcomm device and ttyUSB0-USB4.
lsusb ls /dev/ttyUSB*
- Open the ttyUSB2 port via minicom:
ls /dev/ttyUSB* sudo apt-get install minicom sudo minicom -D /dev/ttyUSB2
- Send the following command via minicom and wait for the module to reboot.
at+cusbcfg=usbid,1e0e,9011
Test Networking
- After dialing, the Raspberry Pi can see that usb0 has obtained the ip through the following command:
ifconfig -a
- Test usb0 networking status:
ping -I usb0 www.baidu.com
- If failed to obtain IP or to connect successfully, you can use the following command to obtain IP and connect:
sudo dhclient -v usb0 sudo apt-get install udhcpc sudo udhcpc -i usb0 sudo route add -net 0.0.0.0 usb0 auto usb0 iface usb0 inet dhcp
- Some systems may not be able to obtain the usb0 network card, please use the following command to obtain the usb0 network card:
sudo ifconfig usb0 up
- If you need to switch to the Windows system, or restore the default settings of the module, you can send the following command to restore through the serial port:
at+cusbcfg=usbid,1e0e,9001
Config DNS (Optional)
- If you can ping the IP, but cannot ping the URL, it is a DNS server problem, you can configure it according to the following steps:
- After restarting the Raspberry Pi, you can see that the DNS setting is successful through the following command.
sudo nano /etc/resolvconf.conf
- Add the following command at the end of the file:
name_servers=8.8.8.8 114.114.114.114
- Save the file and reboot the Raspberry Pi.
- After restarting the Raspberry Pi, you can see that the DNS setting is successful through the following command.
sudo nano /etc/resolv.conf
- Save the file, exit, and ping test again.
If you use Jetson Nano, you can use the following commands to configure:
sudo cp /etc/systemd/resolved.conf /etc/systemd/resolved.conf.bak sudo vi /etc/systemd/resolved.conf DNS=114.114.114.114 8.8.8.8 8.8.4.4 sudo systemctl restart systemd-resolved.service sudo systemctl enable systemd-resolved.service sudo mv /etc/resolv.conf /etc/resolv.conf.bak sudo ln -s /run/systemd/resolve/resolv.conf /etc/
Select A Network Card (Optional)
-
If you are connected to WIFI, ETH, and 5G at the same time, and you want to prioritize one of them to access the Internet, for example, usb0 has priority over the eth0 network card to access the Internet, you can configure it according to the following steps:
- Edit the network configuration file dhcpcd.conf:
sudo nano /etc/dhcpcd.conf
- Add the following statement at the end:
interface usb0 metric 200 interface eth0 metric 300
Load USB Device Descriptor
After the SIM7600X is changed to 9011 mode, some Linxu systems cannot recognize ttyUSB*, and you can load the USB device descriptor through the following command:
- ubuntu system
sudo su sudo echo 1e0e 9011 > /sys/bus/usb-serial/drivers/generic/new_id
- raspbian and centos systems
sudo su sudo modprobe option sudo sh -c 'echo "1e0e 9011" > /sys/bus/usb-serial/drivers/option1/new_id' sudo sh -c 'echo "1e0e 9018" > /sys/bus/usb-serial/drivers/option1/new_id' sudo sh -c 'echo "1e0e 901E" > /sys/bus/usb-serial/drivers/option1/new_id'
Auto-start usb0 On Boot
- To set auto-start usb0 on boot, open Raspberry Pi boot configuration script.
sudo nano /etc/rc.local
- Add the startup command to the penultimate line, noting that it is the absolute path of your internet-running file, which is the line above exit 0.
sudo dhclient -v usb0
Note that you must add "&" to run in the background, otherwise the system may not start.