## 2 The Elephant in the Room: Great Diversity
### One Simple Approach to Help Harmonization  
The primary objective of this paper is to develop and implement a solution to connect and expose data from IoT sensors to the Internet, based on the 6 LoWPAN protocol. This solution involves creating a communications Relay that allows leaf nodes in the network to communicate with the cloud. This Relay device would host a two-way communications system: (i) a local area network, to speak with the 6 LoWPAN coordinator, and (ii) NB-IoT, which provides the transparent, logical-direct path to the cloud platform where data are integrated.  
6 LoWPAN sensors usually exchange information using the CoAP protocol. Network coordinators usually use their own methods, platforms, or _secret recipes_ to subsequently make these data appear somewhere else where access is granted (IPv4 networks). However, this layer is usually opaque and tailored specifically for the very brand/use case itself, with little to no chance of modification.  
To overcome this issue, we propose a new type of _Thing_ based on a low-cost FiPy module [22]. This development board comes handy, as it runs on the well-known ESP32 family of chips, and it incorporates Wi-Fi for the local access path, NB-IoT for the global path, as well as some other wireless technologies such as BLE, Sigfox, and LoRa. The main architecture of the system can be seen in Figure 1.  
Thus, data would be requested to the 6 LoWPAN coordinator by the Relay, which afterwards properly parses the data as a JSON document, then uploads it to the cloud.  
Figure 1: General block diagram for this project’s architecture.  
Notice that there is a middleware platform in between called PyBytes [23]. Although this could be avoided, it is the most straightforward manner to use NB-IoT with Pycom development boards.  
Furthermore, this approach is almost carrier agnostic, leveraging ubiquity and ease of implementation. Only two parameters are to be set in the Relay's program code, the APN and LTE band. However, in Europe, the band is often FDD #20 (-800 MHz), regardless of the mobile carrier and country, and the APN is a static parameter per carrier. With this, the developer only needs to invoke Pybytes' library functions to send messages to the back end.  
The LTE modem scans the designated band, and then attaches to the very narrow-band carrier commanded by the network, which may change its central frequency between geographical locations, even inside the same country and mobile operator. For this research, 1 NCE [24] was chosen as the mobile carrier, which was actually using Vodafone's NB-IoT towers/network; they are just a reseller providing quasi-global NB-IoT service.  
Once attached and connected to the cellular network, the Relay can successfully send data to Pybytes, which then sends these data directly to the Home Assistant API to accordingly store and cure the incoming data on the InfluxDB database, eventually triggering automations or whatsoever, should they be set up.  
In summary, this study presents a comprehensive solution for the collection, processing, transmission, and exposure of IoT sensor data to the Internet, utilizing leading-edge, open-source technologies, and ensuring a new roadmap for work in the coming years, offering high interoperability thanks to the use of standard protocols in the IoT industry.  
To prove the Relay's proper functioning, we set up a simple indoor testbench in a medium-sized room with a typical setup composed of the following: (i) a 6 LoWPAN network with one coordinator node and two ambient sensor nodes; (ii) the Relay itself, centered on the FiPy board, which embeds the NB-IoT modem; and (iii) a Wi-Fi router, providing LAN/WLAN connectivity between the coordinator node and the Relay device. Apart from this reachable set up, there were also an AWS-Lightsail server where the Home Assistant instance was deployed, exposing the endpoint to which Pybytes would forward NB-IoT messages, and providing the web interface for the user to visualize data and interact with the system.