Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions content/firmwareapi/pycom/network/lora/pymesh.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ lora = LoRa(mode=LoRa.LORA, region=LoRa.EU868,
frequency = 863000000, bandwidth=LoRa.BW_125KHZ, sf=7)

print("Enable Pymesh")
pymesh = lora.Pymesh()
pymesh = lora.Mesh()

# check node state inside Pymesh
# PYMESH_ROLE_DISABLED = 0, ///< The Pymesh stack is disabled.
Expand All @@ -39,9 +39,9 @@ For various other Pymesh examples, check the [Pymesh Chapter](/pymesh).

## Constructor

#### class network.LoRa.Pymesh(\*, key=masterkey)
#### class network.LoRa.Mesh(\*, key=masterkey)

This constructor `network.LoRa.Pymesh()` creates and configures the Pymesh object.
This constructor `network.LoRa.Mesh()` creates and configures the Pymesh object.

By default, the key is `0134C0DE1AB51234C0DE1AB5CA1A110F`.

Expand All @@ -53,7 +53,7 @@ from network import LoRa

lora = LoRa(mode=LoRa.LORAWAN, region=LoRa.EU868)
masterkey = ubinascii.unhexlify("112233")
pymesh = lora.Pymesh(key=masterkey)
pymesh = lora.Mesh(key=masterkey)

# as test, the masterkey can be printed
>>> print("masterkey:", pymesh.cli("masterkey"))
Expand All @@ -65,7 +65,7 @@ masterkey: 11223300000000000000000000000000
#### pymesh.deinit()

This destroys the Pymesh task. Any further Pymesh commands will return no answer.
To recreate the Pymesh, use the `LoRa.Pymesh()` constructor.
To recreate the Pymesh, use the `LoRa.Mesh()` constructor.

```python

Expand Down
6 changes: 5 additions & 1 deletion content/pymesh/lib-ble-rpc.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ aliases:
- pymesh/simple-example
---

## Overview

The Pymesh mobile application is available [here for both iOS and Android platforms](https://github.com/pycom/pycom-libraries/tree/master/pymesh/mobile_app). It can be used to connect over BLE to a Pymesh node. It also allows users to find out network information.

## RPC protocol

It is implemented in [ble_rpc.py](https://github.com/pycom/pycom-libraries/blob/master/lib/pymesh/lib/ble_rpc.py).
Expand Down Expand Up @@ -44,7 +48,7 @@ This returns the list of pairs that form a mesh connection, as shown bellow:

#### get_node_info(mac_id = ' ')

This returns the node data for a specified mac address, or own data if `mac_id` is not specified. Node data is dictionary with the following structure:
This returns the node data for a specified MAC address, or returns own data if the `mac_id` is not specified. The node data is given as a dictionary with the following structure:

```
{
Expand Down
6 changes: 4 additions & 2 deletions content/pymesh/simple-example.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@ aliases:

## What is Pymesh micropython library?

The Pymesh Micropython library is a set of frozen scripts in the Pymesh firmware binary release (which has not yet been released).
The Pymesh Micropython library is a set of frozen scripts in the Pymesh firmware binary release.

[Open-source on github](https://github.com/pycom/pycom-libraries/tree/master/lib/pymesh)
[Open-source on github](https://github.com/pycom/pycom-libraries/tree/master/pymesh/pymesh_frozen)

It allows users to access Pymesh in a few lines of code, as shown in the following code snippet.

Additionally, users can install the Pymesh mobile application which is available [here for both iOS and Android platforms](https://github.com/pycom/pycom-libraries/tree/master/pymesh/mobile_app). It allows users to connect over BLE to a Pymesh node and find out network information.

```python

import pycom
Expand Down