SUMMERY OF THE UTILITY MODEL
In view of this, the utility model provides a loRa wireless gateway under the condition that does not influence the original structure of gateway and communication, solves the problem that the 485 communication interfaces of equipment are occupied.
The technical scheme of the utility model is realized like this: the utility model provides a LoRa wireless gateway, which comprises a 4G module and an RS485 transparent transmission module, wherein the RS485 transparent transmission module comprises a first RS485 module, a second RS485 module and a transparent transmission module;
the 4G module comprises a plurality of serial ports;
the first RS485 module and the second RS485 module are respectively electrically connected with the serial ports of the 4G module in a one-to-one correspondence mode, and the transparent transmission module is respectively connected with the first RS485 module and the second RS485 module through RS485 buses.
On the basis of the technical scheme, preferably, the Air724UG LTE module is selected as the 4G module;
the RO pin of the first RS485 module is electrically connected with the UART1_ RXD pin of the Air724UG LTE module, and the DI pin of the first RS485 module is electrically connected with the UART1_ TXD pin of the Air724UG LTE module;
the RO pin of the second RS485 module is electrically connected to the UART3_ RXD pin of the Air724UG LTE module, and the DI pin of the second RS485 module is electrically connected to the UART3_ TXD pin of the Air724UG LTE module.
On the basis of the above technical solution, preferably, the transparent transmission module includes a CH442E chip;
the IN and EN pins of the CH442E chip are electrically connected with GPIO _22 and GPIO _23 of the Air724UG LTE module respectively;
the S1B pin of the CH442E chip is electrically connected with the DI pin of the second RS485 module, the DB pin of the CH442E chip is electrically connected with the RO pin of the first RS485 module, and the S2B pin of the CH442E chip is suspended;
the S1C pin of the CH442E chip is electrically connected to the RO pin of the second RS485 module, the DC pin of the CH442E chip is electrically connected to the DI pin of the first RS485 module, and the S2C pin of the CH442E chip is floating.
On the basis of the technical scheme, the LORA communication module electrically connected with the 4G module serial port is preferably further included.
On the basis of the technical scheme, the USB interface card preferably further comprises a USB serial port;
the 4G module comprises a USB interface; and the USB serial port is electrically connected with the USB interface of the 4G module. The utility model discloses a loRa wireless gateway has following beneficial effect for prior art:
(1) the transparent transmission module is arranged in the RS485 transparent transmission module, so that the first RS485 module and the second RS485 module can be blocked or connected, and a monitoring and blocking type reading mode is supported; when monitoring data, the transparent transmission chip is communicated with the first RS485 module and the second RS485 module; when the blocking type reading is carried out, the transparent transmission chip disconnects the first RS485 module and the second RS485 module, and the gateway directly communicates with the slave equipment, so that the problem that the 485 communication structure of the equipment is occupied is solved, and data acquisition can be carried out under the condition that the original structure and communication are not influenced;
(2) by setting the RS485 transparent transmission module into a structure of two RS485 communication interfaces and a transparent transmission module, the gateway can be ensured to carry out data acquisition without destroying the existing 485 communication, has the functions of data acquisition and Lora networking, and can transmit the data of lower Lora equipment and 485 data to the cloud in a 4G manner;
(3) the 4G module is adopted to realize the functions of data acquisition, data processing, data transmission and the like, so that the proxy microprocessor realizes the functions of data acquisition and data processing, and the integration level of the system is improved.
Detailed Description
The technical solutions in the embodiments of the present invention will be described clearly and completely below with reference to the embodiments of the present invention, and it is obvious that the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments in the present invention, all other embodiments obtained by a person skilled in the art without creative work all belong to the protection scope of the present invention.
As shown in fig. 1, the utility model discloses a loRa wireless gateway, it includes 4G module, RS485 passes through module and LORA communication module.
The 4G module is a general name of a product with hardware loaded to a specified frequency band, software supporting a standard LTE protocol and highly integrated and modularized software and hardware. The hardware integrates radio frequency and baseband on a PCB platelet to complete wireless receiving, transmitting and baseband signal processing functions. The software supports the functions of voice dialing, short message receiving and sending, dialing networking and the like. In this embodiment, the improvement of the 4G module structure is not involved, and a 4G module already put into market may be used. Preferably, in this embodiment, the 4G module selects an Air724UG 4G LTE module. The Air724UG 4G LTE module comprises 1 USB2.0 high-speed interface, 1.8V/3.0V (U) SIM card interface, 3 UART interfaces and 1 SPI interface. The first RS485 module and the second RS485 module are electrically connected with a main serial port UART1 and a universal serial port UART3 on the Air724UG LTE module respectively.
And the RS485 transparent transmission module is in a master-slave mode and interacts with other equipment through a 485 communication protocol. Because the RS485 communication interface has the condition of invalid occupation, the equipment which really needs to transmit data cannot communicate, and the existing solution either waits for the RS485 communication interface to be idle or adds the RS485 communication interface on the gateway. Neither of these approaches solves the problem well. Therefore, in order to solve the above problem, in this embodiment, a transparent transmission module is provided. Specifically, the RS485 transparent transmission module comprises a first RS485 module, a second RS485 module and a transparent transmission module; the first RS485 module and the second RS485 module are respectively electrically connected with the serial port in a one-to-one correspondence mode, and the transparent transmission module is respectively connected with the first RS485 module and the second RS485 module through RS485 buses.
Preferably, the first RS485 module and the second RS485 module can be configured as a master-slave device and interact with other devices through a 485 communication protocol. The first RS485 module is in serial communication with a UART1 of the Air724UG LTE module, and the second RS485 module is in serial communication with a UART3 of the Air724UG LTE module. In this embodiment, as shown in fig. 2, the RO pin of the first RS485 module is electrically connected to the UART1_ RXD pin of the Air724UG LTE module, and the DI pin of the first RS485 module is electrically connected to the UART1_ TXD pin of the Air724UG LTE module; the RO pin of the second RS485 module is electrically connected to the UART3_ RXD pin of the Air724UG LTE module, and the DI pin of the second RS485 module is electrically connected to the UART3_ TXD pin of the Air724UG LTE module.
Preferably, the transparent transmission module can block or connect the first RS485 module and the second RS485 module, and supports a monitoring and blocking type reading mode; when monitoring data, the transparent transmission chip is communicated with the first RS485 module and the second RS485 module; when the blocking type reading is carried out, the transparent transmission chip disconnects the first RS485 module and the second RS485 module, and the gateway directly communicates with the slave equipment. Under the scene that RS485 master-slave communication exists and the communication priority is high, the monitoring function can be used for completing the data acquisition function under the condition that original equipment is not interfered; under the condition that RS485 master-slave communication exists and the communication priority is low, blocking type reading can be used, and accurate determination of self-reading data is guaranteed. In this embodiment, instead of improving the structure and algorithm of the transparent transmission module, a transparent transmission module already put into the market may be used, for example, as shown in fig. 2, the transparent transmission module of this embodiment uses a CH442E chip. The CH442E chip contains a 2-channel SPDT single pole double throw analog switch. The IN and EN pins of the CH442E chip are electrically connected with the GPIO _22 and GPIO _23 pins of the Air724UG LTE module respectively; the S1B pin of the CH442E chip is electrically connected with the DI pin of the second RS485 module, and the DB pin of the CH442E chip is electrically connected with the RO pin of the first RS485 module; the S1C pin of the CH442E chip is electrically connected to the RO pin of the second RS485 module, and the DC pin of the CH442E chip is electrically connected to the DI pin of the first RS485 module. As shown in fig. 2, the RO pin of the first RS485 module is denoted by 485_1_ RO; the DI pin of the first RS485 module is represented by 485_1_ DI; an RO pin of a second RS485 module is represented by 485_2_ RO; the DI pin of the second RS485 module is denoted 485_2_ DI.
Wherein, the EN pin is an enabling switch, and the low level is effective. An IN pin of the CH442E chip is a switch selection input pin, and when the IN pin is at a low level, a channel between an RO pin of the first RS485 module and a DI pin of the second RS485 module, and a channel between the DI pin of the first RS485 module and the RO pin of the second RS485 module are communicated; on the contrary, a channel between the RO pin of the first RS485 module and the DI pin of the second RS485 module, and a channel between the DI pin of the first RS485 module and the RO pin of the second RS485 module are disconnected;
when the CH442E chip is IN a monitoring mode, an EN pin and an IN pin of the CH442E chip are both set to be at a low level, a channel between an RO pin of the first RS485 module and a DI pin of the second RS485 module, and a channel between the DI pin of the first RS485 module and the RO pin of the second RS485 module are communicated; at this time, the Air724UG LTE module is only used for receiving data, that is, when the first RS485 module is a sender and the second RS485 module is a receiver, the RO pin of the first RS485 module sends information to the DI pin of the second RS485 module and the UART1_ RXD pin of the Air724UG LTE module, and the Air724UG LTE module monitors the transmission content of the first RS485 module to the second RS485 module through the UART1_ RXD pin; when the second RS485 module is a sender and the first RS485 module is a receiver, the RO pin of the second RS485 module sends information to the DI pin of the first RS485 module and the UART3_ RXD pin of the Air724UG LTE module, and the Air724UG LTE module monitors the transmission content of the second RS485 module to the first RS485 module through the UART3_ RXD pin;
when the CH442E chip is IN the blocking mode, the IN pin of the CH442E chip is set to a high level, at this time, a channel between the RO pin of the first RS485 module and the DI pin of the second RS485 module, and a channel between the DI pin of the first RS485 module and the RO pin of the second RS485 module are disconnected, and communication between the first RS485 module and the second RS485 module is disconnected, at this time, only communication between the first RS485 module and the Air724UG LTE module, and communication between the second RS485 module and the Air724UG LTE module can be realized, so that the blocking function is realized. The specific process of communication between the first RS485 module and the Air724UG LTE module is as follows: when the first RS485 module is a sender and the Air724UG LTE module is a receiver, the RO pin of the first RS485 module sends information to the UART1_ RXD pin of the Air724UG LTE module; when the Air724UG LTE module is the sender and the first RS485 module is the receiver, the UART1_ TXD pin of the Air724UG LTE module sends information to the DI pin of the first RS485 module. The communication process between the second RS485 module and the Air724UG LTE module is the same as the communication process between the first RS485 module and the Air724UG LTE module in principle, and the description is not repeated here.
And the LORA communication module provides a LORA communication mode and is electrically connected with the 4G module serial port. In this embodiment, the modification of the structure and algorithm of the LORA communication module is not involved, and the LORA communication module can be implemented by using the prior art, which will not be described again here.
The USB serial port can be connected with a computer to debug and control the edge computing server, and can also be connected with a wire network to upload data to a cloud. In this embodiment, the USB serial port is electrically connected to the USB interface of the 4G module.
The working principle of the embodiment is as follows: when the first RS485 module and the second RS485 module transmit data, the data of the first RS485 module and the data of the second RS485 module are monitored in real time through the transparent transmission module, and when the transparent transmission module monitors that the current RS485 module does not transmit data, the RS485 module is immediately blocked, so that the problem that the RS485 module is occupied is solved.
The beneficial effect of this embodiment does: the transparent transmission module is arranged in the RS485 transparent transmission module, so that the first RS485 module and the second RS485 module can be blocked or connected, and a monitoring and blocking type reading mode is supported; when monitoring data, the transparent transmission chip is communicated with the first RS485 module and the second RS485 module; when the blocking type reading is carried out, the transparent transmission chip disconnects the first RS485 module and the second RS485 module, and the gateway directly communicates with the slave equipment, so that the problem that the 485 communication structure of the equipment is occupied is solved, and data acquisition can be carried out under the condition that the original structure and communication are not influenced;
by setting the RS485 transparent transmission module into a structure of two RS485 communication interfaces and a transparent transmission module, the gateway can be ensured to carry out data acquisition without destroying the existing 485 communication, has the functions of data acquisition and Lora networking, and can transmit the data of lower Lora equipment and 485 data to the cloud in a 4G manner;
the 4G module is adopted to realize the functions of data acquisition, data processing, data transmission and the like, so that the proxy microprocessor realizes the functions of data acquisition and data processing, and the integration level of the system is improved.
The above description is only a preferred embodiment of the present invention, and should not be taken as limiting the invention, and any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.