Skip to content

Commit dc88379

Browse files
committed
Initial: add pi pico w support
1 parent 12e9def commit dc88379

File tree

7 files changed

+18
-3
lines changed

7 files changed

+18
-3
lines changed

Diff for: src/AIoTC_Config.h

+5
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,11 @@
134134
#define HAS_TCP
135135
#endif
136136

137+
#if defined(ARDUINO_RASPBERRY_PI_PICO_W)
138+
#define BOARD_HAS_SECRET_KEY
139+
#define HAS_TCP
140+
#endif
141+
137142
#if defined(BOARD_HAS_SOFTSE) || defined(BOARD_HAS_OFFLOADED_ECCX08) || defined(BOARD_HAS_ECCX08) || defined(BOARD_HAS_SE050)
138143
#define BOARD_HAS_SECURE_ELEMENT
139144
#endif

Diff for: src/tls/AIoTCUPCert.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ static const unsigned char x509_crt_bundle[] = {
240240
0x00, 0x01
241241
};
242242

243-
#elif defined (ARDUINO_EDGE_CONTROL)
243+
#elif defined (ARDUINO_EDGE_CONTROL) || defined (ARDUINO_RASPBERRY_PI_PICO_W)
244244
/*
245245
* https://www.amazontrust.com/repository/AmazonRootCA1.pem
246246
* https://www.amazontrust.com/repository/AmazonRootCA2.pem

Diff for: src/tls/utility/TLSClientMqtt.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ void TLSClientMqtt::begin(ConnectionHandler & connection) {
5959
* https://github.com/arduino/uno-r4-wifi-usb-bridge/blob/f09ca94fdcab845b8368d4435fdac9f6999d21d2/certificates/certificates.pem#L852
6060
*/
6161
(void)connection;
62+
#elif defined(ARDUINO_RASPBERRY_PI_PICO_W)
63+
setCACert(AIoTUPCert);
6264
#elif defined(ARDUINO_ARCH_ESP32)
6365
#if (ESP_ARDUINO_VERSION < ESP_ARDUINO_VERSION_VAL(3, 0, 4))
6466
setCACertBundle(x509_crt_bundle);

Diff for: src/tls/utility/TLSClientMqtt.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,11 @@
5454
*/
5555
#include <WiFiSSLClient.h>
5656
class TLSClientMqtt : public WiFiSSLClient {
57-
#elif defined(BOARD_ESP)
57+
#elif defined(BOARD_ESP) || defined(ARDUINO_RASPBERRY_PI_PICO_W)
5858
/*
5959
* ESP32*
6060
* ESP82*
61+
* PICOW
6162
*/
6263
#include <WiFiClientSecure.h>
6364
class TLSClientMqtt : public WiFiClientSecure {

Diff for: src/tls/utility/TLSClientOta.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ void TLSClientOta::begin(ConnectionHandler &connection) {
5555
* https://github.com/arduino-libraries/Arduino_ESP32_OTA/blob/fc755e7d1d3946232107e2590662ee08d6ccdec4/src/tls/amazon_root_ca.h
5656
*/
5757
(void)connection;
58+
#elif defined(ARDUINO_RASPBERRY_PI_PICO_W)
59+
setCACert(AIoTUPCert);
5860
#elif defined(ARDUINO_ARCH_ESP32)
5961
#if (ESP_ARDUINO_VERSION < ESP_ARDUINO_VERSION_VAL(3, 0, 4))
6062
setCACertBundle(x509_crt_bundle);

Diff for: src/tls/utility/TLSClientOta.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,11 @@
5454
*/
5555
#include <WiFiSSLClient.h>
5656
class TLSClientOta : public WiFiSSLClient {
57-
#elif defined(BOARD_ESP)
57+
#elif defined(BOARD_ESP) || defined(ARDUINO_RASPBERRY_PI_PICO_W)
5858
/*
5959
* ESP32*
6060
* ESP82*
61+
* PICOW
6162
*/
6263
#include <WiFiClientSecure.h>
6364
class TLSClientOta : public WiFiClientSecure {

Diff for: src/utility/time/TimeService.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -341,6 +341,7 @@ void TimeServiceClass::initRTC()
341341
esp8266_initRTC();
342342
#elif defined (ARDUINO_ARCH_RENESAS)
343343
renesas_initRTC();
344+
#elif defined (ARDUINO_RASPBERRY_PI_PICO_W)
344345
#else
345346
#error "RTC not available for this architecture"
346347
#endif
@@ -358,6 +359,7 @@ void TimeServiceClass::setRTC(unsigned long time)
358359
esp8266_setRTC(time);
359360
#elif defined (ARDUINO_ARCH_RENESAS)
360361
renesas_setRTC(time);
362+
#elif defined (ARDUINO_RASPBERRY_PI_PICO_W)
361363
#else
362364
#error "RTC not available for this architecture"
363365
#endif
@@ -375,6 +377,8 @@ unsigned long TimeServiceClass::getRTC()
375377
return esp8266_getRTC();
376378
#elif defined (ARDUINO_ARCH_RENESAS)
377379
return renesas_getRTC();
380+
#elif defined (ARDUINO_RASPBERRY_PI_PICO_W)
381+
return 1;
378382
#else
379383
#error "RTC not available for this architecture"
380384
#endif

0 commit comments

Comments
 (0)