PPPD dial-up

From Waveshare Wiki
Jump to: navigation, search

Preparation

The process of Jetson Nano or Raspberry Pi using NDIS driver to access the Internet through SIM7600 4G module

Hardware Preparation

  • SIM7600CE 4G HAT and its accessories
  • Jetson Nano and its accessories, or Raspberry Pi and its accessories
  • 4G SIM card with internet access

Hardware Connection

The hardware connection is shown in the following figure:
Notice:
1. If it is used on the 40 pin, you must pay attention to pull down the Flight Mode and PWR pins of SIM7600, that is, you need to design an initialization script. For details, see the relevant product page, or it will enter the flight mode.

2. If the Raspberry Pi supplies power to the SIM7600 through the USB cable alone, the power supply may be unstable, causing the SIM7600 to power off after it is turned on.

3. If you only use the dial-up Internet function, you don not need to connect to the 40Pin of the Jetson Nano or Raspberry Pi.

How to Use

Check the Hardware Connection & Network (Do not Skip this step!)

  • Press and hold the PWKKEY button on the SIM7600CE 4G HAT to turn on the SIM7600CE 4G HAT. After it is turned on normally, the NET indicator should flash (if it is not flashing, please check whether the SIM card is available, or whether it has entered the airplane mode).
  • Check whether the Ubuntu system of Jetson Nano or the Raspberry Pi Raspbian system has a built-in Qualcomm USB serial port driver. The non-new version of the mirror system may not have the built-in driver. The way to check is as shown below:
Check Ubuntu version
uname -a
lsb_release -a
cat /proc/version
#check whether drive Qualcomm USB virtual serial ports
lsusb

If you can see the words Qualcomm/Option, it means the built-in Qualcomm USB virtual serial port driver

  • Enter the AT command, set it to 4G Internet access, and check the network connection status
sudo su
#close ModermManager to prevent to displaying valid data when debugging AT serial ports. If this process is not required, you don't need to close it.
killall ModemManager
#Install minicom serial tools
apt-get install minicom
#Check serial device, AT command serial, that is /dev/ttyUSB2
1s /dev/ttyUSB2
#Force set 4G network
AT+CNMP=38
#Check the network
AT+CSQ
#Check whether the network register
AT+CREG?
#Query network operators
AT+COPS?
#Query the network band
AT+CPSI?

So far, SIM7600CE and Jetson Nano are connected normally, and the network connection is normal.

Configure PPP Dial-up Script to Connect Network

  • First, install ppp dialer:
sudo apt-get install ppp
  • Next, switch to root user
sudo su
  • Then: modify the dialing script file. For simplicity, copy the following two files directly to the Jetson Nano or Raspberry Pi:

The above two files will be given at the end of the article.

  • Next: Copy (replace) the above two files to the relevant path
# Note the use of the root account to operate

# Put chat in /etc/ppp
cp ./chat /etc/ppp
# put dial in /etc/ppp/peers
cp ./dial /etc/ppp/peers

PPPD dial-up11.png
Finally, execute the dial command

# Note the use of the root account to operate

# start dialing
pppd call dial

As shown in the figure below, it is the effect of successful dialing:

  • test:
# Pay attention to use the root account to operate, do not close the terminal that dialed successfully, and open a new terminal to operate

# View the network port and its ip
ifconfig -a
# To avoid DNS resolution failure, add the following default routes
route add -net 0.0.0.0 ppp0
# Pass the ppp0 internet test
ping -I ppp0 www.baidu.com

As shown in the figure above, if Baidu is pinged through the ppp0 network port, the ppp dial-up Internet connection is successful.

  • Disconnect
# Note the use of the root account to operate
# disconnect ppp connection
killall pppd

Finally, test the speed using ppp dial-up Internet access:
Note that the above values are for reference only. There are slight differences in the data obtained by the speed measurement in different regions and operators. In an ideal situation, the ideal uplink and downlink speeds are 20Mbps in the SIMCOM laboratory test.

Resource