Looks like you have already written a lot of low-level code for your device already (https://github.com/meshtastic/Meshtastic-esp32) but have y'all considered taking a look at the Nerves project (https://nerves-project.org)?
You might uncover some really cool stuff in the Erlang/Elixir ecosystem for doing mesh communications.