Drone mesh network, concept using ESP-WIFI-MESH

Concept

Implementation
I made a simple implementation of this concept using esp32 and esp-wifi-mesh library, as per the concept, the node 0 encodes and decodes data between mesh and host, the data are encoded and decoded in base64

I tested with my two available fc minipix and pixhawk 6c, and the system works*

Two fc’s with esp32

decoder esp32

mission planner

Problem
I believe there are much more room for improvement, but for now when connecting the node 0 sends all drones data with the mix, some times gcs stuck in loading parameters or loads one drone data not the other and when switching it reading data all over again,
For now to overcome this problem i need to power cycle the drone one after another or try plugging in and out node 0 multiple times to get all drone data with the parameters

This bottleneck in node 0 might be the problem that I am guessing, or it could be a bad code.

Tried something to solve?
I try to read the gcs data that is broadcasting so that i can create a scheduler that helps to connect drones orderly and relieves some bottleneck on the node 0. So the data from gcs i read in both hex and ascii, initially the data is random and then sends mission planner version, Afterwards this data is followed {a….b….c….d….e…(so on) …y… z} might be the parameter reading? Then steady length data stream, i observed this from node 1, but i couldn’t find any differentiating factor for reading particular drone data alone

I am out of options, any solution or suggestions would be helpful

Code
This is the code i using, its a arduino code using painless mesh library

remember to change node 0 ie router-base address in node code
node-v1.ino line 29

3 Likes

Hello,

I have accept this as blog even if it is a starting POC as it could bring some good discussion

From your code : raise baudrate, raise your buffer as if you have message bigger than 256bytes, they won’t pass.
Then, why encode in base64 ? mavlink msg are already serialized, so you should be able to forward them directly.

One optimization would be to know the packet size limit that the meshing allow and start packing your mavlink msg (which means to parse them to know their id and size) to fit the mesh packet ! You will save air time doing so.

1 Like

I would recommend adding proper mavlink routing with relaying and packet deduplication.

hey there
thank you for accepting this blog

As per the comment, i have raised the baudrate and buffer from 115200 to 921600 and 256 to 512 (ig we can push more in esp-wifi-mesh) , now I am able to get steady connection from both the drones (v1.2)!
i tried to send mavlink msg directly, but the gcs couldn’t able to connect, it says “connection failed” and then painless mesh library allows only char data to sent so i have to convert the data, each time to sent and receive
parsing the messages into batches of mesh package limit is great, and i have tried it in v3.1 code, where you can mention batch size and buffer size

although esp-wifi-mesh has package limit of 1,456 bytes we can push more ig, but for low throughput communication like lora batching the message will be great

1 Like

i am looking to modify the mavesp8266 project

1 Like

added mavlink parse in v4

1 Like

It’s great to see this because MAVESP (ardupilot version, original version) has always had an issue where it can’t deal with more than a single vehicle.

We don’t seem to really be maintaining MAVESP very well though so it’s fallen behind as well.

I might try and install what you’ve got here and see if I can get it working. I’m currently using the Seeed Studio ESP32C3 but I could replace it with another version although I’m limited to using hardware that’s been certified for use in Japan (e.g has a Japanese “giteki”)

1 Like

Hello, thank you for your support, it is been a while, I was trying possible application beyond Wi-Fi telemetry, like inter drone communication and possibility of decentralized traffic management system, since my last update i converted the project from Arduino to platform IO, and some minor changes regarding packet size, Wi-Fi power and i added a simple paring procedure between router and node, instead of hardcoding the id in the node code

Now I am trying to use Espressif esp-wifi-mesh library instead of painlessmesh for variety of mesh topology and applications

1 Like

Great stuff

For other people seeing this thread, there is also another alternative called DroneBridge but I don’t think it handles a mesh network.

1 Like

[update]
hello all, I being working on to switch from painlessmesh library to ESP-WIFI-MESH and it is done, i have published it as separate git branch (ESP-WIFI-MESH) , so what’s it by switching?

  • it brings all goodies offered by ESP-WIFI-MESH, like self healing network, optimized data transfer, and more i recommend to check out esp-wifi-mesh documentation
  • ability to connect to router

but,

  • For now , router is needed for the mesh to function
  • yes we can go with no router too, but i believe it is only available on ESP-MDF which requires specific version on esp-idf… but I am trying to make no router version on esp-wifi-mesh itself

here is the current working diagram of this telemetry


since there is a router in the system, so i added TCP support to the root node, where you can use either serial or TCP to connect , to toggle between tcp and serial change the value “ENABLE_TCP_DISABLE_SERIAL” in wifi-mesh-router

[note: In TCP mode, IP is not static it is dynamic]
To configure the router and node change these

problems in ESP-WIFI-MESH
comparing previous versions this losses packets a lot, i don’t why… may be bad code?, but i find that this version of wifi-mesh very sensitive to baudrate, rtos_delay, and buffer size, but i don’t know how to tune these, for now i find that to read 1024 bytes at 115200 baud it need 88ms delay, where this is functional, Any insight and suggestions will be helpful

Also parallelly I working on “Dynamic node” in this, there is no root and node presets, the drone near to router or best connection with router, will be assigned as root, then that root drone will be a gateway for other drones data. The cool thing is something to happen to that root drone, the network itself do a election on which node is near or best connection with router then it is set that drone as root, again take a look at esp-wifi-mesh documentation

I published this node on different git branch named “nodular”, under nodular you can find Dynamic-node, the problem with this is it has to act as gateway for all drone as well as it need to send it’s own telemetry data through TCP only, yes root drones can’t communicate via mesh they use TCP for there telemetry… I have given my shot I was able to connect the other drones on the mesh except the root drone…

Any suggestions or changes and clarification would be helpful

1 Like

Hello,
I really like your work on PainlessMesh applied to drones.
I would like to use it for a project based on PX4 and QGroundcontrol. However, I am not a computer engineer. Could you explain to me, how to build the binaries?

Thanks

Best Regards