# Design and Implementation of a Mixed IoT LPWAN Network Architecture
## 4 Electronic Design
### LoRaWAN Base Station  
The purpose of the device described here is to act as gateway between LoRaWAN in 868 MHz ISM radio band and a wired or wireless 2.4 GHz IP network. LoRaWAN is used by the final IoT devices and in the IP network are located the LoRaWAN network server responsible for managing the communication with devices and the application server responsible for managing the information received from devices. Both the typical architecture of a LoRaWAN network and the situation in it of the base station can be seen in Figure 18.  
Figure 17: Gateway block diagram.  
The cost is lower than other commercial solutions with the same functionality. As an estimation, a commercial product such as MultiConnect Conduit IP67 from Multitech has a market price around \(\epsilon\) 1400 (July 2018). The proposed solution costs 396\(\epsilon\). Although it does not have all the functionalities of the commercial product, it presents enough to cover the needs of work in the case studies analysed, which makes it a competitive product compared to the previous one. In addition, it has the advantage of using open-source software that can be improved and customized without relying on third parties. Unlike other low-cost solutions, it does not perform a LoRa point-to-point link with a single device simultaneously, but is fully compatible with the LoRaWAN specification and thus with the possibility of receiving several frequencies simultaneously, linking several devices at the same time and taking advantage of extended capabilities such as the adaptive bit rate to achieve optimal link quality in each case. Power is supplied using POE (Power Over Ethernet) to avoid additional wiring and the whole has been assembled in a IP67 box with external antennas and pole mounting bracket. The main controller is based on Raspberry Pi in order to reduce costs and use open-hardware. For the LoRaWAN connectivity, the IMST ic880A board [39] is used, which includes a LoRaWAN SX1301 concentrator and a double SX1257 radio capable of handling up to 8 simultaneous 125 kHz channels. Due the ic880A board does not have the proper format to be directly connected to Raspberry Pi, it has been necessary to insert a connection adapter card, allowing communication between them via the SPI bus. About software, the packages lora_gateway and packet_forwarder [40] have been used on Raspbian OS and they have been configured with the IP address of the available LoRaWAN network server. This hardware and software configuration facilitates scalability according to the needs of each application case, assuming an advantage over closed commercial solutions. The prototype shown in Figure 19 could evolve to a single card format containing both the LoRaWAN radio and concentrator chips, and the processor and communications chipset used in the Raspberry Pi board. Furthermore, in Figure 19b you can see an additional external antenna with the idea of expanding the base station with a Sigfox radio module that would be connected to the UART (Universal Asynchronous Receiver Transmitter) port of Raspberry Pi.  
Figure 18: LoRaWAN network architecture.