Automatic and correctif positioning of LoRa station
Gateway module
This section refers to the module operating on a gateway. Its role is to respond to server requests by providing information about the surrounding Wi-Fi networks.
The code source is in the repertory sonde. For more information you can read the README
ChirpStack Server module
This section describes the code running server side to request updates to the gateways and then process the data received.
The code has been generated with node-red. The Flow_Serveur file in the serveur directory is a json file describing the nodes of the flow. It can be imported in an already running node-red instance.
There are two parts in the flow:
- One sends scan requests to the gateways. It works by sending a message on the topic scan/request to the MQTT broker. This can be launched either manually or automatically at regular intervals.
- The other part listens to the scan/response topic. When a message is received, the server launches two requests in parallel :
- One to the Chirpstack API to get the GPS coordinates of the gateway we want to check.
- The other to the Google API to get the GPS coordinates of the gateway using the Wi-Fi networks detected along with their signal strenght.
Wifi location request are also implemented using BeaconDB and could be easily extended to other services. Switching between different API only requires to activate and deactivate the corresponding nodes in the flow.
Note that the best results are obtained with the Google API, but it requires a valid API key and can cost money.
To function properly, it is required that you set a username and password for the Chirpstack API. The API key for the Google API must also be set at the end of the request. To do this you need to modify the corresponding nodes (Message de demande d'une clé API
for ChirpStack and Requête de la position à Google à partir des données WiFi scannées
for Google).