Skip to content

Networking and Communications

For this week’s assignment I used my barduino board and a commercial ESP32 development board to experiment with ESP-Wifi-MESH networking. According to Espressif’s documentation,

Mesh Networking

ESP-WIFI-MESH is a networking protocol built atop the Wi-Fi protocol. ESP-WIFI-MESH allows numerous devices spread over a large physical area (both indoors and outdoors) to be interconnected under a single WLAN (Wireless Local-Area Network). ESP-WIFI-MESH is self-organizing and self-healing meaning the network can be built and maintained autonomously.

What’s particular about Mesh Networking, is that instead of all nodes having to be in range of the main access point, they just have to be in range of each other, as long as one or more are connected. They relay the relevant information between nodes.

A regular network works this way:

! traditional networking

Whereas a Mesh Network works this way: ! traditional networking

It’s like each device or node is also an access point, they can self-organize and dynamically talk to each other to ensure that the packets reach their final node destination.

In order to program my mesh network, I followed a Random Nerd tutorial on the subject.

Standing on the shoulders of people who actually know what they’re doing, I followed the tutorial to install a library that takes care of the particulars of creating a simple mesh network using esp8266 and esp32 hardware, in order to allow the programmer to work with a mesh network without having to worry about how the network is structured or managed. It’s aptly named painlessMesh. To run on ESP32, I also needed the AsyncTCP library. If I had some ESP8266 modules to add to this network, I’d need the ESPAsyncTCP library.

Once I had all the libraries and dependencies installed in Arduino IDE, I opened the simplest example sketch, the StartHere. This is an example sketch that gets uploaded to each of the ESP32 modules (or 8266 if you have them), and as soon as that’s done, they start blinking the default leds and sending messages to each other. In this case, they send “Hello from node 3864417485 (a number that identifies it in the network) myFreeMemory: (how ever much memory is has)”

I only changed the led pin on my Barduino board to make sure it lit up, as the default is not the same in the development module.

I find this very interesting and will look into it in the future, not only tro expand the range of sensing devices in the land at home, for example to collect information on pool water level, garden moisture, or other things like that. Also, there’s BLE mesh networking, and I’d like to explore and see if that can be used to synchronize several audio speakers, like my final project.

Files

StartHere Sketch

Checklist

Group assignment

  • Send a message between two projects

Individual assignment

  • Design, build, and connect wired or wireless node(s) with network or bus addresses

Learning outcomes

  • Demonstrate workflows used in network design

  • Implement and interpret networking protocols and/or communication protocols

Have you?

  • Linked to the group assignment page
  • Documented your project.
  • Documented what you have learned from implementing networking and/or communication protocols
  • Explained the programming process/es you used.
  • Outlined problems and how you fixed them
  • Included design files (or linked to where they are located if you are using a board you have designed and fabricated earlier) and original code.

Last update: June 30, 2022