This week, I used the painlessMesh library to create a very simple mesh network of three nodes. I wrote the code to resemble how I believe our blimps/ RoCo robots should use the network once they are automated: they send instructions to one another that is interpreted in a switch statement, these instructions call different functions that the robots should do such as move forward or stop, and some instructions can have data following it that the robots can use to move.
In the demonstration video below, we have one node (the top one) that I am controlling using the Arduino serial monitor which has the ability to specify which node to message and what the instruction is (in reality we wouldn’t use the serial monitor, but we would control one node with our React app, and the node would determine how and where to send that information itself). The node can send a byte that either turns on or off the LED of another board. Also, I set up the library such that the node that sent the message blinks its LED when the other board confirms that it has received the message.
The topology of this system looks like this:
Although in the video I only controlled the blue root node from my laptop, I could also make the green nodes talk to each other, hopping through the blue node.
For high level instructions, I think that having the confirmation that the message received is important, so that the message can be resent if it was lost. However, for data such as sensor data streaming, high throughput is one of the main objectives, and losing a few packets is usually recoverable and acceptable if it means that more data can be sent. Additionally, there seems to be about a second delay from when I type the command into the serial monitor and the actual LED lighting up on the ESP feather boards. I’m pretty sure that this delay is attributed to the serial monitor itself, so when I am able to set up the React app to control the boards instead, I will do 2-way message (sending and receiving confirmation) latency tests, both from the root node to a leaf and also inter-leaf.