The user serial port equipment (can be various instruments/PLC/SCM/PC, etc.) at the field acquisition point is connected to the 4G Modem terminal serial port through the RS232 or RS485 interface, and the data sent by the user serial port equipment is sent to the data center through the 4G wireless network after being encapsulated by the 4G Modem equipment.
Description of working process of Modem:
After the Modem is powered on, it first registers to the 4G wireless network through the dialing program. After successful dialing, the 4G Modem will obtain an internal IP address randomly assigned by the mobile. The 4G Modem is in the mobile intranet, and its intranet IP address is usually not fixed and changes with each dialing.We can understand that the 4G Modem is a device in the mobile internal LAN, which communicates with the external Internet public network through the mobile gateway. This is similar to the way a computer in a LAN accesses an external network through a gateway.
The 4G Modem initiates the communication connection with the data center and keeps the communication connection existing all the time. Because the 4G Modem is in the mobile intranet, and the IP address is not fixed. Therefore, only the 4G Modem can be actively connected to the data center, and the data center cannot be actively connected to the 4G Modem. This requires the data center to have a fixed public IP address or a fixed domain name.The public network IP address or fixed domain name of the data center is stored in the 4G Modem as a parameter, so that the 4G Modem can be actively connected to the data center once it is powered on and dialed successfully.
Specifically, the 4G Modem initiates a TCP or UDP communication request to the data center through parameters such as the IP address of the data center (if the central domain name is used, the central IP address is resolved through the central domain name first) and the port number.After receiving the response from the center, the 4G Modem considers that the handshake with the center is successful, and then keeps the communication connection existing. If the communication connection is interrupted, the 4G Modem will immediately shake hands with the center again.
Since the TCP/UDP communication connection has been established, two-way communication of data is possible.
For Modem, as long as the two-way communication with the data center is established, it is relatively simple to complete the conversion of user serial data and 4G network data packets. Once the Modem receives the user's serial port data, it immediately encapsulates the serial port data in a TCP/UDP packet and sends it to the data center.On the contrary, when the Modem receives the TCP/UDP packet sent by the data center, it takes out the data content and immediately sends it to the user equipment through the serial port.