Skip to content

Commit

Permalink
support all network interfaces of the Pico Core (RP2040)
Browse files Browse the repository at this point in the history
  • Loading branch information
JAndrassy committed Oct 21, 2023
1 parent 8b2cafb commit 5282558
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ The library is a modification of the Arduino WiFi101OTA library.
* WiFiS3 library of Arduino Uno R4 WiFi
* WiFiEspAT - esp8266 or ESP32 as network adapter with AT firmware
* EthernetENC - shields and modules with ENC28j60 chip
* WiFi library of the Pico Core including its Ethernet network interfaces

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

Expand Down
12 changes: 10 additions & 2 deletions src/ArduinoOTA.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class ArduinoOTAClass : public WiFiOTAClass {
void end() {
#if defined(_WIFI_ESP_AT_H_)|| defined(WiFiS3_h) || defined(ESP32) || defined(UIPETHERNET_H)
server.end();
#elif defined(ESP8266)
#elif defined(ESP8266) || (defined(ARDUINO_ARCH_RP2040) && !defined(ARDUINO_ARCH_MBED))
server.stop();
#else
//#warning "The networking library doesn't have a function to stop the server"
Expand Down Expand Up @@ -128,7 +128,7 @@ ArduinoOTAMdnsClass <EthernetServer, EthernetClient, EthernetUDP> ArduinoOTA;
#elif defined(UIPETHERNET_H) // no UDP multicast implementation yet
ArduinoOTAClass <EthernetServer, EthernetClient> ArduinoOTA;

#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
#elif defined(WiFiNINA_h) || defined(WIFI_H) || defined(WiFiS3_h) || defined(ESP8266) || defined(ESP32) // NINA, WiFi101 and Espressif WiFi
#ifdef NO_OTA_PORT
ArduinoOTAClass <WiFiServer, WiFiClient> ArduinoOTA;
#else
Expand All @@ -145,6 +145,14 @@ ArduinoOTAClass <WiFiServer, WiFiClient> ArduinoOTA;
#elif defined(_WIFISPI_H_INCLUDED) // no UDP multicast implementation
ArduinoOTAClass <WiFiSpiServer, WiFiSpiClient> ArduinoOTA;

#elif defined(ARDUINO_ARCH_RP2040) && !defined(ARDUINO_ARCH_MBED)
#ifdef NO_OTA_PORT
ArduinoOTAClass <WiFiServer, WiFiClient> ArduinoOTA;
#else
#include <WiFiUdp.h>
ArduinoOTAMdnsClass <WiFiServer, WiFiClient, WiFiUDP> ArduinoOTA;
#endif

#else
#warning "Network library not included or not supported"
#endif
Expand Down

0 comments on commit 5282558

Please sign in to comment.