Skip to content

Commit 0da32db

Browse files
authored
Merge pull request #309 from sinricpro/picow
Support Raspberry Pi Pico W
2 parents 6f9780f + 68a8bde commit 0da32db

File tree

39 files changed

+336
-304
lines changed

39 files changed

+336
-304
lines changed

.github/workflows/build.yml renamed to .github/workflows/build-esp8266-esp32.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Build
1+
name: Build for ESP8266-ESP32
22

33
on:
44
pull_request:

.github/workflows/build-rpipicow.yml

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Build for Raspberry Pi Pico W
2+
3+
on:
4+
pull_request:
5+
branches: [ master ]
6+
paths:
7+
- src/**
8+
- examples/**
9+
10+
jobs:
11+
build:
12+
13+
runs-on: ubuntu-latest
14+
strategy:
15+
matrix:
16+
example: [examples/ACUnit, examples/AirQualitySensor/AirQualitySensor, examples/Blinds, examples/ContactSensor, examples/DimSwitch, examples/doorbell, examples/Fan, examples/GarageDoor, examples/Light/Light, examples/Lock/Lock, examples/Lock/Lock_with_feedback, examples/MotionSensor, examples/PowerSensor, examples/Relay/MultiRelays_advance, examples/Relay/Relay, examples/Speaker, examples/Switch/MultiSwitch_advance, examples/Switch/MultiSwitch_beginner, examples/Switch/MultiSwitch_intermediate, examples/Switch/Switch, examples/Thermostat, examples/TV]
17+
18+
steps:
19+
- name: Step 1 - Checkout Repo
20+
uses: actions/checkout@v3
21+
with:
22+
submodules: "recursive"
23+
- name: Step 2 - Set up Python
24+
uses: actions/setup-python@v3
25+
with:
26+
python-version: "3.9"
27+
- name: Step 3 - Install dependencies
28+
run: |
29+
pip install -U https://github.com/platformio/platformio/archive/develop.zip
30+
pio pkg install --global --platform https://github.com/maxgerhardt/platform-raspberrypi.git
31+
- name: Step 4 - Install library dependencies
32+
run: |
33+
pio lib --global install "bblanchon/ArduinoJson"
34+
pio lib --global install "links2004/WebSockets"
35+
- name: Step 5 - Run build test using PlatformIO
36+
run: pio ci --lib="." -b rpipicow
37+
env:
38+
PLATFORMIO_CI_SRC: ${{ matrix.example }}

README.md

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# SinricPro (ESP8266 / ESP32 SDK)
1+
# SinricPro (ESP8266 / ESP32 / RP2040)
22
[![arduino-library-badge](https://www.ardu-badge.com/badge/SinricPro.svg?)](https://www.ardu-badge.com/SinricPro) [![PlatformIO Registry](https://badges.registry.platformio.org/packages/sinricpro/library/SinricPro.svg)](https://registry.platformio.org/libraries/sinricpro/SinricPro)
33

44
[![Platform ESP8266](https://img.shields.io/badge/Platform-Espressif8266-orange)](#) [![Platform ESP32](https://img.shields.io/badge/Platform-Espressif32-orange)](#)
@@ -10,8 +10,9 @@
1010
[![Build](https://github.com/sinricpro/esp8266-esp32-sdk/actions/workflows/build.yml/badge.svg)](https://github.com/sinricpro/esp8266-esp32-sdk/actions/workflows/build.yml)
1111

1212
## Note
13-
1. Use the latest ESP Arduino Core!
13+
1. Use the latest ESP8226/ESP32/RP2040 Arduino Core!
1414
2. Use the latest WebSocktes library!
15+
3. Use the latest ArduinoJson library!
1516

1617
## Installation
1718

@@ -35,7 +36,7 @@
3536

3637
## Dependencies
3738
[ArduinoJson](https://github.com/bblanchon/ArduinoJson) by Benoit Blanchon (minimum Version 6.12.0)
38-
[WebSockets](https://github.com/Links2004/arduinoWebSockets) by Markus Sattler (minimum Version 2.3.5)
39+
[WebSockets](https://github.com/Links2004/arduinoWebSockets) by Markus Sattler (minimum Version 2.4.0)
3940

4041
---
4142

changelog.md

+3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
# Changelog
2+
## Version 2.11.1
3+
- Support Raspberry Pi Pico W
4+
25
## Version 2.10.3
36
- Fixed version number for PlatformIO library registry
47

examples/ACUnit/ACUnit.ino

+7-8
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,16 @@
1515
//#define ENABLE_DEBUG
1616

1717
#ifdef ENABLE_DEBUG
18-
#define DEBUG_ESP_PORT Serial
19-
#define NODEBUG_WEBSOCKETS
20-
#define NDEBUG
18+
#define DEBUG_ESP_PORT Serial
19+
#define NODEBUG_WEBSOCKETS
20+
#define NDEBUG
2121
#endif
2222

2323
#include <Arduino.h>
24-
#ifdef ESP8266
25-
#include <ESP8266WiFi.h>
26-
#endif
27-
#ifdef ESP32
28-
#include <WiFi.h>
24+
#if defined(ESP8266)
25+
#include <ESP8266WiFi.h>
26+
#elif defined(ESP32) || defined(ARDUINO_ARCH_RP2040)
27+
#include <WiFi.h>
2928
#endif
3029

3130
#include "SinricPro.h"

examples/AirQualitySensor/AirQualitySensor/AirQualitySensor.ino

+7-8
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,17 @@
1515
//#define ENABLE_DEBUG
1616

1717
#ifdef ENABLE_DEBUG
18-
#define DEBUG_ESP_PORT Serial
19-
#define NODEBUG_WEBSOCKETS
20-
#define NDEBUG
18+
#define DEBUG_ESP_PORT Serial
19+
#define NODEBUG_WEBSOCKETS
20+
#define NDEBUG
2121
#endif
2222

2323

2424
#include <Arduino.h>
25-
#ifdef ESP8266
26-
#include <ESP8266WiFi.h>
27-
#endif
28-
#ifdef ESP32
29-
#include <WiFi.h>
25+
#if defined(ESP8266)
26+
#include <ESP8266WiFi.h>
27+
#elif defined(ESP32) || defined(ARDUINO_ARCH_RP2040)
28+
#include <WiFi.h>
3029
#endif
3130

3231
#include "SinricPro.h"

examples/AirQualitySensor/AirQualitySensor_gp2y1014au0f/AirQualitySensor_gp2y1014au0f.ino

+7-8
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,18 @@
1717
//#define ENABLE_DEBUG
1818

1919
#ifdef ENABLE_DEBUG
20-
#define DEBUG_ESP_PORT Serial
21-
#define NODEBUG_WEBSOCKETS
22-
#define NDEBUG
20+
#define DEBUG_ESP_PORT Serial
21+
#define NODEBUG_WEBSOCKETS
22+
#define NDEBUG
2323
#endif
2424

2525
#include <GP2YDustSensor.h> // https://github.com/luciansabo/GP2YDustSensor
2626

2727
#include <Arduino.h>
28-
#ifdef ESP8266
29-
#include <ESP8266WiFi.h>
30-
#endif
31-
#ifdef ESP32
32-
#include <WiFi.h>
28+
#if defined(ESP8266)
29+
#include <ESP8266WiFi.h>
30+
#elif defined(ESP32) || defined(ARDUINO_ARCH_RP2040)
31+
#include <WiFi.h>
3332
#endif
3433

3534
#include "SinricPro.h"

examples/Blinds/Blinds.ino

+7-8
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,16 @@
1515
//#define ENABLE_DEBUG
1616

1717
#ifdef ENABLE_DEBUG
18-
#define DEBUG_ESP_PORT Serial
19-
#define NODEBUG_WEBSOCKETS
20-
#define NDEBUG
18+
#define DEBUG_ESP_PORT Serial
19+
#define NODEBUG_WEBSOCKETS
20+
#define NDEBUG
2121
#endif
2222

2323
#include <Arduino.h>
24-
#ifdef ESP8266
25-
#include <ESP8266WiFi.h>
26-
#endif
27-
#ifdef ESP32
28-
#include <WiFi.h>
24+
#if defined(ESP8266)
25+
#include <ESP8266WiFi.h>
26+
#elif defined(ESP32) || defined(ARDUINO_ARCH_RP2040)
27+
#include <WiFi.h>
2928
#endif
3029

3130
#include "SinricPro.h"

examples/Camera/Camera.ino

+3-3
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@
2020
//#define ENABLE_DEBUG
2121

2222
#ifdef ENABLE_DEBUG
23-
#define DEBUG_ESP_PORT Serial
24-
#define NODEBUG_WEBSOCKETS
25-
#define NDEBUG
23+
#define DEBUG_ESP_PORT Serial
24+
#define NODEBUG_WEBSOCKETS
25+
#define NDEBUG
2626
#endif
2727

2828
#include <WiFi.h>

examples/ContactSensor/ContactSensor.ino

+4-5
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,10 @@
2424
#endif
2525

2626
#include <Arduino.h>
27-
#ifdef ESP8266
28-
#include <ESP8266WiFi.h>
29-
#endif
30-
#ifdef ESP32
31-
#include <WiFi.h>
27+
#if defined(ESP8266)
28+
#include <ESP8266WiFi.h>
29+
#elif defined(ESP32) || defined(ARDUINO_ARCH_RP2040)
30+
#include <WiFi.h>
3231
#endif
3332

3433
#include "SinricPro.h"

examples/DimSwitch/DimSwitch.ino

+7-8
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,16 @@
1313
//#define ENABLE_DEBUG
1414

1515
#ifdef ENABLE_DEBUG
16-
#define DEBUG_ESP_PORT Serial
17-
#define NODEBUG_WEBSOCKETS
18-
#define NDEBUG
16+
#define DEBUG_ESP_PORT Serial
17+
#define NODEBUG_WEBSOCKETS
18+
#define NDEBUG
1919
#endif
2020

2121
#include <Arduino.h>
22-
#ifdef ESP8266
23-
#include <ESP8266WiFi.h>
24-
#endif
25-
#ifdef ESP32
26-
#include <WiFi.h>
22+
#if defined(ESP8266)
23+
#include <ESP8266WiFi.h>
24+
#elif defined(ESP32) || defined(ARDUINO_ARCH_RP2040)
25+
#include <WiFi.h>
2726
#endif
2827

2928
#include "SinricPro.h"

examples/Fan/Fan.ino

+7-8
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,16 @@
1313
//#define ENABLE_DEBUG
1414

1515
#ifdef ENABLE_DEBUG
16-
#define DEBUG_ESP_PORT Serial
17-
#define NODEBUG_WEBSOCKETS
18-
#define NDEBUG
16+
#define DEBUG_ESP_PORT Serial
17+
#define NODEBUG_WEBSOCKETS
18+
#define NDEBUG
1919
#endif
2020

2121
#include <Arduino.h>
22-
#ifdef ESP8266
23-
#include <ESP8266WiFi.h>
24-
#endif
25-
#ifdef ESP32
26-
#include <WiFi.h>
22+
#if defined(ESP8266)
23+
#include <ESP8266WiFi.h>
24+
#elif defined(ESP32) || defined(ARDUINO_ARCH_RP2040)
25+
#include <WiFi.h>
2726
#endif
2827

2928
#include "SinricPro.h"

examples/GarageDoor/GarageDoor.ino

+7-8
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,16 @@
1515
//#define ENABLE_DEBUG
1616

1717
#ifdef ENABLE_DEBUG
18-
#define DEBUG_ESP_PORT Serial
19-
#define NODEBUG_WEBSOCKETS
20-
#define NDEBUG
18+
#define DEBUG_ESP_PORT Serial
19+
#define NODEBUG_WEBSOCKETS
20+
#define NDEBUG
2121
#endif
2222

2323
#include <Arduino.h>
24-
#ifdef ESP8266
25-
#include <ESP8266WiFi.h>
26-
#endif
27-
#ifdef ESP32
28-
#include <WiFi.h>
24+
#if defined(ESP8266)
25+
#include <ESP8266WiFi.h>
26+
#elif defined(ESP32) || defined(ARDUINO_ARCH_RP2040)
27+
#include <WiFi.h>
2928
#endif
3029

3130
#include "SinricPro.h"

examples/Light/Light/Light.ino

+7-8
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,16 @@
1313
//#define ENABLE_DEBUG
1414

1515
#ifdef ENABLE_DEBUG
16-
#define DEBUG_ESP_PORT Serial
17-
#define NODEBUG_WEBSOCKETS
18-
#define NDEBUG
16+
#define DEBUG_ESP_PORT Serial
17+
#define NODEBUG_WEBSOCKETS
18+
#define NDEBUG
1919
#endif
2020

2121
#include <Arduino.h>
22-
#ifdef ESP8266
23-
#include <ESP8266WiFi.h>
24-
#endif
25-
#ifdef ESP32
26-
#include <WiFi.h>
22+
#if defined(ESP8266)
23+
#include <ESP8266WiFi.h>
24+
#elif defined(ESP32) || defined(ARDUINO_ARCH_RP2040)
25+
#include <WiFi.h>
2726
#endif
2827

2928
#include "SinricPro.h"

examples/Light/Light_FastLED_WS2812/Light_FastLED_WS2812.ino

+7-8
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,16 @@
1313
//#define ENABLE_DEBUG
1414

1515
#ifdef ENABLE_DEBUG
16-
#define DEBUG_ESP_PORT Serial
17-
#define NODEBUG_WEBSOCKETS
18-
#define NDEBUG
16+
#define DEBUG_ESP_PORT Serial
17+
#define NODEBUG_WEBSOCKETS
18+
#define NDEBUG
1919
#endif
2020

2121
#include <Arduino.h>
22-
#ifdef ESP8266
23-
#include <ESP8266WiFi.h>
24-
#endif
25-
#ifdef ESP32
26-
#include <WiFi.h>
22+
#if defined(ESP8266)
23+
#include <ESP8266WiFi.h>
24+
#elif defined(ESP32) || defined(ARDUINO_ARCH_RP2040)
25+
#include <WiFi.h>
2726
#endif
2827

2928
#define FASTLED_ESP8266_DMA

examples/Light/RGB_LED_Stripe_5050/RGB_LED_Stripe_5050.ino

+3-3
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313
//#define ENABLE_DEBUG
1414

1515
#ifdef ENABLE_DEBUG
16-
#define DEBUG_ESP_PORT Serial
17-
#define NODEBUG_WEBSOCKETS
18-
#define NDEBUG
16+
#define DEBUG_ESP_PORT Serial
17+
#define NODEBUG_WEBSOCKETS
18+
#define NDEBUG
1919
#endif
2020

2121
#include <Arduino.h>

examples/Lock/Lock/Lock.ino

+7-8
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,16 @@
1515
//#define ENABLE_DEBUG
1616

1717
#ifdef ENABLE_DEBUG
18-
#define DEBUG_ESP_PORT Serial
19-
#define NODEBUG_WEBSOCKETS
20-
#define NDEBUG
18+
#define DEBUG_ESP_PORT Serial
19+
#define NODEBUG_WEBSOCKETS
20+
#define NDEBUG
2121
#endif
2222

2323
#include <Arduino.h>
24-
#ifdef ESP8266
25-
#include <ESP8266WiFi.h>
26-
#endif
27-
#ifdef ESP32
28-
#include <WiFi.h>
24+
#if defined(ESP8266)
25+
#include <ESP8266WiFi.h>
26+
#elif defined(ESP32) || defined(ARDUINO_ARCH_RP2040)
27+
#include <WiFi.h>
2928
#endif
3029

3130
#include "SinricPro.h"

0 commit comments

Comments
 (0)