Skip to content

Commit b8d2528

Browse files
authored
Merge pull request #12 from arduino/move-to-arduino_v2-CA
Upgrading containers to support migration to new Arduino CA
2 parents e04ac1a + 15a5ffe commit b8d2528

File tree

8 files changed

+19
-20
lines changed

8 files changed

+19
-20
lines changed

arduino-iot-cloud-provisioning/api/provisioning.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ device_provisioning()
124124
--header "Accept: application/json" \
125125
--header "Content-Type: application/json" \
126126
--header "Authorization: Bearer ${ACCESS_TOKEN}" \
127-
--data-raw "{\"ca\":\"Arduino\",\"csr\":\"${CSR}\",\"enabled\":true}" | jq .pem | tr -d '"')
127+
--data-raw "{\"ca\":\"Arduino_v2\",\"csr\":\"${CSR}\",\"enabled\":true}" | jq .pem | tr -d '"')
128128

129129
if [ $? -eq 0 ] && [ -n "$DEVICE_CERT" ]; then
130130
echo $DEVICE_CERT

arduino-iot-cloud-provisioning/api/registration/iot-cloud.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ func (ra RegistrationApi) RegisterToIOTCloud(c echo.Context) error {
233233

234234
// Get device certificate
235235
createDeviceCertPayload := CreateDeviceCertPayload{
236-
CA: "Arduino",
236+
CA: "Arduino_v2",
237237
CSR: string(csrBytes),
238238
Enabled: true,
239239
}

arduino-iot-cloud-provisioning/provisioning.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ device_provisioning()
168168
--header "Content-Type: application/json" \
169169
--header "X-Organization: ${ORG_ID}" \
170170
--header "Authorization: Bearer ${ACCESS_TOKEN}" \
171-
--data-raw "{\"ca\":\"Arduino\",\"csr\":\"${CSR}\",\"enabled\":true}" | \
171+
--data-raw "{\"ca\":\"Arduino_v2\",\"csr\":\"${CSR}\",\"enabled\":true}" | \
172172
jq .pem | tr -d '"')
173173
if [ $? -ne 0 ] || [ -z "$DEVICE_CERT" ] || [ "$DEVICE_CERT" == "null" ]; then
174174
echo -e $FAILURE

arduino-ootb-python-devel/Dockerfile

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,9 +121,8 @@ RUN pip3 install --find-links=/tmp --no-index M2Crypto
121121
RUN pip3 install /tmp/kpn_senml-1.1.1-py3-none-any.whl
122122

123123
# install aiotcloud library
124-
#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 \
125-
ADD arduino_iot_cloud-0.0.2-py3-none-any.whl /tmp/
126-
RUN pip3 install /tmp/arduino_iot_cloud-0.0.2-py3-none-any.whl
124+
ADD arduino_iot_cloud-1.4.1-py3-none-any.whl /tmp/
125+
RUN pip3 install /tmp/arduino_iot_cloud-1.4.1-py3-none-any.whl
127126

128127
# copy requirements.txt
129128
COPY requirements.txt requirements.txt
-18.4 KB
Binary file not shown.
Binary file not shown.
Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
-----BEGIN CERTIFICATE-----
2-
MIIBzzCCAXSgAwIBAgIUHxAd66fhJecnwaOR4+wNF03tSlkwCgYIKoZIzj0EAwIw
2+
MIIB0DCCAXagAwIBAgIUb62eK/Vv1baaPAaY5DADBUbxB1owCgYIKoZIzj0EAwIw
33
RTELMAkGA1UEBhMCVVMxFzAVBgNVBAoTDkFyZHVpbm8gTExDIFVTMQswCQYDVQQL
4-
EwJJVDEQMA4GA1UEAxMHQXJkdWlubzAeFw0xODA3MjQwOTQ3MDBaFw00ODA3MTYw
5-
OTQ3MDBaMEUxCzAJBgNVBAYTAlVTMRcwFQYDVQQKEw5BcmR1aW5vIExMQyBVUzEL
6-
MAkGA1UECxMCSVQxEDAOBgNVBAMTB0FyZHVpbm8wWTATBgcqhkjOPQIBBggqhkjO
7-
PQMBBwNCAARtd2xaz2EcfUSYUfJe4QJAd7ecvUmio4xOq16YrIL8aVtEIne0TS6O
8-
3ypxwTls1jkUvdlrGEtL7LPV7kKJiVUio0IwQDAOBgNVHQ8BAf8EBAMCAQYwDwYD
9-
VR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUWz4qa47JsBqoVOY2m4wJ+fzhuYAwCgYI
10-
KoZIzj0EAwIDSQAwRgIhAL/T3CNmaLUK3D8NDsNz4grH92CqEA3TIL/hApabawXY
11-
AiEA6tnZ2lrNElKXCajtZg/hjWRE/+giFzBP8riar8qOz2w=
4+
EwJJVDEQMA4GA1UEAxMHQXJkdWlubzAgFw0yNTAxMTAxMDUzMjJaGA8yMDU1MDEw
5+
MzEwNTMyMlowRTELMAkGA1UEBhMCVVMxFzAVBgNVBAoTDkFyZHVpbm8gTExDIFVT
6+
MQswCQYDVQQLEwJJVDEQMA4GA1UEAxMHQXJkdWlubzBZMBMGByqGSM49AgEGCCqG
7+
SM49AwEHA0IABKHhU2w1UhozDegrrFsSwY9QN7M+ZJug7icCNceNWhBF0Mr1UuyX
8+
8pr/gcbieZc/0znG16HMa2GFcPY7rmIdccijQjBAMA8GA1UdEwEB/wQFMAMBAf8w
9+
DgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBRCZSmE0ASI0cYD9AmzeOM7EijgPjAK
10+
BggqhkjOPQQDAgNIADBFAiEAz6TLYP9eiVOr/cVU/11zwGofe/FoNe4p1BlzMl7G
11+
VVACIG8tL3Ta2WbIOaUVpBL2gfLuI9WSW1sR++zXP+zFhmen
1212
-----END CERTIFICATE-----

arduino-ootb-python-devel/examples/arduino_iot_cloud_example.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import time
55
import logging
66
from time import strftime
7-
from arduino_iot_cloud import AIOTClient
7+
from arduino_iot_cloud import ArduinoCloudClient
88
from arduino_iot_cloud import Location
99
from arduino_iot_cloud import Schedule
1010
from arduino_iot_cloud import ColoredLight
@@ -24,7 +24,7 @@ def get_cpu_temp():
2424
tempFile.close()
2525
return round(float(cpu_temp)/1000, 2)
2626

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

0 commit comments

Comments
 (0)