Skip to content

Commit fb4dd6f

Browse files
committed
examples: Update examples.
1 parent 2bde636 commit fb4dd6f

File tree

2 files changed

+14
-12
lines changed

2 files changed

+14
-12
lines changed

examples/example.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -63,15 +63,15 @@ def user_task(client, args):
6363
# ID, and the password is the secret key obtained from the IoT cloud when provisioning a device.
6464
client = ArduinoCloudClient(device_id=DEVICE_ID, username=DEVICE_ID, password=SECRET_KEY, sync_mode=args.sync)
6565

66-
# Alternatively, the client also supports key and certificate-based authentication. To use this
67-
# mode, set "keyfile" and "certfile", and the CA certificate (if any) in "ssl_params".
68-
# Furthermore, secure elements, which can be used to store the key and cert, are also supported.
69-
# To secure elements, set "use_hsm" to True in "ssl_params" and set the token's "pin" if any.
66+
# Alternatively, the client supports key and certificate-based authentication. To use this
67+
# mode, set "keyfile" and "certfile", and specify the CA certificate (if any) in "ssl_params".
68+
# Secure elements, which can be used to store the key and certificate, are also supported.
69+
# To use secure elements, provide the key and certificate URIs (in provider:token format) and
70+
# set the token's PIN (if applicable). For example:
7071
# client = ArduinoCloudClient(
7172
# device_id=DEVICE_ID,
7273
# ssl_params={
73-
# "use_hsm": True, "pin": "1234",
74-
# "keyfile": KEY_PATH, "certfile": CERT_PATH, "cafile": CA_PATH,
74+
# "pin": "1234", "keyfile": KEY_PATH, "certfile": CERT_PATH, "cafile": CA_PATH,
7575
# "verify_mode": ssl.CERT_REQUIRED, "server_hostname" : "iot.arduino.cc"
7676
# },
7777
# sync_mode=args.sync,

examples/micropython_basic.py

+8-6
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
from secrets import DEVICE_ID
1919
from secrets import SECRET_KEY # noqa
2020

21-
KEY_PATH = "key.der"
22-
CERT_PATH = "cert.der"
21+
KEY_PATH = "key.der" # noqa
22+
CERT_PATH = "cert.der" # noqa
2323

2424

2525
def on_switch_changed(client, value):
@@ -76,13 +76,15 @@ def wifi_connect():
7676
# ID, and the password is the secret key obtained from the IoT cloud when provisioning a device.
7777
client = ArduinoCloudClient(device_id=DEVICE_ID, username=DEVICE_ID, password=SECRET_KEY, sync_mode=False)
7878

79-
# Alternatively, the client also supports key and certificate-based authentication. To use this
80-
# mode, set "keyfile" and "certfile", and the CA certificate (if any) in "ssl_params".
81-
# Note that for MicroPython, the key and cert files must be stored in DER format on the filesystem.
79+
# Alternatively, the client supports key and certificate-based authentication. To use this
80+
# mode, set "keyfile" and "certfile", and specify the CA certificate (if any) in "ssl_params".
81+
# Secure elements, which can be used to store the key and certificate, are also supported.
82+
# To use secure elements, provide the key and certificate URIs (in provider:token format) and
83+
# set the token's PIN (if applicable). For example:
8284
# client = ArduinoCloudClient(
8385
# device_id=DEVICE_ID,
8486
# ssl_params={
85-
# "keyfile": KEY_PATH, "certfile": CERT_PATH, "cadata": CADATA,
87+
# "pin": "1234", "keyfile": KEY_PATH, "certfile": CERT_PATH, "cadata": CADATA,
8688
# "verify_mode": ssl.CERT_REQUIRED, "server_hostname" : "iot.arduino.cc"
8789
# },
8890
# sync_mode=False,

0 commit comments

Comments
 (0)