Skip to content

Commit 12edd44

Browse files
author
Catalin Ioana
committed
Pymesh corrected documentation
1 parent ce6d44b commit 12edd44

File tree

7 files changed

+50
-48
lines changed

7 files changed

+50
-48
lines changed

content/pymesh/_index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ _**Note: For obtaining the Pymesh firmware please follow the steps from [Pymesh
2020

2121
## What does Pymesh offer you?
2222

23-
* Ad-hoc communication network over raw-LoRa radio
23+
* An ad-hoc communication network over raw-LoRa radio
2424
* Multi-gateway (Border Routers) Nodes that connect Mesh-internal data with the Cloud
2525
* Each Node uses LBS - Listen Before Talk
2626
* Security on multiple levels

content/pymesh/lib-api.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ aliases:
88

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

11-
Code is open-sourced in [pycom-libraries repository](https://github.com/pycom/pycom-libraries/tree/master/lib/pymesh).
11+
The code is open-sourced in [pycom-libraries repository](https://github.com/pycom/pycom-libraries/tree/master/lib/pymesh).
1212

13-
It is easily customisable and contributions are highly recommend using [Github PRs](https://github.com/pycom/pycom-libraries/pulls).
13+
It is easily customisable and contributions are welcome using [Github PRs](https://github.com/pycom/pycom-libraries/pulls).
1414

1515
### Main features
1616

@@ -40,7 +40,7 @@ A simple example of usage is in the [main.py](https://github.com/pycom/pycom-lib
4040

4141
## Specifications
4242

43-
It can be easily customised, by modifying any file from [/lib folder](https://github.com/pycom/pycom-libraries/tree/master/lib/pymesh/lib) and flashing it to the board. Automatically the uploaded file will be executed instead of the _frozen_ one, already embedded into the binary firmware.
43+
It can be easily customised, by modifying any file from [/lib folder](https://github.com/pycom/pycom-libraries/tree/master/lib/pymesh/lib) 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.
4444

4545
### Structure
4646

@@ -55,9 +55,9 @@ It can be easily customised, by modifying any file from [/lib folder](https://gi
5555
* setting BLE server
5656
* auxiliary files:
5757
* `pymesh-debug.py`
58-
* debugging on levels, allowing dynamically changing debug level
58+
* debugging on multiple levels, allowing dynamically changing the current debug level
5959
* `pymesh-config.py`
60-
* reading/writing Pymesh configuration file
60+
* reading/writing the Pymesh configuration file
6161
* `gps.py`
6262
* maintaining location coordinates, as an extension `Pytrack` GPS can be used
6363
* Mesh internals

content/pymesh/lib-ble-rpc.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@ This sets the location coordinates.
2828

2929
#### get_mesh_mac_list()
3030

31-
This returns list of distinct MAC address that are in this mesh network, for example `[mac1, mac2, mac 3]`.`
31+
This returns the list of distinct MAC address that are within this mesh network, for example `[mac1, mac2, mac 3]`.`
3232

3333
#### get_mesh_pairs()
3434

35-
This returns list of pairs that is a mesh connection, as shown bellow:
35+
This returns the list of pairs that form a mesh connection, as shown bellow:
3636

3737
```
3838
[
@@ -69,7 +69,7 @@ This returns the node data for a specified mac address, or own data id `mac_id`
6969

7070
#### send_message(data)
7171

72-
This sends a message with another node. It return True if there is buffer to store it (to be sent).
72+
This sends a message to another node. It return True if there is a buffer to store it (to be sent onwards).
7373

7474
`data` is a dictionary with the following structure:
7575
```
@@ -84,11 +84,11 @@ This sends a message with another node. It return True if there is buffer to sto
8484

8585
#### send_message_was_sent(mac, msg_id)
8686

87-
This checks if acknowledge was received for the specified `mac` and `msg_id`. It returns `True` if message was delivered.
87+
This checks if acknowledgement was received from the specified `mac` and `msg_id`. It returns `True` if message was delivered.
8888

8989
#### receive_message()
9090

91-
This returns the received messages, in a dictionary with the next structure:
91+
This returns the received messages, in a dictionary with the following structure:
9292
```
9393
{
9494
'b': 'text',

content/pymesh/lib-cli.md

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ aliases:
66

77
## Overview
88

9-
The Pymesh micropython library is included as frozen in the Pymesh firmware releases.
9+
The Pymesh micropython library is included as a `frozen python script` in the Pymesh firmware releases.
1010

11-
Instead of REPL, a specific Pymesh CLI is interpreting commands and it is recognised, by starting with `>`.
11+
Instead of REPL, a specific Pymesh CLI interprets commands. This is shown by `>`.
1212

1313
The CLI is executed on a separate thread inside the Pymesh library.
1414

@@ -25,10 +25,10 @@ List of available commands
2525
ip - display current IPv6 unicast addresses
2626
mac - set or display the current LoRa MAC address
2727
self - display all info about current node
28-
mml - display the Mesh Mac List (MAC of all nodes inside this Mesh), also inquires Leader
29-
mp - display the Mesh Pairs (Pairs of all nodes connections), also inquires Leader
28+
mml - display the Mesh Mac List (MAC of all nodes inside this Mesh)
29+
mp - display the Mesh Pairs (pairs of all nodes connections)
3030
s - send message
31-
ws - verifies if message sent was acknowledged
31+
ws - verifies if the message sent was acknowledged
3232
rm - verifies if any message was received
3333
sleep - deep-sleep
3434
br - enable/disable or display the current Border Router functionality
@@ -75,7 +75,7 @@ deepsleep_init
7575
Cleanup code, all Alarms cb should be stopped
7676
Going to deepsleep for 10 seconds
7777
```
78-
This puts the device in deepsleep for designated number of seconds.
78+
This puts the device into deepsleep for a designated number of seconds.
7979

8080
```
8181
>buf
@@ -110,20 +110,22 @@ This executes an Openthread CLI command. The list of CLI commands is [here](http
110110
>mac
111111
1
112112
```
113-
This shows LoRa MAC, this address is used as unique identifier in the Pymesh. Bellow there's a section on how to set MAC specific MAC address (useful for debugging, the MAC could be consecutive small numbers like `0x1`, `0x2`, `...`)
113+
This shows the LoRa MAC or sets it to a known value. This address is used as a unique identifier within the Pymesh.
114+
115+
This can be useful for debugging and the MAC could be set to consecutive small numbers, such as `0x1`, `0x2`, ...
114116

115117
```
116118
>mml
117119
mesh_mac_list [1, 6, 2]
118120
```
119-
This shows the list of all MAC Nodes attached to Pymesh. It inquires Leader, which centralises this data.
121+
This shows the list of all MAC Nodes attached to Pymesh. It inquires the Leader, which centralises this data.
120122

121123
```
122124
>mp
123125
Send pack: 0xF3 to IP fdde:ad00:beef:0:0:ff:fe00:fc00
124126
last_mesh_pairs [[2, 6, -87], [1, 6, -77]]
125127
```
126-
This shows Mesh Pairs list, with each direct connected nodes (by their MAC address) and the averaged RSSI value.
128+
This shows the Mesh Pairs list. It lists each directly connected node (by their MAC address) and the averaged RSSI value.
127129

128130
```
129131
>mni
@@ -143,15 +145,15 @@ True
143145
PACK_MESSAGE_ACK received
144146
1945883 ================= ACK RECEIVED :) :) :)
145147
```
146-
This sends text messages to another Node inside Pymesh. The messaging waits for acknowledgement (ACK message type) from the destination node.
148+
This sends text messages to another Node within the Pymesh. The messaging node waits for acknowledgement (ACK message type) from the destination node.
147149

148150
```
149151
>ws
150152
(to)<1
151153
ACK? mac 1, id 12345 => 1
152154
True
153155
```
154-
This shows if a message was acknowledged by the destination Node.
156+
This shows if the message was acknowledged by the destination Node.
155157

156158
```
157159
>rm
@@ -197,7 +199,7 @@ BR: [(net='2001:cafe:cafe:cafe::/64', preference=0)]
197199
(state 0=Disable, 1=Enable, 2=Display [Default Display])<
198200
Border Router state: [(net='2001:cafe:cafe:cafe::/64', preference=0)]
199201
```
200-
This enables/disables and shows the state of the current node as Border Router.
202+
This enables/disables the Border Router functionality of the current node. It also shows the state of the current node as Border Router.
201203

202204
```
203205
>brs
@@ -207,4 +209,4 @@ brs
207209
(port destination [Default: 5555])<
208210
Send BR message: {'ip': '1:2:3::4', 'b': '', 'port': 5555}
209211
```
210-
This sends a packet to an IP address external of the Pymesh. This packet will be received by the designated Border Router and it can be further forwarded to another network interface, like: BLE, Wifi, Sigfox or Cellular (Fipy only).
212+
This sends a packet to an external IP address, outside of the Pymesh. The packet will be received by the designated Border Router and it can be further forwarded to another network interface, such as: BLE, Wifi, Sigfox or Cellular (Fipy only).

content/pymesh/licence.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@ In order to receive access to the Pymesh firmware releases (for Lopy4, Fipy, L01
1010
<!-- <a href="/gitbook/assets/specsheets/Pycom_002_Specsheets_LoPy4_v2.pdf" target="\_blank"> the Pymesh LICENCE PDF document </a> -->
1111

1212
1. Complete the Pymesh LICENCE PDF document(not yet available), sign it and send us by [this email](mailto:catalin@pycom.io?subject=[Pymesh_LICENCE]).
13-
1. You will receive on email an archive containing the images for all boards.
14-
1. Extract the corresponding image, for example Lopy4.tar.gz, and upload the firmware to your board, using the [Pycom Firmware Update Tool](https://pycom.io/downloads/), like in the following image:
13+
1. You will receive by email an archive containing the images for all boards.
14+
1. Extract the corresponding image, for example Lopy4.tar.gz, and upload the firmware to your board, using the [Pycom Firmware Update Tool](https://pycom.io/downloads/), similar in the following image:
1515
<img src="/gitbook/assets/pymesh/pymesh_firmware_update.png" alt="Pymesh Firmware Update" width="500"/>
1616

1717
## Test Pymesh firmware loading
1818

1919
### Method 1
2020

21-
The simplest method to check if Pymesh class is successfully installed, just try this code directly in REPL:
21+
The simplest way to check if the Pymesh class has been successfully installed is to try the following code, directly in REPL:
2222

2323
```python
2424
>>> from network import LoRa
@@ -36,7 +36,7 @@ Q: **I've received an error, such as `(LoadProhibited). Exception was unhandled.
3636

3737
A: In some cases, the NVM partition needs to be formatted. For this a format of whole Flash Memory should be performed.
3838

39-
This can be done using the cli version of the Firmware Update Tool, so please navigate where this app was installed (search for pycom-fwtool-cli executable) and execute:
39+
This can be done using the cli version of the `Firmware Update Tool`, so please navigate where the app was installed (search for pycom-fwtool-cli executable) and execute:
4040
```
4141
pycom-fwtool-cli -p <PORT> erase_all
4242
```
@@ -45,4 +45,4 @@ pycom-fwtool-cli -p <PORT> erase_all
4545

4646
* on Windows `COM10`
4747
* on Linux `/dev/ttyACM0`
48-
* on MacOS ``/dev/tty.usbmodemPy8eaa911`
48+
* on MacOS `/dev/tty.usbmodemPy8eaa911`

content/pymesh/pymesh-br.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,19 @@ aliases:
99

1010
## Overview
1111

12-
The Border Router role, of a Node inside Pymesh, takes the traffic from the Pymesh and forwards it to the Cloud (Pymesh-external).
12+
Any node inside of the Pymesh can take on the role as a Border Router, which takes the traffic from the Pymesh and forwards it to the Cloud (Pymesh-external).
1313

1414
Several things must be accomplished:
1515

16-
* The BR node should have connection with the Cloud, using another network interface (than LoRa-Pymesh), for example: BLE, Wifi or Cellular.
17-
* The node has to be declared as BR, so all the other nodes send packets to it, with destination Cloud.
18-
* Dynamically multiple nodes can be BR, each of them having different priorities levels (Normal, High or Low)
19-
* The BR with the smallest routing cost is chosen.
20-
* If multiple BR have the same routing cost, the priority level is used.
16+
* The Border Router node should have connection with the Cloud. This should occur using another network interface (other than LoRa-Pymesh), for example: BLE, Wifi or Cellular.
17+
* The node has to be declared as a Border Router, so that all the other nodes send packets to it. The final destination is the Cloud.
18+
* To add flexibility, at runtime (dynamically), multiple nodes can act as Border Routers. Each of them can have different priority levels (Normal, High or Low).
19+
* The Border Router with the smallest routing cost is selected.
20+
* If multiple Border Routers have the same routing cost, then the priority level is used.
2121

2222
## Border Router using CLI
2323

24-
As explained in [Pymesh CLI - Border Router section](pymesh/lib-cli/#border-router-specific), using commands `br` and `brs`, a simple testing scenario can be easily implemented.
24+
As explained in [Pymesh CLI - Border Router section](pymesh/lib-cli/#border-router-specific), using commands `br` and `brs`, a simple test scenario can be easily implemented.
2525

2626
## Border Router using Pymesh API
2727

@@ -54,14 +54,14 @@ pymesh.send_mess_external(ip, port, "Hello World")
5454

5555
Internally, the Border Router mechanism is implemented with the following steps:
5656

57-
* declare the BR network address prefix, like `2001:dead:beef:cafe::/64`
58-
* this piece of information is sent to the `Leader` and the dataset will increase version (it will be updated)
59-
* the dataset is propagated to all Pymesh nodes
60-
* all the nodes will be assigned a random IPv6 unicast address with this network prefix (like `2001:dead:beef:cafe:1234:5678:9ABC:DEF0`)
61-
* if a node sends data to an IPv6 which is external (it doesn't have prefix from Pymesh already existent networks, like `1:2:3::4`), this UDP datagram will be routed to the BR
62-
* this UDP packet will have as source the random IPv6 from BR network address
63-
* BR will receive the UDP datagrams for external with an appended header, which contains:
57+
* Declare the Border Router network address prefix, for example `2001:dead:beef:cafe::/64`
58+
* The network address prefix is then sent to the `Leader` and the dataset will increase the version, meaning that it will be updated.
59+
* The dataset is propagated to all Pymesh nodes.
60+
* All the nodes will be assigned a random IPv6 unicast address with this network prefix (for example `2001:dead:beef:cafe:1234:5678:9ABC:DEF0`)
61+
* If a node sends data to an IPv6 which is external (meaning it doesn't have a prefix from already existent networks in Pymesh, for example `1:2:3::4`), then the UDP datagram will be routed to the Border Router
62+
* This UDP packet will have as source the random IPv6 from BR network address
63+
* The Border Router will receive the external UDP datagrams with an appended header, which contains:
6464
* MAGIC byte: `0xBB`
6565
* IPv6 destination as bytearray (16 bytes)
6666
* port destination as 2 bytes (1-65535 values).
67-
* the IPv6 destination is important so BR could actually route (forward) the UDP datagram content to the right interface (Wifi/BLE/cellular).
67+
* The IPv6 destination is important, because it means that the Border Router can route (forward) the UDP datagram content to the correct interface (Wifi/BLE/cellular).

content/pymesh/simple-example.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ aliases:
66

77
## What is Pymesh micropython library?
88

9-
Pymesh micropython library is a set of scripts included (as frozen) in the Pymesh firmware binary release (not yet released).
9+
The Pymesh Micropython library is a set of frozen scripts in the Pymesh firmware binary release (which has not yet been released).
1010

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

13-
It allows users to use Pymesh in a few lines of code, as shown in the following code snippet.
13+
It allows users to access Pymesh in a few lines of code, as shown in the following code snippet.
1414

1515
```python
1616

@@ -97,9 +97,9 @@ while True:
9797

9898
## Output
9999

100-
An example of output is bellow.
100+
An example of possible output is below.
101101

102-
At any point pressing `Enter` will try to execute CLI commands, more details are presented in [Pymesh library CLI](/pymesh/lib-cli).
102+
At any point pressing `Enter` will result in the attempt to execute CLI commands. More details are found in [Pymesh library CLI](/pymesh/lib-cli).
103103

104104
```
105105

0 commit comments

Comments
 (0)