This is the notebook for visualizing the long-term connectivity and link quality dataset collected from ChirpBox.

Open source:

This notebook is used in association with data_analysis.py, dataset.csv, topology_map.png and metadata_processing.py, which are available at:
DOI

Firmware:

Firmware related source code can be found at ChirpBox repository/Daemon.

Data collection code:

Data collection related source code can be found at ChirpBox repository/ChirpBox_manager/Tools/chirpbox_tool/.

In [1]:
from data_analysis import *
from IPython.display import Image
import pathlib
dataset_tool = Analysis() # Specify data analysis class

current_directory = str(pathlib.Path.cwd()) # Current directory of notebook
dataset_CSV = str(pathlib.Path.cwd()) + "//dataset_03052021_15092021.csv" # TODO: name the CSV file
In [2]:
# Specify the folder for output processing
directory_path = current_directory
# Specify the SF, frequency, node ID
id_list = list(range(21)) # 21 nodes for current dataset

Below are the figures presented in our paper:

Dataset: Environmental Impact on the Long-Term Connectivityand Link Quality of an Outdoor LoRa Network

Figure 2:

Showing maximum and minimum temperatures for all nodes, and weather temperature from June 22, 2021 to June 25, 2021

In [3]:
# save plot output type and format
plot_type = ["max_min_temperature", 'pdf']
# LoRa parameters
sf_list = [12]
freq_list = [490000]
# plot start and end time
plot_date_start = "2021-06-22 00:00:00"
plot_date_end = "2021-06-25 00:00:00"
plot_date = [plot_date_start, plot_date_end]
# draw
dataset_tool.dataset_analysis(sf_list, freq_list, id_list, directory_path, dataset_CSV, plot_type, plot_date)

Figure 3:

Impact of weather conditions on link quality in terms of RSS at the link-level (link #19-10) during June 25 - July 25, 2021. Radio parameters are set to SF 7 and 480 MHz.

In [4]:
# save plot output format
plot_type = ['AVG_link_RSSI_temperature_plot', 'pdf']
# LoRa parameters
sf_list = list(range(7,13))
freq_list = [480000]
# rx and tx nodes
rx_tx_node = [10, 19]
# plot start and end time
plot_date_start = "2021-06-25 00:00:00"
plot_date_end = "2021-07-25 00:00:00"
plot_date = [plot_date_start, plot_date_end]
# draw
dataset_tool.dataset_analysis(sf_list, freq_list, id_list, directory_path, dataset_CSV, plot_type, plot_date, rx_tx_node)

Figure 4:

Impact of weather conditions on connectivity in terms of the number of neighbours at the network- and node-level (node 4). Radio parameters are set to SF 7 and 480 MHz.

In [5]:
# save plot output format
plot_type = ["subplot_degree", 'pdf']
# LoRa parameters
sf_list = [7]
freq_list = [480000]
# rx and tx nodes
rx_tx_node = [13, 0]
# plot start and end time
plot_date_start = "2021-05-27 00:00:00"
plot_date_end = "2021-06-01 08:00:00"
plot_date = [plot_date_start, plot_date_end]
# draw
dataset_tool.dataset_analysis(sf_list, freq_list, id_list, directory_path, dataset_CSV, plot_type, plot_date, rx_tx_node)

Figure 5:

Impact of weather conditions on link quality in terms of PRR at the link-level (link #7-5). Radio parameters are set to SF 7 and 480 MHz.

In [6]:
# save plot output format
plot_type = ["subplot_PRR", 'pdf']
# LoRa parameters
sf_list = [7]
freq_list = [480000]
# rx and tx nodes
rx_tx_node = [5, 7]
# plot start and end time
plot_date_start = "2021-05-06 14:00:00"
plot_date_end = "2021-05-11 12:00:00"
plot_date = [plot_date_start, plot_date_end]
# draw
dataset_tool.dataset_analysis(sf_list, freq_list, id_list, directory_path, dataset_CSV, plot_type, plot_date, rx_tx_node)

Draw heatmap and topologies and convert them to GIFs.

Note:

Do not draw with a long period (more than 24 hours), otherwise there will be a lot of figures and the GIF will become huge.

In [7]:
# only plot SF 7 and frequency 480000 for heatmap and topology
sf_list = [7]
freq_list = [480000]
# plot start and end time
plot_date_start = "2021-05-07 00:00:00"
plot_date_end = "2021-05-07 12:00:00"
plot_date = [plot_date_start, plot_date_end]
# save plot output format
plot_type = ["heatmap", "topology", "using_pos2", "png"]
dataset_tool.dataset_analysis(sf_list, freq_list, id_list, directory_path, dataset_CSV, plot_type, plot_date)

Show heatmap GIF

In [9]:
# show the GIF of heatmap
file_prefix = 'Heatmap' + "_SF" + str('{0:02}'.format(sf_list[0])) + "_CH" + str('{0:06}'.format(freq_list[0]))
Image(open(directory_path + "\\" + PROCESSED_PLOTS_FOLDER + "\\" + file_prefix + '.gif','rb').read())
Out[9]: