This code allows to plot on a map the power of the signal as receveid from a device conneted to LoRaWAN.
Two cloud servers are considered: TTN and Loriot
We are suppposing that the devices are LoPy with a Pytrack board.
ABP authentication is used. To this end, constants:
DEVADDR = '____'
NWKSKEY = '____'
APPSKEY = '____'
in file pytrack/trackit.py
must be configured.
Executing:
python mapplot.py
two files are generated:
rssival.csv
that stores the RSSI values of all the messages received by the cloud server;datatoplot.js
that contains the data to be plotted. This is done automatically loading in a browser either filewebmapplot.html
orwebmapplot_norefresh.html
Before starting:
-
In file
mapplot.py
:- set the CLOUD_SERVER variable
- then, accordingly to the cloud server used, fill in the other related variables below
-
In file
webmapplot.html
orwebmapplot_norefresh.html
:- set the variables
home_lat
andhome_lng
to the home center of the map - add your own Mapbox
accessToken:
- set refresh period at line:
<meta http-equiv="refresh" content="5">
- set the variables
-
Before starting, delete or store somewhere else files: "datatoplot.js" and "rssival.csv". Not deleting these files while cause new points to be added to them.