You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+72-15Lines changed: 72 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,21 +3,21 @@
3
3
4
4
This code wraps all the functions necessary to make your object work with Live Objects.
5
5
6
-
You can declare parameters, which you can later update OTA from Live objects. You can also create commands to trigger actions remotely.
7
-
Only thing you must do yourself is connecting the board with internet.
6
+
You can declare parameters, which you can later update OTA from Live objects. You can also create commands to trigger actions remotely.
7
+
Only thing you must do yourself is connecting the board with internet.
8
8
9
9
Code uses MQTT connection to exchange data with Live objects under the hood to keep your parameters up to date or execute the commands received without you having to take care of them (apart from writing the code of these commands, of course).
-**_lang_id**: used Python dialect: PYTHON / MICROPYTHON,
215
+
-**_net_type**: used type of network: WIFI / LTE / network delivered by OS / ...
216
+
-**_carrier_capability**: _tuple_ containing supported type(s) of network,
217
+
-**_wifi_tls_capability**: _True_ if TLS is supported and MQTTS could be used,
218
+
-**_credentials**: required credentials depended on network type: SSID/PASS for Wi-Fi, PIN/APN for LTE etc.
219
+
220
+
If other specific fields are necessary you need to define them.
221
+
You need to override specific methods - e.g. `connect` which is depended on type of board.
222
+
All specific functions are placed at the end of `hal.py`.
223
+
If your board needs function supporting its equipment you need to put it in this place.
224
+
171
225
172
226
# Installation guide for uPython #
173
227
## Example for ESP32 / ESP8266 ##
@@ -181,16 +235,17 @@ def foo():
181
235
1. Preparation
182
236
183
237
Change **\<APIKEY\>** in `credentials.py` to one you generated.\
184
-
Change **\<WIFI_SSID\>** and **\<WIFI_PASS\>** suitable to your WiFi.
185
-
238
+
Change **\<WIFI_SSID\>** and **\<WIFI_PASS\>** suitable to your Wi-Fi or
239
+
change **\<PIN\>** and **\<APN_NAME\>** suitable to your SIM card.
186
240
187
241
2. Copy files into device
188
242
```Shell
189
243
>ampy -pCOMXX put umqttrobust.py
190
244
>ampy -pCOMXX put simple.py
191
245
>ampy -pCOMXX put LiveObjects // It will copy directory with its content
192
246
```
193
-
3. Prepare your script and save it as `main.py` then copy file into device. You can use one of example ones (`1_send_data.py`, ...) renaming it to `main.py`
247
+
3. Prepare your script and save it as `main.py` then copy file into device.
248
+
You can use one of example ones (`1_send_data.py`, ...) renaming it to `main.py`
194
249
```Shell
195
250
>ampy -pCOMXX put main.py
196
251
```
@@ -202,6 +257,7 @@ Change **\<WIFI_SSID\>** and **\<WIFI_PASS\>** suitable to your WiFi.
202
257
Ctrl + C Stops currently running script
203
258
204
259
### Summary ###
260
+
205
261
After all steps content of the device should look like below:
206
262
```Shell
207
263
>ampy -pCOMXX ls
@@ -220,7 +276,8 @@ After all steps content of the device should look like below:
220
276
221
277
## Example for LoPy / GPy ##
222
278
223
-
You can do the steps as above but better is to use [Pymakr plug-in](https://pycom.io/products/supported-networks/pymakr/) for **Visual Studio Code** or **Atom** delivered by [Pycom](https://pycom.io/). Plug-in supports code development, its upload to board and communication with board.
279
+
You can do the steps as above but better is to use [Pymakr plug-in](https://pycom.io/products/supported-networks/pymakr/) for **Visual Studio Code** or **Atom** delivered by [Pycom](https://pycom.io/).
280
+
Plug-in supports code development, its upload to the board and communication with board.
224
281
225
282
## Troubleshooting ##
226
283
If you are getting 'MQTT exception: 5' check your api key
0 commit comments