Skip to content

Commit 5282558

Browse files
committed
support all network interfaces of the Pico Core (RP2040)
1 parent 8b2cafb commit 5282558

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ The library is a modification of the Arduino WiFi101OTA library.
4242
* WiFiS3 library of Arduino Uno R4 WiFi
4343
* WiFiEspAT - esp8266 or ESP32 as network adapter with AT firmware
4444
* EthernetENC - shields and modules with ENC28j60 chip
45+
* WiFi library of the Pico Core including its Ethernet network interfaces
4546

4647
EthernetENC library doesn't support UDP multicast for MDNS, so Arduino IDE will not show the network upload port.
4748

src/ArduinoOTA.h

+10-2
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ class ArduinoOTAClass : public WiFiOTAClass {
6464
void end() {
6565
#if defined(_WIFI_ESP_AT_H_)|| defined(WiFiS3_h) || defined(ESP32) || defined(UIPETHERNET_H)
6666
server.end();
67-
#elif defined(ESP8266)
67+
#elif defined(ESP8266) || (defined(ARDUINO_ARCH_RP2040) && !defined(ARDUINO_ARCH_MBED))
6868
server.stop();
6969
#else
7070
//#warning "The networking library doesn't have a function to stop the server"
@@ -128,7 +128,7 @@ ArduinoOTAMdnsClass <EthernetServer, EthernetClient, EthernetUDP> ArduinoOTA;
128128
#elif defined(UIPETHERNET_H) // no UDP multicast implementation yet
129129
ArduinoOTAClass <EthernetServer, EthernetClient> ArduinoOTA;
130130

131-
#elif defined(WiFiNINA_h) || defined(WIFI_H) || defined(WiFiS3_h) || defined(ESP8266) || defined(ESP32) || defined(ARDUINO_RASPBERRY_PI_PICO_W) // NINA, WiFi101 and Espressif WiFi
131+
#elif defined(WiFiNINA_h) || defined(WIFI_H) || defined(WiFiS3_h) || defined(ESP8266) || defined(ESP32) // NINA, WiFi101 and Espressif WiFi
132132
#ifdef NO_OTA_PORT
133133
ArduinoOTAClass <WiFiServer, WiFiClient> ArduinoOTA;
134134
#else
@@ -145,6 +145,14 @@ ArduinoOTAClass <WiFiServer, WiFiClient> ArduinoOTA;
145145
#elif defined(_WIFISPI_H_INCLUDED) // no UDP multicast implementation
146146
ArduinoOTAClass <WiFiSpiServer, WiFiSpiClient> ArduinoOTA;
147147

148+
#elif defined(ARDUINO_ARCH_RP2040) && !defined(ARDUINO_ARCH_MBED)
149+
#ifdef NO_OTA_PORT
150+
ArduinoOTAClass <WiFiServer, WiFiClient> ArduinoOTA;
151+
#else
152+
#include <WiFiUdp.h>
153+
ArduinoOTAMdnsClass <WiFiServer, WiFiClient, WiFiUDP> ArduinoOTA;
154+
#endif
155+
148156
#else
149157
#warning "Network library not included or not supported"
150158
#endif

0 commit comments

Comments
 (0)