Balena Rtl Power: a balenaLabs Residency project

Why?

Common wireless systems rely on a some form of radio waves. These waves are differentiated by frequency bands(Hz) so that they have a particular use case that can fit the benefits of the band.

Lower frequency bands have a longer range but are more affected by obstructions and have less data bandwidth while Higher frequency bands have a shorter range but are less affected by signal obstructions and have more data bandwidth. For example, WLAN(WiFi) uses a form of radio waves in either the 2.4 GHz, 5 GHz or the newer 6 GHz bands while applications like navigational radio beacons and transoceanic air traffic control use a much lower frequency band.

The problem comes when trying to actually understand these various signals around you. You often need to either become a near expert or spend most of your time studying radio technology to fully grok it. Plus, you won’t know if you may need specialized radio equipment. Why can’t we have a flexible way to visualize it to have a point of entry in understanding these signals? e.g At this particular time(and/or location), this frequency band is the strongest by the looks of this graph because the color is stronger.

The project

Hence, Balena RTL Power, a project to visualize and analyze signal frequency bands in a more simple and general way. This will be using a Software Defined Radio(SDR), rtl power and balena! A brief overview of the project:

Block diagram:

  • RTL-SDR - A cheap SDR thats a great starting point in working with SDRs. An SDR is a really useful and flexible system in which radio configuration is easily done through software where originally it was done through different hardware. So, 5+ radio hardwares for analyzing low-band to high-band frequencies becomes only 1 hardware with an SDR.
  • rtl_power - the software that configures how the SDR will operate. It configures what range of frequencies to cover, at what tuning, and also outputs the data that is being read.
  • grtlp - a wrapper function I wrote in Golang so that the data can be sent through MQTT
  • MQTT - a lightweight messaging protocol that is suitable for IoT usecases.
  • Connector - a balena block that automatically connects data sources with data sinks e.g, mqtt to influxdb.
  • InfluxDB - InfluxDB is a time series database that is ideal for data such as sensor readings or our signal power data.
  • Dashboard - The primary output of this project. We will be using balena-dash, which is a balena block that provides a Grafana dashboard where you can easily visualize your data on your browser. This iteration’s output will primarily be a Grafana heatmap to properly visualize the power of each frequency band at a certain time. Each band will be it’s own row and the color intensity of a block will represent the power. Sort of like this:

    Where the top row is the higher frequency band and the lower frequency band is at the bottom row.

That’s all I have for now. I’ll be posting more details of the project and update as I move along!

2 Likes

Good job @jaomaloy very informative! Looking forward to test your project!

1 Like

Status of the project

December 23, 2021

I am able to display the data of each band that has been computed.


However, this isn’t the final output I want it to have. This may actually be useful to display individual bands but I want a holistic view of the whole range that has been selected by the user. This particular picture is based on the range of 860MHz to 870MHz with a step of 200kHz.

Excited to see this project on the hub! I am a sucker for anything SDR!

//Sam
balenaPhono
balenaBlynk

1 Like

A little bit about the configuration

The main thing you have to do when running the project will have to be setting 3 device variables. The lower band (LOWER_BAND), upper band (UPPER_BAND), and bin size (BIN_SIZE). This is to tell rtl_power which range of frequency bands it has to scan (Lower band to Upper band) and what the sizes of each bin (Bin size) are.

Using the example from my most recent update, we have a lower band of 860MHz and an upper band of 870MHz with a bin size of 200kHz. This means that we analyze the frequencies between 860MHz to 870MHz and we divide the range into 50 200kHz bins. Then, rtl_power scans for the strength of each bin.

There are a couple more things you can configure to your liking, but more information on that in the repo!

Status of the project

Jan 06, 2022

I have finally configured the grafana dashboard to display a heatmap! This is the generated heatmap in the dashboard

and its full-size view can show you more detail in terms of the bins being displayed.

Compared to the per band data graph, this display gives you a visual overview of every band you have examined from the range specified. This drastically simplifies the analysis you have to do. Using the same example configuration as before (860MHz:870MHz:200kHz), we can clearly see that the bands with the strongest signal strengths range between the 862MHz - 865MHz bands.

You may notice that there are spaces in between data points that makes it look a little different from the desired output I showed in the initial post. This is because of the queries done to fill these data bins. Currently, the queries are done one at a time so there are noticable spaces between datapoints. When zoomed in, this is how it looks:

I hypothesize that optimizing these queries will improve the look of the heatmap. That will be another improvement in the future.