This project contains examples and tools for setting up a secure IoT node with IoT Core using the ATECC508A or ATECC608A and WINC1500 with a selection of energy efficent microcontrollers.
Install Zerynth Studio.
- ATWINC1500 - 802.11 b/g/n Module with integrated TLS 1.2 stack
- ATSAMW25 - Integrated module featuring ATWINC1500 + ATSAMD21G18A + ATECC508A
- ATSAMD21 (ARM Cortex-M0+)
- ATSAMG55 (ARM Cortex-M4)
- ATSAMW25 (ARM Cortex-M0+)
The first step is ensuring that you have a Google Cloud IoT Core account set up with IoT core. The tutorials will walk you through the initial configuration of your account and creation of your first device registry and device.
Zerynth Python binary can be used to execute the demo custom Python scripts without further dependencies.
Run ztc info --tools
to retrieve Python path. (e.g. C:\Users\myusername\zerynth2\sys\python\python.exe)
Zerynth Python binary called ZERYNTH_PYTHON henceforth.
- Register and virtualize the device.
- Run
ztc device discover --matchdb
to retrieve the device uid. - Run
ztc device alias put RETRIEVEDUID gcp_board USEDDEVICE
, whereUSEDDEVICE
can be one ofxplained_samg55
,xplained_d21
,arduino_mkr1000
, to assign the aliasgcp_board
to the device (--classname ArduinoMKR1000
is also needed forarduino_mkr1000
target). - Run
ztc provisioning uplink-config-firmware gcp_board --i2caddr 0x0
to prepare the device for provisioning. - Run
ztc provisioning crypto-scan gcp_board -o .
to obtain address and type of the crypto element (stored to configure the application). - Run
ztc provisioning write-config gcp_board configuration.bin --lock True
to write desired configuration to the device. This command LOCKS the crypto element and sets the address to 0x58, this procedure is IRREVERSIBLE - Manually reset the device and run again
ztc provisioning crypto-scan gcp_board -o .
to check if the new address has been assigned and to update scanned info file. - Run
ztc provisioning gen-private gcp_board 2
to generate a private key inside slot 2 of the crypto element. - Run
ztc provisioning get-public gcp_board 2 -o devpublic.pem
to generate a private key inside slot 2 of the crypto element. - Run
ZERYNTH_PYTHON kit_provision.py --ssid WIFI-NAME --password WIFI-PSW --device_id DEVID --registry_id REGISTRYID --cloud_region=REGION --project_id=PROJECTID
to update the Zerynth project device configuration file.
- If you have Google Cloud CLI installed and configured on your system simply run
gcloud iot devices credentials create --path=devpublic.pem --type=es256 --device=DEVID --region=REGION --registry=REGISTRYID --project=PROJECTID
, otherwise manually pastedevpublic.pem
content in the text box that appears under your device page on Goolge Cloud IoT Core console after pressingAdd public key
and selectingEnter manually
asInput method
andES256
asPublic key format
.
- Open Zerynth Studio.
- From the Device Management Widget switch to Advanced Mode and then back to Auto mode to force alias refresh.
- Open GoogleCloudConnect project.
- Open the serial monitor to see, after uplink, if the device successfully connects to the WiFi and to the cloud. Uplink the project.
- Create a subscription to collect mqtt data into a Google Cloud PubSub queue via
gcloud pubsub subscriptions create
command or Google Cloud Console. - Set Google Cloud credentials for your environment and run
ZERYNTH_PYTHON at_gui.py SUBSCRIPTION
to see incoming data. Update publish period and led state from the console via device's config.
- Initial release