{"id":5376,"date":"2023-12-13T09:49:17","date_gmt":"2023-12-13T08:49:17","guid":{"rendered":"https:\/\/cyber-fi.net\/?p=5376"},"modified":"2024-09-15T09:11:22","modified_gmt":"2024-09-15T07:11:22","slug":"my-lorawan-lab-part-1-hardware-setup","status":"publish","type":"post","link":"https:\/\/cyber-fi.net\/index.php\/2023\/12\/13\/my-lorawan-lab-part-1-hardware-setup\/","title":{"rendered":"My LoRaWAN Lab &#8211; Part 1, Hardware Setup"},"content":{"rendered":"\n<p>About two years ago, I studied for the CWISA exam from CWNP and learned about LoRaWAN for the first time. With many HomeKit devices, I have been interested in IoT for a long time. But with the CWISA, I got deeper into IoT technologies.<\/p>\n\n\n\n<p>When I got informed that my planned WLAN security boot camp at WLPC EU 2023 didn&#8217;t get enough reservations, I booked the LoRaWAN boot camp from Raymond Hendrix and Troy Martin. This was a great learning experience, and we spent three days learning a lot about LoRaWAN and building a little LoRaWAN setup with a gateway, a power plug, a smart button, and an IoT server based on node-red, influx, and Grafana.<\/p>\n\n\n\n<p>This blog post is meant to summarise how I extended this Lab to learn, get more practice with LoRaWAN, and build something useful simultaneously. As with most labs, it is certainly not all &#8220;best practice,&#8221; but it could give some ideas if someone is interested in building a LoRaWAN lab.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">The Lab devices<\/h3>\n\n\n\n<p>From the WLPC boot camp I already had the following components:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Raspberry Pi 4B<\/li>\n\n\n\n<li>RAK5146 Gateway Concentrator Module for LoRaWAN<\/li>\n\n\n\n<li>Milesight WS523 Portable Socket<\/li>\n\n\n\n<li>A Smart Button that is not yet used in this setup<\/li>\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\">My problem statement<\/h3>\n\n\n\n<p>I have a refrigerator in the cellar where I cannot connect a WLAN-based smart plug. This diagram shows the distance from my home to the basement.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"462\" src=\"https:\/\/cyber-fi.net\/wp-content\/uploads\/2023\/12\/LoRaWAN-Lab-1024x462.jpg\" alt=\"\" class=\"wp-image-5378\" srcset=\"https:\/\/cyber-fi.net\/wp-content\/uploads\/2023\/12\/LoRaWAN-Lab-1024x462.jpg 1024w, https:\/\/cyber-fi.net\/wp-content\/uploads\/2023\/12\/LoRaWAN-Lab-300x135.jpg 300w, https:\/\/cyber-fi.net\/wp-content\/uploads\/2023\/12\/LoRaWAN-Lab-768x347.jpg 768w, https:\/\/cyber-fi.net\/wp-content\/uploads\/2023\/12\/LoRaWAN-Lab.jpg 1125w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Most problematic are the circa 80cm of concrete and soil (often wet in Germany).<\/p>\n\n\n\n<p>In the past, we had to throw away food because of a power outage that we overlooked.<br>I hoped that I could connect the Milesight WS523 power plug from the boot camp with LoRa.<\/p>\n\n\n\n<p><strong>First test:<\/strong> I placed the Raspberry Pi-based gateway with the RAK5146 module in my living room and waited for messages from the power plug. Nothing!<br><strong>Second test:<\/strong> I increased the spreading factor up to 12 without success.<br><strong>Third test:<\/strong> I placed the gateway on the balcony table and got messages from the sensor. But by moving the sensor to a rain-protected place, the messages again ceased.<\/p>\n\n\n\n<p>With these results, I decided to get an external antenna and an outdoor enclosure.<\/p>\n\n\n\n<p>I decided to use the RAK 5.8 dBi antenna:<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"535\" height=\"542\" src=\"https:\/\/cyber-fi.net\/wp-content\/uploads\/2023\/12\/RAK_W118_01.png\" alt=\"\" class=\"wp-image-5379\" style=\"aspect-ratio:0.9870848708487084;width:357px;height:auto\" srcset=\"https:\/\/cyber-fi.net\/wp-content\/uploads\/2023\/12\/RAK_W118_01.png 535w, https:\/\/cyber-fi.net\/wp-content\/uploads\/2023\/12\/RAK_W118_01-296x300.png 296w\" sizes=\"auto, (max-width: 535px) 100vw, 535px\" \/><\/figure>\n<\/div>\n\n\n<p>For the Raspberry Pi gateway, the iPEX connector is needed.<\/p>\n\n\n\n<p class=\"has-text-align-center\">Link: https:\/\/store.rakwireless.com\/products\/5-8dbi-fiber-glass-antenna<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>The enclosure is made of plastic and is IP65 rated:<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"1000\" height=\"1000\" src=\"https:\/\/cyber-fi.net\/wp-content\/uploads\/2023\/12\/kunststoff-gehaeuse-mastmontage-wetterfest-1.jpeg\" alt=\"\" class=\"wp-image-5387\" style=\"aspect-ratio:1;width:534px;height:auto\" srcset=\"https:\/\/cyber-fi.net\/wp-content\/uploads\/2023\/12\/kunststoff-gehaeuse-mastmontage-wetterfest-1.jpeg 1000w, https:\/\/cyber-fi.net\/wp-content\/uploads\/2023\/12\/kunststoff-gehaeuse-mastmontage-wetterfest-1-300x300.jpeg 300w, https:\/\/cyber-fi.net\/wp-content\/uploads\/2023\/12\/kunststoff-gehaeuse-mastmontage-wetterfest-1-150x150.jpeg 150w, https:\/\/cyber-fi.net\/wp-content\/uploads\/2023\/12\/kunststoff-gehaeuse-mastmontage-wetterfest-1-768x768.jpeg 768w, https:\/\/cyber-fi.net\/wp-content\/uploads\/2023\/12\/kunststoff-gehaeuse-mastmontage-wetterfest-1-165x165.jpeg 165w\" sizes=\"auto, (max-width: 1000px) 100vw, 1000px\" \/><\/figure>\n<\/div>\n\n\n<p class=\"has-text-align-center\">Link: https:\/\/www.wlan-shop24.de\/plastic-enclosure-cabinet-mast-installation<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p class=\"has-text-align-left\">When the enclosure was delivered, I thought about how I could ideally power my gateway. I have a power outlet on the balcony, but it has a switch in the living room. And I don&#8217;t want a failed gateway because I accidentally pressed the power switch.<br>So, I added a mini UPS to the setup. This is the same low-cost UPS that I use to power APs for short surveys. Not shown in this picture, but on the back is also a USB connector.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"985\" height=\"534\" src=\"https:\/\/cyber-fi.net\/wp-content\/uploads\/2023\/12\/UPS-1.jpg\" alt=\"\" class=\"wp-image-5386\" style=\"aspect-ratio:1.844569288389513;width:552px;height:auto\" srcset=\"https:\/\/cyber-fi.net\/wp-content\/uploads\/2023\/12\/UPS-1.jpg 985w, https:\/\/cyber-fi.net\/wp-content\/uploads\/2023\/12\/UPS-1-300x163.jpg 300w, https:\/\/cyber-fi.net\/wp-content\/uploads\/2023\/12\/UPS-1-768x416.jpg 768w\" sizes=\"auto, (max-width: 985px) 100vw, 985px\" \/><\/figure>\n<\/div>\n\n\n<p class=\"has-text-align-center\">Link: https:\/\/www.amazon.de\/gp\/product\/B0921SB3LJ<br><\/p>\n\n\n\n<p>When assembling everything, I realized a standard USB-C cable didn&#8217;t fit, but a cable with 90-degree rotated connectors worked fine. This is 50cm long, the shortest cable I found with 90-degree connectors.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"878\" height=\"1024\" src=\"https:\/\/cyber-fi.net\/wp-content\/uploads\/2023\/12\/USB-Cable-1-878x1024.jpg\" alt=\"\" class=\"wp-image-5385\" style=\"aspect-ratio:0.857421875;width:195px;height:auto\" srcset=\"https:\/\/cyber-fi.net\/wp-content\/uploads\/2023\/12\/USB-Cable-1-878x1024.jpg 878w, https:\/\/cyber-fi.net\/wp-content\/uploads\/2023\/12\/USB-Cable-1-257x300.jpg 257w, https:\/\/cyber-fi.net\/wp-content\/uploads\/2023\/12\/USB-Cable-1-768x896.jpg 768w, https:\/\/cyber-fi.net\/wp-content\/uploads\/2023\/12\/USB-Cable-1.jpg 1200w\" sizes=\"auto, (max-width: 878px) 100vw, 878px\" \/><\/figure>\n<\/div>\n\n\n<p class=\"has-text-align-center\"><\/p>\n\n\n\n<p class=\"has-text-align-center\">Link: https:\/\/www.amazon.de\/gp\/product\/B07PHQGW6P<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>I connected the enclosure and the antenna to a plexiglass board and mounted both to the balcony.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"984\" height=\"1024\" src=\"https:\/\/cyber-fi.net\/wp-content\/uploads\/2023\/12\/71tUr6mgg3L._AC_SL1500_-984x1024.jpg\" alt=\"\" class=\"wp-image-5391\" style=\"aspect-ratio:0.9609375;width:384px;height:auto\" srcset=\"https:\/\/cyber-fi.net\/wp-content\/uploads\/2023\/12\/71tUr6mgg3L._AC_SL1500_-984x1024.jpg 984w, https:\/\/cyber-fi.net\/wp-content\/uploads\/2023\/12\/71tUr6mgg3L._AC_SL1500_-288x300.jpg 288w, https:\/\/cyber-fi.net\/wp-content\/uploads\/2023\/12\/71tUr6mgg3L._AC_SL1500_-768x799.jpg 768w, https:\/\/cyber-fi.net\/wp-content\/uploads\/2023\/12\/71tUr6mgg3L._AC_SL1500_.jpg 1442w\" sizes=\"auto, (max-width: 984px) 100vw, 984px\" \/><\/figure>\n<\/div>\n\n\n<p class=\"has-text-align-center\">Link: https:\/\/www.amazon.de\/gp\/product\/B0CJHMVTT6<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"805\" src=\"https:\/\/cyber-fi.net\/wp-content\/uploads\/2023\/12\/enclosure-antenna-1024x805.jpeg\" alt=\"\" class=\"wp-image-5384\" srcset=\"https:\/\/cyber-fi.net\/wp-content\/uploads\/2023\/12\/enclosure-antenna-1024x805.jpeg 1024w, https:\/\/cyber-fi.net\/wp-content\/uploads\/2023\/12\/enclosure-antenna-300x236.jpeg 300w, https:\/\/cyber-fi.net\/wp-content\/uploads\/2023\/12\/enclosure-antenna-768x603.jpeg 768w, https:\/\/cyber-fi.net\/wp-content\/uploads\/2023\/12\/enclosure-antenna.jpeg 1213w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n<\/div>\n\n\n<p>And yes, there is some cleaning needed next spring &#8230;<br>The reception was again fine in this setup, and I received messages. This is also proof that antennas not only work for transmission but also have a receive gain.<br>My next fear was that the gateway or the UPS could fail when it gets cold in the winter. I am willing to risk it, but I wanted at least to know how cold it gets inside the enclosure.<br>I decided to use a LoRaWAN sensor inside the box. The gateway is within reach of my WLAN, but with a LoRaWAN sensor, it&#8217;s easier to get the data into my Grafana IoT dashboard. I decided to buy two Dragino devices because they have good value for money and can connect an external temperature sensor to measure inside and outside the enclosure. <\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"640\" height=\"611\" src=\"https:\/\/cyber-fi.net\/wp-content\/uploads\/2023\/12\/IMG_2857.jpeg\" alt=\"\" class=\"wp-image-5388\" style=\"aspect-ratio:1.0474631751227497;width:406px;height:auto\" srcset=\"https:\/\/cyber-fi.net\/wp-content\/uploads\/2023\/12\/IMG_2857.jpeg 640w, https:\/\/cyber-fi.net\/wp-content\/uploads\/2023\/12\/IMG_2857-300x286.jpeg 300w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/figure>\n<\/div>\n\n\n<p class=\"has-text-align-center\">Link1: https:\/\/iot-shop.de\/en\/shop\/dg-lht65n-e3-868-dragino-lht65n-e3-lorawan-temperature-humidity-sensor-5595<\/p>\n\n\n\n<p class=\"has-text-align-center\">Link2: https:\/\/iot-shop.de\/en\/shop\/dg-lht52-dragino-lht52-temperature-sensor-5427<\/p>\n\n\n\n<p class=\"has-text-align-center\">Link3: https:\/\/iot-shop.de\/en\/shop\/dg-as-01-dragino-as-01-external-temperature-probe-for-lht52-5429<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p class=\"has-text-align-left\">After deciding which one to mount inside the enclosure, I placed the second sensor in the cellar. This is the resulting content of the enclosure:<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"480\" height=\"640\" src=\"https:\/\/cyber-fi.net\/wp-content\/uploads\/2023\/12\/IMG_2858.jpeg\" alt=\"\" class=\"wp-image-5389\" style=\"aspect-ratio:0.75;width:342px;height:auto\" srcset=\"https:\/\/cyber-fi.net\/wp-content\/uploads\/2023\/12\/IMG_2858.jpeg 480w, https:\/\/cyber-fi.net\/wp-content\/uploads\/2023\/12\/IMG_2858-225x300.jpeg 225w\" sizes=\"auto, (max-width: 480px) 100vw, 480px\" \/><\/figure>\n<\/div>\n\n\n<p>With that, I finished the hardware setup.<\/p>\n\n\n\n<p>In the next part, I&#8217;ll summarize the software setup of this Lab.<\/p>\n\n\n\n<p>The URLs under the pictures only show where I bought the devices. Feel free to look for better vendors.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>About two years ago, I studied for the CWISA exam from CWNP and learned about LoRaWAN for the first time. With many HomeKit devices, I have been interested in IoT for a long time. But with the CWISA, I got deeper into IoT technologies. When I got informed that my planned WLAN security boot camp <\/p>\n<div class=\"read-more-text\"><a href=\"https:\/\/cyber-fi.net\/index.php\/2023\/12\/13\/my-lorawan-lab-part-1-hardware-setup\/\" class=\"read-more\">continue reading<\/a><\/div>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"twitterCardType":"","cardImageID":0,"cardImage":"","cardTitle":"","cardDesc":"","cardImageAlt":"","cardPlayer":"","cardPlayerWidth":0,"cardPlayerHeight":0,"cardPlayerStream":"","cardPlayerCodec":"","footnotes":""},"categories":[718,717],"tags":[721,691,720,719],"class_list":["post-5376","post","type-post","status-publish","format-standard","hentry","category-iot","category-wireless","tag-cwisa","tag-cwnp","tag-iot","tag-lorawan"],"_links":{"self":[{"href":"https:\/\/cyber-fi.net\/index.php\/wp-json\/wp\/v2\/posts\/5376","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cyber-fi.net\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cyber-fi.net\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cyber-fi.net\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/cyber-fi.net\/index.php\/wp-json\/wp\/v2\/comments?post=5376"}],"version-history":[{"count":14,"href":"https:\/\/cyber-fi.net\/index.php\/wp-json\/wp\/v2\/posts\/5376\/revisions"}],"predecessor-version":[{"id":5638,"href":"https:\/\/cyber-fi.net\/index.php\/wp-json\/wp\/v2\/posts\/5376\/revisions\/5638"}],"wp:attachment":[{"href":"https:\/\/cyber-fi.net\/index.php\/wp-json\/wp\/v2\/media?parent=5376"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cyber-fi.net\/index.php\/wp-json\/wp\/v2\/categories?post=5376"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cyber-fi.net\/index.php\/wp-json\/wp\/v2\/tags?post=5376"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}