EG254S: IoT System Project - IoT Network  IoT Security

Understanding the Meshquitto Network

 (Adapted from: https://github.com/sglvladi/meshquitto)

The Meshquitto is a simple Arduino project, which I had found from the web, that aims to provide a gateway between a mesh network of ESP8266's and a remote MQTT broker (refer to the diagram below). As mentioned previously in understanding the painlessMesh Setup, the Meshquitto uses the MQTT protocol communication.

How it works

The Meshquitto Gateway is composed of 2 ESP8266 devices which I will be using the Adafruit Feather HUZZAH ESP8266 for the project.

1st ESP8266 – MQTT Gateway

The MQTT Gateway connects to an available WiFi network and consequently establishes a connection to a MQTT broker (Raspberry Pi). Any messages received from the MQTT broker are forwarded to the Mesh gateway and vice versa.

 

2nd ESP8266 – Mesh Gateway

The Mesh Gateway connects to the mesh network. Any messages received from the MQTT Gateway are forwarded to the Mesh network. Likewise, published messages from any of the Meshquitto Nodes to the MQTT broker must first be sent to the Mesh Gateway before being forwarded to the MQTT Gateway.

Communication between the MQTT Gateway and Mesh Gateway ESP8266 devices is achieved through Software serial. Since Software serial does not provide parity check functionality, CRC16 is used to detect transmission errors.

(NOTE: Retransmission is not currently implemented, thus corrupted messages are simply dropped).

Secured Communication

AES encryption has been imported to add an extra security layer to messages passed between nodes in the mesh.

Therefore, messages sent wirelessly between the nodes in the mesh network as well as to the mesh gateway are encrypted using Advanced Encryption Standard (AES). Later, we will also be setting up SSL/TLS across the Internet when we look at IoT Security.

 

For further details on meshquitto: https://github.com/sglvladi/meshquitto