Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion arduino-iot-cloud-provisioning/api/provisioning.sh
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ device_provisioning()
--header "Accept: application/json" \
--header "Content-Type: application/json" \
--header "Authorization: Bearer ${ACCESS_TOKEN}" \
--data-raw "{\"ca\":\"Arduino\",\"csr\":\"${CSR}\",\"enabled\":true}" | jq .pem | tr -d '"')
--data-raw "{\"ca\":\"Arduino_v2\",\"csr\":\"${CSR}\",\"enabled\":true}" | jq .pem | tr -d '"')

if [ $? -eq 0 ] && [ -n "$DEVICE_CERT" ]; then
echo $DEVICE_CERT
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ func (ra RegistrationApi) RegisterToIOTCloud(c echo.Context) error {

// Get device certificate
createDeviceCertPayload := CreateDeviceCertPayload{
CA: "Arduino",
CA: "Arduino_v2",
CSR: string(csrBytes),
Enabled: true,
}
Expand Down
2 changes: 1 addition & 1 deletion arduino-iot-cloud-provisioning/provisioning.sh
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ device_provisioning()
--header "Content-Type: application/json" \
--header "X-Organization: ${ORG_ID}" \
--header "Authorization: Bearer ${ACCESS_TOKEN}" \
--data-raw "{\"ca\":\"Arduino\",\"csr\":\"${CSR}\",\"enabled\":true}" | \
--data-raw "{\"ca\":\"Arduino_v2\",\"csr\":\"${CSR}\",\"enabled\":true}" | \
jq .pem | tr -d '"')
if [ $? -ne 0 ] || [ -z "$DEVICE_CERT" ] || [ "$DEVICE_CERT" == "null" ]; then
echo -e $FAILURE
Expand Down
5 changes: 2 additions & 3 deletions arduino-ootb-python-devel/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,8 @@ RUN pip3 install --find-links=/tmp --no-index M2Crypto
RUN pip3 install /tmp/kpn_senml-1.1.1-py3-none-any.whl

# install aiotcloud library
#RUN pip3 install https://github.com/bcmi-labs/python-aiotcloud/releases/download/v0.0.2/arduino_iot_cloud-0.0.2-py3-none-any.whl \
ADD arduino_iot_cloud-0.0.2-py3-none-any.whl /tmp/
RUN pip3 install /tmp/arduino_iot_cloud-0.0.2-py3-none-any.whl
ADD arduino_iot_cloud-1.4.1-py3-none-any.whl /tmp/
RUN pip3 install /tmp/arduino_iot_cloud-1.4.1-py3-none-any.whl

# copy requirements.txt
COPY requirements.txt requirements.txt
Expand Down
Binary file not shown.
Binary file not shown.
18 changes: 9 additions & 9 deletions arduino-ootb-python-devel/ca-root.pem
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
-----BEGIN CERTIFICATE-----
MIIBzzCCAXSgAwIBAgIUHxAd66fhJecnwaOR4+wNF03tSlkwCgYIKoZIzj0EAwIw
MIIB0DCCAXagAwIBAgIUb62eK/Vv1baaPAaY5DADBUbxB1owCgYIKoZIzj0EAwIw
RTELMAkGA1UEBhMCVVMxFzAVBgNVBAoTDkFyZHVpbm8gTExDIFVTMQswCQYDVQQL
EwJJVDEQMA4GA1UEAxMHQXJkdWlubzAeFw0xODA3MjQwOTQ3MDBaFw00ODA3MTYw
OTQ3MDBaMEUxCzAJBgNVBAYTAlVTMRcwFQYDVQQKEw5BcmR1aW5vIExMQyBVUzEL
MAkGA1UECxMCSVQxEDAOBgNVBAMTB0FyZHVpbm8wWTATBgcqhkjOPQIBBggqhkjO
PQMBBwNCAARtd2xaz2EcfUSYUfJe4QJAd7ecvUmio4xOq16YrIL8aVtEIne0TS6O
3ypxwTls1jkUvdlrGEtL7LPV7kKJiVUio0IwQDAOBgNVHQ8BAf8EBAMCAQYwDwYD
VR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUWz4qa47JsBqoVOY2m4wJ+fzhuYAwCgYI
KoZIzj0EAwIDSQAwRgIhAL/T3CNmaLUK3D8NDsNz4grH92CqEA3TIL/hApabawXY
AiEA6tnZ2lrNElKXCajtZg/hjWRE/+giFzBP8riar8qOz2w=
EwJJVDEQMA4GA1UEAxMHQXJkdWlubzAgFw0yNTAxMTAxMDUzMjJaGA8yMDU1MDEw
MzEwNTMyMlowRTELMAkGA1UEBhMCVVMxFzAVBgNVBAoTDkFyZHVpbm8gTExDIFVT
MQswCQYDVQQLEwJJVDEQMA4GA1UEAxMHQXJkdWlubzBZMBMGByqGSM49AgEGCCqG
SM49AwEHA0IABKHhU2w1UhozDegrrFsSwY9QN7M+ZJug7icCNceNWhBF0Mr1UuyX
8pr/gcbieZc/0znG16HMa2GFcPY7rmIdccijQjBAMA8GA1UdEwEB/wQFMAMBAf8w
DgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBRCZSmE0ASI0cYD9AmzeOM7EijgPjAK
BggqhkjOPQQDAgNIADBFAiEAz6TLYP9eiVOr/cVU/11zwGofe/FoNe4p1BlzMl7G
VVACIG8tL3Ta2WbIOaUVpBL2gfLuI9WSW1sR++zXP+zFhmen
-----END CERTIFICATE-----
10 changes: 5 additions & 5 deletions arduino-ootb-python-devel/examples/arduino_iot_cloud_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import time
import logging
from time import strftime
from arduino_iot_cloud import AIOTClient
from arduino_iot_cloud import ArduinoCloudClient
from arduino_iot_cloud import Location
from arduino_iot_cloud import Schedule
from arduino_iot_cloud import ColoredLight
Expand All @@ -24,7 +24,7 @@ def get_cpu_temp():
tempFile.close()
return round(float(cpu_temp)/1000, 2)

def user_task(client):
def user_task(client, args):
# NOTE: this function should not block.
# This is a user-defined task that updates the colored light. Note any registered
# cloud object can be accessed using the client object passed to this function.
Expand Down Expand Up @@ -65,12 +65,12 @@ def user_task(client):
# To use a secure element, set the token's "pin" and URI in "keyfile" and "certfile", and
# the CA certificate (if any) in "ssl_params". Alternatively, a username and password can
# be used to authenticate, for example:
# client = AIOTClient(device_id=b"DEVICE_ID", username=b"DEVICE_ID", password=b"SECRET_KEY")
client = AIOTClient(
# client = ArduinoCloudClient(device_id=b"DEVICE_ID", username=b"DEVICE_ID", password=b"SECRET_KEY")
client = ArduinoCloudClient(
device_id=device_id,
ssl_params={
"pin": pin,
"keyfile": key_uri, "certfile": cert_uri, "ca_certs": CA_CERT_FILE, "cert_reqs": ssl.CERT_REQUIRED,
"keyfile": key_uri, "certfile": cert_uri, "cafile": CA_CERT_FILE,
"module_path": "/usr/lib/libckteec.so.0"
},
)
Expand Down