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
+24-6
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,28 @@
1
-
# Arduino IoT Cloud Micro/Python client ☁️🐍☁️
2
-
Arduino IoT cloud client for Python and MicroPython.
1
+
# Arduino IoT Cloud Python client ☁️🐍☁️
2
+
This is a Python client for the Arduino IoT cloud, which runs on both CPython and MicroPython. The client supports authentication via username and password, or key/certificate pair stored on the filesystem or in a secure element.
3
+
4
+
## Minimal Example
5
+
The following minimal example shows how to control an LED from the dashboard using a switch widget. It first creates a client object which is used to register the LED and Switch objects, and start the client.
6
+
```python
7
+
# Switch callback, toggles the LED
8
+
defled_toggle(client, value):
9
+
client["led"] = value
10
+
11
+
# 1. Create the client, using basic username and password authentication.
For more detailed examples and advanced API features, please see the [examples](https://github.com/arduino/arduino-iot-cloud-py/tree/main/examples).
3
23
4
24
## Testing on CPython/Linux
5
-
If a crypto device is available, the following steps can be skipped, otherwise Arduino IoT cloud can be tested on Linux using SoftHSM.
25
+
The client supports basic authentication using a username and password, and the more advanced key/cert pair stored on filesystem or in a crypto device. To test this functionality, if a crypto device is not available, the following steps can be used to emulate one using SoftHSM.
6
26
7
27
#### Create softhsm token
8
28
Using the first available slot, in this case 0
@@ -52,8 +72,7 @@ python examples/example.py
52
72
```
53
73
54
74
## Testing on MicroPython
55
-
MicroPython currently does Not support secure elements, the key and cert files must be stored in DER format on the filesystem.
56
-
Convert the key and certificate to DER, using the following commands, and copy to the filesystem storage.
75
+
MicroPython currently does Not support secure elements. The username and password can be used, or the key and cert files must be stored in DER format on the filesystem. To test the client on MicroPython, first convert the key and certificate to DER, using the following commands, then copy the files to the internal storage.
0 commit comments