Skip to content

Commit 211dbdb

Browse files
committed
Initial: add pi pico w support
1 parent c28ca7a commit 211dbdb

File tree

7 files changed

+18
-3
lines changed

7 files changed

+18
-3
lines changed

src/AIoTC_Config.h

+5
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,11 @@
137137
#define HAS_TCP
138138
#endif
139139

140+
#if defined(ARDUINO_RASPBERRY_PI_PICO_W)
141+
#define BOARD_HAS_SECRET_KEY
142+
#define HAS_TCP
143+
#endif
144+
140145
#if defined(BOARD_HAS_SOFTSE) || defined(BOARD_HAS_OFFLOADED_ECCX08) || defined(BOARD_HAS_ECCX08) || defined(BOARD_HAS_SE050)
141146
#define BOARD_HAS_SECURE_ELEMENT
142147
#endif

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

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);

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 {

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);

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 {

src/utility/time/TimeService.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,7 @@ void TimeServiceClass::initRTC()
355355
esp8266_initRTC();
356356
#elif defined (ARDUINO_ARCH_RENESAS)
357357
renesas_initRTC();
358+
#elif defined (ARDUINO_RASPBERRY_PI_PICO_W)
358359
#else
359360
#error "RTC not available for this architecture"
360361
#endif
@@ -374,6 +375,7 @@ void TimeServiceClass::setRTC(unsigned long time)
374375
esp8266_setRTC(time);
375376
#elif defined (ARDUINO_ARCH_RENESAS)
376377
renesas_setRTC(time);
378+
#elif defined (ARDUINO_RASPBERRY_PI_PICO_W)
377379
#else
378380
#error "RTC not available for this architecture"
379381
#endif
@@ -393,6 +395,8 @@ unsigned long TimeServiceClass::getRTC()
393395
return esp8266_getRTC();
394396
#elif defined (ARDUINO_ARCH_RENESAS)
395397
return renesas_getRTC();
398+
#elif defined (ARDUINO_RASPBERRY_PI_PICO_W)
399+
return 1;
396400
#else
397401
#error "RTC not available for this architecture"
398402
#endif

0 commit comments

Comments
 (0)