painlessMesh creates a mesh network that is independent from any other/wider network. If you want to get information from your mesh to the wider network a bridge is currently needed. There are a couple of options.
- Have two devices communicate via the serial connection. One of them is a node to the mesh and the second one would be connected to the other network.
- The repository contains an example on setting up a node that will try to connect to a server (on another network). That server will need to run a program that listens on the correct port and understand enough of the mesh protocol to communicate. A program that can be run on the server is available here.
- ESP8266s are limited to using the same channel on the AP and STA, because of this the above solution requires the mesh to be on the same channel as the other/wider network.
- Similar to the solution above you can run a linux computer (raspberry pi) with the painlessMeshBoost in client mode. This allows the raspberry pi to act like an end node. That node connects to the mesh and all other nodes on the mesh can send their data to the raspberry pi. This requires the raspberry pi to have two wifi devices though, one to connect to the mesh network, the other to the wider network.
- One node can act as an MQTT client and connect to an MQTT server. This node will translate between the MQTT protocol and the mesh protocol. An example is included in the repository
- Another possible solution is to have your bridge node run in AP only mode and use the other connection to translate it to a server. This option will take some careful programming though and there are some limitations that it is important to be aware of (listed here). If anyone gets this to work reliably then please post some example code on the wiki or as an issue on gitlab. That way others can benefit from your work.