{"id":2181,"date":"2025-09-01T19:07:11","date_gmt":"2025-09-01T17:07:11","guid":{"rendered":"https:\/\/unica6g.it.uc3m.es\/?page_id=2181"},"modified":"2025-09-03T12:52:36","modified_gmt":"2025-09-03T10:52:36","slug":"how-to-exploit-the-data","status":"publish","type":"page","link":"https:\/\/unica6g.it.uc3m.es\/en\/6g-sorus\/sorusboxscan\/how-to-exploit-the-data\/","title":{"rendered":"6G-SORUS | SorusBoxScan > How to exploit the data"},"content":{"rendered":"<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n<nav class=\"wp-container-2 is-horizontal is-content-justification-space-between is-responsive items-justified-space-between wp-block-navigation\" aria-label=\"SorusBoxScan\"><button aria-haspopup=\"true\" aria-label=\"Open menu\" class=\"wp-block-navigation__responsive-container-open\" data-micromodal-trigger=\"modal-1\">Menu<\/button>\n\t\t\t<div class=\"wp-block-navigation__responsive-container\" style=\"\" id=\"modal-1\">\n\t\t\t\t<div class=\"wp-block-navigation__responsive-close\" tabindex=\"-1\" data-micromodal-close>\n\t\t\t\t\t<div class=\"wp-block-navigation__responsive-dialog\" aria-label=\"Menu\">\n\t\t\t\t\t\t\t<button aria-label=\"Close menu\" data-micromodal-close class=\"wp-block-navigation__responsive-container-close\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewbox=\"0 0 24 24\" width=\"24\" height=\"24\" aria-hidden=\"true\" focusable=\"false\"><path d=\"M13 11.8l6.1-6.3-1-1-6.1 6.2-6.1-6.2-1 1 6.1 6.3-6.5 6.7 1 1 6.5-6.6 6.5 6.6 1-1z\"><\/path><\/svg><\/button>\n\t\t\t\t\t\t<div class=\"wp-block-navigation__responsive-container-content\" id=\"modal-1-content\">\n\t\t\t\t\t\t\t<ul class=\"wp-block-navigation__container\"><li class=\"wp-block-navigation-item wp-block-navigation-link\"><a class=\"wp-block-navigation-item__content\"  href=\"https:\/\/unica6g.it.uc3m.es\/en\/6g-sorus\/sorusboxscan\/\"><span class=\"wp-block-navigation-item__label\">SorusBoxScan<\/span><\/a><\/li><li class=\"wp-block-navigation-item wp-block-navigation-link\"><a class=\"wp-block-navigation-item__content\"  href=\"https:\/\/unica6g.it.uc3m.es\/en\/6g-sorus\/sorusboxscan\/setting-up\/\"><span class=\"wp-block-navigation-item__label\">Setting up the SorusBoxScan Device<\/span><\/a><\/li><li class=\"wp-block-navigation-item wp-block-navigation-link\"><a class=\"wp-block-navigation-item__content\"  href=\"https:\/\/unica6g.it.uc3m.es\/en\/6g-sorus\/sorusboxscan\/example-of-data-collection\/\"><span class=\"wp-block-navigation-item__label\">Example of data collection<\/span><\/a><\/li><li class=\"wp-block-navigation-item current-menu-item wp-block-navigation-link\"><a class=\"wp-block-navigation-item__content\"  href=\"https:\/\/unica6g.it.uc3m.es\/en\/6g-sorus\/sorusboxscan\/how-to-exploit-the-data\/\" aria-current=\"page\"><span class=\"wp-block-navigation-item__label\">How to exploit the data<\/span><\/a><\/li><\/ul>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t<\/div><\/nav>\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<ul><li><a href=\"#using-an-mqtt-client\" data-type=\"internal\" data-id=\"#using-an-mqtt-client\">Using a MQTT client<\/a><\/li><li><a href=\"#using-the-sorusboxscan-sdk\" data-type=\"internal\" data-id=\"#using-the-sorusboxscan-sdk\">Using the SorusBoxScan SDK<\/a><\/li><li><a href=\"#using-the-database-connector\" data-type=\"internal\" data-id=\"#using-the-database-connector\">Using the Database Connector<\/a><\/li><\/ul>\n\n\n\n<h1 id=\"using-an-mqtt-client\">Using an MQTT Client<\/h1>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p>Any MQTT client can be used to receive messages with signal quality measurements as they are generated. This is useful for verifying that the system is working properly before starting a measurement session.<\/p>\n\n\n\n<p>Below are some recommended MQTT clients for different platforms:<\/p>\n\n\n\n<h2 id=\"linux\">Linux<\/h2>\n\n\n\n<ul><li><a href=\"https:\/\/mosquitto.org\/\">Mosquitto<\/a>&nbsp;\u2014 command-line client.<\/li><li><a href=\"https:\/\/mqtt-explorer.com\/\">MQTT Explorer<\/a>&nbsp;\u2014 graphical user interface.<\/li><\/ul>\n\n\n\n<h2 id=\"windows\">Windows<\/h2>\n\n\n\n<ul><li><a href=\"https:\/\/mqtt-explorer.com\/\">MQTT Explorer<\/a>&nbsp;\u2014 graphical user interface.<\/li><\/ul>\n\n\n\n<h2 id=\"android\">Android<\/h2>\n\n\n\n<ul><li><a href=\"https:\/\/play.google.com\/store\/apps\/details?id=at.tripwire.mqtt.client\">My MQTT<\/a><\/li><\/ul>\n\n\n\n<h2 id=\"iphone\">iPhone<\/h2>\n\n\n\n<ul><li>Do you have a favorite? Let us know and we\u2019ll include it!<\/li><\/ul>\n\n\n\n<h1 id=\"using-the-sorusboxscan-sdk\">Using the SorusBoxScan SDK<\/h1>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p>The&nbsp;<a href=\"https:\/\/github.com\/aferre88\/5gdrone-sdk\">SorusBoxScan Python SDK<\/a>&nbsp;provides tools and libraries to help you develop applications for 5G-enabled drones.<\/p>\n\n\n\n<h2 id=\"features\">Features<\/h2>\n\n\n\n<ul><li>Easy integration with 5G drones<\/li><li>Real-time data streaming<\/li><li>Advanced drone control APIs<\/li><li>Comprehensive documentation (in progress)<\/li><\/ul>\n\n\n\n<h2 id=\"prerequisites\">Prerequisites<\/h2>\n\n\n\n<ul><li>A system with Python installed<\/li><li>A virtual environment is recommended for running your project<\/li><li>The SDK is hosted in a private repository, so you need an authenticated Git session. Username\/password prompts will not work on GitHub.<\/li><\/ul>\n\n\n\n<h3 id=\"setting-up-a-virtual-environment\">Setting up a Virtual Environment<\/h3>\n\n\n\n<h4 id=\"on-linux-mac-os-or-similar\">On Linux, Mac OS or similar<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>python -m venv .venv\nsource .venv\/bin\/activate<\/code><\/pre>\n\n\n\n<h4 id=\"on-windows-using-cmd\">On Windows, using CMD<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>python -m venv .venv\n.\\.venv\\Scripts\\activate.bat<\/code><\/pre>\n\n\n\n<h4 id=\"on-windows-using-powershell\">On Windows, using PowerShell<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>python -m venv .venv\n.\\.venv\\Scripts\\activate.ps1<\/code><\/pre>\n\n\n\n<h4 id=\"on-windows-unix-like-shells-eg-git-bash-cli\">On Windows&#8217; UNIX-like shells (e.g. Git Bash CLI)<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>python -m venv .venv\nsource .venv\/Scripts\/activate<\/code><\/pre>\n\n\n\n<h3 id=\"authenticating-with-github\">Authenticating with GitHub<\/h3>\n\n\n\n<ol><li><strong>Install GitHub CLI:<\/strong>In Linux debian-based systems:\n<div class=\"language-bash highlight\">\n<pre><code class=\"md-code__content\"><span id=\"__span-4-1\"><a id=\"__codelineno-4-1\" href=\"https:\/\/aferre88.github.io\/5gdrone-docs\/how-to-exploit-the-data\/2sdk\/#__codelineno-4-1\" name=\"__codelineno-4-1\"><\/a>sudo apt-get update\n<\/span><span id=\"__span-4-2\"><a id=\"__codelineno-4-2\" href=\"https:\/\/aferre88.github.io\/5gdrone-docs\/how-to-exploit-the-data\/2sdk\/#__codelineno-4-2\" name=\"__codelineno-4-2\"><\/a>sudo apt-get install gh\n<\/span><\/code><\/pre>\n<\/div>\n<p>In Windows:<\/p>\n<div class=\"language-sh highlight\">\n<pre><code class=\"md-code__content\"><span id=\"__span-5-1\"><a id=\"__codelineno-5-1\" href=\"https:\/\/aferre88.github.io\/5gdrone-docs\/how-to-exploit-the-data\/2sdk\/#__codelineno-5-1\" name=\"__codelineno-5-1\"><\/a>winget install --id GitHub.cli\n<\/span><\/code><\/pre>\n<\/div>\n<p>Or go to the&nbsp;<a href=\"https:\/\/cli.github.com\/\">GitHub CLI download page<\/a>.<\/p><\/li><li><strong>Authenticate GitHub CLI:<\/strong>\n<div class=\"language-bash highlight\">\n<pre><code class=\"md-code__content\"><span id=\"__span-6-1\"><a id=\"__codelineno-6-1\" href=\"https:\/\/aferre88.github.io\/5gdrone-docs\/how-to-exploit-the-data\/2sdk\/#__codelineno-6-1\" name=\"__codelineno-6-1\"><\/a>gh auth login\n<\/span><\/code><\/pre>\n<\/div>\n<p>&nbsp;<\/p><\/li><li><strong>Follow the prompts to authenticate:<\/strong>\n<ul>\n<li>Select&nbsp;<code>GitHub.com<\/code>.<\/li>\n<li>Choose&nbsp;<code>HTTPS<\/code>&nbsp;as the preferred protocol.<\/li>\n<li>Authenticate with your preferred method (browser or token).<\/li>\n<\/ul>\n<\/li><\/ol>\n\n\n\n<p>Now your Git session is authenticated for GitHub on both Linux and Windows using the GitHub CLI.<\/p>\n\n\n\n<p>You can now use git on GitHub&#8217;s private repositories you have access to just like if they were public.<\/p>\n\n\n\n<h2 id=\"installation\">Installation<\/h2>\n\n\n\n<p>To install the SDK:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>pip install git+https:\/\/github.com\/aferre88\/5gdrone-sdk<\/code><\/pre>\n\n\n\n<p>If your project has a&nbsp;<code>requirements.txt<\/code>, you can run&nbsp;<code>pip freeze &gt; requirements.txt<\/code>&nbsp;to pin the dependency.<\/p>\n\n\n\n<h2 id=\"update\">Update<\/h2>\n\n\n\n<p>To upgrade the SDK to the latest version:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>pip install git+https:\/\/github.com\/aferre88\/5gdrone-sdk -U<\/code><\/pre>\n\n\n\n<h2 id=\"usage\">Usage<\/h2>\n\n\n\n<p>Here\u2019s a basic example to get started. You can use this as a template:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\"\"\"\nThis is an example of how to use the FiveGDroneSDK class to subscribe to the signals topic.\n\"\"\"\n\nfrom fivegdrone_sdk import FiveGDroneSDK\n\n# Environment variables\nMQTT_BROKER = \"mqtt.eclipse.org\"\nMQTT_USERNAME = \"username\"\nMQTT_PASSWORD = \"password\"\nMQTT_PORT = 1883\n\n# Create a new instance of the SDK\nhat = FiveGDroneSDK(MQTT_BROKER, MQTT_PORT, MQTT_USERNAME, MQTT_PASSWORD)\n\n\n# The @hat.signals decorator is used to subscribe to the signals topic\n# The signal_printer function will be called every time a signal is received\n# The signal object is passed as an argument to the function\n@hat.signals\ndef signal_printer(signal):\n    \"\"\"\n    In this example, all the attributes of the signal object are printed,\n    but you can modify the function to do whatever you want with the signal.\n\n    E.g. if you only need the rssi attribute, you can modify the function like this:\n\n    @hat.signals\n    def print_only_rssi(signal):\n        print(f\"Received signal: {signal.rssi}\")\n    \"\"\"\n    print(\"Received signal:\")\n    for attr, value in signal.__dict__.items():\n        if attr == \"position\":\n            print(f\"  {attr}:\")\n            for attr_val, value_val in value.__dict__.items():\n                print(f\"    {attr_val}: {value_val}\")\n            print(f\"    decimal degrees: {value.get_decimal_position()}\")\n            print(f\"    degrees, minutes, seconds: {value.get_dms_position()}\")\n        else:\n            print(f\"  {attr}: {value}\")\n\n\n# Starts the MQTT session and blocks the main thread so the program doesn't end\n# If you want the program to end, you can substitute the start_blocking method\n# with the hat.start_async() method.\nhat.start_blocking()<\/code><\/pre>\n\n\n\n<h3 id=\"basic-integration\">Basic integration<\/h3>\n\n\n\n<h4 id=\"import-the-sdk\">Import the SDK<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>from fivegdrone_sdk import FiveGDroneSDK<\/code><\/pre>\n\n\n\n<h4 id=\"setup-the-connection-to-the-drones-queue\">Setup the connection to the drone&#8217;s queue<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>hat = FiveGDroneSDK(MQTT_BROKER, MQTT_PORT, MQTT_USERNAME, MQTT_PASSWORD)<\/code><\/pre>\n\n\n\n<h4 id=\"create-a-signals-handling-function\">Create a signal&#8217;s handling function<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>@hat.signals\ndef signal_handling_function(signal):\n    print(f\"Signal received in band {signal.frequency_band}\")<\/code><\/pre>\n\n\n\n<p>Your function will be called for every signal received from the drone.<\/p>\n\n\n\n<p>Check the&nbsp;<a href=\"https:\/\/aferre88.github.io\/5gdrone-docs\/how-to-exploit-the-data\/2sdk\/#the-signal-class\">list of attributes for the Signal class<\/a>.<\/p>\n\n\n\n<p>Instead of the&nbsp;<code>@hat.signals<\/code>&nbsp;decorator, you can use the&nbsp;<code>@hat.raw_signals<\/code>&nbsp;decorator to receive all the information in a single string rather than a Signal object.<\/p>\n\n\n\n<h4 id=\"loop-the-connection\">Loop the connection<\/h4>\n\n\n\n<p>You need to trigger the connection loop in order for the MQTT handler to process the messages.<\/p>\n\n\n\n<p>Typically you will need to block the execution of the script to avoid the program exiting rather than keeping the connection open indefinitelly, for doing this, you can use this sentence:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>hat.start_blocking()<\/code><\/pre>\n\n\n\n<h5 id=\"asyncronous-loop\">Asyncronous loop<\/h5>\n\n\n\n<p>If you don&#8217;t want to block the execution of the script (e.g. you are handling your own threads), you can use the non-blocking alternative:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>hat.start_async()<\/code><\/pre>\n\n\n\n<h4 id=\"sending-messages-to-the-queue\">Sending messages to the queue<\/h4>\n\n\n\n<p>Messages can be passed to the queue in order to control the drone or to return information that might be useful for other consumers connected to the queue.<\/p>\n\n\n\n<h5 id=\"sending-an-at-command-to-the-hat\">Sending an AT command to the hat<\/h5>\n\n\n\n<p>E.g. to send the AT message to turn on the GPS module<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>hat.send('control\/command', 'AT+CGPS=1')<\/code><\/pre>\n\n\n\n<h5 id=\"sending-instructions-to-the-drone-operator-via-the-instructions-topic\">Sending instructions to the drone operator via the instructions topic<\/h5>\n\n\n\n<pre class=\"wp-block-code\"><code>hat.send('instructions', 'Go to (53,47)')<\/code><\/pre>\n\n\n\n<h4 id=\"subscribe-and-unsubscribe\">Subscribe and unsubscribe<\/h4>\n\n\n\n<p>You can subscribe yourself to arbitrary topics in the MQTT server. This allows you to exchange information between different related systems.<\/p>\n\n\n\n<h5 id=\"example-subscription-to-the-instructions-queue\">Example subscription to the instructions queue<\/h5>\n\n\n\n<pre class=\"wp-block-code\"><code>def do_for_each_instructions_message(client, userdata, message):\n    print(f\"Instructions message: {message.payload.decode()}\")\n\nhat.subscribe('instructions', 2, do_for_each_instructions_message) # Topic, QOS, callback<\/code><\/pre>\n\n\n\n<p>You can later undo the subscription with:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>hat.unsubscribe('instructions', do_for_each_instructions_message)<\/code><\/pre>\n\n\n\n<h4 id=\"other-functions\">Other functions<\/h4>\n\n\n\n<h5 id=\"to-ask-the-hat-to-pause-sending-signals\">To ask the hat to pause sending signals<\/h5>\n\n\n\n<pre class=\"wp-block-code\"><code>hat.pause()<\/code><\/pre>\n\n\n\n<h5 id=\"to-ask-the-hat-to-resume-sending-signals\">To ask the hat to resume sending signals<\/h5>\n\n\n\n<pre class=\"wp-block-code\"><code>hat.resume()<\/code><\/pre>\n\n\n\n<h5 id=\"to-stop-the-loop-and-disconnect-from-the-mqtt-server\">To stop the loop and disconnect from the MQTT server<\/h5>\n\n\n\n<pre class=\"wp-block-code\"><code>hat.stop()<\/code><\/pre>\n\n\n\n<h2 id=\"the-signal-class\">The Signal class<\/h2>\n\n\n\n<p>The&nbsp;<code>Signal<\/code>&nbsp;class represents signals received from the drone. It is designed to handle various types of signals and provides methods to access and represent these signals.<\/p>\n\n\n\n<h3 id=\"attributes\">Attributes<\/h3>\n\n\n\n<ul><li><code>position<\/code>&nbsp;(<a href=\"https:\/\/aferre88.github.io\/5gdrone-docs\/how-to-exploit-the-data\/2sdk\/#nested-class-gpsposition\">GPSPosition<\/a>): The GPS position data.<\/li><li><code>system_mode<\/code>&nbsp;(str): The type of network used by the drone.<\/li><li><code>operation_mode<\/code>&nbsp;(str): The mode of operation of the hat. It will usually be&nbsp;<code>Online<\/code>.<\/li><li><code>mcc<\/code>&nbsp;(str): The Mobile Country Code.<\/li><li><code>mnc<\/code>&nbsp;(str): The Mobile Network Code.<\/li><li><code>tac<\/code>&nbsp;(str): The Tracking Area Code.<\/li><li><code>scell_id<\/code>&nbsp;(str): The serving cell ID.<\/li><li><code>pcell_id<\/code>&nbsp;(str): The primary cell ID.<\/li><li><code>frequency_band<\/code>&nbsp;(str): The frequency band.<\/li><li><code>earfcn<\/code>&nbsp;(str): The E-UTRA Absolute Radio Frequency Channel Number.<\/li><li><code>dlbw<\/code>&nbsp;(str): The downlink bandwidth.<\/li><li><code>ulbw<\/code>&nbsp;(str): The uplink bandwidth.<\/li><li><code>rsrq<\/code>&nbsp;(str): The Reference Signal Received Quality.<\/li><li><code>rsrp<\/code>&nbsp;(str): The Reference Signal Received Power.<\/li><li><code>rssi<\/code>&nbsp;(str): The Received Signal Strength Indicator.<\/li><li><code>rssnr<\/code>&nbsp;(str): The Reference Signal Signal-to-Noise Ratio.<\/li><li><code>snr<\/code>&nbsp;(str): The Signal-to-Noise Ratio.<\/li><li><code>scs<\/code>&nbsp;(str): The Subcarrier Spacing.<\/li><li><code>nr_dl_bw<\/code>&nbsp;(str): The NR downlink bandwidth.<\/li><\/ul>\n\n\n\n<p>Note that not all attributes will be set in all signals, as the device might be connected to multiple bands.<\/p>\n\n\n\n<h4 id=\"when-connected-to-a-lte-network\">When connected to a LTE network<\/h4>\n\n\n\n<p>You will receive one signal with the following attributes:<\/p>\n\n\n\n<ul><li><code>position<\/code>&nbsp;(<a href=\"https:\/\/aferre88.github.io\/5gdrone-docs\/how-to-exploit-the-data\/2sdk\/#nested-class-gpsposition\">GPSPosition<\/a>): The GPS position data.<\/li><li><code>system_mode<\/code>&nbsp;(str): The type of network used by the drone.<\/li><li><code>operation_mode<\/code>&nbsp;(str): The mode of operation of the hat. It will usually be&nbsp;<code>Online<\/code>.<\/li><li><code>mcc<\/code>&nbsp;(str): The Mobile Country Code.<\/li><li><code>mnc<\/code>&nbsp;(str): The Mobile Network Code.<\/li><li><code>tac<\/code>&nbsp;(str): The Tracking Area Code.<\/li><li><code>scell_id<\/code>&nbsp;(str): The serving cell ID.<\/li><li><code>pcell_id<\/code>&nbsp;(str): The primary cell ID.<\/li><li><code>frequency_band<\/code>&nbsp;(str): The frequency band.<\/li><li><code>earfcn<\/code>&nbsp;(str): The E-UTRA Absolute Radio Frequency Channel Number.<\/li><li><code>dlbw<\/code>&nbsp;(str): The downlink bandwidth.<\/li><li><code>ulbw<\/code>&nbsp;(str): The uplink bandwidth.<\/li><li><code>rsrq<\/code>&nbsp;(str): The Reference Signal Received Quality.<\/li><li><code>rsrp<\/code>&nbsp;(str): The Reference Signal Received Power.<\/li><li><code>rssi<\/code>&nbsp;(str): The Received Signal Strength Indicator.<\/li><li><code>rssnr<\/code>&nbsp;(str): The Reference Signal Signal-to-Noise Ratio.<\/li><\/ul>\n\n\n\n<p><code>system_node<\/code>&nbsp;will be&nbsp;<code>LTE<\/code>.<\/p>\n\n\n\n<h4 id=\"when-connected-to-a-5g-nsa-network\">When connected to a 5G NSA network<\/h4>\n\n\n\n<p>You will receive a&nbsp;<code>LTE<\/code>&nbsp;signal following the previous definition, and one or more signals with&nbsp;<code>system_mode<\/code>&nbsp;set to&nbsp;<code>NR5G_NSA<\/code>&nbsp;and the following attributes:<\/p>\n\n\n\n<ul><li><code>position<\/code>&nbsp;(<a href=\"https:\/\/aferre88.github.io\/5gdrone-docs\/how-to-exploit-the-data\/2sdk\/#nested-class-gpsposition\">GPSPosition<\/a>): The GPS position data.<\/li><li><code>system_mode<\/code>&nbsp;(str): The type of network used by the drone.<\/li><li><code>pcell_id<\/code>&nbsp;(str): The primary cell ID.<\/li><li><code>frequency_band<\/code>&nbsp;(str): The frequency band.<\/li><li><code>earfcn<\/code>&nbsp;(str): The E-UTRA Absolute Radio Frequency Channel Number.<\/li><li><code>rsrp<\/code>&nbsp;(str): The Reference Signal Received Power.<\/li><li><code>rsrq<\/code>&nbsp;(str): The Reference Signal Received Quality.<\/li><li><code>snr<\/code>&nbsp;(str): The Signal-to-Noise Ratio.<\/li><li><code>scs<\/code>&nbsp;(str): The Subcarrier Spacing.<\/li><li><code>nr_dl_bw<\/code>&nbsp;(str): The NR downlink bandwidth.<\/li><\/ul>\n\n\n\n<h4 id=\"when-connected-to-a-5g-sa-network\">When connected to a 5G SA network<\/h4>\n\n\n\n<p>You will receive signals with the&nbsp;<code>system_mode<\/code>&nbsp;set to&nbsp;<code>NR5G_SA<\/code>, and the following attributes:<\/p>\n\n\n\n<ul><li><code>position<\/code>&nbsp;(<a href=\"https:\/\/aferre88.github.io\/5gdrone-docs\/how-to-exploit-the-data\/2sdk\/#nested-class-gpsposition\">GPSPosition<\/a>): The GPS position data.<\/li><li><code>system_mode<\/code>&nbsp;(str): The type of network used by the drone.<\/li><li><code>operation_mode<\/code>&nbsp;(str): The mode of operation of the hat. It will usually be&nbsp;<code>Online<\/code>.<\/li><li><code>mcc<\/code>&nbsp;(str): The Mobile Country Code.<\/li><li><code>mnc<\/code>&nbsp;(str): The Mobile Network Code.<\/li><li><code>tac<\/code>&nbsp;(str): The Tracking Area Code.<\/li><li><code>scell_id<\/code>&nbsp;(str): The serving cell ID.<\/li><li><code>pcell_id<\/code>&nbsp;(str): The primary cell ID.<\/li><li><code>frequency_band<\/code>&nbsp;(str): The frequency band.<\/li><li><code>earfcn<\/code>&nbsp;(str): The E-UTRA Absolute Radio Frequency Channel Number.<\/li><li><code>rsrp<\/code>&nbsp;(str): The Reference Signal Received Power.<\/li><li><code>rsrq<\/code>&nbsp;(str): The Reference Signal Received Quality.<\/li><li><code>snr<\/code>&nbsp;(str): The Signal-to-Noise Ratio.<\/li><\/ul>\n\n\n\n<h4 id=\"when-not-connected-to-a-network\">When not connected to a network<\/h4>\n\n\n\n<p>You will receive signals with the&nbsp;<code>system_mode<\/code>&nbsp;set to&nbsp;<code>NO SERVICE<\/code>, and the following attributes:<\/p>\n\n\n\n<ul><li><code>position<\/code>&nbsp;(<a href=\"https:\/\/aferre88.github.io\/5gdrone-docs\/how-to-exploit-the-data\/2sdk\/#nested-class-gpsposition\">GPSPosition<\/a>): The GPS position data.<\/li><li><code>system_mode<\/code>&nbsp;(str): The type of network used by the drone.<\/li><li><code>operation_mode<\/code>&nbsp;(str): The mode of operation of the hat. It will usually be&nbsp;<code>Online<\/code>.<\/li><\/ul>\n\n\n\n<h3 id=\"nested-class-gpsposition\">Nested Class: GPSPosition<\/h3>\n\n\n\n<p>The&nbsp;<code>GPSPosition<\/code>&nbsp;class represents GPS position data.<\/p>\n\n\n\n<h4 id=\"methods\">Methods<\/h4>\n\n\n\n<h5 id=\"get_datetimeself\"><code>get_datetime(self)<\/code><\/h5>\n\n\n\n<p>Returns the date and time reported by the GPS service.<\/p>\n\n\n\n<p><strong>Returns:<\/strong>&nbsp;&#8211;&nbsp;<code>datetime<\/code>: Date and time reported by the GPS service.<\/p>\n\n\n\n<h5 id=\"get_positionself\"><code>get_position(self)<\/code><\/h5>\n\n\n\n<p>Returns the GPS position in DDMM.MMMMMM format (decimal minutes).<\/p>\n\n\n\n<p><strong>Returns:<\/strong>&nbsp;&#8211;&nbsp;<code>tuple<\/code>: A tuple containing the latitude and longitude of the GPS position. &#8211;&nbsp;<code>float<\/code>: Latitude in DDMM.MMMMMM format. &#8211;&nbsp;<code>str<\/code>: Latitude direction (N or S). &#8211;&nbsp;<code>float<\/code>: Longitude in DDMM.MMMMMM format. &#8211;&nbsp;<code>str<\/code>: Longitude direction (E or W).<\/p>\n\n\n\n<h5 id=\"get_decimal_positionself\"><code>get_decimal_position(self)<\/code><\/h5>\n\n\n\n<p>Returns the GPS position in decimal degrees.<\/p>\n\n\n\n<p><strong>Returns:<\/strong>&nbsp;&#8211;&nbsp;<code>tuple<\/code>: A tuple containing the latitude and longitude of the GPS position. &#8211;&nbsp;<code>float<\/code>: Latitude in decimal degrees. &#8211;&nbsp;<code>float<\/code>: Longitude in decimal degrees.<\/p>\n\n\n\n<h5 id=\"get_dms_positionself\"><code>get_dms_position(self)<\/code><\/h5>\n\n\n\n<p>Returns the GPS position in sexagesimal format.<\/p>\n\n\n\n<p><strong>Returns:<\/strong>&nbsp;&#8211;&nbsp;<code>tuple<\/code>: A tuple containing the latitude and longitude of the GPS position. &#8211;&nbsp;<code>tuple<\/code>: A tuple containing the latitude in sexagesimal format. &#8211;&nbsp;<code>int<\/code>: Degrees. &#8211;&nbsp;<code>int<\/code>: Minutes. &#8211;&nbsp;<code>float<\/code>: Seconds. &#8211;&nbsp;<code>str<\/code>: Direction (N or S). &#8211;&nbsp;<code>tuple<\/code>: A tuple containing the longitude in sexagesimal format. &#8211;&nbsp;<code>int<\/code>: Degrees. &#8211;&nbsp;<code>int<\/code>: Minutes. &#8211;&nbsp;<code>float<\/code>: Seconds. &#8211;&nbsp;<code>str<\/code>: Direction (E or W).<\/p>\n\n\n\n<h5 id=\"get_altitude_metersself\"><code>get_altitude_meters(self)<\/code><\/h5>\n\n\n\n<p>Returns the altitude of the GPS position in meters.<\/p>\n\n\n\n<p><strong>Returns:<\/strong>&nbsp;&#8211;&nbsp;<code>float<\/code>: The altitude of the GPS in meters.<\/p>\n\n\n\n<h5 id=\"get_speed_knotsself\"><code>get_speed_knots(self)<\/code><\/h5>\n\n\n\n<p>Returns the speed of the GPS position in knots.<\/p>\n\n\n\n<p><strong>Returns:<\/strong>&nbsp;&#8211;&nbsp;<code>float<\/code>: The speed of the GPS in knots.<\/p>\n\n\n\n<h5 id=\"get_speed_kmhself\"><code>get_speed_kmh(self)<\/code><\/h5>\n\n\n\n<p>Returns the speed of the GPS position in km\/h.<\/p>\n\n\n\n<p><strong>Returns:<\/strong>&nbsp;&#8211;&nbsp;<code>float<\/code>: The speed of the GPS in km\/h.<\/p>\n\n\n\n<h5 id=\"get_courseself\"><code>get_course(self)<\/code><\/h5>\n\n\n\n<p>Returns the course of the GPS position.<\/p>\n\n\n\n<p><strong>Returns:<\/strong>&nbsp;&#8211;&nbsp;<code>float<\/code>: The course of the GPS position.<\/p>\n\n\n\n<h1 id=\"using-the-database-connector\">Using the Database Connector<\/h1>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p>The&nbsp;<a href=\"https:\/\/github.com\/aferre88\/5gdrone-sdk\">SorusBoxScan DB Connector<\/a>&nbsp;is a tool based on the&nbsp;<a href=\"https:\/\/aferre88.github.io\/5gdrone-docs\/how-to-exploit-the-data\/2sdk\/\">SorusBoxScan Python SDK<\/a>&nbsp;that stores each received signal in a MariaDB database.<\/p>\n\n\n\n<h2 id=\"prerequisites\">Prerequisites<\/h2>\n\n\n\n<ul><li>Python 3.8+<\/li><li>If you&#8217;re using Linux, install the MariaDB binary libraries:\n<div class=\"language-sh highlight\">\n<pre><code class=\"md-code__content\"><span id=\"__span-0-1\"><a id=\"__codelineno-0-1\" href=\"https:\/\/aferre88.github.io\/5gdrone-docs\/how-to-exploit-the-data\/3db\/#__codelineno-0-1\" name=\"__codelineno-0-1\"><\/a>sudo apt install libmariadb3 libmariadb-dev\n<\/span><\/code><\/pre>\n<\/div>\n<\/li><\/ul>\n\n\n\n<h2 id=\"create-the-database-structure\">Create the database structure<\/h2>\n\n\n\n<p>Run the following SQL script in your MariaDB instance:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>CREATE TABLE signals (\n    id INT(11) NOT NULL AUTO_INCREMENT,\n    lat DECIMAL(10,6) DEFAULT NULL,\n    lon DECIMAL(10,6) DEFAULT NULL,\n    datetime DATETIME DEFAULT NULL,\n    alt DECIMAL(10,2) DEFAULT NULL,\n    speed DECIMAL(10,2) DEFAULT NULL,\n    course DECIMAL(10,2) DEFAULT NULL,\n    system_mode VARCHAR(50) DEFAULT NULL,\n    operation_mode VARCHAR(50) DEFAULT NULL,\n    mcc VARCHAR(10) DEFAULT NULL,\n    mnc VARCHAR(10) DEFAULT NULL,\n    tac VARCHAR(10) DEFAULT NULL,\n    scell_id VARCHAR(50) DEFAULT NULL,\n    pcell_id VARCHAR(50) DEFAULT NULL,\n    frequency_band VARCHAR(50) DEFAULT NULL,\n    earfcn VARCHAR(50) DEFAULT NULL,\n    dlbw VARCHAR(50) DEFAULT NULL,\n    ulbw VARCHAR(50) DEFAULT NULL,\n    rsrq VARCHAR(50) DEFAULT NULL,\n    rsrp VARCHAR(50) DEFAULT NULL,\n    rssi VARCHAR(50) DEFAULT NULL,\n    rssnr VARCHAR(50) DEFAULT NULL,\n    snr VARCHAR(50) DEFAULT NULL,\n    scs VARCHAR(50) DEFAULT NULL,\n    nr_dl_bw VARCHAR(50) DEFAULT NULL,\n    PRIMARY KEY (id)\n);<\/code><\/pre>\n\n\n\n<h2 id=\"configure-environment-variables\">Configure Environment Variables<\/h2>\n\n\n\n<p>Create a&nbsp;<code>.env<\/code>&nbsp;file in the project root. You can use&nbsp;<code>.env.example<\/code>&nbsp;as a template.<\/p>\n\n\n\n<h2 id=\"run-the-project\">Run the Project<\/h2>\n\n\n\n<p>Use the following command to start the connector:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>python -m fivegdrone_db<\/code><\/pre>","protected":false},"excerpt":{"rendered":"<p>Using a MQTT client Using the SorusBoxScan SDK Using the Database Connector Using an MQTT Client Any MQTT client can be used to receive messages with signal quality measurements as they are generated. This is useful for verifying that the system is working properly before starting a measurement session. Below are some recommended MQTT clients&hellip; <br \/> <a class=\"read-more\" href=\"https:\/\/unica6g.it.uc3m.es\/en\/6g-sorus\/sorusboxscan\/how-to-exploit-the-data\/\">Read more<\/a><\/p>","protected":false},"author":1,"featured_media":0,"parent":2170,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":[],"_links":{"self":[{"href":"https:\/\/unica6g.it.uc3m.es\/en\/wp-json\/wp\/v2\/pages\/2181"}],"collection":[{"href":"https:\/\/unica6g.it.uc3m.es\/en\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/unica6g.it.uc3m.es\/en\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/unica6g.it.uc3m.es\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unica6g.it.uc3m.es\/en\/wp-json\/wp\/v2\/comments?post=2181"}],"version-history":[{"count":9,"href":"https:\/\/unica6g.it.uc3m.es\/en\/wp-json\/wp\/v2\/pages\/2181\/revisions"}],"predecessor-version":[{"id":2299,"href":"https:\/\/unica6g.it.uc3m.es\/en\/wp-json\/wp\/v2\/pages\/2181\/revisions\/2299"}],"up":[{"embeddable":true,"href":"https:\/\/unica6g.it.uc3m.es\/en\/wp-json\/wp\/v2\/pages\/2170"}],"wp:attachment":[{"href":"https:\/\/unica6g.it.uc3m.es\/en\/wp-json\/wp\/v2\/media?parent=2181"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}