Skip to content

Commit c6a895a

Browse files
authored
Merge pull request #206 from pycom/pb-833-documentation-of-pybytes-library-api
Pb 833 documentation of pybytes library api
2 parents 382d9fd + 6cb166b commit c6a895a

30 files changed

+1066
-11
lines changed

config.toml

Lines changed: 214 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1193,12 +1193,201 @@ theme = "doc-theme"
11931193
parent = "pybytes"
11941194
weight = 10
11951195

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

12031392
[[menu.main]]
12041393
name = "Provisioning via USB"
@@ -1208,25 +1397,39 @@ theme = "doc-theme"
12081397
weight = 10
12091398

12101399
[[menu.main]]
1211-
name = "Project Releases"
1212-
url = "/pybytes/releases/"
1213-
identifier = "pybytes@releases"
1400+
name = "Sigfox"
1401+
url = "/pybytes/sigfox/"
1402+
identifier = "pybytes@sigfox"
12141403
parent = "pybytes"
1404+
weight = 40
1405+
1406+
[[menu.main]]
1407+
name = "DevKit contract"
1408+
url = "/pybytes/sigfox/devkit/"
1409+
identifier = "pybytes@sigfox@devkit"
1410+
parent = "pybytes@sigfox"
1411+
weight = 10
1412+
1413+
[[menu.main]]
1414+
name = "Custom contract"
1415+
url = "/pybytes/sigfox/custom/"
1416+
identifier = "pybytes@sigfox@custom"
1417+
parent = "pybytes@sigfox"
12151418
weight = 20
12161419

12171420
[[menu.main]]
1218-
name = "Pybytes iOS"
1219-
url = "/pybytes/smart/"
1220-
identifier = "pybytes@smart"
1421+
name = "Project Releases"
1422+
url = "/pybytes/releases/"
1423+
identifier = "pybytes@releases"
12211424
parent = "pybytes"
1222-
weight = 20
1425+
weight = 50
12231426

12241427
[[menu.main]]
12251428
name = "Create new release"
12261429
url = "/pybytes/releases/new/"
12271430
identifier = "pybytes@releases@new"
12281431
parent = "pybytes@releases"
1229-
weight = 20
1432+
weight = 10
12301433

12311434
[[menu.main]]
12321435
name = "Deploy release"
@@ -1282,14 +1485,14 @@ theme = "doc-theme"
12821485
url = "/pybytes/dashboard/"
12831486
identifier = "pybytes@dashboard"
12841487
parent = "pybytes"
1285-
weight = 30
1488+
weight = 70
12861489

12871490
[[menu.main]]
12881491
name = "Integrations"
12891492
url = "/pybytes/integrations/"
12901493
identifier = "pybytes@integrations"
12911494
parent = "pybytes"
1292-
weight = 40
1495+
weight = 80
12931496

12941497
[[menu.main]]
12951498
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)