Add RP2040/RP2350 (Raspberry Pi Pico W) build support (Arduino IDE + PlatformIO)#339
Add RP2040/RP2350 (Raspberry Pi Pico W) build support (Arduino IDE + PlatformIO)#339wedsamuel1230 wants to merge 13 commits intos00500:masterfrom
Conversation
- Updated version to 2.3.4 in library.json and library.properties - Enhanced .gitignore to exclude additional files - Refactored ESPUI.cpp and ESPUI.h for platform-specific handling - Introduced pico-gui and rp2040Example for Raspberry Pi Pico W - Updated platformio.ini for Pico W and RP2040 examples
…o 2.3.4 in library.json and library.properties - Enhanced .gitignore to exclude additional files - Refactored ESPUI.cpp and ESPUI.h for platform-specific handling - Introduced pico-gui and rp2040Example for Raspberry Pi Pico W - Updated platformio.ini for Pico W and RP2040 examples
…uards to all examples Core library fixes: - Set ESPUI_USING_FREERTOS=0 for RP2040/RP2350 (no FreeRTOS on arduino-pico) - Guard xSemaphoreTake/Give behind ESPUI_USING_FREERTOS macro - Remove corrupted preprocessor fragment in ESPUIclient.cpp - Unify ESPUIclient to use AsyncWebSocketClient* on all platforms - Remove duplicate RP2040 sync begin() code path All examples (Arduino IDE + PlatformIO) updated with: - Platform detection: ESP32 / ESP8266 / RP2040 WiFi includes - DNSServer/captive portal guarded (#if !defined(ARDUINO_ARCH_RP2040)) - Hostname handling per platform (setHostname/hostname/skip) - ChipID per platform (getEfuseMac/getChipId/rp2040.getChipID) - MDNS guarded for RP2040 (not available on arduino-pico) - WiFi.begin uses .c_str() on RP2040 (same as ESP32) Deleted separate pico examples (merged into existing): - examples/pico-gui, examples/pico-all-controls, examples/rp2040Example - pio_examples/pico-gui, pio_examples/rp2040Example Updated library metadata: - library.json: RP2040/RP2350 keywords, raspberrypi platform - library.properties: RP2040 in architectures and dependencies Tested: All 6 Arduino IDE examples compile for rp2040:rp2040:rpipicow
Add RP2040 Pico W build environment to all 6 PlatformIO example platformio.ini files using maxgerhardt/platform-raspberrypi with earlephilhower arduino-pico core and ayushsharma82/RPAsyncTCP. All 6 PIO examples compile successfully for rpipicow: - gui: 528KB Flash, 74KB RAM - tabbedGui: 477KB Flash, 73KB RAM - completeExample: 485KB Flash, 73KB RAM - completeLambda: 485KB Flash, 73KB RAM - gui-generic-api: 477KB Flash, 73KB RAM - prepareFilesystem: 202KB Flash, 72KB RAM Also add .pio/ to .gitignore to exclude PIO build artifacts.
RP2040/RP2350 Full Build Support
…edsamuel1230/ESPUI into fix/rp2040-build-and-pico-test
clean up .gitignore by removing unnecessary entries
|
Hey there Claude =P This looks interensting, I will get back to reviewing but I am generally low on time for this project, hope to get to it in 1-2 weeks |
|
Hi there! Actually I used AI to help the PR description and the code changes were AI-assisted. |
|
Hm, somehow this fails to build for me... https://github.com/earlephilhower/arduino-pico.git does not have a platform.json even, feels like there might be a mistake here... I guess the plan was rather using something like https://github.com/maxgerhardt/platform-raspberrypi.git ? did you run the pico gui successfully ? |
|
Yeah I did run the pico gui successfully using arduino ide. Update: This should resolve your build failure. |
Fix/rp2040 build and pico test
Set ESPUI_USING_ASYNC to 0 for RP2040 and RP2350 and conditionally compile async-only APIs. Wrapped beginSPIFFS, beginLITTLEFS and the memory-mode begin() implementations behind #if ESPUI_USING_ASYNC in src/ESPUI.cpp, added appropriate #endif adjustments, and gated the onWsEvent declaration in src/ESPUI.h. Also added WebServer.h and WebSocketsServer.h includes for the non-async path so RP2040/RP2350 build with the synchronous server/websocket implementation. These changes ensure the project builds correctly on RP2040/RP2350 platforms that don't use the async stack and avoid exposing async APIs where not supported.
Summary
This PR adds full RP2040/RP2350 (Raspberry Pi Pico W) build support to ESPUI, with verified compilation on both Arduino IDE and PlatformIO.
What changed
Core library
src/ESPUI.cpp/.hsrc/ESPUIclient.cpp/.hAsyncWebSocketClientand add semaphore guards for RP2040 compatibilityExamples (12 total)
All Arduino IDE and PlatformIO examples now include RP2040 platform guards:
gui.ino— WiFi, DNS, hostname guardstabbedGui.ino— RP2040 adjustments across WiFi/DNS/hostname/MDNS-related pathscompleteExample.cpp— MDNS guards, WiFi.c_str()fixescompleteLambda.ino— MDNS guards, WiFi.c_str()fixesgui-generic-api.ino— Fix#elselogic bugprepareFilesystem.ino— RP2040 guardsPlatformIO
[env:rpipicow]to all 6platformio.inifilesmaxgerhardt/platform-raspberrypi.gitwithearlephilhowercoreMetadata / housekeeping
library.jsonraspberrypiplatformESPAsyncWebServer(>= ^3.7.9)library.properties— Add RP2040/RP2350 architectures.gitignore— Add.pio/,pio_build_*.logCompile verification
rp2040:rp2040:rpipicowrpipicowTechnical notes / limitations
#if defined(ARDUINO_ARCH_RP2040) || defined(ARDUINO_RP2040) || defined(PICO_RP2040)WiFi.begin()requires.c_str()for SSID/password stringsDNSServer,WiFi.hostname(),MDNSrp2040.getChipID()Acknowledgements
Thanks to the original ESPUI project: https://github.com/s00500/ESPUI
This PR extends the ESP8266/ESP32 async webserver framework to Raspberry Pi Pico W while maintaining the same developer experience.