So you're a Noob? Post your questions here until you graduate! Don't be shy.

User avatar
By BLCKPSTV
#84298 Hi,

I'm trying to get an old project back up and I stumbled on to this error.

Code: Select all Udp-class is renamed to EthernetUdp


I'm not sure what to do, add new library or change the udp?

Code: Select all#if defined(ESP8266)
#include <ESP8266WiFi.h>        // Include the Wi-Fi library
#else
#include <WiFi.h>
#endif
#include <WiFiUdp.h>            // UDP library

#include <OSCMessage.h>         // OSC library
#include <Wire.h>

const char* ssid     = "df";         // The SSID (name) of the Wi-Fi network you want to connect to
const char* password = "df";     // The password of the Wi-Fi network

void setup() {
  Serial.begin(115200);         // Start the Serial communication to send messages to the computer
  delay(10);
  Serial.println('\n');
 
  WiFi.begin(ssid, password);             // Connect to the network
  Serial.print("Connecting to ");
  Serial.print(ssid); Serial.println(" ...");

  int i = 0;
  while (WiFi.status() != WL_CONNECTED) { // Wait for the Wi-Fi to connect
    delay(1000);
    Serial.print(++i); Serial.print(' ');
  }

  Serial.println('\n');
  Serial.println("Connection established!"); 
  Serial.print("IP address:\t");
  Serial.println(WiFi.localIP());         // Send the IP address of the ESP8266 to the computer


Serial.println("Starting UDP");
Udp.begin(localPort);
Serial.print("Local port: ");
#ifdef ESP32
Serial.println(localPort);
#else
Serial.println(Udp.localPort());
#endif

}
void loop() {
  OSCMessage msg("/trigger/prophet");
    msg.add("hello, osc.");
    Udp.beginPacket(outIp, outPort);
    msg.send(Udp);
    Udp.endPacket();
    msg.empty();
    delay(500);
 
  }