Background
LoRa is a low-power consumption and long-distance Internet of things technology provided by Semtech corporation, and is widely applied to the fields of wireless meter reading and the like. LoRaWAN adopts LoRa technique to construct low-power consumption, long-distance wireless internet wide area network. LoRaWAN benefits from the gains of spread spectrum modulation and forward error correction codes, with LoRa achieving approximately 2 times the communication distance of cellular technology (handsets).
The long-distance transmission of LoRaWAN has the following defects:
1) in complex environments of high-rise forests, such as basements, closed darkrooms, sewers and other places with relatively closed spaces, LoRa signals cannot be well covered.
2) Under the environment that LoRaWAN wireless terminal equipment is not deployed much, if the gateways are deployed for the wireless terminal equipment, the cost is high, the enterprise burden is increased, the utilization rate of the gateways is low, and resources are wasted.
Disclosure of Invention
The invention aims to overcome the defects in the prior art and provides a LoRaWAN complex transparent transmission relay implementation method, which adopts a relay mode on an SX1278 radio frequency chip of Semtech company to receive uplink data of LoRaWAN wireless terminal equipment, encapsulates the data and sends the encapsulated data to a gateway, then receives downlink data of the gateway, a server receives the uplink data, analyzes and judges whether the data is the relayed data, then adds relay information and the like to the relayed downlink data to encapsulate the relayed data, sends the encapsulated data to the gateway, and sends FRMPayload part of the data to the wireless terminal equipment after the relay receives the downlink data. In order to better be compatible with the original LoRaWAN network and reduce the upgrade and reconstruction of the original LoRaWAN network equipment, the invention provides four optimization schemes.
In order to achieve the technical purpose and achieve the technical effect, the technical scheme specifically comprises the following steps:
a LoRaWAN complex transparent transmission relay implementation method comprises the following steps:
step 1, a relay searches a LoRaWAN network, and the LoRaWAN network is accessed to obtain corresponding SF and frequency;
step 2, LoRaWAN wireless terminal equipment fails to search LoRaWAN network and finally works in SF12 and 471.5 MHZ;
step 3, the relay receives uplink data of LoRaWAN wireless terminal equipment in fixed SF12 and 471.5MHZ in a CLASS _ C mode;
step 4, after receiving the uplink data of the LoRaWAN wireless terminal equipment, the relay splices the information of the address and the like of the relay to the head and the tail of the data so as to access the SF and the frequency in the LoRaWAN network and send the processed data to the gateway;
step 5, after the relay sends the data to the gateway, starting a receiving window of 2 seconds by using SF and frequency accessed into the LoRaWAN network;
and 6, after the gateway sends the data to the server, the server analyzes the data, if the data contains the address information of the relay, the data is transmitted through the relay, and the server does not make MAC instructions such as ADR, channel frequency, CLASS _ B and the like on the LoRaWAN wireless terminal equipment which is subjected to the relay.
And 7, the server encapsulates information such as descending data into a relay address twice, the data is sent to the gateway, and the gateway sends the data to the relay.
And 8, after the relay receives the downlink data of the gateway, analyzing the data, and then sending the FRMPayload in the downlink data sheet to LoRaWAN wireless terminal equipment by using fixed SF12 and 471.5 MHZ. And if the relay does not receive the downlink data of the gateway, the receiving is overtime.
And 9, then the relay runs in the steps 3, 4, 5, 6, 7 and 8.
Furthermore, the LoRaWAN wireless terminal device searches for the network by using fixed SF12 and 471.5MHZ under other SF and frequency preferentially when searching for the network fails.
Further, the LoRaWAN wireless terminal equipment periodically searches the network again according to the signal intensity in the access network.
Further, the LoRaWAN wireless terminal device is preferentially under other SF and frequency when searching for the network, and fixed SF and frequency are reused when the network searching fails, wherein the SF and frequency can be other better wireless resources in the current environment, and not only are those under SF12 and 471.5 MHZ.
Further, after the relay sends the data to the gateway, a receiving window of several seconds is started by using the SF and the frequency accessed into the LoRaWAN network, and the time window should be changed according to situations such as LoRa data transmission time, network delay, server response speed and the like, and not only is 2 seconds.
The invention has the following beneficial effects:
1. the relay is transparent to LoRaWAN wireless terminal equipment and a gateway, is adapted to the existing LoRaWAN equipment, and only needs to upgrade and transform a server.
2. The relay in the invention is suitable for relatively closed environment, even environment without Ethernet and the like.
3. The relay network in the invention is simple and convenient to deploy.
4. In the relay working mode, the server can obtain the whole data transmission flow and the signal environment of the LoRaWAN wireless equipment terminal, and the optimization and the maintenance in the future are facilitated.
5. The relay in the invention uses an SX1278 radio frequency chip, and the cost of the whole machine is much lower than that of a gateway.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention will be described in further detail below with reference to the accompanying drawings and examples.
The method adopts a relay network searching mode to connect to the original LoRaWAN network, receives the uplink data of the LoRaWAN wireless terminal equipment in fixed SF12 and 471.5MHZ, then sends the data to the gateway and obtains the downlink data of the gateway in the SF and the frequency obtained after the network access, and then sends the data to the LoRaWAN wireless terminal equipment in fixed SF12 and 471.5 MHZ.
The relay data transmission process is as follows:
1. the relay searches for the LoRaWAN network, and accesses the LoRaWAN network to obtain corresponding SF and frequency;
LoRaWAN wireless terminal equipment fails to search for the LoRaWAN network and finally works in SF12 and 471.5 MHZ;
3. the relay receives uplink data of the LoRaWAN wireless terminal device in CLASS _ C in fixed SF12 and 471.5 MHZ.
4. After receiving the uplink data of the LoRaWAN wireless terminal equipment, the relay splices the information such as the address of the relay to the head and the tail of the data so as to access the SF and the frequency in the LoRaWAN network and send the processed data to the gateway.
5. The relay starts a 2 second receive window with SF and frequency access to the LoRaWAN network after sending data to the gateway.
6. After the gateway sends the data to the server, the server analyzes the data, if the data contains the address information of the relay, the data is the data transmitted through the relay, and the server does not make MAC instructions such as ADR, channel frequency, CLASS _ B and the like on the LoRaWAN wireless terminal equipment which is subjected to the relay.
7. The server encapsulates information such as descending data descending relay address twice, sends the data to the gateway, and the gateway sends the data to the relay.
8. And if the relay receives the downlink data of the gateway, analyzing the data, and then sending the FRMPayload in the downlink data sheet to LoRaWAN wireless terminal equipment by using fixed SF12 and 471.5 MHZ. And if the relay does not receive the downlink data of the gateway, the receiving is overtime.
9. The relay then runs in the above-described flows 3, 4, 5, 6, 7, 8.
Because LoRaWAN wireless terminal equipment and relay all need to search for the network, avoid LoRaWAN wireless terminal equipment that probably exists not to have access to network and relay load too big. Four schemes are used to reduce the probability of the above situation:
1) when the LoRaWAN wireless terminal equipment searches for the network, the LoRaWAN wireless terminal equipment preferentially uses other SF and frequency, and when the network searching fails, the LoRaWAN wireless terminal equipment uses fixed SF12 and 471.5MHZ to search for the network.
2) And periodically searching the network again by the LoRaWAN wireless terminal equipment according to the signal intensity in the access network.
3) The LoRaWAN wireless terminal device is preferentially under other SF and frequency when searching the network, and fixed SF and frequency are reused when the network searching fails, wherein the SF and the frequency can be other better wireless resources in the current environment, and not only are SF12 and 471.5 MHZ.
4) After the relay sends the data to the gateway, a receiving window of several seconds is started by using SF and frequency accessed into the LoRaWAN network, and the time window should be adjusted according to situations such as LoRa data transmission time, network delay, server response speed and the like, and not only is 2 seconds.
The above description is only a preferred embodiment of the present invention, and the scope of the present invention is not limited thereto, and any simple modifications or equivalent substitutions of the technical solutions that can be obviously obtained by those skilled in the art within the technical scope of the present invention are within the scope of the present invention.