toc Pymesh Library API Pymesh > Pymesh Library API

Pymesh Library API


This Micropython library is included as frozen scripts in the Pymesh firmware release.

The code is open-sourced in pycom-libraries repository.

It is easily customisable and contributions are welcome using Github PRs.

Main features

  • Start Pymesh over LoRa on 863Mhz, bandwidth 250kHz, spreading-factor 7 (please check defaults for exact values).
  • Pymesh parameters are automatically saved in NVM, so in the next restart/deepsleep, the node will try to maintain its IP addresses and connections with neighbour nodes.
  • Start Bluetooth LE server with name PyGo <LoRa MAC>
  • Internal CLI for controlling/triggering Pymesh features, as explained in Pymesh library CLI.

Color coding LED

The LED color represents the state of the node in the Mesh network.

Blinking        - Send/Receive packet
Magenta         - LEADER
Green           - ROUTER
White           - CHILD,
Red             - Searching / Detached from any Pymesh
Cyan            - SINGLE LEADER (no other Router in the same Pymesh)

Example of usage

A simple example of usage can be found here.


It can be easily customised, by modifying any file from /lib folder and flashing it to the board. The uploaded file will automatically be executed instead of the frozen one, which is already embedded into the binary firmware.


    • contains all the methods accessible from
  • BLE services
  • auxiliary files:
      • debugging on multiple levels, allowing dynamically changing the current debug level
      • reading/writing the Pymesh configuration file
      • maintaining location coordinates, as an extension Pytrack GPS can be used
  • Mesh internals
      • methods to inquire Mesh-internal parameters
    • and
      • 2 layers of internal mesh maintenance


Previous Next