Secure home automation system based on ESP-NOW mesh network, MQTT and Home Assistant platform
Keywords:
ESP-NOW, Smart Home, Mesh Network, Domotic System, MQTT, Home AssistantAbstract
Domotics allows for the control and monitoring of interconnected electronic devices in a home through effective communication protocols within an Internet of Things (IoT) architecture. To achieve proper functionality, it is necessary to ensure the communication and security of the IoT devices that make up the network, which are the main challenges faced by domotic systems. In this context, we have developed an algorithm that allows for the creation of a secure mesh network using the ESP-NOW communication protocol, with data encryption on the mesh network. The algorithm has been implemented and evaluated using low-cost commercial IoT devices and integrated through a secure MQTT Broker with the Home Assistant domotic platform. Tests carried out in a real environment on the proposed domotic system indicate that the network is fast and stable, with an overall average latency of 75 ms and an overall average packet loss rate of 9.25%.
Downloads
References
J. Berru-Ayala, D. Hernandez-Rojas, P. Morocho-D ´ ´ıaz, J. NovilloVicuna, B. Mazon-Olivo, and A. Pan, “Scada system based on iot for ˜
intelligent control of banana crop irrigation,” in International Conference
on Applied Technologies. Springer, 2019, pp. 243–256.
D. L. Hernandez-Rojas, T. M. Fern ´ andez-Caram ´ es, P. Fraga-Lamas, ´
and C. J. Escudero, “A plug-and-play human-centered virtual teds
architecture for the web of things,” Sensors, vol. 18, no. 7, p. 2052,
T. N. Hoang, S.-T. Van, and B. D. Nguyen, “Esp-now based decentralized low cost voice communication systems for buildings,” in 2019
International Symposium on Electrical and Electronics Engineering
(ISEE), 2019, pp. 108–112.
J. N. Vicuna, D. L. H. Rojas, B. M. Olivo, and K. D. C. Elizaldes, ˜
“Monitoreo inalambrico de se ´ nales el ˜ ectricas de voltaje 110/220v a ´
traves de arduino,” ´ Alternativas, vol. 19, no. 1, pp. 55–62, 2018.
D. Eridani, A. F. Rochim, and F. N. Cesara, “Comparative performance
study of esp-now, wi-fi, bluetooth protocols based on range, transmission speed, latency, energy usage and barrier resistance,” in 2021
International Seminar on Application for Technology of Information and
Communication (iSemantic), 2021, pp. 322–328.
R. Rizal Isnanto, Y. Eko Windarto, J. Imago Dei Gloriawan, and F. Noerdiyan Cesara, “Design of a robot to control agricultural soil conditions
using esp-now protocol,” in 2020 Fifth International Conference on
Informatics and Computing (ICIC), 2020, pp. 1–6.
X. Wen and Y. Wang, “Design of smart home environment monitoring
system based on raspberry pi,” in 2018 Chinese Control And Decision
Conference (CCDC), 2018, pp. 4259–4263.
L. Leonardi, G. Patti, and L. Lo Bello, “Multi-hop real-time communications over bluetooth low energy industrial wireless mesh networks,”
IEEE Access, vol. 6, pp. 26 505–26 519, 2018.
H. Yuliandoko and A. Rohman, “Flooding detection system based on
water monitoring and zigbee mesh protocol,” in 2019 4th International
Conference on Information Technology, Information Systems and Electrical Engineering (ICITISEE), 2019, pp. 385–390.
M. S. Amjad, J. Wan, H. Li, X. Chen, and J. Yao, “Latency measurement and analysis of z-wave network in smart home environment,” in
Advances in Information and Communication, A. Kiv, T. D’Hondt, and
J. Steinberger, Eds. Cham: Springer International Publishing, 2020, pp.
–340.
E. Feki, K. Kassab, and A. Mami, “Integration of the small board
computers rasp berry pi in home automation based on knx protocol,” in
IEEE 19th Mediterranean Microwave Symposium (MMS), 2019,
pp. 1–4.
W. You and H. Ge, “Design and implementation of modbus protocol
for intelligent building security,” in 2019 IEEE 19th International
Conference on Communication Technology (ICCT), 2019, pp. 420–423.
J. J. C. Calva, D. L. H. Rojas, R. F. M. Roman, and C. D. R. Garc ´ ´ıa,
“Seguridad iot: Principales amenazas en una taxonom´ıa de activos,”
HAMUT’AY, vol. 7, no. 3, pp. 51–59, 2021.
W. Liu, Y. Li, J. Li, Y. Xue, and B. Li, “Vulnerability analysis of espmesh protocol in smart home,” Security and Communication Networks,
vol. 2021, pp. 1–11, 2021.
espressif. (2022) Esp-now. [Online]. Available:
https://github.com/espressif/esp-now
C. M. Tupas Castro, A. Sharma, D. Sampath Kumar, K. Abidi, and
N. Kim, “The implementation of thread network for a smart factory,”
in 2022 IEEE Symposium Series on Computational Intelligence (SSCI),
, pp. 253–260.
M. G. Gomez, “Sistema de control de casa inteligente utilizando ´
el protocolo esp-now: Smart-home control system using the esp-now
protocol,” Investigacion y Ciencia Aplicada a la Ingenier ´ ´ıa, vol. 4,
no. 24, pp. 1–6, 2021.
A. U. Khan, M. E. Khan, M. Hasan, W. Zakri, W. Alhazmi, and
T. Islam, “An efficient wireless sensor network based on the esp-mesh
protocol for indoor and outdoor air quality monitoring,” Sustainability,
vol. 14, no. 24, 2022. [Online]. Available: https://www.mdpi.com/2071-
/14/24/16630
G. Facchinetti, G. Petrucci, B. Albanesi, M. G. De Marinis, and
M. Piredda, “Can smart home technologies help older adults manage
their chronic condition? a systematic literature review,” International
Journal of Environmental Research and Public Health, vol. 20, no. 2,
[Online]. Available: https://www.mdpi.com/1660-4601/20/2/1205
M. L. Daniel, G. G. Cristian, P. G.-B. Cristina, and M. C.-L. Juan,
“Bilrost: Handling actuators of the internet of things through tweets
on twitter using a domain- specific language,” International Journal of
Interactive Multimedia and Artificial Intelligence, vol. 6, no. 6, pp. 133–
, 2021.
R. Berjon, M. Mateos, M. E. Beato, and A. Fermoso Garc ´ ´ıa, “An
event mesh for event driven iot applications,” International Journal of
Interactive Multimedia and Artificial Intelligence, vol. 7, no. 6, pp. 54–
, 2022.
P. Sharma, S. Namasudra, R. Gonzalez Crespo, J. Parra-Fuente, and
M. Chandra Trivedi, “Ehdhe: Enhancing security of healthcare documents in iot-enabled digital healthcare ecosystems using blockchain,”
Information Sciences, vol. 629, pp. 703–718, 2023. [Online]. Available:
https://www.sciencedirect.com/science/article/pii/S0020025523001639
X. Zhu and H. Deng, “A security situation awareness approach for
iot software chain based on markov game model,” Special Issue on
Multimedia Streaming and Processing in Internet of Things with Edge
Intelligence, vol. 7, no. 5, pp. 59–65, 2022.
S. Das and S. Namasudra, “A lightweight and anonymous mutual
authentication scheme for medical big data in distributed smart healthcare systems,” IEEE/ACM Transactions on Computational Biology and
Bioinformatics, pp. 1–12, 2022.
C. Zhang, B. Vinodhini, and B. A. Muthu, “Deep learning assisted medical insurance data analytics with multimedia system,” ijimai journal,
painlessMesh. (2016) Painlessmesh. [Online]. Available:
https://gitlab.com/painlessMesh/painlessMesh
N. Reynolds. (2021) m2mmesh. [Online]. Available:
https://github.com/ncmreynolds/m2mMesh
arttupii. (2022) Espnow flooding mesh library. [Online]. Available:
https://github.com/arttupii/espNowFloodingMeshLibrary
ESP32Home. (2020) Espnowwrapper. [Online]. Available:
https://github.com/ESP32Home/ESPNowWrapper
A. Zholtikov. (2022) Zhnetwork. [Online]. Available: https://github.com/aZholtikov/ZHNetwork#esp-now-based-meshnetwork-for-esp8266esp32
D. Holdeman. (2017) Nowmesh. [Online]. Available:
https://github.com/chuckwagoncomputing/NowMesh
M. F. Wicaksono and M. D. Rahmatya, “Iot for residential monitoring
using esp8266 and esp-now protocol,” Jurnal Ilmiah Teknik Elektro
Komputer dan Informatika (JITEKI), vol. 8, no. 1, pp. 93–106, 2022.
B. Mazon-Olivo, D. Hernandez-Rojas, J. Maza-Salinas, and A. Pan, ´
“Rules engine and complex event processor in the context of internet
of things for precision agriculture,” Computers and Electronics in
Agriculture, vol. 154, pp. 347–360, 2018.
A. Alzahrani and T. H. H. Aldhyani, “Artificial intelligence algorithms
for detecting and classifying mqtt protocol internet of things
attacks,” Electronics, vol. 11, no. 22, 2022. [Online]. Available:
https://www.mdpi.com/2079-9292/11/22/3837
A. M. Campoverde, D. L. Hernandez, and B. E. Maz ´ on, “Cloud ´
computing con herramientas open-source para internet de las cosas,”
Maskana, vol. 6, pp. 173–182, 2015.
D. L. Hernandez-Rojas, T. M. Fern ´ andez-Caram ´ es, P. Fraga-Lamas, ´
and C. J. Escudero, “Design and practical evaluation of a family of
lightweight protocols for heterogeneous sensing through ble beacons in
iot telemetry applications,” Sensors, vol. 18, no. 1, p. 57, 2017.
D. Hernandez-Rojas, B. Mazon-Olivo, J. Novillo-Vicuna, C. Escudero- ˜
Cascon, A. Pan-Bermudez, and G. Belduma-Vacacela, “Iot android gateway for monitoring and control a wsn,” in International Conference
on Technology Trends. Springer, 2017, pp. 18–32.
JoelDR. (2023) Bram-now. [Online]. Available:
https://github.com/JoelDR/BRAM-NOW-mesh
M. Al-Mashhadani and M. Shujaa, “Iot security using aes encryption
technology based esp32 platform.” Int. Arab J. Inf. Technol., vol. 19,
no. 2, pp. 214–223, 2022.
F. E. Potestad Ordo´nez, E. Tena S ˜ anchez, M. d. P. Parra Fern ´ andez, ´
M. d. C. Baena Oliva, A. J. Acosta Jimenez, M. Valencia Barrero, and ´
C. J. Jimenez Fern ´ andez, “Metodolog ´ ´ıa de diseno para la detecci ˜ on´
de fallos en cifradores de bloques basada en codigos de hamming,” ´
Sinerg´ıas en la investigacion en STEM ´ , 2022.
Node-RED. (2022) Node-red guide. [Online]. Available:
J.-H. Park, H.-S. Kim, and W.-T. Kim, “Dm-mqtt: An efficient mqtt
based on sdn multicast for massive iot communications,” SENSORS,
vol. 18, no. 9, SEP 2018.
E. Wang, L. Xiao, X. Han, B. Tan, and L. Luo, “Design of an agile
training system based on wireless mesh network,” IEEE Access, vol. 10,
pp. 84 302–84 316, 2022.
M. Wang, Y. Li, J. Lv, Y. Gao, C. Qiao, B. Liu, and W. Dong, “Ace:
A routing algorithm based on autonomous channel scheduling for
bluetooth mesh network,” Electronics, vol. 11, no. 1, 2022. [Online].
Available: https://www.mdpi.com/2079-9292/11/1/113
A. Marahatta, Y. Rajbhandari, A. Shrestha, A. Singh, A. Thapa,
F. Gonzalez-Longatt, P. Korba, and S. Shin, “Evaluation of a lora
mesh network for smart metering in rural locations,” Electronics,
vol. 10, no. 6, 2021. [Online]. Available: https://www.mdpi.com/2079-
/10/6/751
V. D. Pham, D. T. Le, R. Kirichek, and A. Shestakov, “Research on using
the aodv protocol for a lora mesh network,” in Distributed Computer
and Communication Networks, V. M. Vishnevskiy, K. E. Samouylov, and
D. V. Kozyrev, Eds. Cham: Springer International Publishing, 2020,
pp. 149–160.
K. Khanchuea and R. Siripokarpirom, “A multi-protocol iot gateway
and wifi/ble sensor nodes for smart home and building automation:
Design and implementation,” in 2019 10th International Conference of
Information and Communication Technology for Embedded Systems (ICICTES), 2019, pp. 1–6.
![](https://latamt.ieeer9.org/public/journals/1/submission_7915_11474_coverImage_en_US.png)