Skip to content

Commit 6d25148

Browse files
authored
Merge pull request #212 from pycom/pb-833-documentation-of-pybytes-library-api
Pb 833 documentation of pybytes library api -publish
2 parents c847528 + 6cb166b commit 6d25148

30 files changed

+1066
-11
lines changed

config.toml

Lines changed: 214 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1166,12 +1166,201 @@ theme = "doc-theme"
11661166
parent = "pybytes"
11671167
weight = 10
11681168

1169+
[[menu.main]]
1170+
name = "Pybytes library API"
1171+
url = "/pybytes/api/"
1172+
identifier= "pybytes@api"
1173+
parent= "pybytes"
1174+
weight = 20
1175+
1176+
[[menu.main]]
1177+
name = "Activate Device"
1178+
url = "/pybytes/api/activate/"
1179+
identifier = "pybytes@api@activate"
1180+
parent = "pybytes@api"
1181+
weight = 11
1182+
1183+
[[menu.main]]
1184+
name = "Connect"
1185+
url = "/pybytes/api/connect_device/"
1186+
identifier = "pybytes@api@connect_device"
1187+
parent = "pybytes@api"
1188+
weight = 12
1189+
1190+
[[menu.main]]
1191+
name = "Connect LTE"
1192+
url = "/pybytes/api/connect_lte/"
1193+
identifier = "pybytes@api@connect_lte"
1194+
parent = "pybytes@api"
1195+
weight = 13
1196+
1197+
[[menu.main]]
1198+
name = "Connect loRa ABP"
1199+
url = "/pybytes/api/connect_lora_abp/"
1200+
identifier = "pybytes@api@connect_lora_abp"
1201+
parent = "pybytes@api"
1202+
weight = 14
1203+
1204+
[[menu.main]]
1205+
name = "Connect loRa OTAA"
1206+
url = "/pybytes/api/connect_lora_otaa/"
1207+
identifier = "pybytes@api@connect_lora_otaa"
1208+
parent = "pybytes@api"
1209+
weight = 15
1210+
1211+
[[menu.main]]
1212+
name = "Connect Sigfox"
1213+
url = "/pybytes/api/connect_sigfox/"
1214+
identifier = "pybytes@api@connect_sigfox"
1215+
parent = "pybytes@api"
1216+
weight = 16
1217+
1218+
[[menu.main]]
1219+
name = "Connect Wifi"
1220+
url = "/pybytes/api/connect_wifi/"
1221+
identifier = "pybytes@api@connect_wifi"
1222+
parent = "pybytes@api"
1223+
weight = 17
1224+
1225+
[[menu.main]]
1226+
name = "Deepsleep"
1227+
url = "/pybytes/api/deepsleep/"
1228+
identifier = "pybytes@api@deepsleep"
1229+
parent = "pybytes@api"
1230+
weight = 19
1231+
1232+
[[menu.main]]
1233+
name = "Disconnect"
1234+
url = "/pybytes/api/disconnect/"
1235+
identifier = "pybytes@api@disconnect"
1236+
parent = "pybytes@api"
1237+
weight = 20
1238+
1239+
[[menu.main]]
1240+
name = "Dump CA"
1241+
url = "/pybytes/api/dump_ca/"
1242+
identifier = "pybytes@api@dump_ca"
1243+
parent = "pybytes@api"
1244+
weight = 22
1245+
1246+
[[menu.main]]
1247+
name = "Enable LTE"
1248+
url = "/pybytes/api/enable_lte/"
1249+
identifier = "pybytes@api@enable_lte"
1250+
parent = "pybytes@api"
1251+
weight = 23
1252+
1253+
[[menu.main]]
1254+
name = "Enable SSL"
1255+
url = "/pybytes/api/enable_ssl/"
1256+
identifier = "pybytes@api@enable_ssl"
1257+
parent = "pybytes@api"
1258+
weight = 24
1259+
1260+
[[menu.main]]
1261+
name = "Enable terminal"
1262+
url = "/pybytes/api/enable_terminal/"
1263+
identifier = "pybytes@api@enable_terminal"
1264+
parent = "pybytes@api"
1265+
weight = 25
1266+
1267+
[[menu.main]]
1268+
name = "Export configuration"
1269+
url = "/pybytes/api/export_config/"
1270+
identifier = "pybytes@api@export_config"
1271+
parent = "pybytes@api"
1272+
weight = 26
1273+
1274+
[[menu.main]]
1275+
name = "Get configuration"
1276+
url = "/pybytes/api/get_config/"
1277+
identifier = "pybytes@api@get_config"
1278+
parent = "pybytes@api"
1279+
weight = 27
1280+
1281+
[[menu.main]]
1282+
name = "Is connected"
1283+
url = "/pybytes/api/is_connected/"
1284+
identifier = "pybytes@api@is_connected"
1285+
parent = "pybytes@api"
1286+
weight = 28
1287+
1288+
[[menu.main]]
1289+
name = "Print configuration"
1290+
url = "/pybytes/api/print_config/"
1291+
identifier = "pybytes@api@print_config"
1292+
parent = "pybytes@api"
1293+
weight = 29
1294+
1295+
[[menu.main]]
1296+
name = "Read configuration"
1297+
url = "/pybytes/api/read_config/"
1298+
identifier = "pybytes@api@read_config"
1299+
parent = "pybytes@api"
1300+
weight = 30
1301+
1302+
[[menu.main]]
1303+
name = "Reconnect"
1304+
url = "/pybytes/api/reconnect/"
1305+
identifier = "pybytes@api@reconnect"
1306+
parent = "pybytes@api"
1307+
weight = 31
1308+
1309+
[[menu.main]]
1310+
name = "Send info message"
1311+
url = "/pybytes/api/send_info_message/"
1312+
identifier = "pybytes@api@send_info_message"
1313+
parent = "pybytes@api"
1314+
weight = 32
1315+
1316+
[[menu.main]]
1317+
name = "Send ping message"
1318+
url = "/pybytes/api/send_ping_message/"
1319+
identifier = "pybytes@api@send_ping_message"
1320+
parent = "pybytes@api"
1321+
weight = 33
1322+
1323+
[[menu.main]]
1324+
name = "Send signal"
1325+
url = "/pybytes/api/send_signal/"
1326+
identifier = "pybytes@api@send_signal"
1327+
parent = "pybytes@api"
1328+
weight = 34
1329+
1330+
[[menu.main]]
1331+
name = "Set configuration"
1332+
url = "/pybytes/api/set_config/"
1333+
identifier = "pybytes@api@set_config"
1334+
parent = "pybytes@api"
1335+
weight = 35
1336+
1337+
[[menu.main]]
1338+
name = "Start"
1339+
url = "/pybytes/api/start/"
1340+
identifier = "pybytes@api@start"
1341+
parent = "pybytes@api"
1342+
weight = 36
1343+
1344+
[[menu.main]]
1345+
name = "Update configuration"
1346+
url = "/pybytes/api/update_config/"
1347+
identifier = "pybytes@api@update_config"
1348+
parent = "pybytes@api"
1349+
weight = 37
1350+
1351+
[[menu.main]]
1352+
name = "Write configuration"
1353+
url = "/pybytes/api/write_config/"
1354+
identifier = "pybytes@api@write_config"
1355+
parent = "pybytes@api"
1356+
weight = 38
1357+
11691358
[[menu.main]]
11701359
name = "Add a device to Pybytes"
11711360
url = "/pybytes/connect/"
11721361
identifier = "pybytes@connect"
11731362
parent = "pybytes"
1174-
weight = 20
1363+
weight = 30
11751364

11761365
[[menu.main]]
11771366
name = "Provisioning via USB"
@@ -1181,25 +1370,39 @@ theme = "doc-theme"
11811370
weight = 10
11821371

11831372
[[menu.main]]
1184-
name = "Project Releases"
1185-
url = "/pybytes/releases/"
1186-
identifier = "pybytes@releases"
1373+
name = "Sigfox"
1374+
url = "/pybytes/sigfox/"
1375+
identifier = "pybytes@sigfox"
11871376
parent = "pybytes"
1377+
weight = 40
1378+
1379+
[[menu.main]]
1380+
name = "DevKit contract"
1381+
url = "/pybytes/sigfox/devkit/"
1382+
identifier = "pybytes@sigfox@devkit"
1383+
parent = "pybytes@sigfox"
1384+
weight = 10
1385+
1386+
[[menu.main]]
1387+
name = "Custom contract"
1388+
url = "/pybytes/sigfox/custom/"
1389+
identifier = "pybytes@sigfox@custom"
1390+
parent = "pybytes@sigfox"
11881391
weight = 20
11891392

11901393
[[menu.main]]
1191-
name = "Pybytes iOS"
1192-
url = "/pybytes/smart/"
1193-
identifier = "pybytes@smart"
1394+
name = "Project Releases"
1395+
url = "/pybytes/releases/"
1396+
identifier = "pybytes@releases"
11941397
parent = "pybytes"
1195-
weight = 20
1398+
weight = 50
11961399

11971400
[[menu.main]]
11981401
name = "Create new release"
11991402
url = "/pybytes/releases/new/"
12001403
identifier = "pybytes@releases@new"
12011404
parent = "pybytes@releases"
1202-
weight = 20
1405+
weight = 10
12031406

12041407
[[menu.main]]
12051408
name = "Deploy release"
@@ -1255,14 +1458,14 @@ theme = "doc-theme"
12551458
url = "/pybytes/dashboard/"
12561459
identifier = "pybytes@dashboard"
12571460
parent = "pybytes"
1258-
weight = 30
1461+
weight = 70
12591462

12601463
[[menu.main]]
12611464
name = "Integrations"
12621465
url = "/pybytes/integrations/"
12631466
identifier = "pybytes@integrations"
12641467
parent = "pybytes"
1265-
weight = 40
1468+
weight = 80
12661469

12671470
[[menu.main]]
12681471
name = "Amazon IoT"

content/pybytes/api/_index.md

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
---
2+
title: "Pybytes library API"
3+
aliases:
4+
---
5+
6+
To test the Pybytes library API, connect your device to Pymakr and call the methods listed below.
7+
You can use the Pybytes library API in your MicroPython project.
8+
9+
10+
### Debugging
11+
Enable debugging if you are having any issues.
12+
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
13+
14+
#### use:
15+
16+
```
17+
>> import pycom;
18+
>> pycom.nvs_set('pybytes_debug', debugLevel)
19+
```
20+
21+
#### e.g.
22+
```
23+
>> import pycom;
24+
>> pycom.nvs_set('pybytes_debug', 99)
25+
```
26+
27+
28+
# API List
29+
30+
31+
* [Activate](activate)
32+
33+
* [Connect](connect)
34+
35+
* [Connect LTE](connect_lte)
36+
37+
* [Connect LoRa ABP](connect_lora_abp)
38+
39+
* [Connect LoRa OTAA](connect_lora_otaa)
40+
41+
* [Connect Sigfox](connect_sigfox)
42+
43+
* [Connect Wifi](connect_wifi)
44+
45+
* [Deepsleep](deepsleep)
46+
47+
* [Disconnect](disconnect)
48+
49+
* [Dump CA](dump_ca)
50+
51+
* [Enable LTE](enable_lte)
52+
53+
* [Enable SSL](enable_ssl)
54+
55+
* [Enable terminal](enable_terminal)
56+
57+
* [Export configuration](export_config)
58+
59+
* [Get configuration](get_config)
60+
61+
* [Is connected](is_connected)
62+
63+
* [Print configuration](print_config)
64+
65+
* [Read configuration](read_config)
66+
67+
* [Reconnect](reconnect)
68+
69+
* [Send info message](send_info_message)
70+
71+
* [Send ping message](send_ping_message)
72+
73+
* [Send signal](send_signal)
74+
75+
* [Set configuration](set_config)
76+
77+
* [Start](start)
78+
79+
* [Update configuration](update_config)

content/pybytes/api/activate.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
---
2+
title: "Activate Device"
3+
aliases:
4+
- pybytes/api/activate.html
5+
- pybytes/api/activate.md
6+
---
7+
8+
Activate device on Pybytes, via Pymakr plugin.
9+
10+
**Method**
11+
----
12+
**pybytes.activate(activation_string)**
13+
14+
15+
**Parameters**
16+
----
17+
| name | Description | is Required | Default value
18+
| ------------- |:-------------:|:-------------:|:-------------:|
19+
| activation string | Generated by Pybytes | Yes | - |
20+
21+
22+
**Example**
23+
----
24+
`pybytes.activate("eyJhIjoiNTYzM...")`
25+
26+
27+
**Success Response**
28+
----
29+
30+
```
31+
>> Please wait while we try to connect to Pycom
32+
>> Wifi connection established... activating device!
33+
>> WMAC: 807D3AC325E8
34+
>> Firmware: 1.20.1.r2
35+
>> Pybytes: 1.3.0
36+
>> Initialized watchdog for WiFi and LTE connection with timeout 1260000 ms
37+
>> WiFi connection established
38+
>> Pybytes connected successfully (using the built-in pybytes library)
39+
```

0 commit comments

Comments
 (0)