GithubHelp home page GithubHelp logo

khoih-prog / asyncudp_wt32_eth01 Goto Github PK

View Code? Open in Web Editor NEW
16.0 2.0 4.0 95 KB

Fully Asynchronous UDP Library for WT32_ETH01 (ESP32 + LAN8720). The library is easy to use and includes support for Unicast, Broadcast and Multicast environments.

License: GNU General Public License v3.0

C++ 80.95% C 18.61% Shell 0.43%
wt32-eth01 esp32 esp32-arduino esp32-s2 esp32-c3 async async-udp multicast udp-multicast ntp ntp-client time time-server broadcast udp-server udp-client lan8720 udp-multicast-server

asyncudp_wt32_eth01's Introduction

AsyncUDP_WT32_ETH01 Library

arduino-library-badge GitHub release contributions welcome GitHub issues

Donate to my libraries using BuyMeACoffee



Table of Contents



Important Change from v2.1.0

Please have a look at HOWTO Fix Multiple Definitions Linker Error



Why do we need this AsyncUDP_WT32_ETH01 library

Features

This AsyncUDP_WT32_ETH01 library is a fully asynchronous UDP library, designed for a trouble-free, multi-connection network environment, for WT32_ETH01 (ESP32 + LAN8720 Ethernet). The library is easy to use and includes support for Unicast, Broadcast and Multicast environments.

This library is based on, modified from:

  1. Hristo Gochkov's AsyncUDP

to apply the better and faster asynchronous feature of the powerful AsyncUDP into WT32_ETH01.

Why Async is better

  • Using asynchronous network means that you can handle more than one connection at the same time
  • You are called once the request is ready and parsed
  • When you send the response, you are immediately ready to handle other connections while the server is taking care of sending the response in the background
  • Speed is OMG
  • After connecting to a UDP server as an Async Client, you are immediately ready to handle other connections while the Client is taking care of receiving the UDP responding packets in the background.
  • You are not required to check in a tight loop() the arrival of the UDP responding packets to process them.

Currently supported Boards

  1. WT32_ETH01 boards using ESP32-based boards and LAN8720 Ethernet


Prerequisites

  1. Arduino IDE 1.8.19+ for Arduino. GitHub release

  2. ESP32 Core 2.0.5+ for ESP32-based boards. Latest release

  3. WebServer_WT32_ETH01 library 1.5.1+. To install, check arduino-library-badge.


Installation

The suggested way to install is to:

Use Arduino Library Manager

The best way is to use Arduino Library Manager. Search for AsyncUDP_WT32_ETH01, then select / install the latest version. You can also use this link arduino-library-badge for more detailed instructions.

Manual Install

  1. Navigate to AsyncUDP_WT32_ETH01 page.
  2. Download the latest release AsyncUDP_WT32_ETH01-main.zip.
  3. Extract the zip file to AsyncUDP_WT32_ETH01-main directory
  4. Copy the whole AsyncUDP_WT32_ETH01-main folder to Arduino libraries' directory such as ~/Arduino/libraries/.

VS Code & PlatformIO:

  1. Install VS Code
  2. Install PlatformIO
  3. Install AsyncUDP_WT32_ETH01 library by using Library Manager. Search for AsyncUDP_WT32_ETH01 in Platform.io Author's Libraries
  4. Use included platformio.ini file from examples to ensure that all dependent libraries will installed automatically. Please visit documentation for the other options and examples at Project Configuration File


Libraries' Patches

1. For fixing ESP32 compile error

To fix ESP32 compile error, just copy the following file into the ESP32 cores/esp32 directory (e.g. ./arduino-1.8.15/hardware/espressif/cores/esp32) to overwrite the old file:



HOWTO Fix Multiple Definitions Linker Error

The current library implementation, using xyz-Impl.h instead of standard xyz.cpp, possibly creates certain Multiple Definitions Linker error in certain use cases.

You can include this .hpp file

// Can be included as many times as necessary, without `Multiple Definitions` Linker Error
#include "AsyncUDP_WT32_ETH01.hpp"     //https://github.com/khoih-prog/AsyncUDP_WT32_ETH01

in many files. But be sure to use the following .h file in just 1 .h, .cpp or .ino file, which must not be included in any other file, to avoid Multiple Definitions Linker Error

// To be included only in main(), .ino with setup() to avoid `Multiple Definitions` Linker Error
#include "AsyncUDP_WT32_ETH01.h"       //https://github.com/khoih-prog/AsyncUDP_WT32_ETH01

Check the new multiFileProject example for a HOWTO demo.



HOWTO Use analogRead() with ESP32 running WiFi and/or BlueTooth (BT/BLE)

Please have a look at ESP_WiFiManager Issue 39: Not able to read analog port when using the autoconnect example to have more detailed description and solution of the issue.

1. ESP32 has 2 ADCs, named ADC1 and ADC2

2. ESP32 ADCs functions

  • ADC1 controls ADC function for pins GPIO32-GPIO39
  • ADC2 controls ADC function for pins GPIO0, 2, 4, 12-15, 25-27

3.. ESP32 WiFi uses ADC2 for WiFi functions

Look in file adc_common.c

In ADC2, there're two locks used for different cases:

  1. lock shared with app and Wi-Fi: ESP32: When Wi-Fi using the ADC2, we assume it will never stop, so app checks the lock and returns immediately if failed. ESP32S2: The controller's control over the ADC is determined by the arbiter. There is no need to control by lock.

  2. lock shared between tasks: when several tasks sharing the ADC2, we want to guarantee all the requests will be handled. Since conversions are short (about 31us), app returns the lock very soon, we use a spinlock to stand there waiting to do conversions one by one.

adc2_spinlock should be acquired first, then adc2_wifi_lock or rtc_spinlock.

  • In order to use ADC2 for other functions, we have to acquire complicated firmware locks and very difficult to do
  • So, it's not advisable to use ADC2 with WiFi/BlueTooth (BT/BLE).
  • Use ADC1, and pins GPIO32-GPIO39
  • If somehow it's a must to use those pins serviced by ADC2 (GPIO0, 2, 4, 12, 13, 14, 15, 25, 26 and 27), use the fix mentioned at the end of ESP_WiFiManager Issue 39: Not able to read analog port when using the autoconnect example to work with ESP32 WiFi/BlueTooth (BT/BLE).


HOWTO Setting up the Async UDP Client

#define ASYNC_UDP_WT32_ETH01_DEBUG_PORT      Serial

// Use from 0 to 4. Higher number, more debugging messages and memory usage.
#define _ASYNC_UDP_WT32_ETH01_LOGLEVEL_      1

#include <AsyncUDP_WT32_ETH01.h>

/////////////////////////////////////////////

// Select the IP address according to your local network
IPAddress myIP(192, 168, 2, 232);
IPAddress myGW(192, 168, 2, 1);
IPAddress mySN(255, 255, 255, 0);

// Google DNS Server IP
IPAddress myDNS(8, 8, 8, 8);

/////////////////////////////////////////////

#include <time.h>

// 0.ca.pool.ntp.org
IPAddress timeServerIP = IPAddress(208, 81, 1, 244);
// time.nist.gov
//IPAddress timeServerIP = IPAddress(132, 163, 96, 1);

#define NTP_REQUEST_PORT      123

const int NTP_PACKET_SIZE = 48;       // NTP timestamp is in the first 48 bytes of the message

byte packetBuffer[NTP_PACKET_SIZE];   // buffer to hold incoming and outgoing packets

// A UDP instance to let us send and receive packets over UDP
AsyncUDP Udp;

// send an NTP request to the time server at the given address
void createNTPpacket(void)
{
  ...
}

void sendNTPPacket(void)
{
  createNTPpacket();
  //Send unicast
  Udp.write(packetBuffer, sizeof(packetBuffer));
}

void parsePacket(AsyncUDPPacket packet)
{
  ...
}

void setup()
{
  ...
  
  //NTP requests are to port NTP_REQUEST_PORT = 123
  if (Udp.connect(timeServerIP, NTP_REQUEST_PORT))
  {
    // Setting up Async packet Handler
    Udp.onPacket([](AsyncUDPPacket packet)
    {
      parsePacket(packet);
    });
  }
}

void loop()
{
  sendNTPPacket();

  // wait 60 seconds before asking for the time again
  delay(60000);
}


Examples

  1. AsyncUDPClient
  2. AsyncUdpNTPClient
  3. AsyncUdpSendReceive
  4. AsyncUDPServer
  5. AsyncUDPMulticastServer
  6. multiFileProject New

#define ASYNC_UDP_WT32_ETH01_DEBUG_PORT Serial
// Use from 0 to 4. Higher number, more debugging messages and memory usage.
#define _ASYNC_UDP_WT32_ETH01_LOGLEVEL_ 2
#include <AsyncUDP_WT32_ETH01.h>
/////////////////////////////////////////////
// Select the IP address according to your local network
IPAddress myIP(192, 168, 2, 232);
IPAddress myGW(192, 168, 2, 1);
IPAddress mySN(255, 255, 255, 0);
// Google DNS Server IP
IPAddress myDNS(8, 8, 8, 8);
/////////////////////////////////////////////
#include <time.h>
// 0.ca.pool.ntp.org
IPAddress timeServerIP = IPAddress(208, 81, 1, 244);
// time.nist.gov
//IPAddress timeServerIP = IPAddress(132, 163, 96, 1);
#define NTP_REQUEST_PORT 123
const int NTP_PACKET_SIZE = 48; // NTP timestamp is in the first 48 bytes of the message
byte packetBuffer[NTP_PACKET_SIZE]; // buffer to hold incoming and outgoing packets
// A UDP instance to let us send and receive packets over UDP
AsyncUDP Udp;
// send an NTP request to the time server at the given address
void createNTPpacket(void)
{
Serial.println("============= createNTPpacket =============");
// set all bytes in the buffer to 0
memset(packetBuffer, 0, NTP_PACKET_SIZE);
// Initialize values needed to form NTP request
// (see URL above for details on the packets)
packetBuffer[0] = 0b11100011; // LI, Version, Mode
packetBuffer[1] = 0; // Stratum, or type of clock
packetBuffer[2] = 6; // Polling Interval
packetBuffer[3] = 0xEC; // Peer Clock Precision
// 8 bytes of zero for Root Delay & Root Dispersion
packetBuffer[12] = 49;
packetBuffer[13] = 0x4E;
packetBuffer[14] = 49;
packetBuffer[15] = 52;
}
void parsePacket(AsyncUDPPacket packet)
{
struct tm ts;
char buf[80];
memcpy(packetBuffer, packet.data(), sizeof(packetBuffer));
Serial.print("Received UDP Packet Type: ");
Serial.println(packet.isBroadcast() ? "Broadcast" : packet.isMulticast() ? "Multicast" : "Unicast");
Serial.print("From: ");
Serial.print(packet.remoteIP());
Serial.print(":");
Serial.print(packet.remotePort());
Serial.print(", To: ");
Serial.print(packet.localIP());
Serial.print(":");
Serial.print(packet.localPort());
Serial.print(", Length: ");
Serial.print(packet.length());
Serial.println();
unsigned long highWord = word(packetBuffer[40], packetBuffer[41]);
unsigned long lowWord = word(packetBuffer[42], packetBuffer[43]);
// combine the four bytes (two words) into a long integer
// this is NTP time (seconds since Jan 1 1900):
unsigned long secsSince1900 = highWord << 16 | lowWord;
Serial.print(F("Seconds since Jan 1 1900 = "));
Serial.println(secsSince1900);
// now convert NTP time into )everyday time:
Serial.print(F("Epoch/Unix time = "));
// Unix time starts on Jan 1 1970. In seconds, that's 2208988800:
const unsigned long seventyYears = 2208988800UL;
// subtract seventy years:
unsigned long epoch = secsSince1900 - seventyYears;
time_t epoch_t = epoch; //secsSince1900 - seventyYears;
// print Unix time:
Serial.println(epoch);
// print the hour, minute and second:
Serial.print(F("The UTC/GMT time is ")); // UTC is the time at Greenwich Meridian (GMT)
ts = *localtime(&epoch_t);
strftime(buf, sizeof(buf), "%a %Y-%m-%d %H:%M:%S %Z", &ts);
Serial.println(buf);
}
void sendNTPPacket(void)
{
createNTPpacket();
//Send unicast
Udp.write(packetBuffer, sizeof(packetBuffer));
}
void setup()
{
Serial.begin(115200);
while (!Serial);
Serial.print("\nStarting AsyncUdpNTPClient on " + String(ARDUINO_BOARD));
Serial.println(" with " + String(SHIELD_TYPE));
Serial.println(WEBSERVER_WT32_ETH01_VERSION);
Serial.println(ASYNC_UDP_WT32_ETH01_VERSION);
Serial.setDebugOutput(true);
// To be called before ETH.begin()
WT32_ETH01_onEvent();
//bool begin(uint8_t phy_addr=ETH_PHY_ADDR, int power=ETH_PHY_POWER, int mdc=ETH_PHY_MDC, int mdio=ETH_PHY_MDIO,
// eth_phy_type_t type=ETH_PHY_TYPE, eth_clock_mode_t clk_mode=ETH_CLK_MODE);
//ETH.begin(ETH_PHY_ADDR, ETH_PHY_POWER, ETH_PHY_MDC, ETH_PHY_MDIO, ETH_PHY_TYPE, ETH_CLK_MODE);
ETH.begin(ETH_PHY_ADDR, ETH_PHY_POWER);
// Static IP, leave without this line to get IP via DHCP
//bool config(IPAddress local_ip, IPAddress gateway, IPAddress subnet, IPAddress dns1 = 0, IPAddress dns2 = 0);
ETH.config(myIP, myGW, mySN, myDNS);
WT32_ETH01_waitForConnect();
// Client address
Serial.print("AsyncUdpNTPClient started @ IP address: ");
Serial.println(ETH.localIP());
//NTP requests are to port NTP_REQUEST_PORT = 123
if (Udp.connect(timeServerIP, NTP_REQUEST_PORT))
{
Serial.println("UDP connected");
Udp.onPacket([](AsyncUDPPacket packet)
{
parsePacket(packet);
});
}
}
void loop()
{
sendNTPPacket();
// wait 60 seconds before asking for the time again
delay(60000);
}


Debug Terminal Output Samples

1. AsyncUdpNTPClient on ESP32_DEV with ETH_PHY_LAN8720

This is terminal debug output when running AsyncUdpNTPClient on WT32_ETH01 (ESP32 + LAN8720). It connects to NTP Server using AsyncUDP_WT32_ETH01 library, and requests NTP time every 60s. The packet is then received and processed asynchronously to print current UTC/GMT time.

Connect to NTP server time.windows.com (IP=168.61.215.74)
Starting AsyncUdpNTPClient on ESP32_DEV with ETH_PHY_LAN8720
WebServer_WT32_ETH01 v1.5.1 for core v2.0.0+
AsyncUdp_WT32_ETH01 v2.1.0 for core v2.0.0+
ETH Started
ETH Connected
ETH MAC: A8:03:2A:A1:61:73, IPv4: 192.168.2.95
FULL_DUPLEX, 100Mbps
AsyncUdpNTPClient started @ IP address: 192.168.2.232
UDP connected
============= createNTPpacket =============
Received UDP Packet Type: Unicast
From: 208.81.1.244:123, To: 192.168.2.232:50549, Length: 48
Seconds since Jan 1 1900 = 3847193050
Epoch/Unix time = 1638204250
The UTC/GMT time is Mon 2021-11-29 16:44:10 GMT
============= createNTPpacket =============
Received UDP Packet Type: Unicast
From: 208.81.1.244:123, To: 192.168.2.232:50549, Length: 48
Seconds since Jan 1 1900 = 3847193110
Epoch/Unix time = 1638204310
The UTC/GMT time is Mon 2021-11-29 16:45:10 GMT
============= createNTPpacket =============
Received UDP Packet Type: Unicast
From: 208.81.1.244:123, To: 192.168.2.232:50549, Length: 48
Seconds since Jan 1 1900 = 3847193170
Epoch/Unix time = 1638204370
The UTC/GMT time is Mon 2021-11-29 16:46:10 GMT
Connect to NTP server time.nist.gov (IP=132.163.96.1)
Starting AsyncUdpNTPClient on ESP32_DEV with ETH_PHY_LAN8720
WebServer_WT32_ETH01 v1.5.1 for core v2.0.0+
AsyncUdp_WT32_ETH01 v2.1.0 for core v2.0.0+
ETH MAC: A8:03:2A:A1:61:73, IPv4: 192.168.2.232
FULL_DUPLEX, 100Mbps
AsyncUdpNTPClient started @ IP address: 192.168.2.232
UDP connected
============= createNTPpacket =============
Received UDP Packet Type: Unicast
From: 132.163.96.1:123, To: 192.168.2.232:50549, Length: 48
Seconds since Jan 1 1900 = 3847193590
Epoch/Unix time = 1638204790
The UTC/GMT time is Mon 2021-11-29 16:53:10 GMT
============= createNTPpacket =============
Received UDP Packet Type: Unicast
From: 132.163.96.1:123:123, To: 192.168.2.232:50549, Length: 48
Seconds since Jan 1 1900 = 3847193650
Epoch/Unix time = 1638204850
The UTC/GMT time is Mon 2021-11-29 16:54:10 GMT
============= createNTPpacket =============
Received UDP Packet Type: Unicast
From: 132.163.96.1:123:123, To: 192.168.2.232:50549, Length: 48
Seconds since Jan 1 1900 = 3847193710
Epoch/Unix time = 1638204910
The UTC/GMT time is Mon 2021-11-29 16:55:10 GMT

2. AsyncUDPSendReceive on ESP32_DEV with ETH_PHY_LAN8720

This is terminal debug output when running AsyncUDPSendReceive on WT32_ETH01 (ESP32 + LAN8720). It connects to NTP Server time.nist.gov (IP=132.163.96.1) using AsyncUDP_WT32_ETH01 library, and requests NTP time every 60s. The packet is received and processed asynchronously to print current UTC/GMT time. The ACK packet is then sent.

Starting AsyncUDPSendReceive on ESP32_DEV with ETH_PHY_LAN8720
WebServer_WT32_ETH01 v1.5.1 for core v2.0.0+
AsyncUdp_WT32_ETH01 v2.1.0 for core v2.0.0+
ETH MAC: A8:03:2A:A1:61:73, IPv4: 192.168.2.232
FULL_DUPLEX, 100Mbps
AsyncUDPSendReceive started @ IP address: 192.168.2.232

Starting connection to server...
UDP connected
============= createNTPpacket =============
Received UDP Packet Type: Unicast
From: 132.163.96.1:123, To: 192.168.2.232:62775, Length: 48
Seconds since Jan 1 1900 = 3834968497
Epoch/Unix time = 1625979697
The UTC/GMT time is Sun 2021-07-11 05:01:37 GMT
============= sendACKPacket =============
============= createNTPpacket =============
Received UDP Packet Type: Unicast
From: 132.163.96.1:123, To: 192.168.2.232:62775, Length: 48
Seconds since Jan 1 1900 = 3834968557
Epoch/Unix time = 1625979757
The UTC/GMT time is Sun 2021-07-11 05:02:37 GMT
============= sendACKPacket =============


Debug

Debug is enabled by default on Serial. To disable, use level 0

#define ASYNC_UDP_WT32_ETH01_DEBUG_PORT      Serial

// Use from 0 to 4. Higher number, more debugging messages and memory usage.
#define _ASYNC_UDP_WT32_ETH01_LOGLEVEL_      1

You can also change the debugging level from 0 to 4

#define ASYNC_UDP_WT32_ETH01_DEBUG_PORT      Serial

// Use from 0 to 4. Higher number, more debugging messages and memory usage.
#define _ASYNC_UDP_WT32_ETH01_LOGLEVEL_      4

Troubleshooting

If you get compilation errors, more often than not, you may need to install a newer version of Arduino IDE, the Arduino STM32 core or depending libraries.

Sometimes, the library will only work if you update the STM32 core to the latest version because I am always using the latest cores /libraries.



Issues

Submit issues to: AsyncUDP_WT32_ETH01 issues


TO DO

  1. Fix bug. Add enhancement

DONE

  1. Initial port to to WT32_ETH01 (ESP32 + LAN8720)
  2. Add more examples.
  3. Add debugging features.
  4. Auto detect ESP32 core to use for WT32_ETH01
  5. Fix bug in WT32_ETH01 examples to reduce connection time
  6. Fix multiple-definitions linker error.
  7. Add example multiFileProject to demo for multiple-file project


Contributions and Thanks

  1. Based on and modified from Hristo Gochkov's AsyncUDP. Many thanks to Hristo Gochkov for great AsyncUDP Library
me-no-dev
⭐️⭐️ Hristo Gochkov


Contributing

If you want to contribute to this project:

  • Report bugs and errors
  • Ask for enhancements
  • Create issues and pull requests
  • Tell other people about this library

License

  • The library is licensed under GPLv3

Copyright

Copyright (c) 2018- Hristo Gochkov

Copyright (c) 2021- Khoi Hoang

asyncudp_wt32_eth01's People

Contributors

khoih-prog avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

asyncudp_wt32_eth01's Issues

Multiple definitions

Using platformio on a mac, trying to get this very simple code to compile. I get issues with the linker.


main.cpp


#include "UdpListener.h"
UdpListener udp_server;

void setup()
{
    delay(1);
}

void loop()
{
    delay(1);
}

UdpListener.h


#pragma once
#ifndef UDPLISTENER_H
#define UDPLISTENER_H

#include <AsyncUDP_WT32_ETH01.h>

class UdpListener
{

private :

public:
    UdpListener();
};
#endif

UdpListener.cpp


#include "UdpListener.h"


UdpListener::UdpListener()
{
}

Verbose mode can be enabled via -v, --verbose option

CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/esp32dev.html
PLATFORM: Espressif 32 (4.4.0) > Espressif ESP32 Dev Module
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
DEBUG: Current (cmsis-dap) External (cmsis-dap, esp-prog, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa)
PACKAGES: 
 - framework-arduinoespressif32 @ 3.20003.0 (2.0.3) 
 - tool-esptoolpy @ 1.30300.0 (3.3.0) 
 - toolchain-xtensa-esp32 @ 8.4.0+2021r2-patch3
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 41 compatible libraries
Scanning dependencies...
Dependency Graph
|-- UdpListener
|   |-- Free
|   |-- AsyncUDP_WT32_ETH01 @ 2.0.3
|   |   |-- WebServer_WT32_ETH01 @ 1.4.1
|   |   |   |-- Ethernet @ 2.0.0
|   |   |   |   |-- WiFi @ 2.0.0
|   |   |   |-- WebServer @ 2.0.0
|   |   |   |   |-- WiFi @ 2.0.0
|   |   |   |   |-- FS @ 2.0.0
|   |   |   |-- WiFi @ 2.0.0
Building in release mode
Compiling .pio/build/myenv/src/main.cpp.o
In file included from .pio/libdeps/myenv/AsyncUDP_WT32_ETH01/src/AsyncUDP_WT32_ETH01.h:64,
                 from lib/UdpListener/UdpListener.h:5,
                 from src/main.cpp:3:
.pio/libdeps/myenv/WebServer_WT32_ETH01/src/WebServer_WT32_ETH01.h:50:4: warning: #warning Using ESP32 architecture for WebServer_WT32_ETH01 [-Wcpp]
   #warning Using ESP32 architecture for WebServer_WT32_ETH01
    ^~~~~~~
Compiling .pio/build/myenv/lib2c4/UdpListener/UdpListener.cpp.o
In file included from .pio/libdeps/myenv/AsyncUDP_WT32_ETH01/src/AsyncUDP_WT32_ETH01.h:51,
                 from lib/UdpListener/UdpListener.h:5,
                 from lib/UdpListener/UdpListener.cpp:1:
/Users/waltermarchewka/.platformio/packages/framework-arduinoespressif32/tools/sdk/esp32/include/tcpip_adapter/include/tcpip_adapter.h:15:2: warning: #warning "This header is deprecated, please use new network related API in esp_netif.h" [-Wcpp]
 #warning "This header is deprecated, please use new network related API in esp_netif.h"
  ^~~~~~~
In file included from .pio/libdeps/myenv/AsyncUDP_WT32_ETH01/src/AsyncUDP_WT32_ETH01.h:64,
                 from lib/UdpListener/UdpListener.h:5,
                 from lib/UdpListener/UdpListener.cpp:1:
.pio/libdeps/myenv/WebServer_WT32_ETH01/src/WebServer_WT32_ETH01.h:50:4: warning: #warning Using ESP32 architecture for WebServer_WT32_ETH01 [-Wcpp]
   #warning Using ESP32 architecture for WebServer_WT32_ETH01
    ^~~~~~~
Archiving .pio/build/myenv/lib2c4/libUdpListener.a
Indexing .pio/build/myenv/lib2c4/libUdpListener.a
Linking .pio/build/myenv/firmware.elf
/Users/waltermarchewka/.platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: .pio/build/myenv/lib2c4/libUdpListener.a(UdpListener.cpp.o): in function `AsyncUDPMessage::write(unsigned char)':
/Users/waltermarchewka/Documents/PlatformIO/Projects/ESP32_LOW_POWER_RELAY/.pio/libdeps/myenv/AsyncUDP_WT32_ETH01/src/AsyncUDP_WT32_ETH01_Impl.h:401: multiple definition of `AsyncUDPMessage::write(unsigned char)'; .pio/build/myenv/src/main.cpp.o:/Users/waltermarchewka/Documents/PlatformIO/Projects/ESP32_LOW_POWER_RELAY/.pio/libdeps/myenv/AsyncUDP_WT32_ETH01/src/AsyncUDP_WT32_ETH01_Impl.h:401: first defined here
/Users/waltermarchewka/.platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: .pio/build/myenv/lib2c4/libUdpListener.a(UdpListener.cpp.o): in function `AsyncUDPMessage::flush()':
/Users/waltermarchewka/Documents/PlatformIO/Projects/ESP32_LOW_POWER_RELAY/.pio/libdeps/myenv/AsyncUDP_WT32_ETH01/src/AsyncUDP_WT32_ETH01_Impl.h:436: multiple definition of `AsyncUDPMessage::flush()'; .pio/build/myenv/src/main.cpp.o:/Users/waltermarchewka/Documents/PlatformIO/Projects/ESP32_LOW_POWER_RELAY/.pio/libdeps/myenv/AsyncUDP_WT32_ETH01/src/AsyncUDP_WT32_ETH01_Impl.h:436: first defined here
/Users/waltermarchewka/.platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: .pio/build/myenv/lib2c4/libUdpListener.a(UdpListener.cpp.o): in function `AsyncUDPPacket::available()':
/Users/waltermarchewka/Documents/PlatformIO/Projects/ESP32_LOW_POWER_RELAY/.pio/libdeps/myenv/AsyncUDP_WT32_ETH01/src/AsyncUDP_WT32_ETH01_Impl.h:540: multiple definition of `AsyncUDPPacket::available()'; .pio/build/myenv/src/main.cpp.o:/Users/waltermarchewka/Documents/PlatformIO/Projects/ESP32_LOW_POWER_RELAY/.pio/libdeps/myenv/AsyncUDP_WT32_ETH01/src/AsyncUDP_WT32_ETH01_Impl.h:540: first defined here
/Users/waltermarchewka/.platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: .pio/build/myenv/lib2c4/libUdpListener.a(UdpListener.cpp.o): in function `AsyncUDPPacket::read()':
/Users/waltermarchewka/Documents/PlatformIO/Projects/ESP32_LOW_POWER_RELAY/.pio/libdeps/myenv/AsyncUDP_WT32_ETH01/src/AsyncUDP_WT32_ETH01_Impl.h:567: multiple definition of `AsyncUDPPacket::read()'; .pio/build/myenv/src/main.cpp.o:/Users/waltermarchewka/Documents/PlatformIO/Projects/ESP32_LOW_POWER_RELAY/.pio/libdeps/myenv/AsyncUDP_WT32_ETH01/src/AsyncUDP_WT32_ETH01_Impl.h:567: first defined here
/Users/waltermarchewka/.platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: .pio/build/myenv/lib2c4/libUdpListener.a(UdpListener.cpp.o): in function `AsyncUDPPacket::peek()':
/Users/waltermarchewka/Documents/PlatformIO/Projects/ESP32_LOW_POWER_RELAY/.pio/libdeps/myenv/AsyncUDP_WT32_ETH01/src/AsyncUDP_WT32_ETH01_Impl.h:579: multiple definition of `AsyncUDPPacket::peek()'; .pio/build/myenv/src/main.cpp.o:/Users/waltermarchewka/Documents/PlatformIO/Projects/ESP32_LOW_POWER_RELAY/.pio/libdeps/myenv/AsyncUDP_WT32_ETH01/src/AsyncUDP_WT32_ETH01_Impl.h:579: first defined here
/Users/waltermarchewka/.platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: .pio/build/myenv/lib2c4/libUdpListener.a(UdpListener.cpp.o): in function `AsyncUDPPacket::flush()':
/Users/waltermarchewka/Documents/PlatformIO/Projects/ESP32_LOW_POWER_RELAY/.pio/libdeps/myenv/AsyncUDP_WT32_ETH01/src/AsyncUDP_WT32_ETH01_Impl.h:591: multiple definition of `AsyncUDPPacket::flush()'; .pio/build/myenv/src/main.cpp.o:/Users/waltermarchewka/Documents/PlatformIO/Projects/ESP32_LOW_POWER_RELAY/.pio/libdeps/myenv/AsyncUDP_WT32_ETH01/src/AsyncUDP_WT32_ETH01_Impl.h:591: first defined here
/Users/waltermarchewka/.platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: .pio/build/myenv/lib2c4/libUdpListener.a(UdpListener.cpp.o): in function `AsyncUDPPacket::write(unsigned char)':
/Users/waltermarchewka/Documents/PlatformIO/Projects/ESP32_LOW_POWER_RELAY/.pio/libdeps/myenv/AsyncUDP_WT32_ETH01/src/AsyncUDP_WT32_ETH01_Impl.h:716: multiple definition of `AsyncUDPPacket::write(unsigned char)'; .pio/build/myenv/src/main.cpp.o:/Users/waltermarchewka/Documents/PlatformIO/Projects/ESP32_LOW_POWER_RELAY/.pio/libdeps/myenv/AsyncUDP_WT32_ETH01/src/AsyncUDP_WT32_ETH01_Impl.h:716: first defined here
/Users/waltermarchewka/.platformio/packages/toolchain-xtensa-esp32/bi

OSC(open sound control) Support

Dear all,

I'm opening this discussion to talk about the possibility of adding the OSC(open sound control) for this library. What I want to do is sending OSC message who is originally depending on UDP with WT32_ETH01, like I am not a specialist or programmer, I met the compatible problem when I want to use standard Arduino OSC library with this AsyncUDP library.

Initial test was simple, based on this example of OSC and just want to replace their standard Arduino WifiUDP/EthernetUDP with AsyncUDP, but actually messages are not well formatted and dropped. So I suppose there should have some compatible issues,

Anyone has some ideas?
Thanks in advance

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.