From cd833cf97a4481b80e02092530bda32f0d542b80 Mon Sep 17 00:00:00 2001 From: Catalin Ioana Date: Mon, 4 Nov 2019 13:18:24 +0200 Subject: [PATCH 1/3] [Pymesh] Corrected Lora.Mesh class, add link mobile --- content/firmwareapi/pycom/network/lora/pymesh.md | 10 +++++----- content/pymesh/lib-ble-rpc.md | 7 ++++++- content/pymesh/simple-example.md | 6 ++++-- 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/content/firmwareapi/pycom/network/lora/pymesh.md b/content/firmwareapi/pycom/network/lora/pymesh.md index 40bad67e..411c4194 100644 --- a/content/firmwareapi/pycom/network/lora/pymesh.md +++ b/content/firmwareapi/pycom/network/lora/pymesh.md @@ -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. @@ -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`. @@ -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")) @@ -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 diff --git a/content/pymesh/lib-ble-rpc.md b/content/pymesh/lib-ble-rpc.md index 0f4c6ae8..cda68eb3 100644 --- a/content/pymesh/lib-ble-rpc.md +++ b/content/pymesh/lib-ble-rpc.md @@ -4,6 +4,10 @@ aliases: - pymesh/simple-example --- +## Overview + +Pymesh mobile application is available [here for both iOS and Android platforms](https://github.com/pycom/pycom-libraries/tree/master/pymesh/mobile_app). Using it, users can connect over BLE with a Pymesh node and 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). @@ -44,7 +48,8 @@ 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: + ``` { 'ip': 4c00, # last 2bytes from the ip v6 RLOC16 address diff --git a/content/pymesh/simple-example.md b/content/pymesh/simple-example.md index b477164b..f878c973 100644 --- a/content/pymesh/simple-example.md +++ b/content/pymesh/simple-example.md @@ -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 could 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). Using it, users can connect over BLE with a Pymesh node and find out network information. + ```python import pycom From a3a557d5095072273d7cb33e36079274283e8425 Mon Sep 17 00:00:00 2001 From: Catalin Ioana Date: Mon, 4 Nov 2019 14:01:07 +0200 Subject: [PATCH 2/3] [Pymesh] Corrected content --- content/pymesh/lib-ble-rpc.md | 2 +- content/pymesh/simple-example.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/content/pymesh/lib-ble-rpc.md b/content/pymesh/lib-ble-rpc.md index cda68eb3..dbbae615 100644 --- a/content/pymesh/lib-ble-rpc.md +++ b/content/pymesh/lib-ble-rpc.md @@ -6,7 +6,7 @@ aliases: ## Overview -Pymesh mobile application is available [here for both iOS and Android platforms](https://github.com/pycom/pycom-libraries/tree/master/pymesh/mobile_app). Using it, users can connect over BLE with a Pymesh node and find out network information. +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 diff --git a/content/pymesh/simple-example.md b/content/pymesh/simple-example.md index f878c973..87c2fee9 100644 --- a/content/pymesh/simple-example.md +++ b/content/pymesh/simple-example.md @@ -12,7 +12,7 @@ The Pymesh Micropython library is a set of frozen scripts in the Pymesh firmware It allows users to access Pymesh in a few lines of code, as shown in the following code snippet. -Additionally, users could 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). Using it, users can connect over BLE with a Pymesh node and find out network information. +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 From f7989270777468d57a838f17034aa31337fab248 Mon Sep 17 00:00:00 2001 From: Catalin Ioana Date: Mon, 4 Nov 2019 18:49:14 +0200 Subject: [PATCH 3/3] [Pymesh] The Pymesh... --- content/pymesh/lib-ble-rpc.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/pymesh/lib-ble-rpc.md b/content/pymesh/lib-ble-rpc.md index dbbae615..0a828540 100644 --- a/content/pymesh/lib-ble-rpc.md +++ b/content/pymesh/lib-ble-rpc.md @@ -6,7 +6,7 @@ aliases: ## Overview -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. +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