mirror of
https://github.com/sascha-hemi/pycom-documentation.git
synced 2026-03-21 05:06:35 +01:00
Added Pymesh chapter
This commit is contained in:
56
config.toml
56
config.toml
@@ -520,20 +520,6 @@ theme = "doc-theme"
|
||||
parent = "tutorials@lora"
|
||||
weight = 70
|
||||
|
||||
[[menu.main]]
|
||||
name = "LoRa Mesh"
|
||||
url = "/tutorials/lora/lora-mesh/"
|
||||
identifier = "tutorials@lora@lora-mesh"
|
||||
parent = "tutorials@lora"
|
||||
weight = 80
|
||||
|
||||
[[menu.main]]
|
||||
name = "PyMesh Border Router"
|
||||
url = "/tutorials/lora/pymesh-br/"
|
||||
identifier = "tutorials@lora@pymesh-br"
|
||||
parent = "tutorials@lora"
|
||||
weight = 90
|
||||
|
||||
[[menu.main]]
|
||||
name = "Sigfox Examples"
|
||||
url = "/tutorials/sigfox/"
|
||||
@@ -1229,6 +1215,48 @@ theme = "doc-theme"
|
||||
parent = "pybytes@integrations"
|
||||
weight = 10
|
||||
|
||||
# *** Pymesh
|
||||
[[menu.main]]
|
||||
name = "Pymesh"
|
||||
url = "/pymesh/"
|
||||
identifier = "pymesh"
|
||||
weight = 95
|
||||
|
||||
[[menu.main]]
|
||||
name = "Pymesh Library API"
|
||||
url = "/pymesh/library"
|
||||
identifier = "pymesh@library"
|
||||
parent = "pymesh"
|
||||
weight = 10
|
||||
|
||||
[[menu.main]]
|
||||
name = "Micropython API"
|
||||
url = "/firmwareapi/pycom/network/lora/pymesh"
|
||||
identifier = "pymesh@api"
|
||||
parent = "pymesh"
|
||||
weight = 20
|
||||
|
||||
[[menu.main]]
|
||||
name = "Simple Example"
|
||||
url = "/pymesh/lora-mesh"
|
||||
identifier = "pymesh@lora-mesh"
|
||||
parent = "pymesh"
|
||||
weight = 30
|
||||
|
||||
[[menu.main]]
|
||||
name = "Border Router Examplee"
|
||||
url = "/pymesh/pymesh-br"
|
||||
identifier = "pymesh@pymesh-br"
|
||||
parent = "pymesh"
|
||||
weight = 40
|
||||
|
||||
[[menu.main]]
|
||||
name = "Advanced Security Example"
|
||||
url = "/pymesh/security-advanced"
|
||||
identifier = "pymesh@security-advanced"
|
||||
parent = "pymesh"
|
||||
weight = 50
|
||||
|
||||
# *** Documentation Notes
|
||||
[[menu.main]]
|
||||
name = "Documentation Notes"
|
||||
|
||||
32
content/pymesh/_index.md
Normal file
32
content/pymesh/_index.md
Normal file
@@ -0,0 +1,32 @@
|
||||
---
|
||||
title: "Pymesh"
|
||||
aliases:
|
||||
- pymesh/introduction
|
||||
---
|
||||
|
||||
<img src="/gitbook/assets/pymesh/pymesh_roles.png" alt="Pymesh" width="500"/>
|
||||
|
||||
## What is Pymesh?
|
||||
|
||||
Pymesh is the LoRa full Mesh network technology.
|
||||
|
||||
Mesh networks essentially get rid of gateways, which decentralises the network’s infrastructure. This then means that the network becomes flexible, so it can do many wonderful things – such as generate, change and fix itself. The success of the Mesh network is down to its parts, as any node within the network will automatically connect to the best radio-link available.
|
||||
|
||||
Pymesh solution works on all of our LoRa supporting development boards, the LoPy4 and FiPy as well as on our OEM modules, L01 and L04.
|
||||
|
||||
## What Pymesh offers you?
|
||||
|
||||
* Ad-hoc communication network over raw-LoRa radio
|
||||
* Multi-gateway (Border Routers) Nodes that connect Mesh-internal data with the Cloud
|
||||
* Each Node uses LBS - Listen Before Talk
|
||||
* Security on multiple levels
|
||||
** base level: authentication and encryption using AES 128bit key, so all traffic inside Pymesh is secured
|
||||
** advanced level: RSA or AES at application level allows private communication channels above Pymesh.
|
||||
* Any LoRa device (Lopy4/Fipy) can have any of the Pymesh Node Role: Leader, Router, Child or Border Router.
|
||||
|
||||
## Let's get started!
|
||||
|
||||
* [Pymesh Micropython API](/firmwareapi/pycom/network/lora/pymesh)
|
||||
* [Simple Example](/pymesh/lora-mesh)
|
||||
* [Border Router Example](/pymesh/pymesh-br)
|
||||
* [Advanced Security Example](/pymesh/security-advanced)
|
||||
45
content/pymesh/library.md
Normal file
45
content/pymesh/library.md
Normal file
@@ -0,0 +1,45 @@
|
||||
---
|
||||
title: "Pymesh Library"
|
||||
aliases:
|
||||
- pymesh/library
|
||||
---
|
||||
|
||||
## What is Pymesh micropython library?
|
||||
|
||||
Pymesh micropython library is a set of scripts included (as frozen) in the Pymesh firmware binary release (Not yet released).
|
||||
|
||||
It allows users to use Pymesh in a few lines of code, as shown in the following code snippet.
|
||||
|
||||
```python
|
||||
import pycom
|
||||
import time
|
||||
|
||||
from _pymesh_config import PymeshConfig
|
||||
from _pymesh import Pymesh
|
||||
|
||||
pycom.heartbeat(False)
|
||||
|
||||
# read config file, or set default values
|
||||
pymesh_config = PymeshConfig.read_config()
|
||||
|
||||
#initialize Pymesh
|
||||
pymesh = Pymesh(pymesh_config, new_message_cb)
|
||||
|
||||
while not pymesh.is_connected():
|
||||
print(pymesh.status_str())
|
||||
time.sleep(3)
|
||||
|
||||
# send message to the Node having MAC address 6
|
||||
pymesh.send_mess(6, "Hello World")
|
||||
|
||||
def new_message_cb(rcv_ip, rcv_port, rcv_data):
|
||||
''' callback triggered when a new packet arrived '''
|
||||
print('Incoming %d bytes from %s (port %d):' %
|
||||
(len(rcv_data), rcv_ip, rcv_port))
|
||||
print(rcv_data)
|
||||
|
||||
# user code to be inserted, to send packet to the designated Mesh-external interface
|
||||
# ...
|
||||
return
|
||||
|
||||
```
|
||||
@@ -1,12 +1,12 @@
|
||||
---
|
||||
title: "Pymesh"
|
||||
title: "Pymesh Example"
|
||||
aliases:
|
||||
- tutorials/lora/lora-mesh.html
|
||||
- tutorials/lora/lora-mesh.md
|
||||
- chapter/tutorials/lora/lora-mesh
|
||||
---
|
||||
|
||||
{{% hint style="info" %}}
|
||||
{{% hint style="info" %}}
|
||||
These API's are currently only available in the latest RC builds.
|
||||
{{% /hint %}}
|
||||
|
||||
BIN
static/gitbook/assets/pymesh/pymesh_roles.png
Normal file
BIN
static/gitbook/assets/pymesh/pymesh_roles.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 123 KiB |
Reference in New Issue
Block a user