From 46e07d157e1149f8741127a18198d1a08a5b7035 Mon Sep 17 00:00:00 2001 From: Aline Date: Fri, 20 Dec 2019 17:17:08 +0100 Subject: [PATCH 01/11] docs: pybytes api documentation --- config.toml | 31 ++++--- content/pybytes/api/_index.md | 83 +++++++++++++++++++ content/pybytes/api/activate.md | 0 content/pybytes/api/add_custom_method.md | 0 content/pybytes/api/connect.md | 0 content/pybytes/api/connect_lora_abp.md | 14 ++++ content/pybytes/api/connect_lora_otta.md | 0 content/pybytes/api/connect_lte.md | 14 ++++ content/pybytes/api/connect_sigfox.md | 0 content/pybytes/api/connect_wifi.md | 14 ++++ content/pybytes/api/deepsleep.md | 0 content/pybytes/api/disconnect.md | 0 content/pybytes/api/dump_ca.md | 0 content/pybytes/api/enable_lte.md | 0 content/pybytes/api/enable_ssl.md | 0 content/pybytes/api/enable_terminal.md | 0 content/pybytes/api/export_config.md | 0 content/pybytes/api/get_config.md | 0 content/pybytes/api/is_connected.md | 0 content/pybytes/api/isconnected.md | 0 content/pybytes/api/print_config.md | 0 content/pybytes/api/read_config.md | 0 content/pybytes/api/reconnect.md | 0 .../register_periodical_analog_pin_publish.md | 0 ...register_periodical_digital_pin_publish.md | 0 content/pybytes/api/send_analog_pin_value.md | 0 content/pybytes/api/send_battery_level.md | 0 content/pybytes/api/send_custom_location.md | 0 content/pybytes/api/send_custom_message.md | 0 content/pybytes/api/send_digital_pin_value.md | 0 content/pybytes/api/send_info_message.md | 0 content/pybytes/api/send_ping_message.md | 0 content/pybytes/api/send_scan_info_message.md | 0 content/pybytes/api/send_signal.md | 0 content/pybytes/api/send_virtual_pin_value.md | 0 content/pybytes/api/set_config.md | 0 .../api/set_custom_message_callback.md | 0 content/pybytes/api/start.md | 0 content/pybytes/api/update_config.md | 0 content/pybytes/api/write_config.md | 0 content/pybytes/print_cfg_msg.md | 0 41 files changed, 144 insertions(+), 12 deletions(-) create mode 100644 content/pybytes/api/_index.md create mode 100644 content/pybytes/api/activate.md create mode 100644 content/pybytes/api/add_custom_method.md create mode 100644 content/pybytes/api/connect.md create mode 100644 content/pybytes/api/connect_lora_abp.md create mode 100644 content/pybytes/api/connect_lora_otta.md create mode 100644 content/pybytes/api/connect_lte.md create mode 100644 content/pybytes/api/connect_sigfox.md create mode 100644 content/pybytes/api/connect_wifi.md create mode 100644 content/pybytes/api/deepsleep.md create mode 100644 content/pybytes/api/disconnect.md create mode 100644 content/pybytes/api/dump_ca.md create mode 100644 content/pybytes/api/enable_lte.md create mode 100644 content/pybytes/api/enable_ssl.md create mode 100644 content/pybytes/api/enable_terminal.md create mode 100644 content/pybytes/api/export_config.md create mode 100644 content/pybytes/api/get_config.md create mode 100644 content/pybytes/api/is_connected.md create mode 100644 content/pybytes/api/isconnected.md create mode 100644 content/pybytes/api/print_config.md create mode 100644 content/pybytes/api/read_config.md create mode 100644 content/pybytes/api/reconnect.md create mode 100644 content/pybytes/api/register_periodical_analog_pin_publish.md create mode 100644 content/pybytes/api/register_periodical_digital_pin_publish.md create mode 100644 content/pybytes/api/send_analog_pin_value.md create mode 100644 content/pybytes/api/send_battery_level.md create mode 100644 content/pybytes/api/send_custom_location.md create mode 100644 content/pybytes/api/send_custom_message.md create mode 100644 content/pybytes/api/send_digital_pin_value.md create mode 100644 content/pybytes/api/send_info_message.md create mode 100644 content/pybytes/api/send_ping_message.md create mode 100644 content/pybytes/api/send_scan_info_message.md create mode 100644 content/pybytes/api/send_signal.md create mode 100644 content/pybytes/api/send_virtual_pin_value.md create mode 100644 content/pybytes/api/set_config.md create mode 100644 content/pybytes/api/set_custom_message_callback.md create mode 100644 content/pybytes/api/start.md create mode 100644 content/pybytes/api/update_config.md create mode 100644 content/pybytes/api/write_config.md create mode 100644 content/pybytes/print_cfg_msg.md diff --git a/config.toml b/config.toml index 9314f66..5e0ba37 100644 --- a/config.toml +++ b/config.toml @@ -1159,6 +1159,13 @@ theme = "doc-theme" parent = "pybytes" weight = 10 +[[menu.main]] + name = "Pybytes library API" + url = "/pybytes/api/" + identifier = "pybytes@api" + parent = "pybytes" + weight = 15 + [[menu.main]] name = "Add a device to Pybytes" url = "/pybytes/connect/" @@ -1178,7 +1185,7 @@ theme = "doc-theme" url = "/pybytes/sigfox/" identifier = "pybytes@sigfox" parent = "pybytes" - weight = 30 + weight = 25 [[menu.main]] name = "DevKit contract" @@ -1199,21 +1206,14 @@ theme = "doc-theme" url = "/pybytes/releases/" identifier = "pybytes@releases" parent = "pybytes" - weight = 20 - -[[menu.main]] - name = "Pybytes iOS" - url = "/pybytes/smart/" - identifier = "pybytes@smart" - parent = "pybytes" - weight = 20 + weight = 30 [[menu.main]] name = "Create new release" url = "/pybytes/releases/new/" identifier = "pybytes@releases@new" parent = "pybytes@releases" - weight = 20 + weight = 10 [[menu.main]] name = "Deploy release" @@ -1222,19 +1222,26 @@ theme = "doc-theme" parent = "pybytes@releases" weight = 20 +[[menu.main]] + name = "Pybytes iOS" + url = "/pybytes/smart/" + identifier = "pybytes@smart" + parent = "pybytes" + weight = 35 + [[menu.main]] name = "Visualise data" url = "/pybytes/dashboard/" identifier = "pybytes@dashboard" parent = "pybytes" - weight = 30 + weight = 40 [[menu.main]] name = "Integrations" url = "/pybytes/integrations/" identifier = "pybytes@integrations" parent = "pybytes" - weight = 40 + weight = 45 [[menu.main]] name = "Amazon IoT" diff --git a/content/pybytes/api/_index.md b/content/pybytes/api/_index.md new file mode 100644 index 0000000..413367b --- /dev/null +++ b/content/pybytes/api/_index.md @@ -0,0 +1,83 @@ +--- +title: "Pybytes library API" +aliases: + - pybytes/api +--- + +* [Connect Wifi](connect_wifi) + +* [Connect LTE](connect_lte) + +* [Connect LoRa ABP](connect_lora_abp) + +* [Connect LoRa OTAA](connect_lora_otaa) + +* [Connect Sigfox](connect_sigfox) + +* [Disconnect](disconnect) + +* [Send custom message](send_custom_message) + +* [Set custom message callback](set_custom_message_callback) + +* [Send ping message](send_ping_message) + +* [Send info message](send_info_message) + +* [Send scan info message](send_scan_info_message) + +* [Send digital pin value](send_digital_pin_value) + +* [Send analog pin value](send_analog_pin_value) + +* [Send virtual pin value](send_virtual_pin_value) + +* [Send signal](send_signal) + +* [Register periodical digital pin publish](register_periodical_digital_pin_publish) + +* [Register periodical analog pin publish](register_periodical_analog_pin_publish) + +* [Add custom method](add_custom_method) + +* [Enable terminal](enable_terminal) + +* [Send battery level](send_battery_level) + +* [Send custom location](send_custom_location) + +* [Is connected](is_connected) + +* [isconnected](isconnected) + +* [Connect](connect) + +* [Write config](write_config) + +* [Print cfg msg](print_cfg_msg) + +* [Print config](print_config) + +* [Get config](get_config) + +* [Set config](set_config) + +* [Update config](update_config) + +* [Read config](read_config) + +* [Reconnect](reconnect) + +* [Export config](export_config) + +* [Enable ssl](enable_ssl) + +* [Enable lte](enable_lte) + +* [Deepsleep](deepsleep) + +* [Dump ca](dump_ca) + +* [Start](start) + +* [Activate](activate) diff --git a/content/pybytes/api/activate.md b/content/pybytes/api/activate.md new file mode 100644 index 0000000..e69de29 diff --git a/content/pybytes/api/add_custom_method.md b/content/pybytes/api/add_custom_method.md new file mode 100644 index 0000000..e69de29 diff --git a/content/pybytes/api/connect.md b/content/pybytes/api/connect.md new file mode 100644 index 0000000..e69de29 diff --git a/content/pybytes/api/connect_lora_abp.md b/content/pybytes/api/connect_lora_abp.md new file mode 100644 index 0000000..3b8afec --- /dev/null +++ b/content/pybytes/api/connect_lora_abp.md @@ -0,0 +1,14 @@ +--- +title: "Pybytes library API" +aliases: + - pybytes/api/connect_lora_abp +--- + +**Connect LoRa ABP** +---- + Initialize LoRa ABP connection + + +**Method** +---- +**pybytes.connect_lora_abp()** diff --git a/content/pybytes/api/connect_lora_otta.md b/content/pybytes/api/connect_lora_otta.md new file mode 100644 index 0000000..e69de29 diff --git a/content/pybytes/api/connect_lte.md b/content/pybytes/api/connect_lte.md new file mode 100644 index 0000000..d059fd4 --- /dev/null +++ b/content/pybytes/api/connect_lte.md @@ -0,0 +1,14 @@ +--- +title: "Pybytes library API" +aliases: + - pybytes/api/connect_lte +--- + +**Connect LTE** +---- + Initialize watchdog for WiFi and LTE connection + + +**Method** +---- +**pybytes.connect_lte()** diff --git a/content/pybytes/api/connect_sigfox.md b/content/pybytes/api/connect_sigfox.md new file mode 100644 index 0000000..e69de29 diff --git a/content/pybytes/api/connect_wifi.md b/content/pybytes/api/connect_wifi.md new file mode 100644 index 0000000..e5c582d --- /dev/null +++ b/content/pybytes/api/connect_wifi.md @@ -0,0 +1,14 @@ +--- +title: "Pybytes library API" +aliases: + - pybytes/api/connect_wifi +--- + +**Connect Wifi** +---- + Initialize watchdog for WiFi and LTE connection + + +**Method** +---- +**pybytes.connect_wifi()** diff --git a/content/pybytes/api/deepsleep.md b/content/pybytes/api/deepsleep.md new file mode 100644 index 0000000..e69de29 diff --git a/content/pybytes/api/disconnect.md b/content/pybytes/api/disconnect.md new file mode 100644 index 0000000..e69de29 diff --git a/content/pybytes/api/dump_ca.md b/content/pybytes/api/dump_ca.md new file mode 100644 index 0000000..e69de29 diff --git a/content/pybytes/api/enable_lte.md b/content/pybytes/api/enable_lte.md new file mode 100644 index 0000000..e69de29 diff --git a/content/pybytes/api/enable_ssl.md b/content/pybytes/api/enable_ssl.md new file mode 100644 index 0000000..e69de29 diff --git a/content/pybytes/api/enable_terminal.md b/content/pybytes/api/enable_terminal.md new file mode 100644 index 0000000..e69de29 diff --git a/content/pybytes/api/export_config.md b/content/pybytes/api/export_config.md new file mode 100644 index 0000000..e69de29 diff --git a/content/pybytes/api/get_config.md b/content/pybytes/api/get_config.md new file mode 100644 index 0000000..e69de29 diff --git a/content/pybytes/api/is_connected.md b/content/pybytes/api/is_connected.md new file mode 100644 index 0000000..e69de29 diff --git a/content/pybytes/api/isconnected.md b/content/pybytes/api/isconnected.md new file mode 100644 index 0000000..e69de29 diff --git a/content/pybytes/api/print_config.md b/content/pybytes/api/print_config.md new file mode 100644 index 0000000..e69de29 diff --git a/content/pybytes/api/read_config.md b/content/pybytes/api/read_config.md new file mode 100644 index 0000000..e69de29 diff --git a/content/pybytes/api/reconnect.md b/content/pybytes/api/reconnect.md new file mode 100644 index 0000000..e69de29 diff --git a/content/pybytes/api/register_periodical_analog_pin_publish.md b/content/pybytes/api/register_periodical_analog_pin_publish.md new file mode 100644 index 0000000..e69de29 diff --git a/content/pybytes/api/register_periodical_digital_pin_publish.md b/content/pybytes/api/register_periodical_digital_pin_publish.md new file mode 100644 index 0000000..e69de29 diff --git a/content/pybytes/api/send_analog_pin_value.md b/content/pybytes/api/send_analog_pin_value.md new file mode 100644 index 0000000..e69de29 diff --git a/content/pybytes/api/send_battery_level.md b/content/pybytes/api/send_battery_level.md new file mode 100644 index 0000000..e69de29 diff --git a/content/pybytes/api/send_custom_location.md b/content/pybytes/api/send_custom_location.md new file mode 100644 index 0000000..e69de29 diff --git a/content/pybytes/api/send_custom_message.md b/content/pybytes/api/send_custom_message.md new file mode 100644 index 0000000..e69de29 diff --git a/content/pybytes/api/send_digital_pin_value.md b/content/pybytes/api/send_digital_pin_value.md new file mode 100644 index 0000000..e69de29 diff --git a/content/pybytes/api/send_info_message.md b/content/pybytes/api/send_info_message.md new file mode 100644 index 0000000..e69de29 diff --git a/content/pybytes/api/send_ping_message.md b/content/pybytes/api/send_ping_message.md new file mode 100644 index 0000000..e69de29 diff --git a/content/pybytes/api/send_scan_info_message.md b/content/pybytes/api/send_scan_info_message.md new file mode 100644 index 0000000..e69de29 diff --git a/content/pybytes/api/send_signal.md b/content/pybytes/api/send_signal.md new file mode 100644 index 0000000..e69de29 diff --git a/content/pybytes/api/send_virtual_pin_value.md b/content/pybytes/api/send_virtual_pin_value.md new file mode 100644 index 0000000..e69de29 diff --git a/content/pybytes/api/set_config.md b/content/pybytes/api/set_config.md new file mode 100644 index 0000000..e69de29 diff --git a/content/pybytes/api/set_custom_message_callback.md b/content/pybytes/api/set_custom_message_callback.md new file mode 100644 index 0000000..e69de29 diff --git a/content/pybytes/api/start.md b/content/pybytes/api/start.md new file mode 100644 index 0000000..e69de29 diff --git a/content/pybytes/api/update_config.md b/content/pybytes/api/update_config.md new file mode 100644 index 0000000..e69de29 diff --git a/content/pybytes/api/write_config.md b/content/pybytes/api/write_config.md new file mode 100644 index 0000000..e69de29 diff --git a/content/pybytes/print_cfg_msg.md b/content/pybytes/print_cfg_msg.md new file mode 100644 index 0000000..e69de29 From 3b593532777e9777674880acf9690d5623bc7765 Mon Sep 17 00:00:00 2001 From: Aline Date: Mon, 23 Dec 2019 14:07:47 +0100 Subject: [PATCH 02/11] docs: documentation added for pybytes library api --- content/pybytes/api/connect.md | 14 +++++ content/pybytes/api/connect_lora_otaa.md | 14 +++++ content/pybytes/api/connect_lora_otta.md | 0 content/pybytes/api/connect_sigfox.md | 14 +++++ content/pybytes/api/deepsleep.md | 31 +++++++++++ content/pybytes/api/disconnect.md | 14 +++++ content/pybytes/api/dump_ca.md | 28 ++++++++++ content/pybytes/api/enable_lte.md | 33 ++++++++++++ content/pybytes/api/enable_ssl.md | 28 ++++++++++ content/pybytes/api/enable_terminal.md | 18 +++++++ content/pybytes/api/export_config.md | 27 ++++++++++ content/pybytes/api/get_config.md | 65 ++++++++++++++++++++++++ content/pybytes/api/is_connected.md | 21 ++++++++ content/pybytes/api/isconnected.md | 21 ++++++++ content/pybytes/api/print_config.md | 34 +++++++++++++ content/pybytes/api/read_config.md | 28 ++++++++++ content/pybytes/api/reconnect.md | 21 ++++++++ 17 files changed, 411 insertions(+) create mode 100644 content/pybytes/api/connect_lora_otaa.md delete mode 100644 content/pybytes/api/connect_lora_otta.md diff --git a/content/pybytes/api/connect.md b/content/pybytes/api/connect.md index e69de29..25ae18e 100644 --- a/content/pybytes/api/connect.md +++ b/content/pybytes/api/connect.md @@ -0,0 +1,14 @@ +--- +title: "Pybytes library API" +aliases: + - pybytes/api/connect +--- + +**Connect** +---- + Initialize connection based on default parameters + + +**Method** +---- +**pybytes.connect()** diff --git a/content/pybytes/api/connect_lora_otaa.md b/content/pybytes/api/connect_lora_otaa.md new file mode 100644 index 0000000..8476cda --- /dev/null +++ b/content/pybytes/api/connect_lora_otaa.md @@ -0,0 +1,14 @@ +--- +title: "Pybytes library API" +aliases: + - pybytes/api/connect_lora_otaa +--- + +**Connect LoRa OTAA** +---- + Initialize LoRa OTAA connection + + +**Method** +---- +**pybytes.connect_lora_otaa()** diff --git a/content/pybytes/api/connect_lora_otta.md b/content/pybytes/api/connect_lora_otta.md deleted file mode 100644 index e69de29..0000000 diff --git a/content/pybytes/api/connect_sigfox.md b/content/pybytes/api/connect_sigfox.md index e69de29..8df2b12 100644 --- a/content/pybytes/api/connect_sigfox.md +++ b/content/pybytes/api/connect_sigfox.md @@ -0,0 +1,14 @@ +--- +title: "Pybytes library API" +aliases: + - pybytes/api/connect_sigfox +--- + +**Connect Sigfox** +---- + Initialize Sigfox connection + + +**Method** +---- +**pybytes.connect_sigfox()** diff --git a/content/pybytes/api/deepsleep.md b/content/pybytes/api/deepsleep.md index e69de29..15c821a 100644 --- a/content/pybytes/api/deepsleep.md +++ b/content/pybytes/api/deepsleep.md @@ -0,0 +1,31 @@ +--- +title: "Pybytes library API" +aliases: + - pybytes/api/deepsleep +--- + +**Deepsleep** +---- + Start deepsleep mode for the given period + + +**Method** +---- +**pybytes.deepsleep(ms, pins, mode, enable_pull)** + +**Parameters** +---- +| name | Description | is Required | Default value +| ------------- |:-------------:|:-------------:|:-------------:| +| ms | Time to sleep in ms | Yes | - | +| pins | Affected pins | No | None | +| mode | Sleep mode | No | None | +| enable_pull | Enable pull | No | None | + +**Example** +---- +pybytes.deepsleep(1000) + + +## Success Response +TBD diff --git a/content/pybytes/api/disconnect.md b/content/pybytes/api/disconnect.md index e69de29..da31db7 100644 --- a/content/pybytes/api/disconnect.md +++ b/content/pybytes/api/disconnect.md @@ -0,0 +1,14 @@ +--- +title: "Pybytes library API" +aliases: + - pybytes/api/disconnect +--- + +**Disconnect** +---- + Disconnect device + + +**Method** +---- +**pybytes.disconnect()** diff --git a/content/pybytes/api/dump_ca.md b/content/pybytes/api/dump_ca.md index e69de29..5dd4992 100644 --- a/content/pybytes/api/dump_ca.md +++ b/content/pybytes/api/dump_ca.md @@ -0,0 +1,28 @@ +--- +title: "Pybytes library API" +aliases: + - pybytes/api/dump_ca +--- + +**Dump CA** +---- + Make a dump_ca + + +**Method** +---- +**pybytes.dump_ca(ca_file)** + +**Parameters** +---- +| name | Description | is Required | Default value +| ------------- |:-------------:|:-------------:|:-------------:| +| ca_file | File path | No | /flash/cert/pycom-ca.pem | + + +**Example** +---- +`pybytes.dump_ca(ca_file='/flash/cert/pycom-ca.pem')` + +## Success Response +`Successfully created /flash/cert/pycom-ca.pem` diff --git a/content/pybytes/api/enable_lte.md b/content/pybytes/api/enable_lte.md index e69de29..8acc6f4 100644 --- a/content/pybytes/api/enable_lte.md +++ b/content/pybytes/api/enable_lte.md @@ -0,0 +1,33 @@ +--- +title: "Pybytes library API" +aliases: + - pybytes/api/enable_lte +--- + +**Enable LTE** +---- + Enable LTE connection + + +**Method** +---- +**pybytes.enable_lte(carrier, cid, band, apn, type, reset, fallback)** + +**Parameters** +---- +| name | Description | is Required | Default value +| ------------- |:-------------:|:-------------:|:-------------:| +| carrier | Carrier | No | None | +| cid | Cid | No | None | +| band | Band | No | None | +| apn | APN | No | None | +| type | Type | No | None | +| reset | Reset | No | None | +| fallback | Fallbackena | No | False | + +**Example** +---- +`pybytes.enable_lte('Standard', 1, 3, 'internet', 'IP', False)` + +## Success Response +`TBD` diff --git a/content/pybytes/api/enable_ssl.md b/content/pybytes/api/enable_ssl.md index e69de29..a1e195f 100644 --- a/content/pybytes/api/enable_ssl.md +++ b/content/pybytes/api/enable_ssl.md @@ -0,0 +1,28 @@ +--- +title: "Pybytes library API" +aliases: + - pybytes/api/enable_ssl +--- + +**Enable SSL** +---- + Enable SSL + + +**Method** +---- +**pybytes.enable_ssl(ca_file, dump_ca)** + +**Parameters** +---- +| name | Description | is Required | Default value +| ------------- |:-------------:|:-------------:|:-------------:| +| ca_file | File Path | No | /flash/cert/pycom-ca.pem | +| dump_ca | Dump_ca | No | Yes | + +**Example** +---- +`pybytes.enable_ssl('/flash/cert/pycom-ca.pem', True)` + +## Success Response +`Please reset your module to apply the new settings` diff --git a/content/pybytes/api/enable_terminal.md b/content/pybytes/api/enable_terminal.md index e69de29..89a5560 100644 --- a/content/pybytes/api/enable_terminal.md +++ b/content/pybytes/api/enable_terminal.md @@ -0,0 +1,18 @@ +--- +title: "Pybytes library API" +aliases: + - pybytes/api/enable_terminal +--- + +**Enable Terminal** +---- + Enable Terminal + + +**Method** +---- +**pybytes.enable_terminal()** + +**Example** +---- +`pybytes.enable_terminal()` diff --git a/content/pybytes/api/export_config.md b/content/pybytes/api/export_config.md index e69de29..60d5f40 100644 --- a/content/pybytes/api/export_config.md +++ b/content/pybytes/api/export_config.md @@ -0,0 +1,27 @@ +--- +title: "Pybytes library API" +aliases: + - pybytes/api/export_config +--- + +**Export Config** +---- + Export configuration file + + +**Method** +---- +**pybytes.export_config(file)** + +**Parameters** +---- +| name | Description | is Required | Default value +| ------------- |:-------------:|:-------------:|:-------------:| +| file | File Path | No | /flash/pybytes_config.json | + +**Example** +---- +`pybytes.export_config()` + +## Success Response +`Pybytes configuration exported to /flash/pybytes_config.json` diff --git a/content/pybytes/api/get_config.md b/content/pybytes/api/get_config.md index e69de29..5eb9a69 100644 --- a/content/pybytes/api/get_config.md +++ b/content/pybytes/api/get_config.md @@ -0,0 +1,65 @@ +--- +title: "Pybytes library API" +aliases: + - pybytes/api/get_config +--- + +**Get Config** +---- + Returns configuration data + + +**Method** +---- +**pybytes.get_config(key)** + +**Parameters** +---- +| name | Description | is Required | Default value +| ------------- |:-------------:|:-------------:|:-------------:| +| Key | Returns a specific key-value | No | None | + +**Example** +---- +`pybytes.get_config()` + +## Success Response +```json +{ + 'ssl': True, + 'wifi': { + 'ssid': 'SSID', + 'password': 'PASSWORD' + }, + 'lte': { + 'apn': 'internet', + 'cid': 1, + 'reset': False, + 'carrier': 'Standard', + 'band': 3, + 'type': 'IP' + }, + 'username': 'user@email.com', + 'network_preferences': ['lte', 'lora_otaa'], + 'cfg_msg': 'Pybytes configuration read from /flash/pybytes_config.json', + 'dump_ca': True, + 'wlan_antenna': 0, + 'server': '10.0.0.61', + 'lora': { + 'otaa': { + 'app_key': '87c8105c151f885bc19ccb9484fe8185', + 'app_device_eui': '909d7afb9b82c0f6', + 'app_eui': '70B3D57ED000AFA0' + } + }, + 'ota_server': { + 'port': 443, + 'domain': 'software.pycom.io' + }, + 'pybytes_autostart': True, + 'ssl_params': { + 'ca_certs': '/flash/cert/pycom-ca.pem' + }, + 'device_id': '139e95ed-7213-406b-b07a-a54bfbf021c8' +} +``` diff --git a/content/pybytes/api/is_connected.md b/content/pybytes/api/is_connected.md index e69de29..c48e966 100644 --- a/content/pybytes/api/is_connected.md +++ b/content/pybytes/api/is_connected.md @@ -0,0 +1,21 @@ +--- +title: "Pybytes library API" +aliases: + - pybytes/api/is_connected +--- + +**Is connected** +---- + Returns true if connected + + +**Method** +---- +**pybytes.is_connected()** + +**Example** +---- +`pybytes.is_connected()` + +## Success Response +`True` diff --git a/content/pybytes/api/isconnected.md b/content/pybytes/api/isconnected.md index e69de29..418a842 100644 --- a/content/pybytes/api/isconnected.md +++ b/content/pybytes/api/isconnected.md @@ -0,0 +1,21 @@ +--- +title: "Pybytes library API" +aliases: + - pybytes/api/isconnected +--- + +**Is connected** +---- + Returns true if connected + + +**Method** +---- +**pybytes.isconnected()** + +**Example** +---- +`pybytes.isconnected()` + +## Success Response +`True` diff --git a/content/pybytes/api/print_config.md b/content/pybytes/api/print_config.md index e69de29..513a701 100644 --- a/content/pybytes/api/print_config.md +++ b/content/pybytes/api/print_config.md @@ -0,0 +1,34 @@ +--- +title: "Pybytes library API" +aliases: + - pybytes/api/print_config +--- + +**Print config** +---- + Prints current configuration in the terminal + + +**Method** +---- +**pybytes.print_config()** + +**Example** +---- +`pybytes.print_config()` + +## Success Response + ssl = True + wifi = {'ssid': '', 'password': ''} + lte = {'apn': 'internet', 'cid': 1, 'reset': False, 'carrier': 'Standard', 'band': 3, 'type': 'IP'} + username = alipsilv@hotmail.com + network_preferences = ['lte', 'lte', 'lte', 'lora_otaa'] + cfg_msg = Pybytes configuration read from /flash/pybytes_config.json + dump_ca = True + wlan_antenna = 0 + server = 10.0.0.61 + lora = {'otaa': {'app_key': '87c8105c151f885bc19ccb9484fe8185', 'app_device_eui': '909d7afb9b82c0f6', 'app_eui': '70B3D57ED000AFA0'}} + ota_server = {'port': 443, 'domain': 'software.pycom.io'} + pybytes_autostart = True + ssl_params = {'ca_certs': '/flash/cert/pycom-ca.pem'} + device_id = 139e95ed-7213-406b-b07a-a54bfbf021c8 diff --git a/content/pybytes/api/read_config.md b/content/pybytes/api/read_config.md index e69de29..cef2711 100644 --- a/content/pybytes/api/read_config.md +++ b/content/pybytes/api/read_config.md @@ -0,0 +1,28 @@ +--- +title: "Pybytes library API" +aliases: + - pybytes/api/read_config +--- + +**Read config** +---- + Reads configuration from file + + +**Method** +---- +**pybytes.read_config(file', reconnect)** + +**Parameters** +---- +| name | Description | is Required | Default value +| ------------- |:-------------:|:-------------:|:-------------:| +| file | File Path | No | /flash/pybytes_config.json | +| reconnect | Reconnect after changes | No | False | + +**Example** +---- +`pybytes.read_config()` + +## Success Response +`Pybytes configuration read from /flash/pybytes_config.json` diff --git a/content/pybytes/api/reconnect.md b/content/pybytes/api/reconnect.md index e69de29..3e866b8 100644 --- a/content/pybytes/api/reconnect.md +++ b/content/pybytes/api/reconnect.md @@ -0,0 +1,21 @@ +--- +title: "Pybytes library API" +aliases: + - pybytes/api/reconnect +--- + +**Reconnect** +---- + Reconnects device + + +**Method** +---- +**pybytes.reconnect()** + +**Example** +---- +`pybytes.reconnect()` + +## Success Response +`TBD` From 8768d76c89cf2bcdd73fe8467c4d5b026ec8700c Mon Sep 17 00:00:00 2001 From: Aline Date: Mon, 13 Jan 2020 17:37:02 +0100 Subject: [PATCH 03/11] doc: new documentation added --- content/pybytes/api/activate.md | 40 +++++++++++++++++++ content/pybytes/api/connect_wifi.md | 5 +++ content/pybytes/api/deepsleep.md | 8 +++- content/pybytes/api/disconnect.md | 8 ++++ content/pybytes/api/dump_ca.md | 2 +- content/pybytes/api/enable_lte.md | 2 +- content/pybytes/api/enable_ssl.md | 2 +- content/pybytes/api/export_config.md | 2 +- content/pybytes/api/get_config.md | 2 +- content/pybytes/api/is_connected.md | 2 +- content/pybytes/api/isconnected.md | 2 +- content/pybytes/api/print_config.md | 2 +- content/pybytes/api/read_config.md | 2 +- content/pybytes/api/reconnect.md | 8 +++- .../register_periodical_analog_pin_publish.md | 30 ++++++++++++++ 15 files changed, 104 insertions(+), 13 deletions(-) diff --git a/content/pybytes/api/activate.md b/content/pybytes/api/activate.md index e69de29..1a209da 100644 --- a/content/pybytes/api/activate.md +++ b/content/pybytes/api/activate.md @@ -0,0 +1,40 @@ +--- +title: "Pybytes library API" +aliases: + - pybytes/api/activate +--- + +**Activate** +---- + Activate device + + +**Method** +---- +**pybytes.activate(activation_string)** + + +**Parameters** +---- +| name | Description | is Required | Default value +| ------------- |:-------------:|:-------------:|:-------------:| +| activation string | generated by Pybytes | Yes | - | + + + +**Example** +---- +pybytes.activate("eyJhIjoiNTYzM...") + + +**Success Response** +---- + + >> Please wait while we try to connect to Pycom + >> Wifi connection established... activating device! + >> WMAC: 807D3AC325E8 + >> Firmware: 1.20.1.r2 + >> Pybytes: 1.3.0 + >> Initialized watchdog for WiFi and LTE connection with timeout 1260000 ms + >> WiFi connection established + >> Pybytes connected successfully (using the built-in pybytes library) diff --git a/content/pybytes/api/connect_wifi.md b/content/pybytes/api/connect_wifi.md index e5c582d..92970cb 100644 --- a/content/pybytes/api/connect_wifi.md +++ b/content/pybytes/api/connect_wifi.md @@ -12,3 +12,8 @@ aliases: **Method** ---- **pybytes.connect_wifi()** + +**Success Response** +---- + >> Connecting with SSID and PASSWORD + >> WiFi connection established diff --git a/content/pybytes/api/deepsleep.md b/content/pybytes/api/deepsleep.md index 15c821a..c487e6c 100644 --- a/content/pybytes/api/deepsleep.md +++ b/content/pybytes/api/deepsleep.md @@ -27,5 +27,9 @@ aliases: pybytes.deepsleep(1000) -## Success Response -TBD +**Success Response** +---- +After sleep, device reconnect + + >> Connecting with SSID and PASSWORD + >> WiFi connection established diff --git a/content/pybytes/api/disconnect.md b/content/pybytes/api/disconnect.md index da31db7..4c803e9 100644 --- a/content/pybytes/api/disconnect.md +++ b/content/pybytes/api/disconnect.md @@ -12,3 +12,11 @@ aliases: **Method** ---- **pybytes.disconnect()** + +**Success Response** + + >> Watchdog timeout has been increased to 2147483647 ms + >> self.__connection_status=1 | self.__network_type=0 + >> MQTT over WIFI||LTE... disconnecting MQTT + >> Packet sent. (Length: 2) + >> Connected over WIFI... disconnecting diff --git a/content/pybytes/api/dump_ca.md b/content/pybytes/api/dump_ca.md index 5dd4992..943d1cc 100644 --- a/content/pybytes/api/dump_ca.md +++ b/content/pybytes/api/dump_ca.md @@ -24,5 +24,5 @@ aliases: ---- `pybytes.dump_ca(ca_file='/flash/cert/pycom-ca.pem')` -## Success Response +**Success Response** `Successfully created /flash/cert/pycom-ca.pem` diff --git a/content/pybytes/api/enable_lte.md b/content/pybytes/api/enable_lte.md index 8acc6f4..bb4a21e 100644 --- a/content/pybytes/api/enable_lte.md +++ b/content/pybytes/api/enable_lte.md @@ -29,5 +29,5 @@ aliases: ---- `pybytes.enable_lte('Standard', 1, 3, 'internet', 'IP', False)` -## Success Response +**Success Response** `TBD` diff --git a/content/pybytes/api/enable_ssl.md b/content/pybytes/api/enable_ssl.md index a1e195f..8777e6a 100644 --- a/content/pybytes/api/enable_ssl.md +++ b/content/pybytes/api/enable_ssl.md @@ -24,5 +24,5 @@ aliases: ---- `pybytes.enable_ssl('/flash/cert/pycom-ca.pem', True)` -## Success Response +**Success Response** `Please reset your module to apply the new settings` diff --git a/content/pybytes/api/export_config.md b/content/pybytes/api/export_config.md index 60d5f40..d4f94a9 100644 --- a/content/pybytes/api/export_config.md +++ b/content/pybytes/api/export_config.md @@ -23,5 +23,5 @@ aliases: ---- `pybytes.export_config()` -## Success Response +**Success Response** `Pybytes configuration exported to /flash/pybytes_config.json` diff --git a/content/pybytes/api/get_config.md b/content/pybytes/api/get_config.md index 5eb9a69..432f1ed 100644 --- a/content/pybytes/api/get_config.md +++ b/content/pybytes/api/get_config.md @@ -23,7 +23,7 @@ aliases: ---- `pybytes.get_config()` -## Success Response +**Success Response** ```json { 'ssl': True, diff --git a/content/pybytes/api/is_connected.md b/content/pybytes/api/is_connected.md index c48e966..5b72aaa 100644 --- a/content/pybytes/api/is_connected.md +++ b/content/pybytes/api/is_connected.md @@ -17,5 +17,5 @@ aliases: ---- `pybytes.is_connected()` -## Success Response +**Success Response** `True` diff --git a/content/pybytes/api/isconnected.md b/content/pybytes/api/isconnected.md index 418a842..9fed8bc 100644 --- a/content/pybytes/api/isconnected.md +++ b/content/pybytes/api/isconnected.md @@ -17,5 +17,5 @@ aliases: ---- `pybytes.isconnected()` -## Success Response +**Success Response** `True` diff --git a/content/pybytes/api/print_config.md b/content/pybytes/api/print_config.md index 513a701..3fc68ed 100644 --- a/content/pybytes/api/print_config.md +++ b/content/pybytes/api/print_config.md @@ -17,7 +17,7 @@ aliases: ---- `pybytes.print_config()` -## Success Response +**Success Response** ssl = True wifi = {'ssid': '', 'password': ''} lte = {'apn': 'internet', 'cid': 1, 'reset': False, 'carrier': 'Standard', 'band': 3, 'type': 'IP'} diff --git a/content/pybytes/api/read_config.md b/content/pybytes/api/read_config.md index cef2711..71b5769 100644 --- a/content/pybytes/api/read_config.md +++ b/content/pybytes/api/read_config.md @@ -24,5 +24,5 @@ aliases: ---- `pybytes.read_config()` -## Success Response +**Success Response** `Pybytes configuration read from /flash/pybytes_config.json` diff --git a/content/pybytes/api/reconnect.md b/content/pybytes/api/reconnect.md index 3e866b8..61a0f9c 100644 --- a/content/pybytes/api/reconnect.md +++ b/content/pybytes/api/reconnect.md @@ -17,5 +17,9 @@ aliases: ---- `pybytes.reconnect()` -## Success Response -`TBD` +**Success Response** + +After disconnect +---- + >> Connecting with SSID and PASSWORD + >> WiFi connection established diff --git a/content/pybytes/api/register_periodical_analog_pin_publish.md b/content/pybytes/api/register_periodical_analog_pin_publish.md index e69de29..68dc467 100644 --- a/content/pybytes/api/register_periodical_analog_pin_publish.md +++ b/content/pybytes/api/register_periodical_analog_pin_publish.md @@ -0,0 +1,30 @@ +--- +title: "Pybytes library API" +aliases: + - pybytes/api/register_periodical_analog_pin_publish +--- + +**Register periodical analog pin publish** +---- + Publish periodically on the given analog pin + + +**Method** +---- +**pybytes.register_periodical_digital_pin_publish(persistent, pin_number, pull_mode, period)** + +**Parameters** +---- +| name | Description | is Required | Default value +| ------------- |:-------------:|:-------------:|:-------------:| +| persistent | TBD | TBD | TBD | +| pin number | Reconnect after changes | TBD | TBD | +| pull mode | Reconnect after changes | TBD | TBD | +| period | Time in ms | Yes | - | + +**Example** +---- +`pybytes.register_periodical_digital_pin_publish(TBD, TBD, TBD, 1000)` + +**Success Response** +TBD From 7cac853d87b16def6218143fc22c480f512f48e6 Mon Sep 17 00:00:00 2001 From: Aline Date: Tue, 14 Jan 2020 19:04:42 +0100 Subject: [PATCH 04/11] doc: new api documentation added --- content/pybytes/api/activate.md | 2 -- content/pybytes/api/connect.md | 1 - content/pybytes/api/connect_lora_abp.md | 1 - content/pybytes/api/connect_lora_otaa.md | 1 - content/pybytes/api/connect_lte.md | 1 - content/pybytes/api/connect_sigfox.md | 1 - content/pybytes/api/connect_wifi.md | 1 - content/pybytes/api/deepsleep.md | 1 - content/pybytes/api/disconnect.md | 1 - content/pybytes/api/dump_ca.md | 1 - content/pybytes/api/enable_lte.md | 1 - content/pybytes/api/enable_ssl.md | 1 - content/pybytes/api/enable_terminal.md | 1 - content/pybytes/api/export_config.md | 1 - content/pybytes/api/get_config.md | 1 - content/pybytes/api/is_connected.md | 1 - content/pybytes/api/isconnected.md | 1 - content/pybytes/api/print_config.md | 1 - content/pybytes/api/read_config.md | 1 - content/pybytes/api/reconnect.md | 1 - .../register_periodical_analog_pin_publish.md | 12 ++++---- ...register_periodical_digital_pin_publish.md | 30 +++++++++++++++++++ content/pybytes/api/send_analog_pin_value.md | 27 +++++++++++++++++ content/pybytes/api/send_battery_level.md | 26 ++++++++++++++++ content/pybytes/api/send_custom_location.md | 28 +++++++++++++++++ content/pybytes/api/send_custom_message.md | 27 +++++++++++++++++ content/pybytes/api/send_digital_pin_value.md | 28 +++++++++++++++++ content/pybytes/api/send_info_message.md | 20 +++++++++++++ content/pybytes/api/send_ping_message.md | 20 +++++++++++++ content/pybytes/api/send_scan_info_message.md | 20 +++++++++++++ content/pybytes/api/send_signal.md | 27 +++++++++++++++++ content/pybytes/api/send_virtual_pin_value.md | 27 +++++++++++++++++ content/pybytes/api/set_config.md | 30 +++++++++++++++++++ .../api/set_custom_message_callback.md | 26 ++++++++++++++++ content/pybytes/api/start.md | 26 ++++++++++++++++ content/pybytes/api/update_config.md | 30 +++++++++++++++++++ content/pybytes/api/write_config.md | 28 +++++++++++++++++ 37 files changed, 425 insertions(+), 28 deletions(-) diff --git a/content/pybytes/api/activate.md b/content/pybytes/api/activate.md index 1a209da..ee7e371 100644 --- a/content/pybytes/api/activate.md +++ b/content/pybytes/api/activate.md @@ -8,7 +8,6 @@ aliases: ---- Activate device - **Method** ---- **pybytes.activate(activation_string)** @@ -21,7 +20,6 @@ aliases: | activation string | generated by Pybytes | Yes | - | - **Example** ---- pybytes.activate("eyJhIjoiNTYzM...") diff --git a/content/pybytes/api/connect.md b/content/pybytes/api/connect.md index 25ae18e..753b4fe 100644 --- a/content/pybytes/api/connect.md +++ b/content/pybytes/api/connect.md @@ -8,7 +8,6 @@ aliases: ---- Initialize connection based on default parameters - **Method** ---- **pybytes.connect()** diff --git a/content/pybytes/api/connect_lora_abp.md b/content/pybytes/api/connect_lora_abp.md index 3b8afec..4a2db39 100644 --- a/content/pybytes/api/connect_lora_abp.md +++ b/content/pybytes/api/connect_lora_abp.md @@ -8,7 +8,6 @@ aliases: ---- Initialize LoRa ABP connection - **Method** ---- **pybytes.connect_lora_abp()** diff --git a/content/pybytes/api/connect_lora_otaa.md b/content/pybytes/api/connect_lora_otaa.md index 8476cda..e16d2d4 100644 --- a/content/pybytes/api/connect_lora_otaa.md +++ b/content/pybytes/api/connect_lora_otaa.md @@ -8,7 +8,6 @@ aliases: ---- Initialize LoRa OTAA connection - **Method** ---- **pybytes.connect_lora_otaa()** diff --git a/content/pybytes/api/connect_lte.md b/content/pybytes/api/connect_lte.md index d059fd4..c116956 100644 --- a/content/pybytes/api/connect_lte.md +++ b/content/pybytes/api/connect_lte.md @@ -8,7 +8,6 @@ aliases: ---- Initialize watchdog for WiFi and LTE connection - **Method** ---- **pybytes.connect_lte()** diff --git a/content/pybytes/api/connect_sigfox.md b/content/pybytes/api/connect_sigfox.md index 8df2b12..f6d3415 100644 --- a/content/pybytes/api/connect_sigfox.md +++ b/content/pybytes/api/connect_sigfox.md @@ -8,7 +8,6 @@ aliases: ---- Initialize Sigfox connection - **Method** ---- **pybytes.connect_sigfox()** diff --git a/content/pybytes/api/connect_wifi.md b/content/pybytes/api/connect_wifi.md index 92970cb..4ea09da 100644 --- a/content/pybytes/api/connect_wifi.md +++ b/content/pybytes/api/connect_wifi.md @@ -8,7 +8,6 @@ aliases: ---- Initialize watchdog for WiFi and LTE connection - **Method** ---- **pybytes.connect_wifi()** diff --git a/content/pybytes/api/deepsleep.md b/content/pybytes/api/deepsleep.md index c487e6c..5b69a9b 100644 --- a/content/pybytes/api/deepsleep.md +++ b/content/pybytes/api/deepsleep.md @@ -8,7 +8,6 @@ aliases: ---- Start deepsleep mode for the given period - **Method** ---- **pybytes.deepsleep(ms, pins, mode, enable_pull)** diff --git a/content/pybytes/api/disconnect.md b/content/pybytes/api/disconnect.md index 4c803e9..0d1ad27 100644 --- a/content/pybytes/api/disconnect.md +++ b/content/pybytes/api/disconnect.md @@ -8,7 +8,6 @@ aliases: ---- Disconnect device - **Method** ---- **pybytes.disconnect()** diff --git a/content/pybytes/api/dump_ca.md b/content/pybytes/api/dump_ca.md index 943d1cc..96ee085 100644 --- a/content/pybytes/api/dump_ca.md +++ b/content/pybytes/api/dump_ca.md @@ -8,7 +8,6 @@ aliases: ---- Make a dump_ca - **Method** ---- **pybytes.dump_ca(ca_file)** diff --git a/content/pybytes/api/enable_lte.md b/content/pybytes/api/enable_lte.md index bb4a21e..8a19f94 100644 --- a/content/pybytes/api/enable_lte.md +++ b/content/pybytes/api/enable_lte.md @@ -8,7 +8,6 @@ aliases: ---- Enable LTE connection - **Method** ---- **pybytes.enable_lte(carrier, cid, band, apn, type, reset, fallback)** diff --git a/content/pybytes/api/enable_ssl.md b/content/pybytes/api/enable_ssl.md index 8777e6a..7e4b1ee 100644 --- a/content/pybytes/api/enable_ssl.md +++ b/content/pybytes/api/enable_ssl.md @@ -8,7 +8,6 @@ aliases: ---- Enable SSL - **Method** ---- **pybytes.enable_ssl(ca_file, dump_ca)** diff --git a/content/pybytes/api/enable_terminal.md b/content/pybytes/api/enable_terminal.md index 89a5560..01fa566 100644 --- a/content/pybytes/api/enable_terminal.md +++ b/content/pybytes/api/enable_terminal.md @@ -8,7 +8,6 @@ aliases: ---- Enable Terminal - **Method** ---- **pybytes.enable_terminal()** diff --git a/content/pybytes/api/export_config.md b/content/pybytes/api/export_config.md index d4f94a9..f9c8203 100644 --- a/content/pybytes/api/export_config.md +++ b/content/pybytes/api/export_config.md @@ -8,7 +8,6 @@ aliases: ---- Export configuration file - **Method** ---- **pybytes.export_config(file)** diff --git a/content/pybytes/api/get_config.md b/content/pybytes/api/get_config.md index 432f1ed..9d7bf27 100644 --- a/content/pybytes/api/get_config.md +++ b/content/pybytes/api/get_config.md @@ -8,7 +8,6 @@ aliases: ---- Returns configuration data - **Method** ---- **pybytes.get_config(key)** diff --git a/content/pybytes/api/is_connected.md b/content/pybytes/api/is_connected.md index 5b72aaa..40d6c34 100644 --- a/content/pybytes/api/is_connected.md +++ b/content/pybytes/api/is_connected.md @@ -8,7 +8,6 @@ aliases: ---- Returns true if connected - **Method** ---- **pybytes.is_connected()** diff --git a/content/pybytes/api/isconnected.md b/content/pybytes/api/isconnected.md index 9fed8bc..0d3b28f 100644 --- a/content/pybytes/api/isconnected.md +++ b/content/pybytes/api/isconnected.md @@ -8,7 +8,6 @@ aliases: ---- Returns true if connected - **Method** ---- **pybytes.isconnected()** diff --git a/content/pybytes/api/print_config.md b/content/pybytes/api/print_config.md index 3fc68ed..ee10b6e 100644 --- a/content/pybytes/api/print_config.md +++ b/content/pybytes/api/print_config.md @@ -8,7 +8,6 @@ aliases: ---- Prints current configuration in the terminal - **Method** ---- **pybytes.print_config()** diff --git a/content/pybytes/api/read_config.md b/content/pybytes/api/read_config.md index 71b5769..3959793 100644 --- a/content/pybytes/api/read_config.md +++ b/content/pybytes/api/read_config.md @@ -8,7 +8,6 @@ aliases: ---- Reads configuration from file - **Method** ---- **pybytes.read_config(file', reconnect)** diff --git a/content/pybytes/api/reconnect.md b/content/pybytes/api/reconnect.md index 61a0f9c..662984f 100644 --- a/content/pybytes/api/reconnect.md +++ b/content/pybytes/api/reconnect.md @@ -8,7 +8,6 @@ aliases: ---- Reconnects device - **Method** ---- **pybytes.reconnect()** diff --git a/content/pybytes/api/register_periodical_analog_pin_publish.md b/content/pybytes/api/register_periodical_analog_pin_publish.md index 68dc467..f1d64f3 100644 --- a/content/pybytes/api/register_periodical_analog_pin_publish.md +++ b/content/pybytes/api/register_periodical_analog_pin_publish.md @@ -8,23 +8,21 @@ aliases: ---- Publish periodically on the given analog pin - **Method** ---- -**pybytes.register_periodical_digital_pin_publish(persistent, pin_number, pull_mode, period)** +**pybytes.register_periodical_analog_pin_publish(persistent, pin_number, period)** **Parameters** ---- | name | Description | is Required | Default value | ------------- |:-------------:|:-------------:|:-------------:| -| persistent | TBD | TBD | TBD | -| pin number | Reconnect after changes | TBD | TBD | -| pull mode | Reconnect after changes | TBD | TBD | -| period | Time in ms | Yes | - | +| persistent | Bool | No | False | +| pin number | Analog pin number TBD| Yes | - | +| period | Interval in seconds | Yes | - | **Example** ---- -`pybytes.register_periodical_digital_pin_publish(TBD, TBD, TBD, 1000)` +`pybytes.register_periodical_analog_pin_publish(False, 13, 2)` **Success Response** TBD diff --git a/content/pybytes/api/register_periodical_digital_pin_publish.md b/content/pybytes/api/register_periodical_digital_pin_publish.md index e69de29..d65c6b8 100644 --- a/content/pybytes/api/register_periodical_digital_pin_publish.md +++ b/content/pybytes/api/register_periodical_digital_pin_publish.md @@ -0,0 +1,30 @@ +--- +title: "Pybytes library API" +aliases: + - pybytes/api/register_periodical_digital_pin_publish +--- + +**Register periodical digital pin publish** +---- + Publish periodically on the given digital pin + + +**Method** +---- +**pybytes.register_periodical_digital_pin_publish(persistent, pin_number, pull_mode, period)** + +**Parameters** +---- +| name | Description | is Required | Default value +| ------------- |:-------------:|:-------------:|:-------------:| +| persistent | Bool | No | False | +| pin number | Analog pin number | Yes | - | +| pull mode | PULL_UP or TBD | Yes | PULL_UP | +| period | Interval in seconds | Yes | - | + +**Example** +---- +`pybytes.register_periodical_digital_pin_publish(False, PIN_NUMBER, Pin.PULL_UP, 2)` + +**Success Response** +TBD diff --git a/content/pybytes/api/send_analog_pin_value.md b/content/pybytes/api/send_analog_pin_value.md index e69de29..277130d 100644 --- a/content/pybytes/api/send_analog_pin_value.md +++ b/content/pybytes/api/send_analog_pin_value.md @@ -0,0 +1,27 @@ +--- +title: "Pybytes library API" +aliases: + - pybytes/api/send_analog_pin_value +--- + +**Send analog pin value** +---- + Send analog pin value + +**Method** +---- +**pybytes.send_analog_pin_value(persistent, pin_number)** + +**Parameters** +---- +| name | Description | is Required | Default value +| ------------- |:-------------:|:-------------:|:-------------:| +| persistent | Bool | No | False | +| pin number | Analog pin number TBD| Yes | - | + +**Example** +---- +`pybytes.send_analog_pin_value(False, 13)` + +**Success Response** +TBD diff --git a/content/pybytes/api/send_battery_level.md b/content/pybytes/api/send_battery_level.md index e69de29..11879c4 100644 --- a/content/pybytes/api/send_battery_level.md +++ b/content/pybytes/api/send_battery_level.md @@ -0,0 +1,26 @@ +--- +title: "Pybytes library API" +aliases: + - pybytes/api/send_battery_level +--- + +**Send battery level** +---- + Send battery level + +**Method** +---- +**pybytes.send_battery_level(battery_level)** + +**Parameters** +---- +| name | Description | is Required | Default value +| ------------- |:-------------:|:-------------:|:-------------:| +| battery_level | battery level | Yes | False | + +**Example** +---- +`pybytes.send_battery_level(False, 50)` + +**Success Response** +TBD diff --git a/content/pybytes/api/send_custom_location.md b/content/pybytes/api/send_custom_location.md index e69de29..55f0277 100644 --- a/content/pybytes/api/send_custom_location.md +++ b/content/pybytes/api/send_custom_location.md @@ -0,0 +1,28 @@ +--- +title: "Pybytes library API" +aliases: + - pybytes/api/send_custom_location +--- + +**Send custom location** +---- + Send custom location + +**Method** +---- +**pybytes.send_custom_location(pin, x, y)** + +**Parameters** +---- +| name | Description | is Required | Default value +| ------------- |:-------------:|:-------------:|:-------------:| +| pin | TBD | Yes | - | +| x | Longitude | Yes | - | +| y | Latitude | Yes | - | + +**Example** +---- +`pybytes.send_custom_location(pin, 0, 0)` + +**Success Response** +TBD diff --git a/content/pybytes/api/send_custom_message.md b/content/pybytes/api/send_custom_message.md index e69de29..9cbc9f5 100644 --- a/content/pybytes/api/send_custom_message.md +++ b/content/pybytes/api/send_custom_message.md @@ -0,0 +1,27 @@ +--- +title: "Pybytes library API" +aliases: + - pybytes/api/send_custom_message +--- + +**Send custom location** +---- + Send custom location + +**Method** +---- +**pybytes.send_custom_message(message_type, message)** + +**Parameters** +---- +| name | Description | is Required | Default value +| ------------- |:-------------:|:-------------:|:-------------:| +| message_type | TBD 0x00 0x07 | Yes | - | +| message | Longitude | Yes | - | + +**Example** +---- +`pybytes.send_custom_message(TBD, TBD)` + +**Success Response** +TBD diff --git a/content/pybytes/api/send_digital_pin_value.md b/content/pybytes/api/send_digital_pin_value.md index e69de29..1dc4475 100644 --- a/content/pybytes/api/send_digital_pin_value.md +++ b/content/pybytes/api/send_digital_pin_value.md @@ -0,0 +1,28 @@ +--- +title: "Pybytes library API" +aliases: + - pybytes/api/send_digital_pin_value +--- + +**Send analog pin value** +---- + Send analog pin value + +**Method** +---- +**pybytes.send_digital_pin_value(persistent, pin_number, pull_mode)** + +**Parameters** +---- +| name | Description | is Required | Default value +| ------------- |:-------------:|:-------------:|:-------------:| +| persistent | Bool | No | False | +| pin number | Analog pin number TBD| Yes | - | +| pull mode | PULL_UP or TBD | Yes | PULL_UP | + +**Example** +---- +`pybytes.send_digital_pin_value(False, 12, Pin.PULL_UP)` + +**Success Response** +TBD diff --git a/content/pybytes/api/send_info_message.md b/content/pybytes/api/send_info_message.md index e69de29..8cfcc8d 100644 --- a/content/pybytes/api/send_info_message.md +++ b/content/pybytes/api/send_info_message.md @@ -0,0 +1,20 @@ +--- +title: "Pybytes library API" +aliases: + - pybytes/api/send_info_message +--- + +**Send info message** +---- + Send info message + +**Method** +---- +**pybytes.send_info_message()** + +**Example** +---- +`pybytes.send_info_message()` + +**Success Response** +TBD diff --git a/content/pybytes/api/send_ping_message.md b/content/pybytes/api/send_ping_message.md index e69de29..91f1fcd 100644 --- a/content/pybytes/api/send_ping_message.md +++ b/content/pybytes/api/send_ping_message.md @@ -0,0 +1,20 @@ +--- +title: "Pybytes library API" +aliases: + - pybytes/api/send_ping_message +--- + +**Send ping message** +---- + Send ping message + +**Method** +---- +**pybytes.send_ping_message()** + +**Example** +---- +`pybytes.send_ping_message()` + +**Success Response** +TBD diff --git a/content/pybytes/api/send_scan_info_message.md b/content/pybytes/api/send_scan_info_message.md index e69de29..105e2c2 100644 --- a/content/pybytes/api/send_scan_info_message.md +++ b/content/pybytes/api/send_scan_info_message.md @@ -0,0 +1,20 @@ +--- +title: "Pybytes library API" +aliases: + - pybytes/api/send_scan_info_message +--- + +**Send scan info message** +---- + Send scan info message + +**Method** +---- +**pybytes.send_scan_info_message()** + +**Example** +---- +`pybytes.send_scan_info_message()` + +**Success Response** +TBD diff --git a/content/pybytes/api/send_signal.md b/content/pybytes/api/send_signal.md index e69de29..5cfede0 100644 --- a/content/pybytes/api/send_signal.md +++ b/content/pybytes/api/send_signal.md @@ -0,0 +1,27 @@ +--- +title: "Pybytes library API" +aliases: + - pybytes/api/send_signal +--- + +**Send signal** +---- + Send signal + +**Method** +---- +**pybytes.send_signal(pin, value)** + +**Parameters** +---- +| name | Description | is Required | Default value +| ------------- |:-------------:|:-------------:|:-------------:| +| pin | pin | Yes | - | +| value | signal value | Yes | - | + +**Example** +---- +`pybytes.send_signal(13,25)` + +**Success Response** +TBD diff --git a/content/pybytes/api/send_virtual_pin_value.md b/content/pybytes/api/send_virtual_pin_value.md index e69de29..d40e7b9 100644 --- a/content/pybytes/api/send_virtual_pin_value.md +++ b/content/pybytes/api/send_virtual_pin_value.md @@ -0,0 +1,27 @@ +--- +title: "Pybytes library API" +aliases: + - pybytes/api/send_virtual_pin_value +--- + +**Send ping message** +---- + Send ping message + +**Method** +---- +**pybytes.send_virtual_pin_value(pin, value)** + +**Parameters** +---- +| name | Description | is Required | Default value +| ------------- |:-------------:|:-------------:|:-------------:| +| pin | pin | Yes | - | +| value | signal value | Yes | - | + +**Example** +---- +`pybytes.send_virtual_pin_value(13,25)` + +**Success Response** +TBD diff --git a/content/pybytes/api/set_config.md b/content/pybytes/api/set_config.md index e69de29..3ce9cb4 100644 --- a/content/pybytes/api/set_config.md +++ b/content/pybytes/api/set_config.md @@ -0,0 +1,30 @@ +--- +title: "Pybytes library API" +aliases: + - pybytes/api/set_config +--- + +**Set configuration** +---- + Set device configuration + +**Method** +---- +**pybytes.set_config(key, value, permanent, silent, reconnect)** + +**Parameters** +---- +| name | Description | is Required | Default value +| ------------- |:-------------:|:-------------:|:-------------:| +| key | key | Yes | None | +| value | value | No | None | +| permanent | boolean | No | True | +| silent | boolean | No | False | +| reconnect | boolean | No | False | + +**Example** +---- +`pybytes.set_config(key=None, value=None, permanent=True, silent=False, reconnect=False)` + +**Success Response** +TBD diff --git a/content/pybytes/api/set_custom_message_callback.md b/content/pybytes/api/set_custom_message_callback.md index e69de29..890380c 100644 --- a/content/pybytes/api/set_custom_message_callback.md +++ b/content/pybytes/api/set_custom_message_callback.md @@ -0,0 +1,26 @@ +--- +title: "Pybytes library API" +aliases: + - pybytes/api/set_custom_message_callback +--- + +**Send custom message callback** +---- + Send custom location + +**Method** +---- +**pybytes.set_custom_message_callback(callback)** + +**Parameters** +---- +| name | Description | is Required | Default value +| ------------- |:-------------:|:-------------:|:-------------:| +| callback | function | Yes | - | + +**Example** +---- +`pybytes.set_custom_message_callback(true)` + +**Success Response** +TBD diff --git a/content/pybytes/api/start.md b/content/pybytes/api/start.md index e69de29..7f9408a 100644 --- a/content/pybytes/api/start.md +++ b/content/pybytes/api/start.md @@ -0,0 +1,26 @@ +--- +title: "Pybytes library API" +aliases: + - pybytes/api/start +--- + +**Start device** +---- + Start device - TBD + +**Method** +---- +**pybytes.start()** + +**Example** +---- +`pybytes.start()` + +**Success Response** + + >> WMAC: 807D3AC325E8 + >> Firmware: 1.20.1.r2 + >> Pybytes: 1.3.0 + >> Initialized watchdog for WiFi and LTE connection with timeout 1260000 ms + >> WiFi connection established + >> Pybytes connected successfully (using the built-in pybytes library) diff --git a/content/pybytes/api/update_config.md b/content/pybytes/api/update_config.md index e69de29..0ea3a65 100644 --- a/content/pybytes/api/update_config.md +++ b/content/pybytes/api/update_config.md @@ -0,0 +1,30 @@ +--- +title: "Pybytes library API" +aliases: + - pybytes/api/update_config +--- + +**Update configuration** +---- + Update device configuration + +**Method** +---- +**pybytes.update_config(key, value, permanent, silent, reconnect)** + +**Parameters** +---- +| name | Description | is Required | Default value +| ------------- |:-------------:|:-------------:|:-------------:| +| key | key | Yes | None | +| value | value | No | None | +| permanent | boolean | No | True | +| silent | boolean | No | False | +| reconnect | boolean | No | False | + +**Example** +---- +`pybytes.update_config(key=None, value=None, permanent=True, silent=False, reconnect=False)` + +**Success Response** +TBD diff --git a/content/pybytes/api/write_config.md b/content/pybytes/api/write_config.md index e69de29..a273d71 100644 --- a/content/pybytes/api/write_config.md +++ b/content/pybytes/api/write_config.md @@ -0,0 +1,28 @@ +--- +title: "Pybytes library API" +aliases: + - pybytes/api/write_config +--- + +**Update configuration** +---- + Update device configuration + +**Method** +---- +**pybytes.write_config(file='/flash/pybytes_config.json', silent=False)** + +**Parameters** +---- +| name | Description | is Required | Default value +| ------------- |:-------------:|:-------------:|:-------------:| +| file | File path | Yes | '/flash/pybytes_config.json' | +| silent | boolean | No | False | + +**Example** +---- +`pybytes.write_config(file='/flash/pybytes_config.json', silent=False)` + +**Success Response** + + >> Pybytes configuration written to /flash/pybytes_config.json From e86d87e6c3806b05e435f4e4a266cc623c7ef6ed Mon Sep 17 00:00:00 2001 From: Aline Date: Wed, 15 Jan 2020 15:54:57 +0100 Subject: [PATCH 05/11] docs: revised methods, list of methods should appear in the main menu --- config.toml | 273 ++++++++++++++++++ content/pybytes/api/_index.md | 80 ++--- content/pybytes/api/activate.md | 4 +- content/pybytes/api/connect.md | 10 +- content/pybytes/api/connect_lora_abp.md | 21 +- content/pybytes/api/connect_lora_otaa.md | 21 +- content/pybytes/api/connect_lte.md | 19 +- content/pybytes/api/connect_sigfox.md | 10 +- content/pybytes/api/connect_wifi.md | 2 +- content/pybytes/api/deepsleep.md | 4 +- content/pybytes/api/enable_lte.md | 2 +- content/pybytes/api/export_config.md | 4 +- content/pybytes/api/get_config.md | 2 +- content/pybytes/api/is_connected.md | 2 +- content/pybytes/api/isconnected.md | 2 +- content/pybytes/api/print_config.md | 30 +- content/pybytes/api/read_config.md | 2 +- content/pybytes/api/reconnect.md | 2 +- .../register_periodical_analog_pin_publish.md | 2 +- ...register_periodical_digital_pin_publish.md | 2 +- content/pybytes/api/send_analog_pin_value.md | 2 +- content/pybytes/api/send_battery_level.md | 2 +- content/pybytes/api/send_custom_location.md | 2 +- content/pybytes/api/send_custom_message.md | 2 +- content/pybytes/api/send_digital_pin_value.md | 2 +- content/pybytes/api/send_info_message.md | 2 +- content/pybytes/api/send_ping_message.md | 2 +- content/pybytes/api/send_scan_info_message.md | 2 +- content/pybytes/api/send_signal.md | 2 +- content/pybytes/api/send_virtual_pin_value.md | 2 +- content/pybytes/api/set_config.md | 2 +- .../api/set_custom_message_callback.md | 2 +- content/pybytes/api/update_config.md | 2 +- content/pybytes/api/write_config.md | 2 +- 34 files changed, 430 insertions(+), 92 deletions(-) diff --git a/config.toml b/config.toml index f87c8e4..6c44df3 100644 --- a/config.toml +++ b/config.toml @@ -1173,6 +1173,279 @@ theme = "doc-theme" parent = "pybytes" weight = 15 +[[menu.main]] + name = "Add custom method" + url = "/pybytes/api/add_custom_method" + identifier = "pybytes@api@add_custom_method" + parent = "pybytes@api" + weight = 10 + +[[menu.main]] + name = "Activate Device" + url = "/pybytes/api/activate" + identifier = "pybytes@api@activate" + parent = "pybytes@api" + weight = 11 + +[[menu.main]] + name = "Connect" + url = "/pybytes/api/connect" + identifier = "pybytes@api@connect" + parent = "pybytes@api" + weight = 12 + +[[menu.main]] + name = "Connect LTE" + url = "/pybytes/api/connect_lte" + identifier = "pybytes@api@connect_lte" + parent = "pybytes@api" + weight = 13 + +[[menu.main]] + name = "Connect LoRa ABP" + url = "/pybytes/api/connect_lora_abp" + identifier = "pybytes@api@connect_lora_abp" + parent = "pybytes@api" + weight = 14 + +[[menu.main]] + name = "Connect LoRa OTAA" + url = "/pybytes/api/connect_lora_otaa" + identifier = "pybytes@api@connect_lora_otaa" + parent = "pybytes@api" + weight = 15 + +[[menu.main]] + name = "Connect Sigfox" + url = "/pybytes/api/connect_sigfox" + identifier = "pybytes@api@connect_sigfox" + parent = "pybytes@api" + weight = 16 + +[[menu.main]] + name = "Connect Wifi" + url = "/pybytes/api/connect_wifi" + identifier = "pybytes@api@connect_wifi" + parent = "pybytes@api" + weight = 17 + +[[menu.main]] + name = "Deepsleep" + url = "/pybytes/api/deepsleep" + identifier = "pybytes@api@deepsleep" + parent = "pybytes@api" + weight = 18 + +[[menu.main]] + name = "Disconnect" + url = "/pybytes/api/disconnect" + identifier = "pybytes@api@disconnect" + parent = "pybytes@api" + weight = 19 + +[[menu.main]] + name = "Dump ca" + url = "/pybytes/api/dump_ca" + identifier = "pybytes@api@dump_ca" + parent = "pybytes@api" + weight = 20 + +[[menu.main]] + name = "Enable lte" + url = "/pybytes/api/enable_lte" + identifier = "pybytes@api@enable_lte" + parent = "pybytes@api" + weight = 21 + +[[menu.main]] + name = "Enable ssl" + url = "/pybytes/api/enable_ssl" + identifier = "pybytes@api@enable_ssl" + parent = "pybytes@api" + weight = 22 + +[[menu.main]] + name = "Enable terminal" + url = "/pybytes/api/enable_terminal" + identifier = "pybytes@api@enable_terminal" + parent = "pybytes@api" + weight = 23 + +[[menu.main]] + name = "Export config" + url = "/pybytes/api/export_config" + identifier = "pybytes@api@export_config" + parent = "pybytes@api" + weight = 24 + +[[menu.main]] + name = "Get config" + url = "/pybytes/api/get_config" + identifier = "pybytes@api@get_config" + parent = "pybytes@api" + weight = 25 + +[[menu.main]] + name = "Is connected" + url = "/pybytes/api/is_connected" + identifier = "pybytes@api@is_connected" + parent = "pybytes@api" + weight = 26 + +[[menu.main]] + name = "isconnected" + url = "/pybytes/api/isconnected" + identifier = "pybytes@api@isconnected" + parent = "pybytes@api" + weight = 27 + +[[menu.main]] + name = "Print cfg msg" + url = "/pybytes/api/print_cfg_msg" + identifier = "pybytes@api@print_cfg_msg" + parent = "pybytes@api" + weight = 28 + +[[menu.main]] + name = "Print config" + url = "/pybytes/api/print_config" + identifier = "pybytes@api@print_config" + parent = "pybytes@api" + weight = 29 + +[[menu.main]] + name = "Read config" + url = "/pybytes/api/read_config" + identifier = "pybytes@api@read_config" + parent = "pybytes@api" + weight = 30 + +[[menu.main]] + name = "Reconnect" + url = "/pybytes/api/reconnect" + identifier = "pybytes@api@reconnect" + parent = "pybytes@api" + weight = 31 + +[[menu.main]] + name = "Register periodical analog pin publish" + url = "/pybytes/api/register_periodical_analog_pin_publish" + identifier = "pybytes@api@register_periodical_analog_pin_publish" + parent = "pybytes@api" + weight = 32 + +[[menu.main]] + name = "Register periodical digital pin publish" + url = "/pybytes/api/register_periodical_digital_pin_publish" + identifier = "pybytes@api@register_periodical_digital_pin_publish" + parent = "pybytes@api" + weight = 33 + +[[menu.main]] + name = "Send analog pin value" + url = "/pybytes/api/send_analog_pin_value" + identifier = "pybytes@api@send_analog_pin_value" + parent = "pybytes@api" + weight = 34 + +[[menu.main]] + name = "Send battery level" + url = "/pybytes/api/send_battery_level" + identifier = "pybytes@api@send_battery_level" + parent = "pybytes@api" + weight = 35 + +[[menu.main]] + name = "Send custom message" + url = "/pybytes/api/send_custom_message" + identifier = "pybytes@api@send_custom_message" + parent = "pybytes@api" + weight = 36 + +[[menu.main]] + name = "Set custom message callback" + url = "/pybytes/api/set_custom_message_callback" + identifier = "pybytes@api@set_custom_message_callback" + parent = "pybytes@api" + weight = 37 + +[[menu.main]] + name = "Send custom location" + url = "/pybytes/api/send_custom_location" + identifier = "pybytes@api@send_custom_location" + parent = "pybytes@api" + weight = 38 + +[[menu.main]] + name = "Send digital pin value" + url = "/pybytes/api/send_digital_pin_value" + identifier = "pybytes@api@send_digital_pin_value" + parent = "pybytes@api" + weight = 39 + +[[menu.main]] + name = "Send info message" + url = "/pybytes/api/send_info_message" + identifier = "pybytes@api@send_info_message" + parent = "pybytes@api" + weight = 40 + +[[menu.main]] + name = "Send ping message" + url = "/pybytes/api/send_ping_message" + identifier = "pybytes@api@send_ping_message" + parent = "pybytes@api" + weight = 41 + +[[menu.main]] + name = "Send scan info message" + url = "/pybytes/api/send_scan_info_message" + identifier = "pybytes@api@send_scan_info_message" + parent = "pybytes@api" + weight = 42 + +[[menu.main]] + name = "Send signal" + url = "/pybytes/api/send_signal" + identifier = "pybytes@api@send_signal" + parent = "pybytes@api" + weight = 43 + +[[menu.main]] + name = "Send virtual pin value" + url = "/pybytes/api/send_virtual_pin_value" + identifier = "pybytes@api@send_virtual_pin_value" + parent = "pybytes@api" + weight = 44 + +[[menu.main]] + name = "Set config" + url = "/pybytes/api/set_config" + identifier = "pybytes@api@set_config" + parent = "pybytes@api" + weight = 45 + +[[menu.main]] + name = "Start" + url = "/pybytes/api/start" + identifier = "pybytes@api@start" + parent = "pybytes@api" + weight = 46 + +[[menu.main]] + name = "Update config" + url = "/pybytes/api/update_config" + identifier = "pybytes@api@update_config" + parent = "pybytes@api" + weight = 47 + +[[menu.main]] + name = "Write config" + url = "/pybytes/api/write_config" + identifier = "pybytes@api@write_config" + parent = "pybytes@api" + weight = 48 + [[menu.main]] name = "Add a device to Pybytes" url = "/pybytes/connect/" diff --git a/content/pybytes/api/_index.md b/content/pybytes/api/_index.md index 413367b..8bf29fb 100644 --- a/content/pybytes/api/_index.md +++ b/content/pybytes/api/_index.md @@ -4,7 +4,11 @@ aliases: - pybytes/api --- -* [Connect Wifi](connect_wifi) +* [Add custom method](add_custom_method) + +* [Activate](activate) + +* [Connect](connect) * [Connect LTE](connect_lte) @@ -14,70 +18,66 @@ aliases: * [Connect Sigfox](connect_sigfox) +* [Connect Wifi](connect_wifi) + +* [Deepsleep](deepsleep) + * [Disconnect](disconnect) -* [Send custom message](send_custom_message) +* [Dump ca](dump_ca) -* [Set custom message callback](set_custom_message_callback) +* [Enable lte](enable_lte) -* [Send ping message](send_ping_message) - -* [Send info message](send_info_message) - -* [Send scan info message](send_scan_info_message) - -* [Send digital pin value](send_digital_pin_value) - -* [Send analog pin value](send_analog_pin_value) - -* [Send virtual pin value](send_virtual_pin_value) - -* [Send signal](send_signal) - -* [Register periodical digital pin publish](register_periodical_digital_pin_publish) - -* [Register periodical analog pin publish](register_periodical_analog_pin_publish) - -* [Add custom method](add_custom_method) +* [Enable ssl](enable_ssl) * [Enable terminal](enable_terminal) -* [Send battery level](send_battery_level) +* [Export config](export_config) -* [Send custom location](send_custom_location) +* [Get config](get_config) * [Is connected](is_connected) * [isconnected](isconnected) -* [Connect](connect) - -* [Write config](write_config) - * [Print cfg msg](print_cfg_msg) * [Print config](print_config) -* [Get config](get_config) - -* [Set config](set_config) - -* [Update config](update_config) - * [Read config](read_config) * [Reconnect](reconnect) -* [Export config](export_config) +* [Register periodical analog pin publish](register_periodical_analog_pin_publish) -* [Enable ssl](enable_ssl) +* [Register periodical digital pin publish](register_periodical_digital_pin_publish) -* [Enable lte](enable_lte) +* [Send analog pin value](send_analog_pin_value) -* [Deepsleep](deepsleep) +* [Send battery level](send_battery_level) -* [Dump ca](dump_ca) +* [Send custom message](send_custom_message) + +* [Set custom message callback](set_custom_message_callback) + +* [Send custom location](send_custom_location) + +* [Send digital pin value](send_digital_pin_value) + +* [Send info message](send_info_message) + +* [Send ping message](send_ping_message) + +* [Send scan info message](send_scan_info_message) + +* [Send signal](send_signal) + +* [Send virtual pin value](send_virtual_pin_value) + +* [Set config](set_config) * [Start](start) -* [Activate](activate) +* [Update config](update_config) + +* [Write config](write_config) diff --git a/content/pybytes/api/activate.md b/content/pybytes/api/activate.md index ee7e371..ebc5901 100644 --- a/content/pybytes/api/activate.md +++ b/content/pybytes/api/activate.md @@ -6,7 +6,7 @@ aliases: **Activate** ---- - Activate device + Activate device on Pybytes. **Method** ---- @@ -17,7 +17,7 @@ aliases: ---- | name | Description | is Required | Default value | ------------- |:-------------:|:-------------:|:-------------:| -| activation string | generated by Pybytes | Yes | - | +| activation string | Generated by Pybytes | Yes | - | **Example** diff --git a/content/pybytes/api/connect.md b/content/pybytes/api/connect.md index 753b4fe..a094f95 100644 --- a/content/pybytes/api/connect.md +++ b/content/pybytes/api/connect.md @@ -6,8 +6,16 @@ aliases: **Connect** ---- - Initialize connection based on default parameters + Initialize connection based on the configured parameters. **Method** ---- **pybytes.connect()** + +**Example** +---- +`pybytes.connect()` + +**Success Response** +---- + >> Connected using Sigfox. Only upload stream is supported diff --git a/content/pybytes/api/connect_lora_abp.md b/content/pybytes/api/connect_lora_abp.md index 4a2db39..a44c8c0 100644 --- a/content/pybytes/api/connect_lora_abp.md +++ b/content/pybytes/api/connect_lora_abp.md @@ -6,8 +6,25 @@ aliases: **Connect LoRa ABP** ---- - Initialize LoRa ABP connection + Initialize LoRa ABP connection. **Method** ---- -**pybytes.connect_lora_abp()** +**pybytes.connect_lora_abp(timeout, nanogateway)** + +**Parameters** +---- +| name | Description | is Required | Default value +| ------------- |:-------------:|:-------------:|:-------------:| +| timeout | Connection timeout | Yes | - | +| nanogateway | TBD | Yes | - | + +**Example** +---- +`pybytes.connect_lora_abp(15000, false)` + +**Success Response** +---- + >> Trying to join LoRa.ABP for 15000 seconds... + >> Setting up LoRa socket... + >> Connected using LoRa diff --git a/content/pybytes/api/connect_lora_otaa.md b/content/pybytes/api/connect_lora_otaa.md index e16d2d4..0b42a51 100644 --- a/content/pybytes/api/connect_lora_otaa.md +++ b/content/pybytes/api/connect_lora_otaa.md @@ -6,8 +6,25 @@ aliases: **Connect LoRa OTAA** ---- - Initialize LoRa OTAA connection + Initialize LoRa OTAA connection. **Method** ---- -**pybytes.connect_lora_otaa()** +**pybytes.connect_lora_otaa(timeout, nanogateway)** + +**Parameters** +---- +| name | Description | is Required | Default value +| ------------- |:-------------:|:-------------:|:-------------:| +| timeout | Connection timeout | Yes | - | +| nanogateway | TBD | Yes | - | + +**Example** +---- +`pybytes.connect_lora_otaa(timeout=15, nanogateway=False)` + +**Success Response** +---- + >> Trying to join LoRa.OTAA for 15 seconds... + >> Setting up LoRa socket... + >> Connected using LoRa diff --git a/content/pybytes/api/connect_lte.md b/content/pybytes/api/connect_lte.md index c116956..0804732 100644 --- a/content/pybytes/api/connect_lte.md +++ b/content/pybytes/api/connect_lte.md @@ -6,8 +6,23 @@ aliases: **Connect LTE** ---- - Initialize watchdog for WiFi and LTE connection + Initialize watchdog for WiFi and LTE connection. **Method** ---- -**pybytes.connect_lte()** +**pybytes.connect_lte(reconnect=True, check_interval=0.5)** + +**Parameters** +---- +| name | Description | is Required | Default value +| ------------- |:-------------:|:-------------:|:-------------:| +| reconnect | Boolean | Yes | - | +| check_interval | interval in seconds | Yes | - | + +**Example** +---- +`pybytes.connect_lte(reconnect=True, check_interval=0.5)` + +**Success Response** +---- + TBD diff --git a/content/pybytes/api/connect_sigfox.md b/content/pybytes/api/connect_sigfox.md index f6d3415..380fe99 100644 --- a/content/pybytes/api/connect_sigfox.md +++ b/content/pybytes/api/connect_sigfox.md @@ -6,8 +6,16 @@ aliases: **Connect Sigfox** ---- - Initialize Sigfox connection + Initialize Sigfox connection. **Method** ---- **pybytes.connect_sigfox()** + +**Example** +---- +`pybytes.connect_sigfox()` + +**Success Response** +---- + >> Connected using Sigfox. Only upload stream is supported diff --git a/content/pybytes/api/connect_wifi.md b/content/pybytes/api/connect_wifi.md index 4ea09da..9d443a9 100644 --- a/content/pybytes/api/connect_wifi.md +++ b/content/pybytes/api/connect_wifi.md @@ -6,7 +6,7 @@ aliases: **Connect Wifi** ---- - Initialize watchdog for WiFi and LTE connection + Initialize watchdog for WiFi and LTE connection. **Method** ---- diff --git a/content/pybytes/api/deepsleep.md b/content/pybytes/api/deepsleep.md index 5b69a9b..7ceb0d9 100644 --- a/content/pybytes/api/deepsleep.md +++ b/content/pybytes/api/deepsleep.md @@ -16,9 +16,9 @@ aliases: ---- | name | Description | is Required | Default value | ------------- |:-------------:|:-------------:|:-------------:| -| ms | Time to sleep in ms | Yes | - | +| ms | Sleep period in ms | Yes | - | | pins | Affected pins | No | None | -| mode | Sleep mode | No | None | +| mode | Sleep mode TBD | No | None | | enable_pull | Enable pull | No | None | **Example** diff --git a/content/pybytes/api/enable_lte.md b/content/pybytes/api/enable_lte.md index 8a19f94..4498d93 100644 --- a/content/pybytes/api/enable_lte.md +++ b/content/pybytes/api/enable_lte.md @@ -22,7 +22,7 @@ aliases: | apn | APN | No | None | | type | Type | No | None | | reset | Reset | No | None | -| fallback | Fallbackena | No | False | +| fallback | Fallback TBD | No | False | **Example** ---- diff --git a/content/pybytes/api/export_config.md b/content/pybytes/api/export_config.md index f9c8203..ec13264 100644 --- a/content/pybytes/api/export_config.md +++ b/content/pybytes/api/export_config.md @@ -4,9 +4,9 @@ aliases: - pybytes/api/export_config --- -**Export Config** +**Export configuration file** ---- - Export configuration file + Exports configuration file at specified path. **Method** ---- diff --git a/content/pybytes/api/get_config.md b/content/pybytes/api/get_config.md index 9d7bf27..ee5728e 100644 --- a/content/pybytes/api/get_config.md +++ b/content/pybytes/api/get_config.md @@ -6,7 +6,7 @@ aliases: **Get Config** ---- - Returns configuration data + Returns configuration data. **Method** ---- diff --git a/content/pybytes/api/is_connected.md b/content/pybytes/api/is_connected.md index 40d6c34..0887073 100644 --- a/content/pybytes/api/is_connected.md +++ b/content/pybytes/api/is_connected.md @@ -6,7 +6,7 @@ aliases: **Is connected** ---- - Returns true if connected + Returns true if connected. **Method** ---- diff --git a/content/pybytes/api/isconnected.md b/content/pybytes/api/isconnected.md index 0d3b28f..535a040 100644 --- a/content/pybytes/api/isconnected.md +++ b/content/pybytes/api/isconnected.md @@ -6,7 +6,7 @@ aliases: **Is connected** ---- - Returns true if connected + Returns true if connected. **Method** ---- diff --git a/content/pybytes/api/print_config.md b/content/pybytes/api/print_config.md index ee10b6e..ee0a515 100644 --- a/content/pybytes/api/print_config.md +++ b/content/pybytes/api/print_config.md @@ -6,7 +6,7 @@ aliases: **Print config** ---- - Prints current configuration in the terminal + Prints current configuration in the terminal. **Method** ---- @@ -17,17 +17,17 @@ aliases: `pybytes.print_config()` **Success Response** - ssl = True - wifi = {'ssid': '', 'password': ''} - lte = {'apn': 'internet', 'cid': 1, 'reset': False, 'carrier': 'Standard', 'band': 3, 'type': 'IP'} - username = alipsilv@hotmail.com - network_preferences = ['lte', 'lte', 'lte', 'lora_otaa'] - cfg_msg = Pybytes configuration read from /flash/pybytes_config.json - dump_ca = True - wlan_antenna = 0 - server = 10.0.0.61 - lora = {'otaa': {'app_key': '87c8105c151f885bc19ccb9484fe8185', 'app_device_eui': '909d7afb9b82c0f6', 'app_eui': '70B3D57ED000AFA0'}} - ota_server = {'port': 443, 'domain': 'software.pycom.io'} - pybytes_autostart = True - ssl_params = {'ca_certs': '/flash/cert/pycom-ca.pem'} - device_id = 139e95ed-7213-406b-b07a-a54bfbf021c8 + >> ssl = True + >> wifi = {'ssid': '', 'password': ''} + >> lte = {'apn': 'internet', 'cid': 1, 'reset': False, 'carrier': 'Standard', 'band': 3, 'type': 'IP'} + >> username = alipsilv@hotmail.com + >> network_preferences = ['lte', 'lte', 'lte', 'lora_otaa'] + >> cfg_msg = Pybytes configuration read from /flash/pybytes_config.json + >> dump_ca = True + >> wlan_antenna = 0 + >> server = 10.0.0.61 + >> lora = {'otaa': {'app_key': '87c8105c151f885bc19ccb9484fe8185', 'app_device_eui': '909d7afb9b82c0f6', 'app_eui': '70B3D57ED000AFA0'}} + >> ota_server = {'port': 443, 'domain': 'software.pycom.io'} + >> pybytes_autostart = True + >> ssl_params = {'ca_certs': '/flash/cert/pycom-ca.pem'} + >> device_id = 139e95ed-7213-406b-b07a-a54bfbf021c8 diff --git a/content/pybytes/api/read_config.md b/content/pybytes/api/read_config.md index 3959793..ce51a87 100644 --- a/content/pybytes/api/read_config.md +++ b/content/pybytes/api/read_config.md @@ -6,7 +6,7 @@ aliases: **Read config** ---- - Reads configuration from file + Reads configuration from the given file. **Method** ---- diff --git a/content/pybytes/api/reconnect.md b/content/pybytes/api/reconnect.md index 662984f..dba5a24 100644 --- a/content/pybytes/api/reconnect.md +++ b/content/pybytes/api/reconnect.md @@ -6,7 +6,7 @@ aliases: **Reconnect** ---- - Reconnects device + Reconnects device. **Method** ---- diff --git a/content/pybytes/api/register_periodical_analog_pin_publish.md b/content/pybytes/api/register_periodical_analog_pin_publish.md index f1d64f3..b44d964 100644 --- a/content/pybytes/api/register_periodical_analog_pin_publish.md +++ b/content/pybytes/api/register_periodical_analog_pin_publish.md @@ -6,7 +6,7 @@ aliases: **Register periodical analog pin publish** ---- - Publish periodically on the given analog pin + Publish periodically on the given analog pin. **Method** ---- diff --git a/content/pybytes/api/register_periodical_digital_pin_publish.md b/content/pybytes/api/register_periodical_digital_pin_publish.md index d65c6b8..6a0e792 100644 --- a/content/pybytes/api/register_periodical_digital_pin_publish.md +++ b/content/pybytes/api/register_periodical_digital_pin_publish.md @@ -6,7 +6,7 @@ aliases: **Register periodical digital pin publish** ---- - Publish periodically on the given digital pin + Publish periodically on the given digital pin. **Method** diff --git a/content/pybytes/api/send_analog_pin_value.md b/content/pybytes/api/send_analog_pin_value.md index 277130d..bd3c0a1 100644 --- a/content/pybytes/api/send_analog_pin_value.md +++ b/content/pybytes/api/send_analog_pin_value.md @@ -6,7 +6,7 @@ aliases: **Send analog pin value** ---- - Send analog pin value + Send analog pin value. **Method** ---- diff --git a/content/pybytes/api/send_battery_level.md b/content/pybytes/api/send_battery_level.md index 11879c4..86642f5 100644 --- a/content/pybytes/api/send_battery_level.md +++ b/content/pybytes/api/send_battery_level.md @@ -6,7 +6,7 @@ aliases: **Send battery level** ---- - Send battery level + Send battery level. **Method** ---- diff --git a/content/pybytes/api/send_custom_location.md b/content/pybytes/api/send_custom_location.md index 55f0277..2bc3a4d 100644 --- a/content/pybytes/api/send_custom_location.md +++ b/content/pybytes/api/send_custom_location.md @@ -6,7 +6,7 @@ aliases: **Send custom location** ---- - Send custom location + Send custom location. **Method** ---- diff --git a/content/pybytes/api/send_custom_message.md b/content/pybytes/api/send_custom_message.md index 9cbc9f5..c4959fc 100644 --- a/content/pybytes/api/send_custom_message.md +++ b/content/pybytes/api/send_custom_message.md @@ -6,7 +6,7 @@ aliases: **Send custom location** ---- - Send custom location + Send custom location. **Method** ---- diff --git a/content/pybytes/api/send_digital_pin_value.md b/content/pybytes/api/send_digital_pin_value.md index 1dc4475..62f6bcd 100644 --- a/content/pybytes/api/send_digital_pin_value.md +++ b/content/pybytes/api/send_digital_pin_value.md @@ -6,7 +6,7 @@ aliases: **Send analog pin value** ---- - Send analog pin value + Send analog pin value. **Method** ---- diff --git a/content/pybytes/api/send_info_message.md b/content/pybytes/api/send_info_message.md index 8cfcc8d..721db64 100644 --- a/content/pybytes/api/send_info_message.md +++ b/content/pybytes/api/send_info_message.md @@ -6,7 +6,7 @@ aliases: **Send info message** ---- - Send info message + Send info message. **Method** ---- diff --git a/content/pybytes/api/send_ping_message.md b/content/pybytes/api/send_ping_message.md index 91f1fcd..cb6a502 100644 --- a/content/pybytes/api/send_ping_message.md +++ b/content/pybytes/api/send_ping_message.md @@ -6,7 +6,7 @@ aliases: **Send ping message** ---- - Send ping message + Send ping message. **Method** ---- diff --git a/content/pybytes/api/send_scan_info_message.md b/content/pybytes/api/send_scan_info_message.md index 105e2c2..92c7408 100644 --- a/content/pybytes/api/send_scan_info_message.md +++ b/content/pybytes/api/send_scan_info_message.md @@ -6,7 +6,7 @@ aliases: **Send scan info message** ---- - Send scan info message + Send scan info message. **Method** ---- diff --git a/content/pybytes/api/send_signal.md b/content/pybytes/api/send_signal.md index 5cfede0..d1bb586 100644 --- a/content/pybytes/api/send_signal.md +++ b/content/pybytes/api/send_signal.md @@ -6,7 +6,7 @@ aliases: **Send signal** ---- - Send signal + Send signal to the given pin. **Method** ---- diff --git a/content/pybytes/api/send_virtual_pin_value.md b/content/pybytes/api/send_virtual_pin_value.md index d40e7b9..ee9e3ba 100644 --- a/content/pybytes/api/send_virtual_pin_value.md +++ b/content/pybytes/api/send_virtual_pin_value.md @@ -6,7 +6,7 @@ aliases: **Send ping message** ---- - Send ping message + Send ping message. TBD **Method** ---- diff --git a/content/pybytes/api/set_config.md b/content/pybytes/api/set_config.md index 3ce9cb4..63b139c 100644 --- a/content/pybytes/api/set_config.md +++ b/content/pybytes/api/set_config.md @@ -6,7 +6,7 @@ aliases: **Set configuration** ---- - Set device configuration + Set device configuration. **Method** ---- diff --git a/content/pybytes/api/set_custom_message_callback.md b/content/pybytes/api/set_custom_message_callback.md index 890380c..87ee13e 100644 --- a/content/pybytes/api/set_custom_message_callback.md +++ b/content/pybytes/api/set_custom_message_callback.md @@ -6,7 +6,7 @@ aliases: **Send custom message callback** ---- - Send custom location + Send custom location. **Method** ---- diff --git a/content/pybytes/api/update_config.md b/content/pybytes/api/update_config.md index 0ea3a65..1bd55f8 100644 --- a/content/pybytes/api/update_config.md +++ b/content/pybytes/api/update_config.md @@ -6,7 +6,7 @@ aliases: **Update configuration** ---- - Update device configuration + Update device configuration. **Method** ---- diff --git a/content/pybytes/api/write_config.md b/content/pybytes/api/write_config.md index a273d71..b7b3162 100644 --- a/content/pybytes/api/write_config.md +++ b/content/pybytes/api/write_config.md @@ -6,7 +6,7 @@ aliases: **Update configuration** ---- - Update device configuration + Update device configuration. **Method** ---- From fb61c752afa3f92792c40cf1e3910a4d2046b29e Mon Sep 17 00:00:00 2001 From: Aline Date: Wed, 15 Jan 2020 17:19:02 +0100 Subject: [PATCH 06/11] docs: debbuging information should appear on the main page --- content/pybytes/api/_index.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/content/pybytes/api/_index.md b/content/pybytes/api/_index.md index 8bf29fb..502c12d 100644 --- a/content/pybytes/api/_index.md +++ b/content/pybytes/api/_index.md @@ -4,6 +4,28 @@ aliases: - pybytes/api --- + +If you are facing any issues try to enable debugging. + +### Debugging +There are multiple debug levels, 0 is warnings only, 6 is currently the highest used). + +#### use: + +import pycom; + +pycom.nvs_set('pybytes_debug', debugLevel) + + +#### e.g. +``` + >> import pycom; + >> pycom.nvs_set('pybytes_debug', 6) +``` + + +# API List + * [Add custom method](add_custom_method) * [Activate](activate) From cb6fa987367103bb8ff5cd7ba9f8eea6ab0d3799 Mon Sep 17 00:00:00 2001 From: Aline Date: Fri, 17 Jan 2020 17:41:26 +0100 Subject: [PATCH 07/11] docs: new doc added and style changes --- config.toml | 231 ++++++------------ content/pybytes/api/_index.md | 58 ++--- content/pybytes/api/activate.md | 27 +- content/pybytes/api/add_custom_method.md | 0 .../api/{connect.md => connect_device.md} | 9 +- content/pybytes/api/connect_lora_abp.md | 15 +- content/pybytes/api/connect_lora_otaa.md | 15 +- content/pybytes/api/connect_lte.md | 8 +- content/pybytes/api/connect_sigfox.md | 9 +- content/pybytes/api/connect_wifi.md | 11 +- content/pybytes/api/deepsleep.md | 18 +- content/pybytes/api/disconnect.md | 17 +- content/pybytes/api/dump_ca.md | 10 +- content/pybytes/api/enable_lte.md | 16 +- content/pybytes/api/enable_ssl.md | 10 +- content/pybytes/api/enable_terminal.md | 4 +- content/pybytes/api/export_config.md | 12 +- content/pybytes/api/get_config.md | 6 +- content/pybytes/api/is_connected.md | 6 +- content/pybytes/api/isconnected.md | 10 +- content/pybytes/api/print_config.md | 36 +-- content/pybytes/api/read_config.md | 10 +- content/pybytes/api/reconnect.md | 12 +- .../register_periodical_analog_pin_publish.md | 28 --- ...register_periodical_digital_pin_publish.md | 30 --- content/pybytes/api/send_analog_pin_value.md | 27 -- content/pybytes/api/send_battery_level.md | 26 -- content/pybytes/api/send_custom_location.md | 28 --- content/pybytes/api/send_custom_message.md | 27 -- content/pybytes/api/send_digital_pin_value.md | 28 --- content/pybytes/api/send_info_message.md | 9 +- content/pybytes/api/send_ping_message.md | 7 +- content/pybytes/api/send_scan_info_message.md | 20 -- content/pybytes/api/send_signal.md | 9 +- content/pybytes/api/send_virtual_pin_value.md | 27 -- content/pybytes/api/set_config.md | 10 +- .../api/set_custom_message_callback.md | 14 +- content/pybytes/api/start.md | 21 +- content/pybytes/api/update_config.md | 8 +- content/pybytes/api/write_config.md | 11 +- 40 files changed, 269 insertions(+), 611 deletions(-) delete mode 100644 content/pybytes/api/add_custom_method.md rename content/pybytes/api/{connect.md => connect_device.md} (65%) delete mode 100644 content/pybytes/api/register_periodical_analog_pin_publish.md delete mode 100644 content/pybytes/api/register_periodical_digital_pin_publish.md delete mode 100644 content/pybytes/api/send_analog_pin_value.md delete mode 100644 content/pybytes/api/send_battery_level.md delete mode 100644 content/pybytes/api/send_custom_location.md delete mode 100644 content/pybytes/api/send_custom_message.md delete mode 100644 content/pybytes/api/send_digital_pin_value.md delete mode 100644 content/pybytes/api/send_scan_info_message.md delete mode 100644 content/pybytes/api/send_virtual_pin_value.md diff --git a/config.toml b/config.toml index 6c44df3..0fc8b74 100644 --- a/config.toml +++ b/config.toml @@ -1169,289 +1169,198 @@ theme = "doc-theme" [[menu.main]] name = "Pybytes library API" url = "/pybytes/api/" - identifier = "pybytes@api" - parent = "pybytes" - weight = 15 - -[[menu.main]] - name = "Add custom method" - url = "/pybytes/api/add_custom_method" - identifier = "pybytes@api@add_custom_method" - parent = "pybytes@api" - weight = 10 + identifier= "pybytes@api" + parent= "pybytes" + weight = 20 [[menu.main]] name = "Activate Device" - url = "/pybytes/api/activate" + url = "/pybytes/api/activate/" identifier = "pybytes@api@activate" parent = "pybytes@api" weight = 11 [[menu.main]] name = "Connect" - url = "/pybytes/api/connect" - identifier = "pybytes@api@connect" + url = "/pybytes/api/connect_device/" + identifier = "pybytes@api@connect_device" parent = "pybytes@api" weight = 12 [[menu.main]] name = "Connect LTE" - url = "/pybytes/api/connect_lte" + url = "/pybytes/api/connect_lte/" identifier = "pybytes@api@connect_lte" parent = "pybytes@api" weight = 13 [[menu.main]] - name = "Connect LoRa ABP" - url = "/pybytes/api/connect_lora_abp" + name = "Connect loRa ABP" + url = "/pybytes/api/connect_lora_abp/" identifier = "pybytes@api@connect_lora_abp" parent = "pybytes@api" weight = 14 [[menu.main]] - name = "Connect LoRa OTAA" - url = "/pybytes/api/connect_lora_otaa" + name = "Connect loRa OTAA" + url = "/pybytes/api/connect_lora_otaa/" identifier = "pybytes@api@connect_lora_otaa" parent = "pybytes@api" weight = 15 [[menu.main]] name = "Connect Sigfox" - url = "/pybytes/api/connect_sigfox" + url = "/pybytes/api/connect_sigfox/" identifier = "pybytes@api@connect_sigfox" parent = "pybytes@api" weight = 16 [[menu.main]] name = "Connect Wifi" - url = "/pybytes/api/connect_wifi" + url = "/pybytes/api/connect_wifi/" identifier = "pybytes@api@connect_wifi" parent = "pybytes@api" weight = 17 [[menu.main]] name = "Deepsleep" - url = "/pybytes/api/deepsleep" + url = "/pybytes/api/deepsleep/" identifier = "pybytes@api@deepsleep" parent = "pybytes@api" - weight = 18 - -[[menu.main]] - name = "Disconnect" - url = "/pybytes/api/disconnect" - identifier = "pybytes@api@disconnect" - parent = "pybytes@api" weight = 19 [[menu.main]] - name = "Dump ca" - url = "/pybytes/api/dump_ca" - identifier = "pybytes@api@dump_ca" + name = "Disconnect" + url = "/pybytes/api/disconnect/" + identifier = "pybytes@api@disconnect" parent = "pybytes@api" weight = 20 [[menu.main]] - name = "Enable lte" - url = "/pybytes/api/enable_lte" - identifier = "pybytes@api@enable_lte" - parent = "pybytes@api" - weight = 21 - -[[menu.main]] - name = "Enable ssl" - url = "/pybytes/api/enable_ssl" - identifier = "pybytes@api@enable_ssl" + name = "Dump CA" + url = "/pybytes/api/dump_ca/" + identifier = "pybytes@api@dump_ca" parent = "pybytes@api" weight = 22 [[menu.main]] - name = "Enable terminal" - url = "/pybytes/api/enable_terminal" - identifier = "pybytes@api@enable_terminal" + name = "Enable LTE" + url = "/pybytes/api/enable_lte/" + identifier = "pybytes@api@enable_lte" parent = "pybytes@api" weight = 23 [[menu.main]] - name = "Export config" - url = "/pybytes/api/export_config" - identifier = "pybytes@api@export_config" + name = "Enable SSL" + url = "/pybytes/api/enable_ssl/" + identifier = "pybytes@api@enable_ssl" parent = "pybytes@api" weight = 24 [[menu.main]] - name = "Get config" - url = "/pybytes/api/get_config" - identifier = "pybytes@api@get_config" + name = "Enable terminal" + url = "/pybytes/api/enable_terminal/" + identifier = "pybytes@api@enable_terminal" parent = "pybytes@api" weight = 25 [[menu.main]] - name = "Is connected" - url = "/pybytes/api/is_connected" - identifier = "pybytes@api@is_connected" + name = "Export configuration" + url = "/pybytes/api/export_config/" + identifier = "pybytes@api@export_config" parent = "pybytes@api" weight = 26 [[menu.main]] - name = "isconnected" - url = "/pybytes/api/isconnected" - identifier = "pybytes@api@isconnected" + name = "Get configuration" + url = "/pybytes/api/get_config/" + identifier = "pybytes@api@get_config" parent = "pybytes@api" weight = 27 [[menu.main]] - name = "Print cfg msg" - url = "/pybytes/api/print_cfg_msg" - identifier = "pybytes@api@print_cfg_msg" + name = "Is connected" + url = "/pybytes/api/is_connected/" + identifier = "pybytes@api@is_connected" parent = "pybytes@api" weight = 28 [[menu.main]] - name = "Print config" - url = "/pybytes/api/print_config" + name = "Print configuration" + url = "/pybytes/api/print_config/" identifier = "pybytes@api@print_config" parent = "pybytes@api" weight = 29 [[menu.main]] - name = "Read config" - url = "/pybytes/api/read_config" + name = "Read configuration" + url = "/pybytes/api/read_config/" identifier = "pybytes@api@read_config" parent = "pybytes@api" weight = 30 [[menu.main]] name = "Reconnect" - url = "/pybytes/api/reconnect" + url = "/pybytes/api/reconnect/" identifier = "pybytes@api@reconnect" parent = "pybytes@api" weight = 31 [[menu.main]] - name = "Register periodical analog pin publish" - url = "/pybytes/api/register_periodical_analog_pin_publish" - identifier = "pybytes@api@register_periodical_analog_pin_publish" + name = "Send info message" + url = "/pybytes/api/send_info_message/" + identifier = "pybytes@api@send_info_message" parent = "pybytes@api" weight = 32 [[menu.main]] - name = "Register periodical digital pin publish" - url = "/pybytes/api/register_periodical_digital_pin_publish" - identifier = "pybytes@api@register_periodical_digital_pin_publish" + name = "Send ping message" + url = "/pybytes/api/send_ping_message/" + identifier = "pybytes@api@send_ping_message" parent = "pybytes@api" weight = 33 [[menu.main]] - name = "Send analog pin value" - url = "/pybytes/api/send_analog_pin_value" - identifier = "pybytes@api@send_analog_pin_value" + name = "Send signal" + url = "/pybytes/api/send_signal/" + identifier = "pybytes@api@send_signal" parent = "pybytes@api" weight = 34 [[menu.main]] - name = "Send battery level" - url = "/pybytes/api/send_battery_level" - identifier = "pybytes@api@send_battery_level" + name = "Set configuration" + url = "/pybytes/api/set_config/" + identifier = "pybytes@api@set_config" parent = "pybytes@api" weight = 35 [[menu.main]] - name = "Send custom message" - url = "/pybytes/api/send_custom_message" - identifier = "pybytes@api@send_custom_message" + name = "Start" + url = "/pybytes/api/start/" + identifier = "pybytes@api@start" parent = "pybytes@api" weight = 36 [[menu.main]] - name = "Set custom message callback" - url = "/pybytes/api/set_custom_message_callback" - identifier = "pybytes@api@set_custom_message_callback" + name = "Update configuration" + url = "/pybytes/api/update_config/" + identifier = "pybytes@api@update_config" parent = "pybytes@api" weight = 37 [[menu.main]] - name = "Send custom location" - url = "/pybytes/api/send_custom_location" - identifier = "pybytes@api@send_custom_location" - parent = "pybytes@api" - weight = 38 - -[[menu.main]] - name = "Send digital pin value" - url = "/pybytes/api/send_digital_pin_value" - identifier = "pybytes@api@send_digital_pin_value" - parent = "pybytes@api" - weight = 39 - -[[menu.main]] - name = "Send info message" - url = "/pybytes/api/send_info_message" - identifier = "pybytes@api@send_info_message" - parent = "pybytes@api" - weight = 40 - -[[menu.main]] - name = "Send ping message" - url = "/pybytes/api/send_ping_message" - identifier = "pybytes@api@send_ping_message" - parent = "pybytes@api" - weight = 41 - -[[menu.main]] - name = "Send scan info message" - url = "/pybytes/api/send_scan_info_message" - identifier = "pybytes@api@send_scan_info_message" - parent = "pybytes@api" - weight = 42 - -[[menu.main]] - name = "Send signal" - url = "/pybytes/api/send_signal" - identifier = "pybytes@api@send_signal" - parent = "pybytes@api" - weight = 43 - -[[menu.main]] - name = "Send virtual pin value" - url = "/pybytes/api/send_virtual_pin_value" - identifier = "pybytes@api@send_virtual_pin_value" - parent = "pybytes@api" - weight = 44 - -[[menu.main]] - name = "Set config" - url = "/pybytes/api/set_config" - identifier = "pybytes@api@set_config" - parent = "pybytes@api" - weight = 45 - -[[menu.main]] - name = "Start" - url = "/pybytes/api/start" - identifier = "pybytes@api@start" - parent = "pybytes@api" - weight = 46 - -[[menu.main]] - name = "Update config" - url = "/pybytes/api/update_config" - identifier = "pybytes@api@update_config" - parent = "pybytes@api" - weight = 47 - -[[menu.main]] - name = "Write config" - url = "/pybytes/api/write_config" + name = "Write configuration" + url = "/pybytes/api/write_config/" identifier = "pybytes@api@write_config" parent = "pybytes@api" - weight = 48 + weight = 38 [[menu.main]] name = "Add a device to Pybytes" url = "/pybytes/connect/" identifier = "pybytes@connect" parent = "pybytes" - weight = 20 + weight = 30 [[menu.main]] name = "Provisioning via USB" @@ -1465,7 +1374,7 @@ theme = "doc-theme" url = "/pybytes/sigfox/" identifier = "pybytes@sigfox" parent = "pybytes" - weight = 25 + weight = 40 [[menu.main]] name = "DevKit contract" @@ -1486,7 +1395,7 @@ theme = "doc-theme" url = "/pybytes/releases/" identifier = "pybytes@releases" parent = "pybytes" - weight = 30 + weight = 50 [[menu.main]] name = "Create new release" @@ -1507,21 +1416,21 @@ theme = "doc-theme" url = "/pybytes/smart/" identifier = "pybytes@smart" parent = "pybytes" - weight = 35 + weight = 60 [[menu.main]] name = "Visualise data" url = "/pybytes/dashboard/" identifier = "pybytes@dashboard" parent = "pybytes" - weight = 40 + weight = 70 [[menu.main]] name = "Integrations" url = "/pybytes/integrations/" identifier = "pybytes@integrations" parent = "pybytes" - weight = 45 + weight = 80 [[menu.main]] name = "Amazon IoT" diff --git a/content/pybytes/api/_index.md b/content/pybytes/api/_index.md index 502c12d..45d8d69 100644 --- a/content/pybytes/api/_index.md +++ b/content/pybytes/api/_index.md @@ -1,7 +1,6 @@ --- title: "Pybytes library API" aliases: - - pybytes/api --- @@ -12,21 +11,20 @@ There are multiple debug levels, 0 is warnings only, 6 is currently the highest #### use: -import pycom; - -pycom.nvs_set('pybytes_debug', debugLevel) - +``` +>> import pycom; +>> pycom.nvs_set('pybytes_debug', debugLevel) +``` #### e.g. ``` - >> import pycom; - >> pycom.nvs_set('pybytes_debug', 6) +>> import pycom; +>> pycom.nvs_set('pybytes_debug', 6) ``` # API List -* [Add custom method](add_custom_method) * [Activate](activate) @@ -46,60 +44,36 @@ pycom.nvs_set('pybytes_debug', debugLevel) * [Disconnect](disconnect) -* [Dump ca](dump_ca) +* [Dump CA](dump_ca) -* [Enable lte](enable_lte) +* [Enable LTE](enable_lte) -* [Enable ssl](enable_ssl) +* [Enable SSL](enable_ssl) * [Enable terminal](enable_terminal) -* [Export config](export_config) +* [Export configuration](export_config) -* [Get config](get_config) +* [Get configuration](get_config) * [Is connected](is_connected) -* [isconnected](isconnected) +* [Print configuration](print_config) -* [Print cfg msg](print_cfg_msg) - -* [Print config](print_config) - -* [Read config](read_config) +* [Read configuration](read_config) * [Reconnect](reconnect) -* [Register periodical analog pin publish](register_periodical_analog_pin_publish) - -* [Register periodical digital pin publish](register_periodical_digital_pin_publish) - -* [Send analog pin value](send_analog_pin_value) - -* [Send battery level](send_battery_level) - -* [Send custom message](send_custom_message) - -* [Set custom message callback](set_custom_message_callback) - -* [Send custom location](send_custom_location) - -* [Send digital pin value](send_digital_pin_value) - * [Send info message](send_info_message) * [Send ping message](send_ping_message) -* [Send scan info message](send_scan_info_message) - * [Send signal](send_signal) -* [Send virtual pin value](send_virtual_pin_value) - -* [Set config](set_config) +* [Set configuration](set_config) * [Start](start) -* [Update config](update_config) +* [Update configuration](update_config) -* [Write config](write_config) +* [Write configuration](write_config) diff --git a/content/pybytes/api/activate.md b/content/pybytes/api/activate.md index ebc5901..002021a 100644 --- a/content/pybytes/api/activate.md +++ b/content/pybytes/api/activate.md @@ -1,11 +1,10 @@ --- -title: "Pybytes library API" +title: "Activate Device" aliases: - - pybytes/api/activate + - pybytes/api/activate.html + - pybytes/api/activate.md --- -**Activate** ----- Activate device on Pybytes. **Method** @@ -22,17 +21,19 @@ aliases: **Example** ---- -pybytes.activate("eyJhIjoiNTYzM...") +`pybytes.activate("eyJhIjoiNTYzM...")` **Success Response** ---- - >> Please wait while we try to connect to Pycom - >> Wifi connection established... activating device! - >> WMAC: 807D3AC325E8 - >> Firmware: 1.20.1.r2 - >> Pybytes: 1.3.0 - >> Initialized watchdog for WiFi and LTE connection with timeout 1260000 ms - >> WiFi connection established - >> Pybytes connected successfully (using the built-in pybytes library) +``` +>> Please wait while we try to connect to Pycom +>> Wifi connection established... activating device! +>> WMAC: 807D3AC325E8 +>> Firmware: 1.20.1.r2 +>> Pybytes: 1.3.0 +>> Initialized watchdog for WiFi and LTE connection with timeout 1260000 ms +>> WiFi connection established +>> Pybytes connected successfully (using the built-in pybytes library) +``` diff --git a/content/pybytes/api/add_custom_method.md b/content/pybytes/api/add_custom_method.md deleted file mode 100644 index e69de29..0000000 diff --git a/content/pybytes/api/connect.md b/content/pybytes/api/connect_device.md similarity index 65% rename from content/pybytes/api/connect.md rename to content/pybytes/api/connect_device.md index a094f95..0c2dcca 100644 --- a/content/pybytes/api/connect.md +++ b/content/pybytes/api/connect_device.md @@ -1,11 +1,9 @@ --- -title: "Pybytes library API" +title: "Connect Device" aliases: - pybytes/api/connect --- -**Connect** ----- Initialize connection based on the configured parameters. **Method** @@ -18,4 +16,7 @@ aliases: **Success Response** ---- - >> Connected using Sigfox. Only upload stream is supported + +``` +>> Connected using Sigfox. Only upload stream is supported +``` diff --git a/content/pybytes/api/connect_lora_abp.md b/content/pybytes/api/connect_lora_abp.md index a44c8c0..22bf481 100644 --- a/content/pybytes/api/connect_lora_abp.md +++ b/content/pybytes/api/connect_lora_abp.md @@ -1,11 +1,9 @@ --- -title: "Pybytes library API" +title: "Connect LoRa ABP" aliases: - pybytes/api/connect_lora_abp --- -**Connect LoRa ABP** ----- Initialize LoRa ABP connection. **Method** @@ -17,7 +15,7 @@ aliases: | name | Description | is Required | Default value | ------------- |:-------------:|:-------------:|:-------------:| | timeout | Connection timeout | Yes | - | -| nanogateway | TBD | Yes | - | +| nanogateway | Enable nanogateway | Yes | - | **Example** ---- @@ -25,6 +23,9 @@ aliases: **Success Response** ---- - >> Trying to join LoRa.ABP for 15000 seconds... - >> Setting up LoRa socket... - >> Connected using LoRa + +``` +>> Trying to join LoRa.ABP for 15000 seconds... +>> Setting up LoRa socket... +>> Connected using LoRa +``` diff --git a/content/pybytes/api/connect_lora_otaa.md b/content/pybytes/api/connect_lora_otaa.md index 0b42a51..2aa9334 100644 --- a/content/pybytes/api/connect_lora_otaa.md +++ b/content/pybytes/api/connect_lora_otaa.md @@ -1,11 +1,9 @@ --- -title: "Pybytes library API" +title: "Connect LoRa OTAA" aliases: - pybytes/api/connect_lora_otaa --- -**Connect LoRa OTAA** ----- Initialize LoRa OTAA connection. **Method** @@ -17,7 +15,7 @@ aliases: | name | Description | is Required | Default value | ------------- |:-------------:|:-------------:|:-------------:| | timeout | Connection timeout | Yes | - | -| nanogateway | TBD | Yes | - | +| nanogateway | Enable nanogateway | Yes | - | **Example** ---- @@ -25,6 +23,9 @@ aliases: **Success Response** ---- - >> Trying to join LoRa.OTAA for 15 seconds... - >> Setting up LoRa socket... - >> Connected using LoRa + +``` +>> Trying to join LoRa.OTAA for 15 seconds... +>> Setting up LoRa socket... +>> Connected using LoRa +``` diff --git a/content/pybytes/api/connect_lte.md b/content/pybytes/api/connect_lte.md index 0804732..3b56328 100644 --- a/content/pybytes/api/connect_lte.md +++ b/content/pybytes/api/connect_lte.md @@ -1,11 +1,9 @@ --- -title: "Pybytes library API" +title: "Connect LTE" aliases: - pybytes/api/connect_lte --- -**Connect LTE** ----- Initialize watchdog for WiFi and LTE connection. **Method** @@ -22,7 +20,3 @@ aliases: **Example** ---- `pybytes.connect_lte(reconnect=True, check_interval=0.5)` - -**Success Response** ----- - TBD diff --git a/content/pybytes/api/connect_sigfox.md b/content/pybytes/api/connect_sigfox.md index 380fe99..7928f2a 100644 --- a/content/pybytes/api/connect_sigfox.md +++ b/content/pybytes/api/connect_sigfox.md @@ -1,11 +1,9 @@ --- -title: "Pybytes library API" +title: "Connect Sigfox" aliases: - pybytes/api/connect_sigfox --- -**Connect Sigfox** ----- Initialize Sigfox connection. **Method** @@ -18,4 +16,7 @@ aliases: **Success Response** ---- - >> Connected using Sigfox. Only upload stream is supported + +``` +>> Connected using Sigfox. Only upload stream is supported +``` diff --git a/content/pybytes/api/connect_wifi.md b/content/pybytes/api/connect_wifi.md index 9d443a9..c5dc87c 100644 --- a/content/pybytes/api/connect_wifi.md +++ b/content/pybytes/api/connect_wifi.md @@ -1,11 +1,9 @@ --- -title: "Pybytes library API" +title: "Connect Wifi" aliases: - pybytes/api/connect_wifi --- -**Connect Wifi** ----- Initialize watchdog for WiFi and LTE connection. **Method** @@ -14,5 +12,8 @@ aliases: **Success Response** ---- - >> Connecting with SSID and PASSWORD - >> WiFi connection established + +``` +>> Connecting with SSID and PASSWORD +>> WiFi connection established +``` diff --git a/content/pybytes/api/deepsleep.md b/content/pybytes/api/deepsleep.md index 7ceb0d9..064a82f 100644 --- a/content/pybytes/api/deepsleep.md +++ b/content/pybytes/api/deepsleep.md @@ -1,11 +1,9 @@ --- -title: "Pybytes library API" +title: "Deepsleep" aliases: - pybytes/api/deepsleep --- -**Deepsleep** ----- Start deepsleep mode for the given period **Method** @@ -17,18 +15,20 @@ aliases: | name | Description | is Required | Default value | ------------- |:-------------:|:-------------:|:-------------:| | ms | Sleep period in ms | Yes | - | -| pins | Affected pins | No | None | -| mode | Sleep mode TBD | No | None | -| enable_pull | Enable pull | No | None | +| pins | A list or tuple containing the GPIO to setup for deepsleep wakeup | No | None | +| mode | Configure how GPIOs can wake up -> **machine.WAKEUP_ALL_LOW** or **machine.WAKEUP_ANY_HIGH** | No | None | +| enable_pull | If set to **True** keeps the pull up or pull down resistors enabled during deep sleep | No | None | **Example** ---- -pybytes.deepsleep(1000) +`>> pybytes.deepsleep(1000)` **Success Response** ---- After sleep, device reconnect - >> Connecting with SSID and PASSWORD - >> WiFi connection established +``` +>> Connecting with SSID and PASSWORD +>> WiFi connection established +``` diff --git a/content/pybytes/api/disconnect.md b/content/pybytes/api/disconnect.md index 0d1ad27..3bb6e98 100644 --- a/content/pybytes/api/disconnect.md +++ b/content/pybytes/api/disconnect.md @@ -1,11 +1,9 @@ --- -title: "Pybytes library API" +title: "Disconnect" aliases: - pybytes/api/disconnect --- -**Disconnect** ----- Disconnect device **Method** @@ -13,9 +11,12 @@ aliases: **pybytes.disconnect()** **Success Response** +---- - >> Watchdog timeout has been increased to 2147483647 ms - >> self.__connection_status=1 | self.__network_type=0 - >> MQTT over WIFI||LTE... disconnecting MQTT - >> Packet sent. (Length: 2) - >> Connected over WIFI... disconnecting +``` +>> Watchdog timeout has been increased to 2147483647 ms +>> self.__connection_status=1 | self.__network_type=0 +>> MQTT over WIFI||LTE... disconnecting MQTT +>> Packet sent. (Length: 2) +>> Connected over WIFI... disconnecting +``` diff --git a/content/pybytes/api/dump_ca.md b/content/pybytes/api/dump_ca.md index 96ee085..98516b7 100644 --- a/content/pybytes/api/dump_ca.md +++ b/content/pybytes/api/dump_ca.md @@ -1,11 +1,9 @@ --- -title: "Pybytes library API" +title: "Dump CA" aliases: - pybytes/api/dump_ca --- -**Dump CA** ----- Make a dump_ca **Method** @@ -24,4 +22,8 @@ aliases: `pybytes.dump_ca(ca_file='/flash/cert/pycom-ca.pem')` **Success Response** -`Successfully created /flash/cert/pycom-ca.pem` +---- + +``` +>> Successfully created /flash/cert/pycom-ca.pem +``` diff --git a/content/pybytes/api/enable_lte.md b/content/pybytes/api/enable_lte.md index 4498d93..77a440b 100644 --- a/content/pybytes/api/enable_lte.md +++ b/content/pybytes/api/enable_lte.md @@ -1,11 +1,9 @@ --- -title: "Pybytes library API" +title: "Enable LTE" aliases: - pybytes/api/enable_lte --- -**Enable LTE** ----- Enable LTE connection **Method** @@ -22,11 +20,17 @@ aliases: | apn | APN | No | None | | type | Type | No | None | | reset | Reset | No | None | -| fallback | Fallback TBD | No | False | +| fallback | If **True** extends network preferences with the given LTE information| No | False | **Example** ---- -`pybytes.enable_lte('Standard', 1, 3, 'internet', 'IP', False)` +`pybytes.enable_lte('standard', 1, 8, 'soracom.io', 'IP', False)` **Success Response** -`TBD` +---- + +``` +>> Pybytes configuration written to /flash/pybytes_config.json +>> Watchdog timeout has been increased to 2147483647 ms +>> Initialized watchdog for WiFi and LTE connection with timeout 1260000 ms +``` diff --git a/content/pybytes/api/enable_ssl.md b/content/pybytes/api/enable_ssl.md index 7e4b1ee..4abc049 100644 --- a/content/pybytes/api/enable_ssl.md +++ b/content/pybytes/api/enable_ssl.md @@ -1,11 +1,9 @@ --- -title: "Pybytes library API" +title: "Enable SSL" aliases: - pybytes/api/enable_ssl --- -**Enable SSL** ----- Enable SSL **Method** @@ -24,4 +22,8 @@ aliases: `pybytes.enable_ssl('/flash/cert/pycom-ca.pem', True)` **Success Response** -`Please reset your module to apply the new settings` +---- + +``` +>> Please reset your module to apply the new settings +``` diff --git a/content/pybytes/api/enable_terminal.md b/content/pybytes/api/enable_terminal.md index 01fa566..50293ae 100644 --- a/content/pybytes/api/enable_terminal.md +++ b/content/pybytes/api/enable_terminal.md @@ -1,11 +1,9 @@ --- -title: "Pybytes library API" +title: "Enable Terminal" aliases: - pybytes/api/enable_terminal --- -**Enable Terminal** ----- Enable Terminal **Method** diff --git a/content/pybytes/api/export_config.md b/content/pybytes/api/export_config.md index ec13264..1b94786 100644 --- a/content/pybytes/api/export_config.md +++ b/content/pybytes/api/export_config.md @@ -1,12 +1,10 @@ --- -title: "Pybytes library API" +title: "Export configuration file" aliases: - pybytes/api/export_config --- -**Export configuration file** ----- - Exports configuration file at specified path. + Exports all configuration data into a file at specified path. **Method** ---- @@ -23,4 +21,8 @@ aliases: `pybytes.export_config()` **Success Response** -`Pybytes configuration exported to /flash/pybytes_config.json` +---- + +``` +>> Pybytes configuration exported to /flash/pybytes_config.json +``` diff --git a/content/pybytes/api/get_config.md b/content/pybytes/api/get_config.md index ee5728e..a3267b2 100644 --- a/content/pybytes/api/get_config.md +++ b/content/pybytes/api/get_config.md @@ -1,11 +1,9 @@ --- -title: "Pybytes library API" +title: "Get configuration" aliases: - pybytes/api/get_config --- -**Get Config** ----- Returns configuration data. **Method** @@ -23,6 +21,8 @@ aliases: `pybytes.get_config()` **Success Response** +---- + ```json { 'ssl': True, diff --git a/content/pybytes/api/is_connected.md b/content/pybytes/api/is_connected.md index 0887073..10200ac 100644 --- a/content/pybytes/api/is_connected.md +++ b/content/pybytes/api/is_connected.md @@ -17,4 +17,8 @@ aliases: `pybytes.is_connected()` **Success Response** -`True` +---- + +``` +>> True +``` diff --git a/content/pybytes/api/isconnected.md b/content/pybytes/api/isconnected.md index 535a040..c086951 100644 --- a/content/pybytes/api/isconnected.md +++ b/content/pybytes/api/isconnected.md @@ -1,11 +1,9 @@ --- -title: "Pybytes library API" +title: "Is connected" aliases: - pybytes/api/isconnected --- -**Is connected** ----- Returns true if connected. **Method** @@ -17,4 +15,8 @@ aliases: `pybytes.isconnected()` **Success Response** -`True` +---- + +``` +>> True +``` diff --git a/content/pybytes/api/print_config.md b/content/pybytes/api/print_config.md index ee0a515..1e4f9cc 100644 --- a/content/pybytes/api/print_config.md +++ b/content/pybytes/api/print_config.md @@ -1,11 +1,9 @@ --- -title: "Pybytes library API" +title: "Print config" aliases: - pybytes/api/print_config --- -**Print config** ----- Prints current configuration in the terminal. **Method** @@ -17,17 +15,21 @@ aliases: `pybytes.print_config()` **Success Response** - >> ssl = True - >> wifi = {'ssid': '', 'password': ''} - >> lte = {'apn': 'internet', 'cid': 1, 'reset': False, 'carrier': 'Standard', 'band': 3, 'type': 'IP'} - >> username = alipsilv@hotmail.com - >> network_preferences = ['lte', 'lte', 'lte', 'lora_otaa'] - >> cfg_msg = Pybytes configuration read from /flash/pybytes_config.json - >> dump_ca = True - >> wlan_antenna = 0 - >> server = 10.0.0.61 - >> lora = {'otaa': {'app_key': '87c8105c151f885bc19ccb9484fe8185', 'app_device_eui': '909d7afb9b82c0f6', 'app_eui': '70B3D57ED000AFA0'}} - >> ota_server = {'port': 443, 'domain': 'software.pycom.io'} - >> pybytes_autostart = True - >> ssl_params = {'ca_certs': '/flash/cert/pycom-ca.pem'} - >> device_id = 139e95ed-7213-406b-b07a-a54bfbf021c8 +---- + +``` +>> ssl = True +>> wifi = {'ssid': '', 'password': ''} +>> lte = {'apn': 'internet', 'cid': 1, 'reset': False, 'carrier': 'Standard', 'band': 3, 'type': 'IP'} +>> username = alipsilv@hotmail.com +>> network_preferences = ['lte', 'lte', 'lte', 'lora_otaa'] +>> cfg_msg = Pybytes configuration read from /flash/pybytes_config.json +>> dump_ca = True +>> wlan_antenna = 0 +>> server = 10.0.0.61 +>> lora = {'otaa': {'app_key': '87c8105c151f885bc19ccb9484fe8185', 'app_device_eui': '909d7afb9b82c0f6', 'app_eui': '70B3D57ED000AFA0'}} +>> ota_server = {'port': 443, 'domain': 'software.pycom.io'} +>> pybytes_autostart = True +>> ssl_params = {'ca_certs': '/flash/cert/pycom-ca.pem'} +>> device_id = 139e95ed-7213-406b-b07a-a54bfbf021c8 +``` diff --git a/content/pybytes/api/read_config.md b/content/pybytes/api/read_config.md index ce51a87..e1b9f48 100644 --- a/content/pybytes/api/read_config.md +++ b/content/pybytes/api/read_config.md @@ -1,11 +1,9 @@ --- -title: "Pybytes library API" +title: "Read configuration" aliases: - pybytes/api/read_config --- -**Read config** ----- Reads configuration from the given file. **Method** @@ -24,4 +22,8 @@ aliases: `pybytes.read_config()` **Success Response** -`Pybytes configuration read from /flash/pybytes_config.json` +---- + +``` +>> Pybytes configuration read from /flash/pybytes_config.json +``` diff --git a/content/pybytes/api/reconnect.md b/content/pybytes/api/reconnect.md index dba5a24..0ae7d85 100644 --- a/content/pybytes/api/reconnect.md +++ b/content/pybytes/api/reconnect.md @@ -1,11 +1,9 @@ --- -title: "Pybytes library API" +title: "Reconnect" aliases: - pybytes/api/reconnect --- -**Reconnect** ----- Reconnects device. **Method** @@ -17,8 +15,10 @@ aliases: `pybytes.reconnect()` **Success Response** +---- After disconnect ----- - >> Connecting with SSID and PASSWORD - >> WiFi connection established +``` +>> Connecting with SSID and PASSWORD +>> WiFi connection established +``` diff --git a/content/pybytes/api/register_periodical_analog_pin_publish.md b/content/pybytes/api/register_periodical_analog_pin_publish.md deleted file mode 100644 index b44d964..0000000 --- a/content/pybytes/api/register_periodical_analog_pin_publish.md +++ /dev/null @@ -1,28 +0,0 @@ ---- -title: "Pybytes library API" -aliases: - - pybytes/api/register_periodical_analog_pin_publish ---- - -**Register periodical analog pin publish** ----- - Publish periodically on the given analog pin. - -**Method** ----- -**pybytes.register_periodical_analog_pin_publish(persistent, pin_number, period)** - -**Parameters** ----- -| name | Description | is Required | Default value -| ------------- |:-------------:|:-------------:|:-------------:| -| persistent | Bool | No | False | -| pin number | Analog pin number TBD| Yes | - | -| period | Interval in seconds | Yes | - | - -**Example** ----- -`pybytes.register_periodical_analog_pin_publish(False, 13, 2)` - -**Success Response** -TBD diff --git a/content/pybytes/api/register_periodical_digital_pin_publish.md b/content/pybytes/api/register_periodical_digital_pin_publish.md deleted file mode 100644 index 6a0e792..0000000 --- a/content/pybytes/api/register_periodical_digital_pin_publish.md +++ /dev/null @@ -1,30 +0,0 @@ ---- -title: "Pybytes library API" -aliases: - - pybytes/api/register_periodical_digital_pin_publish ---- - -**Register periodical digital pin publish** ----- - Publish periodically on the given digital pin. - - -**Method** ----- -**pybytes.register_periodical_digital_pin_publish(persistent, pin_number, pull_mode, period)** - -**Parameters** ----- -| name | Description | is Required | Default value -| ------------- |:-------------:|:-------------:|:-------------:| -| persistent | Bool | No | False | -| pin number | Analog pin number | Yes | - | -| pull mode | PULL_UP or TBD | Yes | PULL_UP | -| period | Interval in seconds | Yes | - | - -**Example** ----- -`pybytes.register_periodical_digital_pin_publish(False, PIN_NUMBER, Pin.PULL_UP, 2)` - -**Success Response** -TBD diff --git a/content/pybytes/api/send_analog_pin_value.md b/content/pybytes/api/send_analog_pin_value.md deleted file mode 100644 index bd3c0a1..0000000 --- a/content/pybytes/api/send_analog_pin_value.md +++ /dev/null @@ -1,27 +0,0 @@ ---- -title: "Pybytes library API" -aliases: - - pybytes/api/send_analog_pin_value ---- - -**Send analog pin value** ----- - Send analog pin value. - -**Method** ----- -**pybytes.send_analog_pin_value(persistent, pin_number)** - -**Parameters** ----- -| name | Description | is Required | Default value -| ------------- |:-------------:|:-------------:|:-------------:| -| persistent | Bool | No | False | -| pin number | Analog pin number TBD| Yes | - | - -**Example** ----- -`pybytes.send_analog_pin_value(False, 13)` - -**Success Response** -TBD diff --git a/content/pybytes/api/send_battery_level.md b/content/pybytes/api/send_battery_level.md deleted file mode 100644 index 86642f5..0000000 --- a/content/pybytes/api/send_battery_level.md +++ /dev/null @@ -1,26 +0,0 @@ ---- -title: "Pybytes library API" -aliases: - - pybytes/api/send_battery_level ---- - -**Send battery level** ----- - Send battery level. - -**Method** ----- -**pybytes.send_battery_level(battery_level)** - -**Parameters** ----- -| name | Description | is Required | Default value -| ------------- |:-------------:|:-------------:|:-------------:| -| battery_level | battery level | Yes | False | - -**Example** ----- -`pybytes.send_battery_level(False, 50)` - -**Success Response** -TBD diff --git a/content/pybytes/api/send_custom_location.md b/content/pybytes/api/send_custom_location.md deleted file mode 100644 index 2bc3a4d..0000000 --- a/content/pybytes/api/send_custom_location.md +++ /dev/null @@ -1,28 +0,0 @@ ---- -title: "Pybytes library API" -aliases: - - pybytes/api/send_custom_location ---- - -**Send custom location** ----- - Send custom location. - -**Method** ----- -**pybytes.send_custom_location(pin, x, y)** - -**Parameters** ----- -| name | Description | is Required | Default value -| ------------- |:-------------:|:-------------:|:-------------:| -| pin | TBD | Yes | - | -| x | Longitude | Yes | - | -| y | Latitude | Yes | - | - -**Example** ----- -`pybytes.send_custom_location(pin, 0, 0)` - -**Success Response** -TBD diff --git a/content/pybytes/api/send_custom_message.md b/content/pybytes/api/send_custom_message.md deleted file mode 100644 index c4959fc..0000000 --- a/content/pybytes/api/send_custom_message.md +++ /dev/null @@ -1,27 +0,0 @@ ---- -title: "Pybytes library API" -aliases: - - pybytes/api/send_custom_message ---- - -**Send custom location** ----- - Send custom location. - -**Method** ----- -**pybytes.send_custom_message(message_type, message)** - -**Parameters** ----- -| name | Description | is Required | Default value -| ------------- |:-------------:|:-------------:|:-------------:| -| message_type | TBD 0x00 0x07 | Yes | - | -| message | Longitude | Yes | - | - -**Example** ----- -`pybytes.send_custom_message(TBD, TBD)` - -**Success Response** -TBD diff --git a/content/pybytes/api/send_digital_pin_value.md b/content/pybytes/api/send_digital_pin_value.md deleted file mode 100644 index 62f6bcd..0000000 --- a/content/pybytes/api/send_digital_pin_value.md +++ /dev/null @@ -1,28 +0,0 @@ ---- -title: "Pybytes library API" -aliases: - - pybytes/api/send_digital_pin_value ---- - -**Send analog pin value** ----- - Send analog pin value. - -**Method** ----- -**pybytes.send_digital_pin_value(persistent, pin_number, pull_mode)** - -**Parameters** ----- -| name | Description | is Required | Default value -| ------------- |:-------------:|:-------------:|:-------------:| -| persistent | Bool | No | False | -| pin number | Analog pin number TBD| Yes | - | -| pull mode | PULL_UP or TBD | Yes | PULL_UP | - -**Example** ----- -`pybytes.send_digital_pin_value(False, 12, Pin.PULL_UP)` - -**Success Response** -TBD diff --git a/content/pybytes/api/send_info_message.md b/content/pybytes/api/send_info_message.md index 721db64..22a6c68 100644 --- a/content/pybytes/api/send_info_message.md +++ b/content/pybytes/api/send_info_message.md @@ -1,12 +1,10 @@ --- -title: "Pybytes library API" +title: "Send information message" aliases: - pybytes/api/send_info_message --- -**Send info message** ----- - Send info message. + Send information message. **Method** ---- @@ -15,6 +13,3 @@ aliases: **Example** ---- `pybytes.send_info_message()` - -**Success Response** -TBD diff --git a/content/pybytes/api/send_ping_message.md b/content/pybytes/api/send_ping_message.md index cb6a502..5cb0f19 100644 --- a/content/pybytes/api/send_ping_message.md +++ b/content/pybytes/api/send_ping_message.md @@ -1,11 +1,9 @@ --- -title: "Pybytes library API" +title: "Send ping message" aliases: - pybytes/api/send_ping_message --- -**Send ping message** ----- Send ping message. **Method** @@ -15,6 +13,3 @@ aliases: **Example** ---- `pybytes.send_ping_message()` - -**Success Response** -TBD diff --git a/content/pybytes/api/send_scan_info_message.md b/content/pybytes/api/send_scan_info_message.md deleted file mode 100644 index 92c7408..0000000 --- a/content/pybytes/api/send_scan_info_message.md +++ /dev/null @@ -1,20 +0,0 @@ ---- -title: "Pybytes library API" -aliases: - - pybytes/api/send_scan_info_message ---- - -**Send scan info message** ----- - Send scan info message. - -**Method** ----- -**pybytes.send_scan_info_message()** - -**Example** ----- -`pybytes.send_scan_info_message()` - -**Success Response** -TBD diff --git a/content/pybytes/api/send_signal.md b/content/pybytes/api/send_signal.md index d1bb586..11d4207 100644 --- a/content/pybytes/api/send_signal.md +++ b/content/pybytes/api/send_signal.md @@ -1,11 +1,9 @@ --- -title: "Pybytes library API" +title: "Send signal" aliases: - pybytes/api/send_signal --- -**Send signal** ----- Send signal to the given pin. **Method** @@ -24,4 +22,7 @@ aliases: `pybytes.send_signal(13,25)` **Success Response** -TBD +--- +``` +To check the result, look at Pybytes → Device → Data +``` diff --git a/content/pybytes/api/send_virtual_pin_value.md b/content/pybytes/api/send_virtual_pin_value.md deleted file mode 100644 index ee9e3ba..0000000 --- a/content/pybytes/api/send_virtual_pin_value.md +++ /dev/null @@ -1,27 +0,0 @@ ---- -title: "Pybytes library API" -aliases: - - pybytes/api/send_virtual_pin_value ---- - -**Send ping message** ----- - Send ping message. TBD - -**Method** ----- -**pybytes.send_virtual_pin_value(pin, value)** - -**Parameters** ----- -| name | Description | is Required | Default value -| ------------- |:-------------:|:-------------:|:-------------:| -| pin | pin | Yes | - | -| value | signal value | Yes | - | - -**Example** ----- -`pybytes.send_virtual_pin_value(13,25)` - -**Success Response** -TBD diff --git a/content/pybytes/api/set_config.md b/content/pybytes/api/set_config.md index 63b139c..8c14dee 100644 --- a/content/pybytes/api/set_config.md +++ b/content/pybytes/api/set_config.md @@ -1,11 +1,9 @@ --- -title: "Pybytes library API" +title: "Set configuration" aliases: - pybytes/api/set_config --- -**Set configuration** ----- Set device configuration. **Method** @@ -27,4 +25,8 @@ aliases: `pybytes.set_config(key=None, value=None, permanent=True, silent=False, reconnect=False)` **Success Response** -TBD +---- + +``` +>> Pybytes configuration written to /flash/pybytes_config.json +``` diff --git a/content/pybytes/api/set_custom_message_callback.md b/content/pybytes/api/set_custom_message_callback.md index 87ee13e..606be69 100644 --- a/content/pybytes/api/set_custom_message_callback.md +++ b/content/pybytes/api/set_custom_message_callback.md @@ -1,12 +1,10 @@ --- -title: "Pybytes library API" +title: "Send custom message callback" aliases: - pybytes/api/set_custom_message_callback --- -**Send custom message callback** ----- - Send custom location. + Send custom message callback. **Method** ---- @@ -20,7 +18,11 @@ aliases: **Example** ---- -`pybytes.set_custom_message_callback(true)` +`pybytes.set_custom_message_callback(print("Hello Pycom!"))` **Success Response** -TBD +---- + +``` +>> Hello Pycom! +``` diff --git a/content/pybytes/api/start.md b/content/pybytes/api/start.md index 7f9408a..f0ab731 100644 --- a/content/pybytes/api/start.md +++ b/content/pybytes/api/start.md @@ -1,12 +1,10 @@ --- -title: "Pybytes library API" +title: "Start" aliases: - pybytes/api/start --- -**Start device** ----- - Start device - TBD + Start/Restart device. **Method** ---- @@ -17,10 +15,13 @@ aliases: `pybytes.start()` **Success Response** +---- - >> WMAC: 807D3AC325E8 - >> Firmware: 1.20.1.r2 - >> Pybytes: 1.3.0 - >> Initialized watchdog for WiFi and LTE connection with timeout 1260000 ms - >> WiFi connection established - >> Pybytes connected successfully (using the built-in pybytes library) +``` +>> WMAC: 807D3AC325E8 +>> Firmware: 1.20.1.r2 +>> Pybytes: 1.3.0 +>> Initialized watchdog for WiFi and LTE connection with timeout 1260000 ms +>> WiFi connection established +>> Pybytes connected successfully (using the built-in pybytes library) +``` diff --git a/content/pybytes/api/update_config.md b/content/pybytes/api/update_config.md index 1bd55f8..89c1935 100644 --- a/content/pybytes/api/update_config.md +++ b/content/pybytes/api/update_config.md @@ -1,11 +1,9 @@ --- -title: "Pybytes library API" +title: "Update configuration" aliases: - pybytes/api/update_config --- -**Update configuration** ----- Update device configuration. **Method** @@ -27,4 +25,6 @@ aliases: `pybytes.update_config(key=None, value=None, permanent=True, silent=False, reconnect=False)` **Success Response** -TBD +---- + +TBD test diff --git a/content/pybytes/api/write_config.md b/content/pybytes/api/write_config.md index b7b3162..54950b3 100644 --- a/content/pybytes/api/write_config.md +++ b/content/pybytes/api/write_config.md @@ -1,12 +1,10 @@ --- -title: "Pybytes library API" +title: "Write configuration" aliases: - pybytes/api/write_config --- -**Update configuration** ----- - Update device configuration. + Write device configuration. **Method** ---- @@ -24,5 +22,8 @@ aliases: `pybytes.write_config(file='/flash/pybytes_config.json', silent=False)` **Success Response** +---- - >> Pybytes configuration written to /flash/pybytes_config.json +``` +>> Pybytes configuration written to /flash/pybytes_config.json +``` From ec2d5842f15c6a3fc6a5f7db00b5844628d4acf9 Mon Sep 17 00:00:00 2001 From: Aline Date: Wed, 22 Jan 2020 21:29:56 +0100 Subject: [PATCH 08/11] docs: contains Jirka review --- content/pybytes/api/_index.md | 40 +++++++++++++-------------- content/pybytes/api/activate.md | 2 +- content/pybytes/api/connect_device.md | 16 ++++++++++- content/pybytes/api/connect_lte.md | 7 +++++ content/pybytes/api/get_config.md | 26 ++++++++--------- content/pybytes/api/print_config.md | 16 +++++------ content/pybytes/api/send_signal.md | 2 +- content/pybytes/api/set_config.md | 2 +- content/pybytes/api/start.md | 2 +- content/pybytes/api/update_config.md | 4 +-- 10 files changed, 69 insertions(+), 48 deletions(-) diff --git a/content/pybytes/api/_index.md b/content/pybytes/api/_index.md index 45d8d69..ba2439d 100644 --- a/content/pybytes/api/_index.md +++ b/content/pybytes/api/_index.md @@ -3,26 +3,6 @@ title: "Pybytes library API" aliases: --- - -If you are facing any issues try to enable debugging. - -### Debugging -There are multiple debug levels, 0 is warnings only, 6 is currently the highest used). - -#### use: - -``` ->> import pycom; ->> pycom.nvs_set('pybytes_debug', debugLevel) -``` - -#### e.g. -``` ->> import pycom; ->> pycom.nvs_set('pybytes_debug', 6) -``` - - # API List @@ -77,3 +57,23 @@ There are multiple debug levels, 0 is warnings only, 6 is currently the highest * [Update configuration](update_config) * [Write configuration](write_config) + +# Issues + +If you are facing any issues try to enable debugging. + +### Debugging +There are multiple debug levels, 0 is warnings only, 6 is currently the highest used). + +#### use: + +``` +>> import pycom; +>> pycom.nvs_set('pybytes_debug', debugLevel) +``` + +#### e.g. +``` +>> import pycom; +>> pycom.nvs_set('pybytes_debug', 6) +``` diff --git a/content/pybytes/api/activate.md b/content/pybytes/api/activate.md index 002021a..33a20ee 100644 --- a/content/pybytes/api/activate.md +++ b/content/pybytes/api/activate.md @@ -5,7 +5,7 @@ aliases: - pybytes/api/activate.md --- - Activate device on Pybytes. + Activate device on Pybytes, via Pymakr plugin. **Method** ---- diff --git a/content/pybytes/api/connect_device.md b/content/pybytes/api/connect_device.md index 0c2dcca..7ced5e2 100644 --- a/content/pybytes/api/connect_device.md +++ b/content/pybytes/api/connect_device.md @@ -17,6 +17,20 @@ aliases: **Success Response** ---- +WiFi: ``` ->> Connected using Sigfox. Only upload stream is supported +>> Connecting with SSID and PASSWORD +>> WiFi connection established +``` + +LTE: +``` +>> LTE connection established +``` + +LoRa ABP: +``` +>> Trying to join LoRa.ABP for 15000 seconds... +>> Setting up LoRa socket... +>> Connected using LoRa ``` diff --git a/content/pybytes/api/connect_lte.md b/content/pybytes/api/connect_lte.md index 3b56328..33a2c06 100644 --- a/content/pybytes/api/connect_lte.md +++ b/content/pybytes/api/connect_lte.md @@ -20,3 +20,10 @@ aliases: **Example** ---- `pybytes.connect_lte(reconnect=True, check_interval=0.5)` + +**Success Response** +---- + +``` +>> LTE connection established +``` diff --git a/content/pybytes/api/get_config.md b/content/pybytes/api/get_config.md index a3267b2..95bea26 100644 --- a/content/pybytes/api/get_config.md +++ b/content/pybytes/api/get_config.md @@ -31,34 +31,34 @@ aliases: 'password': 'PASSWORD' }, 'lte': { - 'apn': 'internet', - 'cid': 1, + 'apn': 'apn', + 'cid': 999, 'reset': False, - 'carrier': 'Standard', - 'band': 3, - 'type': 'IP' + 'carrier': 'carrier', + 'band': 999, + 'type': 'type' }, 'username': 'user@email.com', 'network_preferences': ['lte', 'lora_otaa'], - 'cfg_msg': 'Pybytes configuration read from /flash/pybytes_config.json', + 'cfg_msg': 'Pybytes configuration read from file.json', 'dump_ca': True, 'wlan_antenna': 0, - 'server': '10.0.0.61', + 'server': 'xx.x.x.xx', 'lora': { 'otaa': { - 'app_key': '87c8105c151f885bc19ccb9484fe8185', - 'app_device_eui': '909d7afb9b82c0f6', - 'app_eui': '70B3D57ED000AFA0' + 'app_key': 'app_key', + 'app_device_eui': 'app_device_eui', + 'app_eui': 'app_eui' } }, 'ota_server': { - 'port': 443, + 'port': 999, 'domain': 'software.pycom.io' }, 'pybytes_autostart': True, 'ssl_params': { - 'ca_certs': '/flash/cert/pycom-ca.pem' + 'ca_certs': 'ca_certs' }, - 'device_id': '139e95ed-7213-406b-b07a-a54bfbf021c8' + 'device_id': 'device_id' } ``` diff --git a/content/pybytes/api/print_config.md b/content/pybytes/api/print_config.md index 1e4f9cc..6d6533e 100644 --- a/content/pybytes/api/print_config.md +++ b/content/pybytes/api/print_config.md @@ -20,16 +20,16 @@ aliases: ``` >> ssl = True >> wifi = {'ssid': '', 'password': ''} ->> lte = {'apn': 'internet', 'cid': 1, 'reset': False, 'carrier': 'Standard', 'band': 3, 'type': 'IP'} ->> username = alipsilv@hotmail.com +>> lte = {'apn': 'apn', 'cid': 999, 'reset': False, 'carrier': 'carrier', 'band': 999, 'type': 'type'} +>> username = user@email.com >> network_preferences = ['lte', 'lte', 'lte', 'lora_otaa'] ->> cfg_msg = Pybytes configuration read from /flash/pybytes_config.json +>> cfg_msg = Pybytes configuration read from file.json >> dump_ca = True >> wlan_antenna = 0 ->> server = 10.0.0.61 ->> lora = {'otaa': {'app_key': '87c8105c151f885bc19ccb9484fe8185', 'app_device_eui': '909d7afb9b82c0f6', 'app_eui': '70B3D57ED000AFA0'}} ->> ota_server = {'port': 443, 'domain': 'software.pycom.io'} +>> server = xx.x.x.xx +>> lora = {'otaa': {'app_key': 'app_key', 'app_device_eui': 'app_device_eui', 'app_eui': 'app_eui'}} +>> ota_server = {'port': 000, 'domain': 'domain.com'} >> pybytes_autostart = True ->> ssl_params = {'ca_certs': '/flash/cert/pycom-ca.pem'} ->> device_id = 139e95ed-7213-406b-b07a-a54bfbf021c8 +>> ssl_params = {'ca_certs': 'ca_certs'} +>> device_id = device_id ``` diff --git a/content/pybytes/api/send_signal.md b/content/pybytes/api/send_signal.md index 11d4207..a6c70be 100644 --- a/content/pybytes/api/send_signal.md +++ b/content/pybytes/api/send_signal.md @@ -4,7 +4,7 @@ aliases: - pybytes/api/send_signal --- - Send signal to the given pin. + Send signal to the given signal number. **Method** ---- diff --git a/content/pybytes/api/set_config.md b/content/pybytes/api/set_config.md index 8c14dee..b2da197 100644 --- a/content/pybytes/api/set_config.md +++ b/content/pybytes/api/set_config.md @@ -22,7 +22,7 @@ aliases: **Example** ---- -`pybytes.set_config(key=None, value=None, permanent=True, silent=False, reconnect=False)` +`pybytes.set_config(key="network_preferences", value="wifi", permanent=True, silent=False, reconnect=False)` **Success Response** ---- diff --git a/content/pybytes/api/start.md b/content/pybytes/api/start.md index f0ab731..6eab3b3 100644 --- a/content/pybytes/api/start.md +++ b/content/pybytes/api/start.md @@ -4,7 +4,7 @@ aliases: - pybytes/api/start --- - Start/Restart device. + Starts Pybytes library. **Method** ---- diff --git a/content/pybytes/api/update_config.md b/content/pybytes/api/update_config.md index 89c1935..bec0903 100644 --- a/content/pybytes/api/update_config.md +++ b/content/pybytes/api/update_config.md @@ -4,7 +4,7 @@ aliases: - pybytes/api/update_config --- - Update device configuration. + Update device configuration parameters. **Method** ---- @@ -22,7 +22,7 @@ aliases: **Example** ---- -`pybytes.update_config(key=None, value=None, permanent=True, silent=False, reconnect=False)` +`pybytes.update_config(key="network_preferences", value="wifi", permanent=True, silent=False, reconnect=False)` **Success Response** ---- From 01d112c38b401f1bd04ab3302d5acf323f3628a5 Mon Sep 17 00:00:00 2001 From: jirikrepl Date: Thu, 23 Jan 2020 12:14:38 +0100 Subject: [PATCH 09/11] refactor: updated structure of pybytes library api page --- content/pybytes/api/_index.md | 42 ++++++++++++++++++----------------- 1 file changed, 22 insertions(+), 20 deletions(-) diff --git a/content/pybytes/api/_index.md b/content/pybytes/api/_index.md index ba2439d..ccad19f 100644 --- a/content/pybytes/api/_index.md +++ b/content/pybytes/api/_index.md @@ -3,6 +3,28 @@ title: "Pybytes library API" aliases: --- +To test Pybytes library API, connect your device to Pymakr and call the methods listed below. +You can use Pybytes library API in your MicroPython project. + + +### Debugging +If you are facing any issues try to enable debugging. +There are multiple debug levels, 0 is warnings only, 99 is currently the highest used). + +#### use: + +``` +>> import pycom; +>> pycom.nvs_set('pybytes_debug', debugLevel) +``` + +#### e.g. +``` +>> import pycom; +>> pycom.nvs_set('pybytes_debug', 99) +``` + + # API List @@ -57,23 +79,3 @@ aliases: * [Update configuration](update_config) * [Write configuration](write_config) - -# Issues - -If you are facing any issues try to enable debugging. - -### Debugging -There are multiple debug levels, 0 is warnings only, 6 is currently the highest used). - -#### use: - -``` ->> import pycom; ->> pycom.nvs_set('pybytes_debug', debugLevel) -``` - -#### e.g. -``` ->> import pycom; ->> pycom.nvs_set('pybytes_debug', 6) -``` From 237c7596198db58ffd5615f11bf436c1790fcb95 Mon Sep 17 00:00:00 2001 From: Aline Date: Mon, 27 Jan 2020 21:01:24 +0100 Subject: [PATCH 10/11] doc: method update_config documented --- content/pybytes/api/update_config.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/pybytes/api/update_config.md b/content/pybytes/api/update_config.md index bec0903..40597a6 100644 --- a/content/pybytes/api/update_config.md +++ b/content/pybytes/api/update_config.md @@ -27,4 +27,4 @@ aliases: **Success Response** ---- -TBD test +Pybytes configuration written to /flash/pybytes_config.json From 6cb166be084e6ddc1571202572b30c31acca5315 Mon Sep 17 00:00:00 2001 From: Aline Date: Mon, 27 Jan 2020 21:23:15 +0100 Subject: [PATCH 11/11] docs: contains Lily's review --- content/pybytes/api/_index.md | 10 +++---- content/pybytes/api/connect_wifi.md | 2 +- content/pybytes/api/deepsleep.md | 2 +- content/pybytes/api/print_config.md | 2 +- content/pybytes/api/read_config.md | 2 +- content/pybytes/api/reconnect.md | 2 +- .../api/set_custom_message_callback.md | 2 +- content/pybytes/api/start.md | 2 +- content/pybytes/api/update_config.md | 2 +- content/pybytes/api/write_config.md | 29 ------------------- 10 files changed, 12 insertions(+), 43 deletions(-) delete mode 100644 content/pybytes/api/write_config.md diff --git a/content/pybytes/api/_index.md b/content/pybytes/api/_index.md index ccad19f..55d2510 100644 --- a/content/pybytes/api/_index.md +++ b/content/pybytes/api/_index.md @@ -3,13 +3,13 @@ title: "Pybytes library API" aliases: --- -To test Pybytes library API, connect your device to Pymakr and call the methods listed below. -You can use Pybytes library API in your MicroPython project. +To test the Pybytes library API, connect your device to Pymakr and call the methods listed below. +You can use the Pybytes library API in your MicroPython project. ### Debugging -If you are facing any issues try to enable debugging. -There are multiple debug levels, 0 is warnings only, 99 is currently the highest used). +Enable debugging if you are having any issues. +There are multiple debug levels, the lowest is 0 which is for warnings only and 99 is the highest used and will print more debugging messages #### use: @@ -77,5 +77,3 @@ There are multiple debug levels, 0 is warnings only, 99 is currently the highest * [Start](start) * [Update configuration](update_config) - -* [Write configuration](write_config) diff --git a/content/pybytes/api/connect_wifi.md b/content/pybytes/api/connect_wifi.md index c5dc87c..7a7edc4 100644 --- a/content/pybytes/api/connect_wifi.md +++ b/content/pybytes/api/connect_wifi.md @@ -4,7 +4,7 @@ aliases: - pybytes/api/connect_wifi --- - Initialize watchdog for WiFi and LTE connection. + Initialize watchdog for the WiFi and LTE connection. **Method** ---- diff --git a/content/pybytes/api/deepsleep.md b/content/pybytes/api/deepsleep.md index 064a82f..c5323d7 100644 --- a/content/pybytes/api/deepsleep.md +++ b/content/pybytes/api/deepsleep.md @@ -26,7 +26,7 @@ aliases: **Success Response** ---- -After sleep, device reconnect +After deepsleep, the device reconnects. ``` >> Connecting with SSID and PASSWORD diff --git a/content/pybytes/api/print_config.md b/content/pybytes/api/print_config.md index 6d6533e..9d1456a 100644 --- a/content/pybytes/api/print_config.md +++ b/content/pybytes/api/print_config.md @@ -4,7 +4,7 @@ aliases: - pybytes/api/print_config --- - Prints current configuration in the terminal. + Prints the current configuration in the terminal. **Method** ---- diff --git a/content/pybytes/api/read_config.md b/content/pybytes/api/read_config.md index e1b9f48..3ada3d8 100644 --- a/content/pybytes/api/read_config.md +++ b/content/pybytes/api/read_config.md @@ -4,7 +4,7 @@ aliases: - pybytes/api/read_config --- - Reads configuration from the given file. + Reads the configuration from the given file. **Method** ---- diff --git a/content/pybytes/api/reconnect.md b/content/pybytes/api/reconnect.md index 0ae7d85..c4eaf55 100644 --- a/content/pybytes/api/reconnect.md +++ b/content/pybytes/api/reconnect.md @@ -17,7 +17,7 @@ aliases: **Success Response** ---- -After disconnect +After the device disconnects: ``` >> Connecting with SSID and PASSWORD >> WiFi connection established diff --git a/content/pybytes/api/set_custom_message_callback.md b/content/pybytes/api/set_custom_message_callback.md index 606be69..9ca7eb6 100644 --- a/content/pybytes/api/set_custom_message_callback.md +++ b/content/pybytes/api/set_custom_message_callback.md @@ -4,7 +4,7 @@ aliases: - pybytes/api/set_custom_message_callback --- - Send custom message callback. + Sends custom message callback. **Method** ---- diff --git a/content/pybytes/api/start.md b/content/pybytes/api/start.md index 6eab3b3..14e06a1 100644 --- a/content/pybytes/api/start.md +++ b/content/pybytes/api/start.md @@ -4,7 +4,7 @@ aliases: - pybytes/api/start --- - Starts Pybytes library. + Opens the Pybytes library. **Method** ---- diff --git a/content/pybytes/api/update_config.md b/content/pybytes/api/update_config.md index 40597a6..dbe4a54 100644 --- a/content/pybytes/api/update_config.md +++ b/content/pybytes/api/update_config.md @@ -22,7 +22,7 @@ aliases: **Example** ---- -`pybytes.update_config(key="network_preferences", value="wifi", permanent=True, silent=False, reconnect=False)` +`pybytes.update_config(key="wifi", value={'password': 'Pa$$w0rd'}, permanent=True, silent=False, reconnect=False)` **Success Response** ---- diff --git a/content/pybytes/api/write_config.md b/content/pybytes/api/write_config.md deleted file mode 100644 index 54950b3..0000000 --- a/content/pybytes/api/write_config.md +++ /dev/null @@ -1,29 +0,0 @@ ---- -title: "Write configuration" -aliases: - - pybytes/api/write_config ---- - - Write device configuration. - -**Method** ----- -**pybytes.write_config(file='/flash/pybytes_config.json', silent=False)** - -**Parameters** ----- -| name | Description | is Required | Default value -| ------------- |:-------------:|:-------------:|:-------------:| -| file | File path | Yes | '/flash/pybytes_config.json' | -| silent | boolean | No | False | - -**Example** ----- -`pybytes.write_config(file='/flash/pybytes_config.json', silent=False)` - -**Success Response** ----- - -``` ->> Pybytes configuration written to /flash/pybytes_config.json -```