Open-Source Electronics Platforms as Enabling Technologies for Smart Cities: Recent Developments and Perspectives

With the increasing availability of affordable open-source embedded hardware platforms, the development of low-cost programmable devices for uncountable tasks has accelerated in recent years. In this sense, the large development community that is being created around popular platforms is also contributing to the construction of Internet of Things applications, which can ultimately support the maturation of the smart-cities era. Popular platforms such as Raspberry Pi, BeagleBoard and Arduino come as single-board open-source platforms that have enough computational power for different types of smart-city applications, while keeping affordable prices and encompassing many programming libraries and useful hardware extensions. As a result, smart-city solutions based on such platforms are becoming common and the surveying of recent research in this area can support a better understanding of this scenario, as presented in this article. Moreover, discussions about the continuous developments in these platforms can also indicate promising perspectives when using these boards as key elements to build smart cities.

Introduction
The development of different areas of electronics, computing, data acquisition, and communication has created a fertile environment for the rise of the Internet of Things (IoT) [1]. The IoT is expected to deeply change our lives, allowing the creation of ubiquitous, distributed, and reactive systems that can surprisingly alter the way we interact with the world [2,3]. Smart cities are an important application of the IoT landscape, bringing complex challenges in different aspects of city structure and of their inhabitants' behaviors [4,5], but also opening many commercial, industrial, educational, and cultural opportunities [6][7][8][9].
The development of efficient communication technologies and cloud data services with decreasing costs, as well as the affordability of powerful open-source hardware platforms, have boosted smart-city initiatives [10,11]. With such platforms, the development time and related costs are considerable reduced, easing the creation of dedicated smart-city applications that can solve punctual problems. On the other hand, in a bigger scope where smart-city systems are designed and deployed by the governments, embedded hardware platforms are also a feasible solution not only during development phases, but also when providing public data: as most platforms are based on open-source technologies, the adoption of public standards is encouraged. Moreover, academic and scientific smart-city applications are inherently propitious to the adoption of open-source electronics platforms to construct IoT devices. Such smart-city scenarios may also rise concerns about interoperability and concurrency [12,13], but the characteristics of open-source electronics boards are favorable when promoting compatibility.
Among the existing open-source electronics platforms, some options are becoming more popular due to many factors. In common, the most popular boards share similar characteristics such as being versatile, powerful (although some models are limited) and cost-effective, being useful to create virtually any kind of device [14,15]. In this context, as most of them are ultimately a computer, respecting the different computational capabilities of the boards, they can be used to create sensors, actuators, and any processing device, presenting themselves as wild-cards for different types of sensor networks, IoT and smart-city applications [16,17].
In recent years, open-source electronics platforms have been used to support IoT applications and thus they can also be employed to support the creation of smart cities. From a different perspective, those platforms are also being taken as pillars for applications that are already being developed around the smart-city principles. Therefore, understanding this scenario can also indicate how smart cities are evolving and what we can expect from the near future.  This article surveys recent scientific developments that exploit open-source electronics boards to create IoT and smart-city applications. Moreover, perspectives of this scenario are presented and discussed. As this is a very dynamic area, this article is valuable to support new researches and developments in this field.
The remainder of this paper is organized as follows. Section 2 presents the current availability of embedded open-source platforms that can be used to create IoT devices. Section 3 surveys recent works employing popular open-source boards for IoT and smart-city applications. Perspectives for future developments are presented in Section 4, followed by Conclusions in Section 5 and References.

Open-Source Platforms for IoT Development
IoT systems may be designed in different ways, but it is reasonable to expect that sensors, actuators and controller units will be present in most applications. For that, embedded hardware platforms may be used to implement these elements and there are many available options on the market. Among those options, open-source platforms are gaining prominence due to many factors and there are currently some good boards to be chosen. However, the existence of many research and industrial projects that are developed exploiting a few different boards is a good indication of which are the most popular platforms.
There are some characteristics that must be properly considered when choosing the most appropriate open-source platform for a particular IoT application. Those characteristics are described as follows:

•
Low cost: To allow massive deployment, especially for physically scattered applications, the chosen platform must be cheap enough to not compromise the design and maintenance of smart-city systems; • Computational power: Depending on the desired functionality, the board should have enough computational power to execute complex tasks, such as visual data processing and controlling of multiple distributed nodes. Processing and memory resources directly influence the computational power of the board; • Programming flexibility: The availability of programming languages and libraries is of paramount importance and this characteristic is not necessarily a function of the available hardware capabilities, but also the relevance of the developers community around the platform; • I/O interfaces. Smart-city applications may use electronic devices to provide relevant data or to take some action, such as cameras, LED, sirens, LCD panels, sensors, among others. The type and number of I/O interfaces in the adopted boards are important parameters when choosing the platform; • Low energy consumption: As IoT nodes may be powered by batteries, low energy consumption is a relevant characteristic for embedded hardware platforms. Besides the use of batteries, energy efficiency is highly desired in modern cities, encouraging the use of more efficient boards; • Reduced size: Depending on the expected functions of the board and the deployment place (e.g., lamp posts, traffic lights, transit plates), the size of the adopted board is relevant and should be considered; There are many open-source electronics platforms but only some of them are being more frequently used to create IoT applications. Among those boards, we selected some of the most popular platforms to be surveyed, considering affordable prices and large use in IoT applications as decision parameters for such selection. The chosen platforms are described in next subsections.

Raspberry Pi
Raspberry Pi is an affordable tiny and powerful multi-purpose computer that can be used for a variety of applications. When coming to the IoT and the smart-city environment, Raspberry also performs well as can be seen in the increasing number of projects that are exploiting its potentials. Although other hardware platforms have been created for the same purpose, Raspberry Pi is highly used by the industry, technology companies, governments, universities, and hobbyists, supporting the development of different kinds of applications [18,19].
Taking advantage of new electronic technologies and the success of ARM-based processors, the initial Raspberry Pi board was created with more modest purposes. Using cheap components that could be combined in a single board, the initial Raspberry Pi board was originally designed to be an affordable computer to assist students in school. However, it rapidly gained interest from other areas due to its flexibility, computational power, and reduced cost, helping it to become one of the best-selling computers in history.
Raspberry Pi is constructed around an ARM (Advanced RISC Machine) processor, which is the basis for the mobile smartphones industry. Therefore, Raspberry not only takes advantage of the characteristics of the RISC (Reduced Instruction Set Computer) processing platform, but also it was designed when manufacturers of RISC processors were consolidated. Since its initial debut, different models and versions of the original Raspberry board were created, addressing different hardware demands.
The increasing success of Raspberry Pi boards is due to many factors, putting this as the leading open-source hardware development platform. In addition, this hegemony has been reinforced by a series of performance evaluations, which has been conducted in recent years, for different scopes. The work in [20] evaluated a Raspberry Pi 2 B board in terms of graphical processing. The CPU and GPU loading was analyzed according to different visual data processing configurations, and energy consumption was assessed for different testing scenarios. From a different perspective, the work in [21] evaluated a Raspberry board (Raspberry Pi B) as a central element for a networking testbed based on the KODO library [22]. Even using an early model of the Raspberry Pi platform, the results in [21] were encouraging. Energy consumption was also evaluated in [23] but considering particular demands when implementing the RESTful Web Services framework. Similarly, the execution of web services in the Raspberry Pi platform was also addressed in [24], which evaluated load balancing in clusters of Raspberry Pi boards. In fact, all those works evaluated the performance of Raspberry Pi boards in different scenarios, indicating the interest of using this platform for a large set of tasks.
The most popular Raspberry Pi boards are the Raspberry Pi 2 B, the Raspberry Pi 3 B, and the Raspberry Zero W. Raspberry Pi was conceived and it is mostly manufactured in UK.

BeagleBoard
BeagleBoard is an open-source hardware platform that has the same principles of Raspberry Pi and thus they can often be used interchangeably. However, there are some important characteristics that put BeagleBoard as a viable option with its own particularities [25]. As with the Raspberry Pi family, BeagleBoard is a single-board tiny computer with affordable prices and low energy consumption. The initial use of this board and the related projects put both platforms in an equivalent development field.
When designing IoT applications, BeagleBoard has some particularities that can make it the board to be chosen. In a different way to Raspberry Pi, BeagleBoard board models have digital and analog I/O (similarly to the Arduino family). Other helpful characteristic is the presence of an onboard permanent storage unit in the BeagleBone series, which can be used to store code and sometimes to avoid the use of a microSD card, although there is a slot for those cards.
The work in [25] conducted a deep review of the BeagleBoard platform, discussing and evaluating some performance metrics of different board models.
The most popular BeagleBoard boards are the BeagleBone Black and the BeagleBone Blue. BeagleBoard was conceived and it is mostly manufactured in the USA.

Arduino
Differently from Raspberry Pi and BeagleBoard, the Arduino platform is an embedded prototyping board that is designed for electronics projects but that does not necessarily operate as a computer. Its use is focused on automation and electronic projects that demand repeated execution of some tasks and thus its software and hardware resources are more limited. However, the simplicity of Arduino finds its place in many automation and control projects and it is common to see Arduino boards composing smart-city systems.
While Raspberry Pi and BeagleBoard are developed around an ARM processor, most Arduino models are developed with a simpler micro-controller manufactured by Atmel, with most of them being of the ATmega family (8-bit, against the 32-bit processors of Raspberry Pi and BeagleBone). In addition, this characteristic has two practical implications: first, an Arduino board is usually cheaper; and second, it has less computational power than a usual Raspberry Pi or a BeagleBoard. Moreover, Arduino operates under a very lower clock speed and it has low RAM memory, but there is a flash memory to store the programs, which are written using special software IDE developed by the Arduino manufacturer. High-level programming languages such as C and Python can be used to program Arduino boards.
Although the reduced computational power may sound badly, the Arduino boards can do many things in terms of electronic control and it is a best-selling platform for its purposes. However, it is often limited for many IoT applications, especially when there is intensive computational processing. Despite that, there are a lot of extension boards (shields) to enhance the functions of Arduino, adding flexibility and useful resources. Among those extension boards, the ESP8266 family of microchips is a SoC (System on a Chip) that adds communication capabilities to Arduino and it became common to see many Arduino-based projects exploiting popular chips such as the ESP-01 and ESP-12. For IoT applications, such chips allow Arduino to easily communicate through Wi-Fi.
The Arduino platform was designed and manufactured in Italy and some of its most popular boards are the Arduino Uno, the Arduino Mega and the Arduino Due.

Open-Source Platforms Comparison
There are different options of open-source hardware platforms, with specifications and constraints that must be properly considered when implementing IoT and smart-city applications. The proper choosing of the most appropriate board is not straightforward, leaving to a heterogeneous scenario with projects and applications developed with different boards or employing combinations of them. However, the proper knowledge of the available off-the-shelf boards can give some light to this matter.
The previously presented open-source electronics platforms have been implemented in different models. Table 1 summarizes some of the most popular models of the presented open-source hardware development platforms (the model revisions and upgrades are not displayed). The "networking" column indicates onboard enabled resources, but additional hardware or dongles can be used to add networking capabilities to the boards. Most of the available open-source hardware platforms will operate as a computer and thus they require an operating system, excepting the Arduino board (the Arduino Yun board comes with a simplified version of the Linux operating system). In addition, there are many different operating systems for those boards, which are more frequently developed under the open-source premises. This creates a healthy environment for innovative projects, which also takes advantage of the average low costs of the embedded open-source hardware platforms.
Some boards do not have onboard storage, such as Raspberry Pi, while BeagleBone, for example, is shipped with an onboard permanent memory unit. When the board has no permanent storage, it usually employs a microSD card to record the operating system image and all user files. In general, terms, operating systems may be differentiated by performance metrics such as portability, required memory, CPU usage, image size, startup time, integrated tools, among others, and thus it is an important decision when designing smart-city applications. Some manufacturers officially support a particular operating system, such as the Raspbian OS for the Raspberry Pi platform, but even Raspberry can use any of dozens of available operating systems. Following the development trend of the open-source platforms, most operating systems for those boards are developed under open-source licenses.
Besides hardware and operating system characteristics, software and middleware are also relevant parameters that have been addressed in some works. The work in [26] discussed different aspects that are relevant when designing IoT applications, including the specification of the services expected from IoT devices and how they can impact the performance of IoT systems. Common services expected for IoT embedded platforms were also discussed in [27]. In that work, services such as virtualization, storage and use of the Rest API are discussed, which are helpful to add flexibility to IoT devices. In a similar way, the work in [28] also discussed services for IoT devices, but with focus on IoT protocols such as CoAP (Constrained Application Protocol) and MQTT (Message Queue Telemetry Transport). In fact, all those works discussed services that should be provided by IoT devices whatever is the employed hardware. Therefore, the presented considerations are valuable when implementing large-scale IoT and smart-city systems.
When choosing the most appropriate solution to construct IoT systems and ultimately smart-city solutions, all the presented aspects should be properly considered, since the particularities of each project should guide the choosing of the hardware and software technologies. Nevertheless, although there are many software middlewares and hardware platforms to develop IoT systems, and companies and research institutions are playing an important role to create this scenario, the existence of generic open-source multi-purpose development hardware platforms is of paramount importance. Open-source boards are revolutionizing the designing, deployment, operation, and maintenance of IoT and smart-city initiatives and thus they deserve more detailed analysis. In addition, in this scenario, the Raspberry Pi and the BeagleBoard family boards are standing out as promising choices, as can be seen in the increasing number of IoT projects based on them. The work in [15] performed interesting comparisons between the Raspberry Pi and the BeagleBoard platforms relating software and hardware issues.

Hardware Issues
In general, words, IoT development may require high flexibility when attaching new components, since different levels of interactions with the environment may be required. In fact, there are many electronic components that can be attached to the chosen open-source boards to extend their functions. For example, sensing units can be attached to allow monitoring of different information such as temperature, pressure, humidity, and pollution. Cameras and display units can also be easily attached. Raspberry Pi, BeagleBoard and Arduino have different I/O interfaces and there are many companies that develop different types of electronic components to be attached onto those boards. Particularly, the availability of GPIO (General Purpose Input/Output) pins allows the connection to a lot of electronic devices and there are many hardware extensions exploiting them, which significantly facilitates the attachment of new hardware components to the boards. Whatever the case, the number, type, and supported protocols of the I/O pins are important parameters when choosing open-source hardware platforms. In fact, the surveyed boards have different particularities concerning digital and analog I/O pins, which should be properly considered in smart-city projects.
Besides generic I/O, additional interfaces are also relevant, such as the CSI (Camera Serial Interface) standard in the Raspberry Pi platform to allow efficient connection of a camera. Depending on the characteristics of the project, such specialized interfaces may indirectly enhance the performance of the system.

Smart Cities and Open-Source Electronics Platforms
The availability of open-source prototyping and development platforms has the potential to deeply change the way IoT applications are created and this trend became even more striking with the release of some popular electronics platforms. Although there is a great appeal around these platforms for DIY (Do-It-Yourself) applications, with a lot of projects in the "Smart Home" domain [19,[29][30][31], different types of IoT applications can be designed. Nowadays, the development of smart-city systems based on such platforms is a reasonable and inexpensive choice for many projects. In addition, the last years have given us some clues of what applications can be created and what can still be envisioned for the near future [32].
Open-source electronics platforms will be typically employed to sense information from the environment or to make specialized processing of such information or other data (e.g., received from the Internet). Concerning sensing functions, we can roughly expect that two different types of information can be gathered: scalar and multimedia. Scalar information such as temperature, pressure, humidity, and luminosity is useful for many applications, and open-source boards can be efficiently used to gather and process such sensed data. However, as such data is usually short, the processing, the transmission and the storage of scalar information are not necessarily a critical issue, opening different opportunities for smart-city applications. On the other hand, multimedia sensing will be performed by cameras and microphones to retrieve large amounts of data, which can also have time restrictions when performing real-time processing. Multimedia-based smart cities are thus more challenging, and they rise additional performance concerns. Nevertheless, it will be natural to see some applications employing scalar and multimedia sensing units at the same board, exploiting continuous developments of more powerful hardware components and more efficient communication standards.
In the context of smart cities, IoT applications are typically designed to solve a particular problem of urban environments. In this sense, smart cities tend to be created by the composition of different concurrent systems [5,33,34]. Considering the state-of-the-art in this area and the use of open-source electronics boards, we selected a group of smart-city common problems to be addressed by such boards, presenting recent works that proposed solutions for them. Although there are many more issues to be addressed by smart-city applications [33], the discussed problems and related approaches are a good indication of the use of open-source boards in this area.

•
Parking system: Large cities daily face the prominent problem of parking and the increasing number of cars in urban areas is continuously aggravating this issue. IoT applications may then be used to manage free parking spots, indirectly reducing congestion and car accidents when the time trying to find an available spot is reduced; The state-of-the-art of IoT and smart-city applications is surveyed in next subsections, but only for works that specify at least one of the considered open-source electronics boards as central elements of the solutions. The selection of the works was made based on this characteristic and the addressing of some of the presented smart-city challenges.

Parking System
Popular open-source electronics platforms are being used to manage parking systems, following different approaches. The work in [35] employed the Raspberry Pi platform to create an intelligent parking system for smart cities. The authors proposed the use of a Raspberry Pi board to manage the vacant parking spots and to inform drivers about them. Drivers can verify the availability of free parking spots through their smartphones and perform payment when required. A distance (ultrasonic) sensor is used in each parking spot, which is then connected to a NodeMCU/ESP8266 board [36]. A Raspberry Pi 3 B board is used as the central unit of the system, collecting data from all NodeMCU, and delivering information to the users. A similar approach was discussed in [37], which directly connected the ultrasonic sensors (in each parking spot) to a Raspberry Pi board, potentially decreasing the cost of the overall solution (but maybe turning it more complex to handle and more susceptible to failures). Moreover, the work in [37] considered the use of the Raspberry Camera to also detect the presence of cars.
For some solutions, the overall cost is a critical parameter and researchers struggle to develop a cheap system. In this sense and still addressing the problem of smart parking in urban areas, the work in [38] also employed ultrasonic sensors to detect the presence of cars, but instead of monitoring each parking spot individually, the detection of cars is performed only in the entrance and exit gates of each monitored parking area. Doing so, the accounting of the available parking spots is performed considering the total number of spots and the cars flow. In [38], a single Raspberry Pi board was used in each parking area as a central server, computing the available parking spots and delivering such information for the users. In fact, this approach is affordable when there are costs limitations, and it could be easily implemented in many cities.
Parking systems were also developed using the Arduino platform. In [39] a parking system employed Infra-Red (IR) sensors in each parking slot to detect if it is free. Then, an LCD display in the parking area entrance is used to exhibit information about the free spots. Moreover, RFID cards are used to support authorization management, since the parking area may not be public. All sensors and supporting hardware (as a motor to open the gate) are connected to an Arduino board, which makes all processing locally. Similarly, the work in [40] also monitored free parking spots using Arduino boards, which were connected to presence sensors (photosensitive). Additionally, an ESP8266 module was used to allow Wi-Fi communications by Arduino boards, enabling them to send information to an external system to inform users about the current parking system state. Differently, in [41] authors combined Arduino and Raspberry Pi platforms to support efficient parking, leaving the most computation burden to the Raspberry Pi board. As an interesting service, the work in [41] also employed CMOS sensors to detect the cars plates.
Following a different trend of the previously presented works, authors in [42] proposed a generic software solution for easy experimentation of visual sensor networks, which can be used in the context of smart cities. As a generic solution, the proposed approach could be used to perform many different functions. As an example of use, the work in [42] employed the BeagleBoard platform as a use case for parking management. The authors made an experiment using a BeagleBone Black board as a central unit, employing a camera to identify free parking spots. Although the work presented in [42] is generic in the sense that a complete software solution is proposed, the adoption of the BeagleBone Black as the open-source experimentation board also indicates its relevance for IoT applications.

Mobility
One of the main goals of smart-city systems is to enhance mobility, which can be achieved optimizing the public transportation system, the vehicles flows and the traffic conditions in rush hours. For that, different aspects can be addressed, and open-source electronics boards can be used to support solutions in this area.
A desired service for smart cities is vehicle tracking, since it is important for public transportation enhancement. The work in [43] proposed a bus tracking system, deploying a Raspberry board on each monitored bus. GPS (Global Positioning System) and GSM/GPRS (Global System for Mobile communications/General Packet Radio Service) expansion boards are attached to Raspberry Pi to provide localization information and data communication through the cellular network, respectively. Such services are then used to indicate the online location of the bus. A similar approach was performed in [44], but in that work a pre-determined route is defined for the vehicle trajectories. The idea was to send alert message if the driver picks a different route other than the one previously specified and already stored in the Raspberry Pi storage card. Moreover, auxiliary sensors for gas leakage and temperature were also employed, aiming at the monitoring of the safety conditions of the drivers.
In [45], the Arduino board was used to keep track of moving vehicles using GPS as the localization service. Then, a GSM/GPRS expansion board was employed to transmit positioning information to be displayed on any user smartphone. A similar work was conducted in [46], but now using a XBee expansion board (IEEE 802.15.4) instead of a GSM/GPRS module.
Concerning congestion and traffic jams, a relevant issue in smart cities is traffic-light management. The work in [47] employed a Raspberry Pi board to control the traffic lights to soften traffic jams in harsh hours. As traffic conditions may suddenly change, for example due to a car accident, the Raspberry Pi board could be used to adjust the time programming of traffic lights, but this service was not performed automatically in [47]. In that work, a user accesses the Raspberry board through an Android App and manually controls the traffic lights. From a different perspective, a Raspberry Pi board was used in [48] to measure the traffic flow (counting cars) and to automatically adjust the traffic lights programming, using a camera for that. The traffic light controllers can then transmit information among them using Wi-Fi connections, allowing a more efficient control of a set of traffic lights.
Still following this trend, the work in [49] employed Arduino boards to control traffic lights. The idea is to perform image processing to change the traffic lights programming, changing waiting times according to the detected vehicle flows on the lanes. In the proposed system, processing is performed in a "conventional" computer (webcams are connected to it) and only decisions are transmitted to two Arduino boards, which ultimately control the lights time. The Arduino platform was also used to support the Raspberry-based solution described in [48].
Also addressing the mobility issues in smart cities, but from a different perspective, the work in [50] leveraged RFID cards as a mechanism to manage passengers in a public system, controlled by a BeagleBone Black board. That board also controls advertisement and information displayed on LCD displays, integrating two important services expected from smart-city environments. From the same perspective, data gathered from every monitored bus is displayed on LCD panels in [51], employing a Raspberry Pi board to gather GPS information transmitted by buses (they have a Raspberry Pi board) and to display that information in a bus terminus.

Energy Management
Open-source boards can also be used to save energy and manage energy consumption in urban areas. The authors in [52] proposed a system to turn on lamp posts only in the presence of cars or pedestrian, instead of keeping the lamps always on during dark times. A Raspberry Pi board was used to control the entire system, being deployed as a single control node. Then, ZigBee communications [53] were performed to control the lamp posts on a defined area. The LEDs in the lamp posts are turned on when it is dark, and cars or pedestrians are detected through presence sensors. Those sensors are not connected to the Raspberry Pi board, but they communicate through Wi-Fi. A similar approach is presented in [54], but it used Arduino boards in all lamp posts, except the coordinator post, which was controlled by a Raspberry Pi board.
Still considering efficient management of lamp posts, the work in [55] employed an Arduino board to control the lights and to monitor the temperature and humidity of a region. As LED lamps may have their light intensity adjusted, authors proposed the use of LDR (Light Dependent Resistors) sensors to reduce light intensity (and energy consumption) when a region is already too bright, potentially achieving efficient lighting on an area. An Arduino board was used in [55] to integrate the sensor units and to perform the adjustments.
An interesting work was presented in [56]. In that work, a neural network was employed to reduce energy consumption in residences, mainly in peak hours, which may affect energy distribution planning in the neighborhoods. As energy consumption in a city is not uniform, and different fares may apply for different periods of the day, the proposed system acts reducing energy consumption when demand is naturally higher. The proposed solution is mainly processed in a Raspberry Pi board.

Discussions and Comments
There are many works proposing IoT and smart-city applications to solve relevant problems in urban areas. The presented and discussed works are only some examples of feasible projects that have open-source electronics boards as the processing core of the proposed solutions. Table 2 summarizes these smart-city prototypes and projects that are centered around at least one of the presented open-source development platforms. As can be seen in Table 2, the surveyed works were published in recent years as expected. Although Arduino is a bit older, the Raspberry and the BeagleBoard platforms are still very young, but their potentials as development platforms for smart-city applications are continuously being proved. Their open-source nature, the reduced energy consumption and low acquisition costs are some of the characteristics that are making these boards winning choices.

Perspectives and Future Directions
The adoption of open-source electronics development platforms as key elements to construct monitoring and control applications has the potential to accelerate the expected transformations promoted by the IoT era [57], with smart cities, vehicular networks, smart farming, integrated health assistance and other disruptive applications potentially changing the way we perceive and interact with the world. The projects and products being created with such open-source boards are becoming increasingly common and this trend will still be more evident with transformations in the educational system: children are having early contact with these boards, supporting the creation of a maker generation [58,59].
For the particular maturation of the smart-city initiatives, the presented open-source hardware platforms will continue to have an important role. In addition, there are some perspectives in this area that are relevant when envisioning future directions for them. Next subsections discuss some of these perspectives.

Multimedia Sensing
The development of affordable tiny camera and microphone hardware components to be connected to open-source boards opened new possibilities for monitoring applications. Different manufacturers are continuously releasing new extension boards and specialized electronics components, which has facilitated the designing of smart-city solutions based on multimedia data. The selection of the most appropriate multimedia components is then a relevant project choice.
For Raspberry Pi, the success of the original board encouraged the creation of a specialized camera that could be easily installed, being initially released in 2013. The Raspberry Camera is a low-power high-definition small camera that is shipped with a flexible flat cable to be plugged into the CSI (Camera Serial Interface). For the BeagleBoard and Arduino platforms, some specialized cameras have good performance and affordable prices, such as the CMOS OV7670. Concerning microphones, there are different components and the acquisition cost will be a function of the desired sensibility and audio capturing quality.
Besides choosing the proper multimedia electronic components, the development of smart-city applications based on image, video and audio will also have to be concerned with other issues, since its inherent higher complexity will directly impact storage, processing, and data transmission. Additionally, more complex tasks such as video compressing may also demand high processing power, which may prohibit the use of some resource-constrained boards. One of the trends for this problem is the adoption of development extension boards, as described in Section 4.2. Such extensions may bring additional processing power or even an extra GPU (Graphical Processing Unit), better supporting multimedia-based applications.
Some works have exploited multimedia sensing for IoT applications. The work in [60] investigated the transmission of high-definition video on the Raspberry Pi platform (particularly the Raspberry Pi 2 B), considering time constraints (real-time transmissions). The Raspberry Camera is used to transmit H.264 video streams and authors in [60] concluded that the desired high-definition real-time video transmissions were satisfactorily performed using the Raspberry Pi board and an IoT P2P communications framework. Considering the BeagleBone Black board, the work in [61] proposed a framework to create smart nodes that can handle any kind of data, including audio, image, and video, making easier the development of distributed sensor nodes. For the work in [62], audio sensors were created using a Raspberry Pi 2 B board. In that work, different audio processing tasks were performed in the Raspberry board, aiming at the calculation of different audio noise parameters. Audio processing for noise detection was also performed in [63], which created audio sensing nodes with Raspberry Pi 3 B boards. All these recent works are leveraging the processing capabilities of open-source electronics platforms for multimedia data processing and storage, which may bring significant results for smart-city scenarios.

Development Extension Boards
One of the perspectives when using open-source electronics platforms is the availability of development extension boards. Such extensions improve the capabilities of the boards, typically adding additional processing power, sensing units, or even facilitating prototyping. Therefore, the choosing of development extension boards may be an important project decision and the constant releasing of new products reinforces the use of open-source boards for IoT and smart-city applications.
Development extension boards may be designed and produced by the same manufacturers of the open-source electronics platforms or even by other companies. Of course, this is possible due to the open-source nature of the platforms. In this way, this "extension boards market" is active and dynamical, constantly bringing novelties that can further support the development of significant applications for smart cities.
The connection of an extension board to an open-source board is performed exploiting the I/O pins. As most of these extensions will attach to the boards in a way that they will be over them, they are referred following this idea: for Raspberry Pi they are HAT (Hardware Attached on Top); for BeagleBoard, they are referred to as capes; and for Arduino, they are called shields. Table 3 presents some popular extension boards for the surveyed open-source electronics platforms. Among those extension boards, some of them can be very helpful for many smart-city applications. As an example, the Matrix Creator board has several onboard sensor units, which can provide many important sensed information for applications in an integrated way. Other interesting extension board is the 1Sheeld, which integrates smartphones and their sensors to Arduino (also providing software to facilitate this integration). Doing so, for example, the smartphone's camera and microphone can be used by the Arduino board, opening interesting opportunities. New extension boards are still being released and many of them may positively impact the development of IoT and smart-city applications. Figure 3 presents an example of two development extension boards (HAT) for the Raspberry Pi platform.

New Communication Technologies
The evolving of communications standards has a relevant role in the development of smart cities. Early applications were based on Wi-Fi technologies (more recently supported by ESP modules) but the advent of the IEEE 802.15.4 and ZigBee standard considerably changed this scenario. When extension boards supporting the ZigBee standard (mostly XBee modules) started to be released, a new wave of developments was possible [53,64]. In addition, we can expect such waves when new communication standards are released, once open-source boards are upgraded, and new extensions are released to allow such communications.
Concerning the perspectives in this area, a new communication standard can significantly enrich IoT smart-city applications. In a short term, a new standard, LoRa, has come as an efficient long-range low-power wireless communication standard that fits very well into the IoT demands [65]. Recently, some LoRa expansion boards were released, and new developments in this area are expected.
Other promising technology is 5G cellular networks. With this communication technology, high-bandwidth low-latency communication is possible, with higher communication range than current cellular networks. However, although promising, the introduction of 5G into the IoT world is still slow and other technologies are winning the race. With new releases of extensions boards, LoRa is being more believed to fulfill the IoT dreams and other standards such as Wi-Fi and Bluetooth are continuously evolving to increase bandwidth and reduce latency while keeping energy consumption low. The recent Raspberry Pi 3 B+ and Raspberry Pi 3 A+ models provide onboard support to the IEEE 802.11ac standard, allowing more efficient Wi-Fi communications. Some more years are still required to say what will be the winning technology for smart-city applications.
Therefore, multimedia sensing, real-time decisions and large data processing and storage will be some of the hot-topics to be addressed in smart-city applications and open-source electronics boards will play an important role to support the achievement of these goals. When concerning new communication technologies, the materialization of new standards in extensions boards and revised versions of open-source platforms will be crucial for the evolution of IoT and smart cities.

Conclusions
The advent of new hardware and communication technologies in the beginning of this century anticipated a series of innovations in the way information is gathered and processed, and initial developments of wireless sensor networks were first steps in this direction. However, although specialized hardware platforms were created to support sensing networks, such as the MicaZ [66] and the TelosB [67], and they had an important role in the consolidation of sensor networks, the era of open-source electronics platforms is coming to enhance not only wireless sensor networks and their variations, but also to boost the complete IoT landscape. This article is then a valuable resource when trying to understand the transformations we are still living.
This article is an important contribution for new developments in this area, providing information that can guide new researches and projects for IoT applications. The discussions and surveyed works may contribute to create a vibrating atmosphere around open-source electronics platforms, which will help them to become the main development solution for smart cities. In addition, other emerging areas such as smart agriculture, smart retail, smart health, among others, may also benefit from those platforms.
The open-source electronics boards are still evolving, and new products are continuously being released. New platforms such as the NodeMCU [36,68] are still coming to the scene, opening new possibilities for small and big developers. In this context, we can expect a promising future for smart-city initiatives, when manufacturers and governmental agencies are seeing this as a fertile environment for the so eagerly awaited transformations.


extfieldsofstudy:
Computer Science
Mathematics

text:
Short-Packet Two-Way Amplify-and-Forward Relaying

This letter investigates an amplify-and-forward two-way relay network (TWRN) for short-packet communications. We consider a classical three-node TWRN consisting of two sources and one relay. Both two time slots (2TS) scheme and three time slots (3TS) scheme are studied under the finite blocklength regime. We derive approximate closed-form expressions of sum-block error rate (BLER) for both schemes. Simple asymptotic expressions for sum-BLER at high signal-to-noise ratio (SNR) are also derived. Based on the asymptotic expressions, we analytically compare the sum-BLER performance of 2TS and 3TS schemes, and attain an expression of critical blocklength, which can determine the performance superiority of 2TS and 3TS in terms of sum-BLER. Extensive simulations are provided to validate our theoretical analysis. Our results discover that 3TS scheme is more suitable for a system with lower relay transmission power, higher differences between the average SNR of both links and relatively lower requirements on data rate and latency.

I. INTRODUCTION
Unlike the traditional broadband services mainly designed for human-operated mobile terminals, the fifth-generation (5G) cellular systems aim to provide extensive wireless connections between autonomous machines [1]. Machine-type communications are typically characterized with short burst packets. In some applications, it also requires ultra low latency, such as vehicle-to-vehicle (V2V) communication and tele-robotic surgery [2]- [4]. To meet the stringent latency requirement, designing short-packet communication with finite blocklength codes is essential for machine-type communications and has attracted considerable research interests recently (see [5]- [9] and the references therein).
In wireless communications, the Shannon theory shows the maximum information rate at which an arbitrarily low error rate can be achieved. However, it requires super-long packet length and is not applicable for short-packet communication scenarios. Motivated by this, [5] developed a new fundamental framework for short-packet communications and derived an error probability bound for a given blocklength and coding rate. It is shown that the block error rate (BLER) increases as the blocklength reduces. This new theoretical framework opens a new research direction for the design and analysis of shortpacket communications and requires a fundamental revisit of conventional cooperative networks, which are designed based on Shannon theory for extremely large packet length scenarios. Specifically, using a relay can improve the system performance on one hand by providing power gain but it may degrade the system performance on the other hand since the blocklength of each hop is halved compared with a non-cooperative transmission. This trade-off has been studied very recently in [6], [7] for one-way relaying network under both static and quasi-static channel conditions. Very recently, [10] revisited the fundamental comparison between half-duplex relaying and full-duplex relaying for short-packet communications in the finite blocklength regime.
Compared to one-way relaying, two-way relaying can further enhance the system spectral efficiency and reduce the network latency by allowing two sources to transmit/receive information simultaneously. To the best knowledge of the authors, the performance of two-way relaying under the finite blocklength regime has not been studied in the open literature. Motivated by this gap, in this paper we investigate a two-way relay network (TWRN) wherein two sources A, B exchange information with the help of one amplify-and-forward (AF) relay R. The information exchange between A and B can be accomplished using two time slots (2TS) or three time slots (3TS) schemes [11]. Specifically, in the 2TS scheme, A and B simultaneously transmit information to R during the first time slot. In the second time slot, R amplifies and forwards the received signal to A, B. In the 3TS scheme 1 , A and B transmit information to R sequentially during the first and second time slots. In the third time slot, R first processes the received signal and then amplifies and forwards it to A and B. It is shown in [11] that 3TS outperforms 2TS in terms of the sumbit error rate for various system setups. This is mainly because that in 3TS, the signals from A and B are received separately such that the relay can optimize its power allocation to these two signals to improve the system performance. However, when it comes to short-packet communication scenarios with finite blocklength codes, 3TS scheme has a shorter blocklength for each time slot than 2TS scheme, which could lead to a higher error rate for 3TS. Thus, it is necessary to revisit the performance comparison of 2TS and 3TS schemes of TWRNs in the finite blocklength regime.
It is worth pointing out that in the existing studies of long packet transmissions, the Shannon bound was applied, which only involves a logarithm function and depends on the received SNR. In this case, only the received SNR and the coding rate of the system are needed to be considered in the comparison between 2TS and 3TS schemes [11]. In contrast, for the considered short-packet communications, we need to jointly consider the received SNR, the coding rate, the blocklength and the BLER to compare these two relaying schemes properly. Furthermore, the new rate bound for shortpacket communications has a more complex structure and involves a complicated Q-function. As such, the performance analysis and optimization of short-packet communications require more complex mathematical manipulations and new approximation methods.
Notation: Throughout this paper, we use f X (x) and F X (x) to denote the probability density function (PDF) and cumulative distribution function (CDF) of a random variable X. E {·} represents the expectation operator.
II. SYSTEM MODEL We consider a two-way relay network (TWRN) consisting of two sources, A and B, and one amplify-and-forward (AF) relay R. All nodes in the considered TWRN are single-antenna and half-duplex devices. We assume that there is no direct link between two sources due to obstacles or severe attenuation, and the information exchange can be only performed via the intermediate relay. Each transmission block has a length of m symbols (i.e., channel uses). The links between A, R and B, R are assumed to suffer from Rayleigh fading with average power gain Ω A and Ω B , respectively. We assume quasi-static fading channels for which the fading coefficients remain constant during each transmission block and change independently from one block to the other.
In the following, we denote by P A , P B and P R the transmit power of A, B and R, respectively. We use N A , N B and N R to denote the variance of additive white Gaussian noise (AWGN) at A, B and R, respectively. For notation simplicity, we define the average SNR for the four links as According to [11], the exact end-to-end signal-to-noise ratio (SNR) at A and B implementing 2TS or 3TS schemes can be summarized as where δ ∈ {A, B} represents the received SNR at the two sources, τ ∈ {2, 3} indicates 2TS, 3TS schemes, and H, G are exponentially distributed random variables with unit power gain. The parameters a δ,τ , b δ,τ and c δ,τ in (1) are summarized in Table I, in which α and β with α 2 + β 2 = 1 are the power allocation factors for A's signal and B's signal in 3TS [11]. Note that the optimal values of α and β are derived later in the performance analysis section.
III. PERFORMANCE ANALYSIS In this section, we analyze the performance of the considered TWRN in terms of sum-block error rate (BLER) under the finite blocklength regime. The sum-BLER is defined as the sum of individual BLER at A and B. We first derive a closed-form expression of sum-BLER for both 2TS and 3TS schemes 2 . In order to gain further insights, we then derive a simple asymptotic expression for sum-BLER at high SNR range.

A. Sum-BLER
Let ε τ be the sum-BLER of the considered TWRN, where τ ∈ {2, 3} represents different transmission schemes. For a fair comparison, we consider that both A and B exchange σ bits of information over m channel uses in each packet transmission. Thus, the duration of each time slot in 2TS and 3TS is m τ = m/τ , measured by channel uses. The coding rate for each time slot in 2TS and 3TS is given by r τ = σ mτ .
According to [15,Eq. (59)], when m τ is sufficiently large (i.e., m τ > 100), ε τ can be tightly approximated as which measures the stochastic variability of the channel relative to a deterministic channel with the same capacity [5].
In the following, we evaluate the general term Ψ δ,τ in order to characterize the sum-BLER in (2). It is intractable to evaluate Ψ δ,τ in a closed-form and we are thus motivated to first use a linear approximation of Q given by [8], [9] √ mτ and ξ τ = θ τ + 1 2ϑτ √ mτ . With the above approximation, Ψ δ,τ can be evaluated as To further evaluate the above integral, we apply the partial integration theorem and Ψ δ,τ can be further evaluated as Note that an exact closed-form expression of F γ δ,τ (x) was given in [11,Eq. (29)]. However, due to the complicated structure of F γ δ,τ (x), we still cannot further solve the above integral. To tackle this, we apply the approximation to the received SNR given in (1) such that the CDF of γ δ,τ can now be approximated as [11,Eq. (29)]. To find a closed-form expression of Ψ δ,τ , we then use a series representation of exp − To solve the above integral, we represent the function y k+1 K 1 (y) in terms of Meijer's G-function [14,]. After some tedious mathematical manipulations, the above integral involving Meijer's G function can be solved by using the results in [16] and Ψ δ,τ can be expressed as where Although the expression given in (7) has infinite summation terms, we will later show in the simulation that very accurate results can be obtained even by choosing the first two summation terms. The sum-BLER of the considered TWRN can be obtained by substituting (7) into (2).
It is worth noting that no closed-form expressions for system performance were characterized in [7] for the one-way relay system, and our analytical expressions can be easily simplified and extended to cover this gap. Due to the complex structure of (2), we cannot further optimize the power allocation factors α, β and gain insights on the impacts of various system parameters. We are thus motivated to seek for a simple expression at high SNR range.

B. High SNR
By using the asymptotic result given in [11,Eq. (33)] and the expression given in (4), the asymptotic sum-BLER for the considered 2TS and 3TS schemes at high SNR range can be expressed as With the above asymptotic expression and the parameters defined in Table I, we can now characterize the optimal values of α 2 and β 2 . This can be done by first substitute β 2 = 1 − α 2 into (9) and then taking the derivative of (9) with respect to α 2 and solving the equation We then obtain that the optimal value of power allocation factors given by Moreover, at high SNR, the sum-throughput of the system is given by Θ τ =σ (2 − ε ∞ τ (σ)). By taking the derivative of the expression Θ τ with respect to σ, after some mathematical manipulations and using the identity of the Lambert W function that Y = Xe X ⇔ X = W (Y ) [17], the optimal information bits that maximize Θ τ can be expressed as σ * = m τ ln 2 W 2e A + e − 1 , where W (x) is the Lambert W function [17] and A = aA,τ +bA,τ cA,τ + aB,τ +bB,τ cB,τ . Furthermore, from (9), we can also characterize the minimum value of system blocklength to ensure a specific sum-BLER constraint ε. The minimum blocklength can be solved from (9) and given bym = στ .
In the following, we analytically compare the performance of 2TS scheme and 3TS scheme with optimal values of α and β at high SNR range. To this end, we define a sum-BLER ratio of the considered 2TS and 3TS schemes, denoted by With the definition, we have 2TS outperforms 3TS in terms of sum-BLER when ε ∞ 2 ε ∞ 3 < 1, and vice versa. Substitute the parameters in Table I, can be expressed in (10) on top of the next page, in which the parameter η is given by It is readily to verify that the term in (10) is an increasing function of m for m > 0. We now define a critical value of blocklength m * such that 2TS and 3TS schemes have the same sum-BLER performance. That is, m * is a solution to the equation We can then deduce that for every m > m * , 3TS scheme outperforms 2TS scheme in terms of sum-BLER, and for every m < m * , 2TS scheme outperforms 3TS scheme. In the following, we then aim to solve m * from With σ > 0 and m > 0, we can easily prove that 3 . Thus, m * only exists when (1 + η) > 3 2 , i.e., η > 1 2 . Otherwise, m * does not exist and is always less than 1. That is, 2TS scheme has a lower sum-BLER than 3TS scheme for any value of m when η ≤ 1 2 . Based on the above analysis, m * can be expressed as Remark 1: The above equation (12) can be used to design a TWRN for short-packet communications under stringent latency requirement. Specifically, let m d be the delay constraint of the network measured in channel uses. We first evaluate the critical value of blocklength m * based on the expression given in (12) for a specific system setup. If m * does not exist, we use 2TS scheme for any delay requirement m d . If m * exists and m d > m * , we choose 3TS to exchange information between the sources in order to achieve lower sum-BLER. Otherwise when m d < m * , we should adopt 2TS scheme.
We next examine the impact of different system parameters on the value of m * . From (12), we can see that m * grows as the transmission information bits σ increases. Besides, m * also increases as η decreases or ∆ decreases. The value of ∆ is affected by the average SNR of the four links. For symmetric source transmit powers and relay-to-source distances such that γ A,R =γ B,R andγ R,A =γ R,B , we immediately have ∆ = 0, η < 1 2 and m * does not exist. In this scenario, 2TS scheme always outperforms 3TS scheme. For the asymmetric system setup thatγ A,R =γ B,R orγ R,A =γ R,B , ∆ = 0 and ∆ grows as the differences betweenγ A,R andγ B,R ,γ R,A andγ R,B increase. We can now summarize that the critical value of blocklength m * decreases as the required information bits reduces and the differences between the average SNR of both links increase. We will later verify the above insights by simulation results in the next section.

IV. NUMERICAL RESULTS AND DISCUSSIONS
In this section, we present some simulation and numerical results to validate and illustrate the above theoretical analysis. In order to capture the effect of path-loss, we use the model where Ω XY with X, Y ∈ {A, B, R} is the average channel power gain between node X and Y , d XY denotes the distance between node X and Y , and ω ∈ [2,5] is the path-loss factor. Note that a 30 dB average signal power attenuation is assumed at a reference distance of 1 meter (m) in the above channel model. In all the following simulations, we set the distance between A, B and R as d AB = 100m, d AR = d BR = 50m, the path-loss factor ω = 3, and the noise power We first compare the analytical expression derived in (2) with the Monte Carlo simulation. The power allocation factors for 3TS scheme are set to be optimal in both the analytical and simulation results. In Fig. 1, we first can see that the derived analytical expression matches the simulation results well, especially at medium and high SNR range. This verifies the tightness of the approximation we adopted in the derivation. Moreover, for symmetric system setup (i.e., P A = P B = P R ), 2TS scheme outperforms 3TS scheme which coincides with the analysis provided in Remark 1. For asymmetric system setup, 2TS scheme and 3TS scheme may outperform each other depending on different transmit powers. As the analytical expression agrees well with the simulation, we will only show the analytical results in the following of this section.
We then compare the performance of 2TS and 3TS scheme for different total system blocklength m where the power allocation factors in 3TS scheme is set to be optimal. We plot the sum-BLER versus 300 ≤ m ≤ 2000 of 2TS and 3TS schemes for different scenarios. Figs. 2 and Fig.  3 validate our asymptotic analysis and the tightness of the derived critical blocklength in (12). We can observe from Figs. 2-3 that when m < m * , 2TS scheme outperforms 3TS scheme and otherwise, 3TS scheme outperforms 2TS scheme. From Fig. 2, we can observe that as the difference between  P A and P B grows, the critical value m * shifts to the left. This means that 3TS scheme is suitable for system with a higher difference between source transmit powers. In Fig. 3, we see that m * decreases as P R reduces, which means that 3TS scheme is appealing to scenario that relay transmit power is relatively low compared with source transmit powers. This is understandable as 3TS allocates different power for different source signals. The less the available power at the relay, the more the significance of this power allocation strategy. All of the above observations coincide well with the analysis provided in Remark 1.
V. CONCLUSIONS In this letter, we revisited the performance of a two-way relay network for short-packet communications in the finite blocklength regime. Specifically, we first derived closed-form expressions of average sum-block error rate (BLER) for both two time slots (2TS) and three time slots (3TS) schemes. To gain further insights and analytically compare the performance of 2TS and 3TS, simple asymptotic expressions of sum-BLER at high SNR range were derived for both schemes. We then defined and attained a critical blocklength which can be used to design a TWRN with various delay requirements. We also concluded that 3TS scheme is more suitable for a system with lower information rate, relatively low transmit power at relay, higher differences between the average SNR of both links and less stringent latency requirement.