# Open-Source MQTT-Based End-to-End IoT System for Smart City Scenarios
## 6 Discussion  
Novel solutions to efficiently and safely manage emerging services in smart cities have been considered. Citizens are much more likely to use alternative mobility solutions, especially as a consequence of the COVID-19 pandemic, characterized by different vulnerabilities that co-exist with more traditional ones. The need to manage and protect vulnerable road users and protect them from accidents is emerging and can be solved by advanced  
\begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Technology** & **WiFi** & **EDGE** & **HSPA+** & **4G** \\ \hline Average Delay & 58 ms & 1158 ms & 651 ms & 467 ms \\ Maximum Delay & 104 ms & 1997 ms & 1430 ms & 589 ms \\ Minimum Delay & 31 ms & 746 ms & 343 ms & 302 ms \\ \hline \hline \end{tabular}
\end{table}
Table 1: MQTT message latency through different communication technologies.  
Figure 8: Handle Value Notification.  
IoT technologies that are suitable even for cheap vehicles. In this paper, we have proposed a system that introduces an E2E solution that is able to monitor the VRU data through wearable devices. Through the proper use of different communication technologies (i.e., BLE, MQTT), devices (i.e., ESP32, Android, Raspberry PI) and software technologies (i.e., Websocket), we have built a Proof-of-Concept solution to monitor the user data in real time. The possibility of benefiting from commonly used devices, such as Android smartphones, as well the open-source release of the whole system code, allows the fast deployment of the proposed solution in smart city scenarios. This solution, which has been demonstrated to be feasible, adopts a flexible open-source software that makes it available to support an additional plug-in for future services.  
While main solutions for IoT are based on ad hoc data collection that lacks flexibility and scalability, the solution proposed in this paper shows that by using common off-the-shelf elements, it is possible to enable the design of a highly scalable and flexible IoT system, that, even though presented for road users, can be also applied, with the data collected by the same set of sensors, to other purposes, such as road maintenance or crowd management, and many other use cases. We believe that showing a complete workflow for this kind of application can foster the development of large-scale IoT systems, being of interest not only for researchers but also for enterprises that can rise and spread in this field.  
The next steps involve the insertion of multiple users able to act as both the publisher and subscriber so as to enable a user-to-user communication paradigm. Moreover, the possibility of exploiting virtualization and containerization technologies will be exploited in order to create a more flexible environment. Finally, we will endeavor to solve privacy and security concerns. At this time, the solution includes online basic security mechanisms, as detailed in the paper. It is widely known that MQTT necessitates additional security mechanisms [39; 40], and in the future, they will become part of the project under development.  
Conceptualization, D.T. and C.R.; methodology, D.T. and C.R.; software, C.D.; validation, C.D., D.T. and C.R.; investigation, C.D.; resources, C.D.; data curation, C.D.; writing--original draft preparation, C.D.; writing--review and editing, D.T. and C.R.; visualization, C.D.; supervision, D.T. and C.R. All authors have read and agreed to the published version of the manuscript.  
This research received no external funding.  
Not applicable.  
The data presented in this study are openly available in Github at [20].  
The authors would like to acknowledge [PERSON], [PERSON] and [PERSON] for their development as a result of Bachelor Thesis work.  
The authors declare no conflict of interest.