|
|
# PainlessMesh Technical Documentation
|
|
|
|
|
|
PainlessMesh creates a self organizing and repairing network where all nodes are connected. All nodes in the mesh are equal. The network uses a star topology, avoiding any circular paths. Messages between different nodes are sent in JSON format, making them easy to understand and produce. Information on the JSON schema used for the various messages can be found [here](https://gitlab.com/BlackEdder/painlessMesh/wikis/mesh-protocol).
|
|
|
PainlessMesh creates a self organizing and repairing network where all nodes are connected. All nodes in the mesh are equal. The network uses a star topology, avoiding any circular paths. Messages between different nodes are sent in JSON format, making them easy to understand and produce. Information on the JSON schema used for the various messages can be found [here](https://gitlab.com/painlessMesh/painlessMesh/wikis/mesh-protocol).
|
|
|
|
|
|
# List of features
|
|
|
|
... | ... | @@ -8,18 +8,17 @@ PainlessMesh creates a self organizing and repairing network where all nodes are |
|
|
- Fairly easy setup.
|
|
|
- Usable on **Arduino** environment.
|
|
|
- Implemented as a layer-3 protocol. Connectionless and without confirmation.
|
|
|
- Totally **asyncrhronous**. No need to poll for new messages.
|
|
|
- Totally **asynchronous**. No need to poll for new messages.
|
|
|
- **Accurate time synchronization**. All nodes share same clock with a precision better than 10 ms.
|
|
|
- All nodes know the complete topology instantly. Updated every 3 seconds.
|
|
|
- Mesh **autoconfigure** itself. Any node can be disconnected in any moment. Any new node is integrated automatically.
|
|
|
- All nodes continuously monitor its directly connected peers to check if they are active.
|
|
|
- Single addressed and broadcast messages are possible.
|
|
|
- Network loops are actively avoided.
|
|
|
- Prepared to run nodes on **battery** with limited functionality by using `sleep()` function.
|
|
|
|
|
|
## Network layout
|
|
|
|
|
|
Every node acts as an accesspoint (AP) for other nodes to connect to and as a client to connect to one AP of another node. There is a limit of 4 station nodes per AP. This limit is fixed by ESP8266 SDK.
|
|
|
Every node acts as an accesspoint (AP) for other nodes to connect to and as a client to connect to one AP of another node. There is a limit of 4 station nodes per AP for ESP8266 and 10 for ESP32.
|
|
|
|
|
|
Each node which is not already/anymore connected to an AP, scans for AP's from other nodes periodically. It will connect to the AP with the strongest signal, which is not already present in the list of connections or sub-connections, i.e. which is not known yet to the node. By only connecting to unknown APs the mesh avoids the creation of network loops, such that there is a single route between each pair of nodes in the mesh.
|
|
|
|
... | ... | @@ -31,7 +30,7 @@ The direction of the arrow represents the direction in which connections are mad |
|
|
|
|
|
A list of connections of the node is stored and for each connection a list of sub-connections is also stored. (Note: the list of connections contains the connections which are received by the node and the connection (max 1) that are initiated by the node.). Every node knows the complete network topology.
|
|
|
|
|
|
The list of sub-connections per node is obtained by a request/response message. The request contains the sub-connections of the requesting node, and the response contains the sub-connections of the responding node. The collection of sub-connections returned, always excludes the requesting connection and its sub-connections. For more information see the [protocol information](https://gitlab.com/BlackEdder/painlessMesh/wikis/mesh-protocol#routing-information)
|
|
|
The list of sub-connections per node is obtained by a request/response message. The request contains the sub-connections of the requesting node, and the response contains the sub-connections of the responding node. The collection of sub-connections returned, always excludes the requesting connection and its sub-connections. For more information see the [protocol information](https://gitlab.com/painlessMesh/painlessMesh/wikis/mesh-protocol#routing-information)
|
|
|
|
|
|
Cases in which a new node sync is done
|
|
|
|
... | ... | @@ -55,11 +54,11 @@ For broadcast messages, all connections are iterated and the message is sent to |
|
|
|
|
|
# Mesh Protocol
|
|
|
|
|
|
[Protocol description](https://gitlab.com/BlackEdder/painlessMesh/wikis/mesh-protocol)
|
|
|
[Protocol description](https://gitlab.com/painlessMesh/painlessMesh/wikis/mesh-protocol)
|
|
|
|
|
|
# Library API
|
|
|
|
|
|
[API description](https://gitlab.com/BlackEdder/painlessMesh/wikis/api)
|
|
|
[API description](https://gitlab.com/painlessMesh/painlessMesh/wikis/api)
|
|
|
|
|
|
|
|
|
|
... | ... | |