Skip to content

Commit d5aa208

Browse files
Merge pull request #102 from ayushsharma82/main
Fix: Arduino Pico SDK v4.4.4
2 parents 87eb31c + c442a9c commit d5aa208

File tree

6 files changed

+23
-13
lines changed

6 files changed

+23
-13
lines changed

.github/workflows/build-arduino.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,16 +123,16 @@ jobs:
123123
run: curl -fsSL https://raw.githubusercontent.com/arduino/arduino-cli/master/install.sh | BINDIR=/usr/local/bin sh
124124

125125
- name: Update core index
126-
run: arduino-cli core update-index --additional-urls https://github.com/earlephilhower/arduino-pico/releases/download/4.4.3/package_rp2040_index.json
126+
run: arduino-cli core update-index --additional-urls https://github.com/earlephilhower/arduino-pico/releases/download/4.4.4/package_rp2040_index.json
127127

128128
- name: Install core
129-
run: arduino-cli core install --additional-urls https://github.com/earlephilhower/arduino-pico/releases/download/4.4.3/package_rp2040_index.json rp2040:rp2040
129+
run: arduino-cli core install --additional-urls https://github.com/earlephilhower/arduino-pico/releases/download/4.4.4/package_rp2040_index.json rp2040:rp2040
130130

131131
- name: Install ArduinoJson
132132
run: arduino-cli lib install ArduinoJson
133133

134134
- name: Install RPAsyncTCP
135-
run: ARDUINO_LIBRARY_ENABLE_UNSAFE_INSTALL=true arduino-cli lib install --git-url https://github.com/ayushsharma82/RPAsyncTCP#v1.3.0
135+
run: ARDUINO_LIBRARY_ENABLE_UNSAFE_INSTALL=true arduino-cli lib install --git-url https://github.com/ayushsharma82/RPAsyncTCP#v1.3.1
136136

137137
- name: Checkout
138138
uses: actions/checkout@v4

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
[![Documentation](https://img.shields.io/badge/Wiki-ESPAsyncWebServer-blue?logo=github)](https://github.com/ESP32Async/ESPAsyncWebServer/wiki)
1717

18-
## Asynchronous HTTP and WebSocket Server Library for ESP32, ESP8266 and RP2040
18+
## Asynchronous HTTP and WebSocket Server Library for ESP32, ESP8266, RP2040 and RP2350
1919

2020
Supports: WebSocket, SSE, Authentication, Arduino Json 7, File Upload, Static File serving, URL Rewrite, URL Redirect, etc.
2121

@@ -100,7 +100,7 @@ platform = https://github.com/maxgerhardt/platform-raspberrypi.git
100100
board = rpipicow
101101
board_build.core = earlephilhower
102102
lib_deps =
103-
ayushsharma82/[email protected].0
103+
ayushsharma82/RPAsyncTCP@^1.3.1
104104
ESP32Async/ESPAsyncWebServer
105105
lib_ignore =
106106
lwIP_ESPHost

library.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
{
4141
"owner": "ayushsharma82",
4242
"name": "RPAsyncTCP",
43-
"version": "^1.3.0",
43+
"version": "^1.3.1",
4444
"platforms": "raspberrypi"
4545
}
4646
],

platformio.ini

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -93,12 +93,12 @@ lib_deps =
9393
ESP32Async/ESPAsyncTCP @ 2.0.0
9494

9595
[env:raspberrypi]
96-
platform = https://github.com/maxgerhardt/platform-raspberrypi.git
96+
platform = https://github.com/maxgerhardt/platform-raspberrypi.git#c7502925e3b08af70e9f924d54ab9d00a7e64781
9797
board = rpipicow
9898
board_build.core = earlephilhower
9999
lib_deps =
100-
bblanchon/ArduinoJson @ 7.3.1
101-
ayushsharma82/RPAsyncTCP@^1.3.0
100+
bblanchon/ArduinoJson @ 7.3.0
101+
ayushsharma82/RPAsyncTCP@^1.3.1
102102
lib_ignore =
103103
lwIP_ESPHost
104104
build_flags = ${env.build_flags}
@@ -139,12 +139,12 @@ lib_deps =
139139
ESP32Async/ESPAsyncTCP @ 2.0.0
140140

141141
[env:ci-raspberrypi]
142-
platform = https://github.com/maxgerhardt/platform-raspberrypi.git#4d1acd7caac8c055c05f5ac6c68fa5f079730947
142+
platform = https://github.com/maxgerhardt/platform-raspberrypi.git#c7502925e3b08af70e9f924d54ab9d00a7e64781
143143
board = ${sysenv.PIO_BOARD}
144144
board_build.core = earlephilhower
145145
lib_deps =
146-
bblanchon/ArduinoJson @ 7.3.1
147-
ayushsharma82/RPAsyncTCP@^1.3.0
146+
bblanchon/ArduinoJson @ 7.3.0
147+
ayushsharma82/RPAsyncTCP@^1.3.1
148148
lib_ignore =
149149
lwIP_ESPHost
150150
build_flags = ${env.build_flags}

src/AsyncEventSource.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,14 @@ class AsyncEventSourceMessage {
6060

6161
public:
6262
AsyncEventSourceMessage(AsyncEvent_SharedData_t data) : _data(data){};
63-
#ifdef ESP32
63+
#if defined(ESP32)
6464
AsyncEventSourceMessage(const char *data, size_t len) : _data(std::make_shared<String>(data, len)){};
65+
#elif defined(TARGET_RP2040) || defined(TARGET_RP2350) || defined(PICO_RP2040) || defined(PICO_RP2350)
66+
AsyncEventSourceMessage(const char *data, size_t len) : _data(std::make_shared<String>()) {
67+
if (data && len > 0) {
68+
_data->concat(data, len);
69+
}
70+
};
6571
#else
6672
// esp8266's String does not have constructor with data/length arguments. Use a concat method here
6773
AsyncEventSourceMessage(const char *data, size_t len) {

src/WebHandlers.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,11 @@ void AsyncStaticWebHandler::handleRequest(AsyncWebServerRequest *request) {
222222
etag = lw ^ request->_tempFile.size(); // etag combines file size and lastmod timestamp
223223
#endif
224224
} else {
225+
#if defined(TARGET_RP2040) || defined(TARGET_RP2350) || defined(PICO_RP2040) || defined(PICO_RP2350)
226+
etag = String(request->_tempFile.size());
227+
#else
225228
etag = request->_tempFile.size();
229+
#endif
226230
}
227231

228232
bool not_modified = false;

0 commit comments

Comments
 (0)