Template: SIM8200X Working with OpenWRT

From Waveshare Wiki
Jump to: navigation, search

The use of OpenWrt

Introduction to OpenWrt

Soft routing is using desktops or servers and other equipment with software. It mainly depends on the settings of the software to achieve the functions of the router. The hard routing is a unique hardware device, including a processor, power supply, and embedded software to provide router functionality.
OpenWrt is a very popular soft routing system. It is a highly modular and highly automated embedded Linux system with powerful network components and scalability. It is often used in industrial control equipment, routers, and other equipment.
In addition to the functions of general home routers, OpenWrt soft routing can also achieve port forwarding, intranet penetration, 4G networking, FTP server and more powerful functions.

Burn the image

Download the RPI OpenWrt system, unzip the system in the Imgs directory, and use the burning tool to burn the system to the SD card.

Login and initial settings

  • After the OpenWrt system is turned on, the Raspberry Pi is equivalent to a router. Therefore, use a network cable to connect the Raspberry Pi to the computer according to the use of the router (you can also use the mobile phone to search for WIFI, the default name is "OpenWrt").
  • You can set the language to auto first.
SIM820x OpenWrt(EN) (1).png
  • Enter 192.168.1.1 on the web page, the default user name: root, and the default password: password, enter the OpenWrt web management interface.
SIM820x OpenWrt(EN) (2).png
  • Set WIFI password: Network —> Wireless —> interface configuration —> Wireless security.
SIM820X OpenWrt01.png
  • Create the new interface: Network -> Interface -> Create interface.
  • Modify the IPv4 address of the LAN port to a different IP that is not the same as the LAN port IP of other routers in your home. (Many routers default the LAN port IP to 192.168.1.1. If you do not modify the IP of the OpenWrt, it will easily lead to conflicts and failure to connect to the Internet).

If necessary, it is also recommended to disable the IPv6 allocation length. After the modification is completed, click "Save & Apply", and re-use 192.168.10.1 to access the OpenWrt console.

SIM820x OpenWrt(EN) (3).png
  • In addition, it is recommended to adjust the Firewall setting to connect the OpenWrt terminal and Web management interface through the local area.

Network —> Firewall, change all "reject" to "accept", and click "Save & Apply" after modification, as shown in the picture below:

SIM820x OpenWrt(EN) (4).png
  • And then select System -> Administration, modify the allowed interface for SSH access to "unspecified" (that is, any interface can be accessed by ssh), check the Gateway port, and click "Save & Apply" after the modification is completed.
SIM820X OpenWrt02.png

At this point, you can connect to the OpenWrt web management interface or terminal through the IP address of the LAN port or wan port.

Check the working status of the drive

Connect to the OpenWrt terminal via SSH, and run the following commands to view the qmi driver, USB device, network port registration, and network port status:

dmesg | grep qmi
dmesg | grep ttyUSB 
ls /dev | grep cdc-wdm 
ifconfig wwan0
SIM8200 OpenWrt 7.png

Configure networking

  • Select System -> FileTransfer, select and upload simcom-cm in the simcom-cm directory of the folder:
SIM820x OpenWrt(EN) (6).png

Use the above "File Transfer" to upload, the uploaded program is located in "simcom-cm" under the /tmp/upload/ directory.

Enter the following commands in the terminal:

cp /tmp/upload/simcom-cm /
chmod a+x simcom-cm
./simcom-cm

【Note】: Closing this terminal will cause the networking program to stop, which will cause the network to be disconnected. It is recommended to run in the background.

SIM8200 OpenWrt 9.png
  • At this time, open a new terminal of OpenWrt and enter the command: ifconfig wwan0. You can see that the wwan0 network port has successfully obtained the operator IP and can ping the external network.
SIM8200 OpenWrt 10.png
  • Enter the Web management interface of OpenWrt, click Network —>Interface —>Create a new interface.
SIM820x OpenWrt(EN) (7).png
  • Enter the interface as shown in the picture below and confirm that the interface selection in "Physical Settings" is "wwan0".
SIM820x OpenWrt(EN) (8).png
  • Confirm that the interface selection in "Firewall Settings" is "wan".
SIM820x OpenWrt(EN) (9).png
  • Click "Save & Apply" to complete the network port settings, then return to the interface below, network-interface, you can see that the network port has been correctly identified.
SIM820x OpenWrt(EN) (10).png

Then the other devices can be connected to the OpenWrt wireless "OpenWrt" or through the network cable to connect to OpenWrt's own network port for networking.