mirror of
https://github.com/sascha-hemi/pycom-documentation.git
synced 2026-03-22 00:06:09 +01:00
2.5 KiB
2.5 KiB
title, aliases
| title | aliases | |
|---|---|---|
| Pymesh Library API |
|
Overview
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
pymesh_config.pydefaults 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>- BLE is used with an RPC protocol, presented int Pymesh library BLE RPC
- 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.
Specifications
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.
Structure
pymesh.py- contains all the methods accessible from
main.py
- contains all the methods accessible from
cli.py- BLE services
ble_rpc.pyble_services.py- setting BLE server
- auxiliary files:
pymesh-debug.py- debugging on multiple levels, allowing dynamically changing the current debug level
pymesh-config.py- reading/writing the Pymesh configuration file
gps.py- maintaining location coordinates, as an extension
PytrackGPS can be used
- maintaining location coordinates, as an extension
- Mesh internals
mesh-interface.py- methods to inquire Mesh-internal parameters
mesh-internal.pyandloramesh.py- 2 layers of internal mesh maintenance