{"id":2736,"date":"2021-12-15T11:57:11","date_gmt":"2021-12-15T09:57:11","guid":{"rendered":"https:\/\/femprocomuns.coop\/?p=2736"},"modified":"2021-12-15T11:57:11","modified_gmt":"2021-12-15T09:57:11","slug":"internet-of-things-network-in-arenys-de-munt","status":"publish","type":"post","link":"https:\/\/femprocomuns.coop\/en\/internet-of-things-network-in-arenys-de-munt\/","title":{"rendered":"Internet of Things Network in Arenys de Munt"},"content":{"rendered":"<p lang=\"ca-ES\" align=\"justify\">Arenys de Munt will have an Internet of Things network promoted by the Town Council after seven sensors were installed on 8 November. Specifically, five indoor CO<sub>2<\/sub> sensors, one outdoor CO<sub>2<\/sub> sensor and one outdoor particle sensor were installed. This municipality has a previously installed antenna to provide coverage for all these new devices.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\" wp-image-2725 alignright\" style=\"text-align: justify;\" src=\"https:\/\/femprocomuns.coop\/wp-content\/uploads\/2021\/12\/sensorDecentlab-211x300.jpg\" alt=\"\" width=\"157\" height=\"223\" srcset=\"https:\/\/femprocomuns.coop\/wp-content\/uploads\/2021\/12\/sensorDecentlab-211x300.jpg 211w, https:\/\/femprocomuns.coop\/wp-content\/uploads\/2021\/12\/sensorDecentlab.jpg 452w\" sizes=\"auto, (max-width: 157px) 100vw, 157px\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\" wp-image-2726 alignright\" style=\"text-align: justify;\" src=\"https:\/\/femprocomuns.coop\/wp-content\/uploads\/2021\/12\/sensorDraguino-215x300.jpg\" alt=\"\" width=\"160\" height=\"223\" srcset=\"https:\/\/femprocomuns.coop\/wp-content\/uploads\/2021\/12\/sensorDraguino-215x300.jpg 215w, https:\/\/femprocomuns.coop\/wp-content\/uploads\/2021\/12\/sensorDraguino.jpg 682w\" sizes=\"auto, (max-width: 160px) 100vw, 160px\" \/><\/p>\n<p>This will allow the whole population to consult the status of the installed sensors, seeing how pollution levels change in different parts of the municipality. They will be able to see the data from the website of the\u00a0<a href=\"https:\/\/sentilo.diba.cat\/sentilo-catalog-web\/0800760009\/component\/map\">Sensor and Actuator Platform\u00a0<\/a>and, as the gateway is public and open, <strong>the whole population will be able to use it for their own devices that work with LoRaWAN.<\/strong><\/p>\n<p>The XOIC team of femProcomuns has participated in the implementation and in the accompaniment and recommendations for a correct installation. Below <strong>we explain the steps we have followed, from the configuration of the sensor to the reception of data and its subsequent visualisation.<\/strong><\/p>\n<h3 style=\"text-align: left;\" align=\"justify\">What does the start-up consist of?<\/h3>\n<p lang=\"ca-ES\" style=\"text-align: left;\" align=\"justify\">The start-up consists of several steps:<\/p>\n<h4 style=\"text-align: left;\" align=\"justify\">1. The start-up of each sensor<\/h4>\n<p style=\"text-align: left;\">In the case of CO<sub>2<\/sub> sensors, they are activated by holding down the yellow button for more than three seconds, the LED will flash green five times, it is not necessary to open the box.<\/p>\n<p style=\"text-align: left;\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-2719 size-medium\" style=\"text-align: justify;\" src=\"https:\/\/femprocomuns.coop\/wp-content\/uploads\/2021\/12\/botoGroc-e1638470390963-300x193.jpg\" alt=\"\" width=\"300\" height=\"193\" srcset=\"https:\/\/femprocomuns.coop\/wp-content\/uploads\/2021\/12\/botoGroc-e1638470390963-300x193.jpg 300w, https:\/\/femprocomuns.coop\/wp-content\/uploads\/2021\/12\/botoGroc-e1638470390963-1024x660.jpg 1024w, https:\/\/femprocomuns.coop\/wp-content\/uploads\/2021\/12\/botoGroc-e1638470390963-80x50.jpg 80w, https:\/\/femprocomuns.coop\/wp-content\/uploads\/2021\/12\/botoGroc-e1638470390963-768x495.jpg 768w, https:\/\/femprocomuns.coop\/wp-content\/uploads\/2021\/12\/botoGroc-e1638470390963.jpg 1119w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/p>\n<p lang=\"ca-ES\" style=\"text-align: left;\" align=\"justify\">For the outdoor CO<sub>2<\/sub> sensors and the particle sensor, first open the sensor with a screwdriver, carefully remove the pcb, then press and hold the black button for 3 seconds.<\/p>\n<p lang=\"ca-ES\" align=\"justify\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-2720 aligncenter\" src=\"https:\/\/femprocomuns.coop\/wp-content\/uploads\/2021\/12\/botoNegre-e1639069553250-300x148.jpg\" alt=\"\" width=\"300\" height=\"148\" srcset=\"https:\/\/femprocomuns.coop\/wp-content\/uploads\/2021\/12\/botoNegre-e1639069553250-300x148.jpg 300w, https:\/\/femprocomuns.coop\/wp-content\/uploads\/2021\/12\/botoNegre-e1639069553250-768x380.jpg 768w, https:\/\/femprocomuns.coop\/wp-content\/uploads\/2021\/12\/botoNegre-e1639069553250.jpg 825w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/p>\n<h4 style=\"text-align: left;\" align=\"justify\">2. Register the sensor in The Things Stack version 3.<\/h4>\n<p lang=\"ca-ES\" style=\"text-align: left;\" align=\"justify\">How do we register the sensors in The Tings Stack version 3?<\/p>\n<p lang=\"ca-ES\" align=\"justify\">Go to the following <a href=\"https:\/\/eu1.cloud.thethings.network\/console\/\">link<\/a> and create a user or login (if you have one).<\/p>\n<p lang=\"ca-ES\" style=\"text-align: left;\" align=\"justify\">We create an application as we did in TTN v2, as we can see in the image an ID must be given to the application; optionally, a name and a description can be added.<\/p>\n<p lang=\"ca-ES\" style=\"text-align: left;\" align=\"justify\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-2721\" src=\"https:\/\/femprocomuns.coop\/wp-content\/uploads\/2021\/12\/creaAP.png\" alt=\"\" width=\"500\" height=\"530\" srcset=\"https:\/\/femprocomuns.coop\/wp-content\/uploads\/2021\/12\/creaAP.png 643w, https:\/\/femprocomuns.coop\/wp-content\/uploads\/2021\/12\/creaAP-283x300.png 283w\" sizes=\"auto, (max-width: 500px) 100vw, 500px\" \/><\/p>\n<p lang=\"ca-ES\" style=\"text-align: left;\" align=\"justify\">Next, we register the devices by entering the data that appear on the label of each sensor instead of the 0 that initially exist.<\/p>\n<p lang=\"ca-ES\" style=\"text-align: left;\" align=\"justify\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-2722\" src=\"https:\/\/femprocomuns.coop\/wp-content\/uploads\/2021\/12\/creaDEV-181x300.png\" alt=\"\" width=\"300\" height=\"499\" srcset=\"https:\/\/femprocomuns.coop\/wp-content\/uploads\/2021\/12\/creaDEV-181x300.png 181w, https:\/\/femprocomuns.coop\/wp-content\/uploads\/2021\/12\/creaDEV.png 544w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/p>\n<p>Finally, we create the API key for MQTT to work so that we can retrieve the data from <a href=\"https:\/\/nodered.org\/\">Node-RED<\/a>. Node-RED is a free software tool developed by IBM that allows physical devices to be connected to the Internet of Things. It provides a browser-based editor that facilitates the connection of flows through the wide range of nodes in the palette that can be deployed at runtime with a single click.<\/p>\n<p style=\"text-align: left;\">To do this, access the side menu, drop down &#8220;Integrations&#8221;, click on MQTT and then click on &#8220;Generate new API key&#8221;.<\/p>\n<p style=\"text-align: left;\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-2723\" src=\"https:\/\/femprocomuns.coop\/wp-content\/uploads\/2021\/12\/generacioClau-300x128.png\" alt=\"\" width=\"600\" height=\"257\" srcset=\"https:\/\/femprocomuns.coop\/wp-content\/uploads\/2021\/12\/generacioClau-300x128.png 300w, https:\/\/femprocomuns.coop\/wp-content\/uploads\/2021\/12\/generacioClau-768x329.png 768w, https:\/\/femprocomuns.coop\/wp-content\/uploads\/2021\/12\/generacioClau-1024x438.png 1024w, https:\/\/femprocomuns.coop\/wp-content\/uploads\/2021\/12\/generacioClau.png 1280w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/p>\n<p style=\"text-align: left;\">After this step, a password (JWT) will be generated, it is necessary to save this password before exiting, as a new one will be generated each time, but we want to use the same one.<\/p>\n<h4 style=\"text-align: left;\" align=\"justify\">3. Receive the data from Node-Red and send it to Sentilo.<\/h4>\n<p style=\"text-align: left;\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-2724 aligncenter\" style=\"text-align: justify;\" src=\"https:\/\/femprocomuns.coop\/wp-content\/uploads\/2021\/12\/nodeRed-300x121.png\" alt=\"\" width=\"622\" height=\"250\" srcset=\"https:\/\/femprocomuns.coop\/wp-content\/uploads\/2021\/12\/nodeRed-300x121.png 300w, https:\/\/femprocomuns.coop\/wp-content\/uploads\/2021\/12\/nodeRed-768x309.png 768w, https:\/\/femprocomuns.coop\/wp-content\/uploads\/2021\/12\/nodeRed.png 846w\" sizes=\"auto, (max-width: 622px) 100vw, 622px\" \/><\/p>\n<p>To retrieve the data from Node-Network it is necessary to follow the following steps.<\/p>\n<p>First, create a mqtt-in with and put the username and the JWT that has been generated when doing the MQTT integration. Next, it is necessary to set v3\/[nameMQTTUser]\/devices\/[device id]\/up to be able to subscribe to the uplinks. We connect it to a JSON node &#8220;Convert between JSON String &amp; Object&#8221;, add a function to get the data and pass it also through base64 and the decoder to get the decrypted data. Finally, we add the nodes to send the data to Sentilo.<\/p>\n<h4 style=\"text-align: left;\" align=\"justify\">4. Retrieve the data from Sentilo.<\/h4>\n<p><a href=\"https:\/\/www.sentilo.io\/\">Sentilo <\/a>(&#8220;Sensor&#8221; in Esperanto)\u00a0is an open source sensor and actuator platform. It allows to locate sensors and actuators by entering coordinates, retrieve the data and display them on a map where they will appear with the location entered.<\/p>\n<p>The last step is to retrieve the data from Sentilo by creating each sensor. The data will be shown on the map with its location and values as we can see in the image.<\/p>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-2727 aligncenter\" src=\"https:\/\/femprocomuns.coop\/wp-content\/uploads\/2021\/12\/sentilo-246x300.png\" alt=\"\" width=\"343\" height=\"418\" srcset=\"https:\/\/femprocomuns.coop\/wp-content\/uploads\/2021\/12\/sentilo-246x300.png 246w, https:\/\/femprocomuns.coop\/wp-content\/uploads\/2021\/12\/sentilo.png 640w\" sizes=\"auto, (max-width: 343px) 100vw, 343px\" \/><\/p>\n<h4 style=\"text-align: left;\" align=\"justify\">5. Having this data in Sentilo.<\/h4>\n<p>What does it allow us to do?<\/p>\n<p>Well, it allows the local council to take action, if necessary, to improve the quality of the air that the population breathes. In addition, it allows the population to be aware of how is the CO2 they breathe if they have to attend an event in any of the monitored points.<\/p>\n<p>With this initiative, Arenys de Munt Town Council joins the municipalities that have LoRa coverage and organisations, educational centres and companies will also be able to connect their sensors and actuators, as is already being done in other municipalities.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Arenys de Munt will have an Internet of Things network promoted by the Town Council after seven sensors were installed on 8 November. Specifically, five indoor CO2 sensors, one outdoor CO2 sensor and one outdoor particle sensor were installed. This &hellip; <a href=\"https:\/\/femprocomuns.coop\/en\/internet-of-things-network-in-arenys-de-munt\/\">Continued<\/a><\/p>\n","protected":false},"author":3,"featured_media":3011,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"kt_blocks_editor_width":"","_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[42,55],"tags":[],"class_list":["post-2736","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-events","category-xoic-en"],"jetpack_featured_media_url":"https:\/\/femprocomuns.coop\/wp-content\/uploads\/2021\/12\/XOIC_ArenysdeMunt.png","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/femprocomuns.coop\/en\/wp-json\/wp\/v2\/posts\/2736","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/femprocomuns.coop\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/femprocomuns.coop\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/femprocomuns.coop\/en\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/femprocomuns.coop\/en\/wp-json\/wp\/v2\/comments?post=2736"}],"version-history":[{"count":18,"href":"https:\/\/femprocomuns.coop\/en\/wp-json\/wp\/v2\/posts\/2736\/revisions"}],"predecessor-version":[{"id":3009,"href":"https:\/\/femprocomuns.coop\/en\/wp-json\/wp\/v2\/posts\/2736\/revisions\/3009"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/femprocomuns.coop\/en\/wp-json\/wp\/v2\/media\/3011"}],"wp:attachment":[{"href":"https:\/\/femprocomuns.coop\/en\/wp-json\/wp\/v2\/media?parent=2736"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/femprocomuns.coop\/en\/wp-json\/wp\/v2\/categories?post=2736"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/femprocomuns.coop\/en\/wp-json\/wp\/v2\/tags?post=2736"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}