{"id":2174,"date":"2025-09-01T19:00:09","date_gmt":"2025-09-01T17:00:09","guid":{"rendered":"https:\/\/unica6g.it.uc3m.es\/?page_id=2174"},"modified":"2025-09-02T14:20:08","modified_gmt":"2025-09-02T12:20:08","slug":"setting-up","status":"publish","type":"page","link":"https:\/\/unica6g.it.uc3m.es\/en\/6g-sorus\/sorusboxscan\/setting-up\/","title":{"rendered":"6G-SORUS | SorusBoxScan > Setting up the SorusBoxScan Device"},"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 current-menu-item wp-block-navigation-link\"><a class=\"wp-block-navigation-item__content\"  href=\"https:\/\/unica6g.it.uc3m.es\/en\/6g-sorus\/sorusboxscan\/setting-up\/\" aria-current=\"page\"><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 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\/\"><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<p>This page will guide you through the installation of the software required to run the device.&nbsp;<a href=\"https:\/\/www.waveshare.com\/w\/upload\/d\/d8\/SIM8202G-M2-5G-HAT-Assembly-en.jpg\">Details on the physical mounting of the device<\/a>&nbsp;can be found on the manufacturer&#8217;s website.<\/p>\n\n\n\n<p>You might also find the&nbsp;<a href=\"https:\/\/www.waveshare.com\/wiki\/SIM8200EA-M2_5G_HAT\">official documentation for the SIM8200EA-M2 5G HAT<\/a>&nbsp;helpful.<\/p>\n\n\n\n<h2>Prerrequisites<\/h2>\n\n\n\n<ol><li>The device must be physically assembled.<\/li><li>A SIM card must be installed. SIM cards with PIN codes are currently not supported, though support may be added in the future. The SIM must provide network access.<\/li><li>The device must have Ubuntu installed. You can follow the&nbsp;<a href=\"https:\/\/ubuntu.com\/download\/raspberry-pi\">official Ubuntu documentation<\/a>&nbsp;to complete this step.<\/li><li>You must have root console access to the device, either physically or via SSH.<\/li><\/ol>\n\n\n\n<h2 id=\"connecting-to-the-network\">Connecting to the Network<\/h2>\n\n\n\n<p>First, install the required packages:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt update\nsudo apt install libqmi-utils udhcpc<\/code><\/pre>\n\n\n\n<p>Then, establish the connection. You may want to create a shell script to connect to the network on startup:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#!\/bin\/sh\n\n\/usr\/bin\/qmi-network \/dev\/cdc-wdm0 start\n\/usr\/bin\/ip link set wwan0 up\n\/usr\/sbin\/udhcpc -q -f -n -i wwan0<\/code><\/pre>\n\n\n\n<p>If you need to set the APN, do so in&nbsp;<code>\/etc\/qmi-network.conf<\/code>. For example, for Movistar in Spain:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>APN=telefonica.es<\/code><\/pre>\n\n\n\n<h2 id=\"installing-the-control-software\">Installing the control software<\/h2>\n\n\n\n<p>The&nbsp;<a href=\"https:\/\/github.com\/aferre88\/5gdrone\">control software<\/a>&nbsp;is a Python application that connects to the HAT via serial interface and to the MQTT server via the Raspberry Pi&#8217;s network connection (whether through the HAT modem, Ethernet port, or Wi-Fi antenna).<\/p>\n\n\n\n<p>Upon establishing a connection with the HAT, the software issues two AT commands:<\/p>\n\n\n\n<ul><li><code>AT+CGPSINFO=1<\/code>&nbsp;to start receiving geopositioning data.<\/li><li><code>AT+CPSI=1<\/code>&nbsp;to start receiving network quality and connectivity data.<\/li><\/ul>\n\n\n\n<p>The HAT will then send geopositioning and network quality data every second. For each valid network data message, the control software sends a geo-tagged message to the MQTT server.<\/p>\n\n\n\n<p>Messages received from the HAT<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><a href=\"https:\/\/aferre88.github.io\/5gdrone-docs\/install\/#__codelineno-3-1\"><\/a>DEBUG:hat:&lt; +CGPSINFO: XXX.XXXXXX,N,XXX.XXXXXX,W,220725,170219.0,654.9,0.0,0.0\n<a href=\"https:\/\/aferre88.github.io\/5gdrone-docs\/install\/#__codelineno-3-2\"><\/a>DEBUG:hat:&lt; +CPSI: LTE,Online,214-07,0x6FB9,73795850,13,EUTRAN-BAND3,1301,5,5,-192,-773,-374,3<\/code><\/pre>\n\n\n\n<p>Message sent to the MQTT server<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>DEBUG:mqtt:signal\/EUTRAN-BAND3>XXX.XXXXXX,N,XXX.XXXXXX,W,220725,170219.0,654.9,0.0,0.0,LTE,Online,214-07,0x6FB9,73795850,13,EUTRAN-BAND3,1301,5,5,-192,-773,-374,3<\/code><\/pre>\n\n\n\n<p>If no geopositioning data is available, the message is discarded.<\/p>\n\n\n\n<p>In some cases, the HAT may report signal quality for multiple bands. When this occurs, the software will send multiple messages to the MQTT server, each containing the same position and timestamp but for different bands.<\/p>\n\n\n\n<p>The control software is distributed as a&nbsp;<a href=\"https:\/\/snapcraft.io\/\">Snap package<\/a>. You can download the latest Snap package from the&nbsp;<a href=\"https:\/\/github.com\/aferre88\/5gdrone\/releases\">Releases section on GitHub<\/a>.<\/p>\n\n\n\n<p>If you need to run a modified version of the software, install Snapcraft and build your own package:<\/p>\n\n\n\n<p><strong>Building a custom snap package<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><a href=\"https:\/\/aferre88.github.io\/5gdrone-docs\/install\/#__codelineno-5-1\"><\/a>sudo apt update\n<a href=\"https:\/\/aferre88.github.io\/5gdrone-docs\/install\/#__codelineno-5-2\"><\/a>sudo apt install snapcraft git\n<a href=\"https:\/\/aferre88.github.io\/5gdrone-docs\/install\/#__codelineno-5-3\"><\/a>git clone https:\/\/github.com\/aferre88\/5gdrone.git\n<a href=\"https:\/\/aferre88.github.io\/5gdrone-docs\/install\/#__codelineno-5-4\"><\/a>cd 5gdrone\n<a href=\"https:\/\/aferre88.github.io\/5gdrone-docs\/install\/#__codelineno-5-5\"><\/a># Make the necessary changes\n<a href=\"https:\/\/aferre88.github.io\/5gdrone-docs\/install\/#__codelineno-5-6\"><\/a>snapcraft\n<\/code><\/pre>\n\n\n\n<p>A <code>.snap<\/code> file will be created in the directory. This is the package you&#8217;ll need to install instead of the downloaded one.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>wget https:\/\/github.com\/aferre88\/5gdrone\/releases\/download\/2024.10.1\/5gdrone_2024.10.1_arm64.snap\nsudo snap install .\/5gdrone_2024.10.1_arm64.snap --dangerous # <\/code><\/pre>\n\n\n\n<h3 id=\"pointing-to-the-correct-mqtt-server\">Pointing to the correct MQTT server<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo snap set 5gdrone mqtt.host=mqtt.uc3m.es\nsudo snap set 5gdrone mqtt.port=8883\nsudo snap set 5gdrone mqtt.user=username\nsudo snap set 5gdrone mqtt.pass=password<\/code><\/pre>\n\n\n\n<p>Then restart the service:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo snap restart 5gdrone<\/code><\/pre>\n\n\n\n<h3 id=\"troubleshooting\">Troubleshooting<\/h3>\n\n\n\n<h4 id=\"setting-the-log-level-to-debug\">Setting the log level to debug<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo snap set 5gdrone loglevel=DEBUG\nsudo snap restart 5gdrone<\/code><\/pre>\n\n\n\n<h4 id=\"follow-the-logs\">Follow the logs<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo journalctl -u snap.5gdrone.5gdrone.service -f<\/code><\/pre>","protected":false},"excerpt":{"rendered":"<p>This page will guide you through the installation of the software required to run the device.&nbsp;Details on the physical mounting of the device&nbsp;can be found on the manufacturer&#8217;s website. You might also find the&nbsp;official documentation for the SIM8200EA-M2 5G HAT&nbsp;helpful. Prerrequisites The device must be physically assembled. A SIM card must be installed. SIM cards&hellip; <br \/> <a class=\"read-more\" href=\"https:\/\/unica6g.it.uc3m.es\/en\/6g-sorus\/sorusboxscan\/setting-up\/\">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\/2174"}],"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=2174"}],"version-history":[{"count":13,"href":"https:\/\/unica6g.it.uc3m.es\/en\/wp-json\/wp\/v2\/pages\/2174\/revisions"}],"predecessor-version":[{"id":2289,"href":"https:\/\/unica6g.it.uc3m.es\/en\/wp-json\/wp\/v2\/pages\/2174\/revisions\/2289"}],"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=2174"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}