Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Portenta C33 Initial: use Arduino_SecureElement library#21

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
pennam wants to merge1 commit intoarduino:master
base:master
Choose a base branch
Loading
frompennam:portenta-c33
Open
Changes fromall 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
31 changes: 26 additions & 5 deletionsexamples/AWS IoT/AWS_IoT_WiFi/AWS_IoT_WiFi.ino
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -20,10 +20,22 @@
This example code is in the public domain.
*/

#include <ArduinoBearSSL.h>
#include <ArduinoECCX08.h>
#include <Arduino_SecureElement.h>
#include <ArduinoMqttClient.h>
#include <WiFiNINA.h> // change to #include <WiFi101.h> for MKR1000
#if defined(ARDUINO_SAMD_MKR1000)
#include <WiFi101.h>
#elif defined(ARDUINO_SAMD_MKRWIFI1010) || defined(ARDUINO_SAMD_NANO_33_IOT)
#include <WiFiNINA.h>
#elif defined(ARDUINO_PORTENTA_C33)
#include <WiFiC3.h>
#include <WiFiSSLClient.h>
#else
#error "Board not supported"
#endif

#if defined(BOARD_HAS_ECCX08)
#include <ArduinoBearSSL.h>
#endif

#include "arduino_secrets.h"

Expand All@@ -33,8 +45,13 @@ const char pass[] = SECRET_PASS;
const char broker[] = SECRET_BROKER;
const char* certificate = SECRET_CERTIFICATE;


#if defined(BOARD_HAS_ECCX08)
WiFiClient wifiClient; // Used for the TCP socket connection
BearSSLClient sslClient(wifiClient); // Used for SSL/TLS connection, integrates with ECC508
#else
WiFiSSLClient sslClient;
#endif
MqttClient mqttClient(sslClient);

unsigned long lastMillis = 0;
Expand All@@ -43,14 +60,18 @@ void setup() {
Serial.begin(115200);
while (!Serial);

if (!ECCX08.begin()) {
Serial.println("No ECCX08 present!");
SecureElement secureElement;

if (!secureElement.begin()) {
Serial.println("No Secure Element present!");
while (1);
}

#if defined(BOARD_HAS_ECCX08)
// Set a callback to get the current time
// used to validate the servers certificate
ArduinoBearSSL.onGetTime(getTime);
#endif

// Set the ECCX08 slot to use for the private key
// and the accompanying public certificate for it
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp