Disclosure of Invention
In order to solve at least one of above-mentioned technical problem, this disclosure provides a two 4G module dialing method of industrial computer to realize that many 4G modules of industrial computer dial simultaneously.
In order to achieve the purpose, the following technical scheme is adopted in the disclosure:
a double 4G module dialing method of an industrial personal computer comprises the following steps:
a double 4G module dialing method of an industrial personal computer comprises the following steps:
s1, resetting a module to indicate a lamp state, electrifying a 4G module, and connecting an industrial personal computer to different networks through at least two different 4G modules respectively;
s2, circularly detecting whether the 4G module is inserted into the industrial personal computer or not, and entering the next step when the insertion of the 4G module into the industrial personal computer is detected;
S3.4G module start, and judge whether each 4G module start successfully according to the kernel information, when the start is successfully inquired, the serial port name enumerated by the 4G module in the system is saved;
s4, detecting the SIM card state of each 4G module, respectively searching the APN configuration with the highest priority of each 4G module according to the APN configuration of the 4G module received by the wwan program, and updating the pppd configuration of each 4G module;
s5, calling pppd for each 4G module respectively to dial, and executing the parameters of each 4G module by the pppd;
s6, detecting whether the 4G module is successfully dialed or not, and if so, finishing dialing; if the dialing fails or the dialing is disconnected, the 4G module is redialed in a corresponding mode according to the reason of the failure or disconnection; and setting a module indicator lamp according to the current network system of the 4G module acquired during detection.
According to at least one embodiment of the present disclosure, the steps are specifically as follows:
s1, resetting a module indicating lamp state, powering on a 4G module, wherein the 4G module comprises a module 1 and a module 2 which are respectively connected with an industrial personal computer, and the module 1 and the module 2 are respectively accessed into a network 1 and a network 2;
s2, detecting whether the 4G module is inserted into the industrial personal computer or not, if not, waiting for the 4G module to be inserted, and otherwise, entering the next step;
s3.1, starting the module 1, judging whether the module 1 is started successfully or not according to the kernel information, if the information of the module 1 is not inquired in the kernel information within the specified time, considering that the starting fails, and waiting for re-execution; if the information of the module 1 is inquired, the serial port name enumerated in the system by the module 1 is saved;
s3.2, starting the module 2, judging whether the module 2 is started successfully or not according to the kernel information, if the information of the module 2 is not inquired in the kernel information within the specified time, considering that the starting fails, and waiting for re-execution; if the information of the module 2 is inquired, the serial port name enumerated in the system by the module 2 is saved;
s4, detecting the states of the SIM cards of the module 1 and the module 2 through AT instructions respectively, searching APN configuration with the highest priority of the module 1 and the module 2 respectively according to APN configuration of the module 1 and the module 2 received by a wwan program, and updating pppd configuration of the module 1 and the module 2;
s5, calling pppd for the module 1 and the module 2 respectively to dial, wherein the pppd executes respective parameters;
s6, detecting whether the 4G module is successfully dialed or not, and if so, finishing dialing; if the dialing fails or the dialing is disconnected, the 4G module is redialed in a corresponding mode according to the reason of the failure or disconnection; and setting a module indicator lamp according to the current network system of the 4G module acquired during detection.
According to at least one embodiment of the present disclosure, the method for redialing the 4G module in the step S6 in a corresponding manner according to the reason of failure or disconnection specifically includes: judging the reason of dialing failure or disconnection, if the dialing failure is caused by the APN configuration reason, using the lower-level APN configuration when the dialing is carried out again; if the dialing is disconnected or failed due to the fact that the 4G module is pulled out, hardware is reset manually, the SIM card is in a problem or the signal quality is weak, the original APN configuration is kept unchanged, and the dialing is directly carried out again.
According to at least one embodiment of the present disclosure, the pppd configuration in step S4 includes a serial port name and serial port configuration of a data channel used by the module, an APN name, an authentication method, and a username and password.
According to AT least one embodiment of the present disclosure, the wwan program is used for APN configuration, start and stop of a dialing program, module hard reset, AT instruction sending, module parameter query, and program operation log recording.
Compared with the prior art, the present disclosure has the advantages that:
according to the double-4G module dialing method for the industrial personal computer, the industrial personal computer can be supported to dial multiple 4G modules simultaneously, so that the industrial personal computer can be accessed to different networks, and collected data can be sent to different servers.
Detailed Description
The present disclosure will be described in further detail with reference to the drawings and embodiments. It is to be understood that the specific embodiments described herein are for purposes of illustration only and are not to be construed as limitations of the present disclosure. It should be further noted that, for the convenience of description, only the portions relevant to the present disclosure are shown in the drawings.
It should be noted that the embodiments and features of the embodiments in the present disclosure may be combined with each other without conflict. The present disclosure will be described in detail below with reference to the accompanying drawings in conjunction with embodiments.
Technical term interpretation:
1, pppd: PPP is a protocol for establishing Internet links over dial-up modems, DSL connections, and many other types of point-to-point links. The pppd daemon works with the kernel PPP driver to establish and maintain a PPP link with another system (called a peer) and to negotiate an Internet Protocol (IP) address for each end of the link. The pppd may also authenticate the peer or provide authentication information to the peer.
AT instruction: AT is the Attention, and AT commands are commands applied to the connection and communication between the terminal device and the PC application. The AT command set is sent from the TE (i.e., Terminal Equipment) or the DTE (i.e., Data Terminal Equipment) to the TA (i.e., Terminal Adapter) or the DCE (i.e., Data circuit Terminal Equipment).
The TE controls the functions of the MS (Mobile Station) by sending AT commands, and interacts with GSM (Global System for Mobile Communication) network services. The communication protocol between the GSM module and the computer is some AT instruction set. Whether each AT instruction is successfully executed or not is correspondingly returned, and for some other unexpected information (such as people dial in, no signal on a line and the like), the GSM module has some corresponding information prompts, and a receiving end can perform corresponding processing.
APN setting: the APN (Access Point Name ) is a parameter that must be configured when a user accesses the Internet through a GSM module, and determines which Access method the user accesses the mobile network, so as to identify the Service type of GPRS (General Packet Radio Service), and there are many types of external networks that the user can Access, such as Internet, WAP (Wireless Application Protocol) websites, group enterprise internal networks, and industry internal private networks. From the APN it can be determined what services are provided in the packet data link, which may include: multicast (P2MP) services, short message services, multimedia messaging, internet content services, and the like.
As shown in fig. 1 and 2, a method for dialing a dual 4G module of an industrial personal computer comprises the following steps:
s1, resetting a module to indicate a lamp state, powering on a 4G module, wherein the 4G module comprises a module 1 and a module 2 which are respectively connected with an industrial personal computer; the industrial personal computer is respectively connected with the module 1 and the module 2 through USB communication, and the module 1 and the module 2 are respectively accessed into the network 1 and the network 2;
s2, detecting whether the 4G module is inserted into the industrial personal computer or not, if not, waiting for the 4G module to be inserted, and otherwise, entering the next step;
s3.1, starting the module 1, judging whether the module 1 is started successfully or not according to the kernel information, if the information of the module 1 is not inquired in the kernel information within the specified time, considering that the starting fails, and waiting for re-execution; if the information of the module 1 is inquired, the serial port name enumerated in the system by the module 1 is saved;
s3.2, starting the module 2, judging whether the module 2 is started successfully or not according to the kernel information, if the information of the module 2 is not inquired in the kernel information within the specified time, considering that the starting fails, and waiting for re-execution; if the information of the module 2 is inquired, the serial port name enumerated in the system by the module 2 is saved;
s4, detecting the states of the SIM cards of the module 1 and the module 2 through AT instructions respectively, searching APN configuration with the highest priority of the module 1 and the module 2 respectively according to APN configuration of the module 1 and the module 2 received by a wwan program, and updating pppd configuration of the module 1 and the module 2;
the pppd configuration comprises a serial port name and serial port configuration of a data channel used by the module, an APN name, an authentication mode and a user name and password;
s5, calling pppd for the module 1 and the module 2 respectively to dial, wherein the pppd executes respective parameters;
s6, detecting whether the 4G module is successfully dialed or not, and if so, finishing dialing; if the dialing fails or the dialing is disconnected, the 4G module is redialed in a corresponding mode according to the reason of the failure or disconnection; and setting a module indicator lamp according to the current network system of the 4G module acquired during detection.
The method for redialing the 4G module in a corresponding mode according to the reason of failure or disconnection specifically comprises the following steps: judging the reason of dialing failure or disconnection, if the dialing failure is caused by the APN configuration reason, using the lower-level APN configuration when the dialing is carried out again; if the dialing is disconnected or failed due to the fact that the 4G module is pulled out, hardware is reset manually, the SIM card is in a problem or the signal quality is weak, the original APN configuration is kept unchanged, and the dialing is directly carried out again.
The wwan program is used for APN configuration, starting and stopping of a dialing program, hard resetting of a module, AT instruction sending, module parameter inquiry and program operation log recording.
The wwan _ alive program is a program running in the background and used for turning on and off the module, detecting abnormality, dialing up and surfing the internet, and redialing the module after the module fails to dial or is disconnected.
The wwan program execution flow:
1) receiving a user execution parameter;
2) judging the legality of the execution parameters, if the execution parameters are illegal, prompting that the parameters are wrong, and printing help information; if the user parameter is legal, different functions are executed according to the user parameter, which specifically comprises the following steps:
the wwan APN add command is used to increase the APN configuration.
The wwan APN delete command is used to delete the configured APN.
The wwan APN show dev command is used to view the configuration information for the APN.
The wwan dialer start command is used to turn on the 4G interface dialing function.
The wwan dialer stop command is used to turn off the 4G interface dialing function.
The wwan modem reboot command is used to restart the 4G module.
The wwan modem show dev command is used to view the call connection information of the 4G module.
The wwan AT send command is used for manually sending the AT command to the 4G module
The wwan AT show dev command is used for checking the manual issuing of the AT instruction record and the result returned by the 4G module.
The wwan log start dev command is used to turn on the 4G interface logging function.
The wwan log stop dev command is used to close the 4G interface logging function.
According to the dialing method, the multiple 4G modules of the industrial personal computer are dialed simultaneously, and the industrial personal computer is respectively accessed into the network 1 and the network 2 through the module 1 and the module 2 so as to send acquired data to different servers.
In the description herein, reference to the description of the terms "one embodiment/mode," "some embodiments/modes," "example," "specific example," or "some examples," etc., means that a particular feature, structure, material, or characteristic described in connection with the embodiment/mode or example is included in at least one embodiment/mode or example of the application. In this specification, the schematic representations of the terms used above are not necessarily intended to be the same embodiment/mode or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments/modes or examples. Furthermore, the various embodiments/aspects or examples and features of the various embodiments/aspects or examples described in this specification can be combined and combined by one skilled in the art without conflicting therewith.
Furthermore, the terms "first", "second" and "first" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one such feature. In the description of the present application, "plurality" means at least two, e.g., two, three, etc., unless specifically limited otherwise.
It will be understood by those skilled in the art that the foregoing embodiments are merely for clarity of illustration of the disclosure and are not intended to limit the scope of the disclosure. Other variations or modifications may occur to those skilled in the art, based on the foregoing disclosure, and are still within the scope of the present disclosure.