Introducing the “Aptinex IsolPoE ESP32 ProDev Kit” – an unparalleled development platform engineered to leverage the potent ESP32 module along with the efficiency and security of isolated Power-over-Ethernet. This DevKit is fortified with the SDAPO DP9700-12V, an isolated PoE module, ensuring your projects are safeguarded against electrical surges, providing a robust and enduring solution.
Central to this kit is the ESP32MOD, a versatile Wi-Fi+BT+BLE MCU module, ideally suited for a wide spectrum of applications, from intricate smart home systems to sophisticated industrial automation. Integral components include the swift LAN8720A-CP-TR for network connectivity and the sturdy LPJ0085AHNL RJ45 connector, ensuring a consolidated power and data delivery over a singular cable.
Efficient programming is facilitated by the CH340C USB-to-serial converter, via a contemporary USB-C port. The AMS1117-3.3 regulator ensures a stable power supply, guaranteeing peak performance. This DevKit is designed for adaptability and simplicity, equipped with an array of GPIOs and interfaces, ready to transform your innovative concepts into reality.
Designed for versatility and ease, the DevKit comes with numerous GPIOs and interfaces, ready to bring your innovative ideas to life.
- ESP32MOD: This module integrates advanced Wi-Fi, BT, and BLE capabilities, suitable for high-demand IoT applications, offering robust processing power and versatile wireless connectivity.
- Isolated PoE: The SDAPO DP9700-12V module not only supplies power via Ethernet but also features electrical isolation, crucial for protecting sensitive electronics from voltage transients.
- LAN8720A-CP-TR Ethernet Controller: Ensures rapid and stable network connections with high throughput, ideal for data-intensive applications requiring reliable Ethernet communication.
- LPJ0085AHNL RJ45 Connector: Optimized for PoE applications, this connector merges power and data lines, facilitating streamlined network installations with reduced wiring complexity.
- CH340C USB-to-Serial Converter: Facilitates reliable serial communication, crucial for firmware updates and debugging, via a USB-C interface for compatibility with contemporary computing devices.
- AMS1117-3.3 Regulator: Provides stable voltage regulation at 3.3V, essential for consistent performance and operational reliability of the ESP32 and peripheral components.
- Expandable GPIOs: Offers a broad array of GPIO pins for extensive peripheral connectivity, enabling complex circuit integrations and multifunctional device development.
- USB-C Port: Supports modern, high-speed USB connectivity for efficient data transfer and device programming, aligning with current technological standards.
- Enhanced Safety: The isolation feature in the PoE module adds a critical layer of protection against electrical noise and spikes, safeguarding the integrity of the development environment and project deployments.
The DevKit includes a comprehensive guide with practical code examples to jumpstart your projects:
- Network Configuration: The setup initializes the Ethernet connection with a static IP, ensuring stable and reliable network connectivity for IoT applications.
IPAddress myIP(192, 168, 1, 155);
ETH.begin(ETH_PHY_ADDR, ETH_PHY_POWER, ETH_PHY_MDC, ETH_PHY_MDIO, ETH_PHY_TYPE, ETH_CLK_MODE);
- UDP Server Initialization: Demonstrates the establishment of an Async UDP server, capable of handling real-time data exchange efficiently.
if (udp.listen(udp_port)) {
udp.onPacket([](AsyncUDPPacket packet) {
// Packet processing code
});
}
- Packet Handling: Showcases the handling of incoming UDP packets, identifying their type (Broadcast, Multicast, Unicast) and responding to the sender, which exemplifies the interactive capabilities of the device within a network.
Serial.print("UDP Packet Type: ");
packet.printf("Got %u bytes of data", packet.length());
- Periodic Broadcasting: In the main loop, the device sends out broadcast messages at regular intervals, “pinging” the network to maintain visibility or solicit responses from other network participants.
udp.broadcast("Anyone here?");
Whether you’re a seasoned engineer or a hobbyist, the “Aptinex IsolPoE ESP32 ProDev Kit” provides the necessary tools to bring your innovative ideas to life with efficiency and ease. Dive into the potential of your projects with the reliability of Ethernet and the flexibility of ESP32 – all in one comprehensive solution. Discover this advanced, feature-rich development platform today.
Sample Code
#include <Arduino.h> | |
#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, 1, 155); | |
IPAddress myGW(192, 168, 1, 1); | |
IPAddress mySN(255, 255, 255, 0); | |
// Google DNS Server IP | |
IPAddress myDNS(8, 8, 8, 8); | |
///////////////////////////////////////////// | |
#define ETH_CLK_MODE ETH_CLOCK_GPIO0_IN | |
// Pin# of the enable signal for the external crystal oscillator (-1 to disable for internal APLL source) | |
#define ETH_PHY_POWER 17 | |
// Type of the Ethernet PHY (LAN8720 or TLK110) | |
#define ETH_PHY_TYPE ETH_PHY_LAN8720 | |
// I²C-address of Ethernet PHY (0 or 1 for LAN8720, 31 for TLK110) | |
#define ETH_PHY_ADDR 1 | |
// Pin# of the I²C clock signal for the Ethernet PHY | |
#define ETH_PHY_MDC 23 | |
// Pin# of the I²C IO signal for the Ethernet PHY | |
#define ETH_PHY_MDIO 18 | |
//UDP Port number | |
#define udp_port 1234 | |
AsyncUDP udp; | |
void setup() | |
{ | |
 Serial.begin(115200); | |
 while (!Serial); | |
 Serial.print(“nStarting Async_UDPClient 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); | |
 delay(3000); | |
 // 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, ETH_PHY_MDC, ETH_PHY_MDIO, ETH_PHY_TYPE, ETH_CLK_MODE); | |
 Serial.begin(115200); | |
 while (!Serial); | |
 // 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(“AsyncUDPServer started @ IP address: “); | |
 Serial.println(ETH.localIP()); | |
 if (udp.listen(udp_port)) | |
 { | |
 Serial.print(“UDP Listening on IP: “); | |
 Serial.println(ETH.localIP()); | |
 udp.onPacket([](AsyncUDPPacket packet) | |
 { | |
 Serial.print(“UDP Packet Type: “); | |
 Serial.print(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.print(“, Data: “); | |
 Serial.write(packet.data(), packet.length()); | |
 Serial.println(); | |
 //reply to the client | |
 packet.printf(“Got %u bytes of data”, packet.length()); | |
 }); | |
} | |
} | |
void loop() | |
{ | |
 delay(100); | |
 //Send broadcast | |
 udp.broadcast(“Anyone here?”); | |
 Serial.println(“MSG BRDCASTED !!!”); | |
} |
#pragma once | |
#ifndef ASYNC_UDP_WT32_ETH01_H | |
#define ASYNC_UDP_WT32_ETH01_H | |
//////////////////////////////////////////////// | |
#if ( ( defined(ESP_ARDUINO_VERSION_MAJOR) && (ESP_ARDUINO_VERSION_MAJOR >= 2) ) && ( ARDUINO_ESP32_GIT_VER != 0x46d5afb1 ) ) | |
#if (_ASYNC_UDP_WT32_ETH01_LOGLEVEL_ > 2) | |
  #warning Using code for ESP32 core v2.0.0+ in AsyncUdp_WT32_ETH01.h | |
#endif | |
#define ASYNC_UDP_WT32_ETH01_VERSION “AsyncUdp_WT32_ETH01 v2.1.0 for core v2.0.0+” | |
extern “C” | |
{ | |
  #include “lwip/ip_addr.h” | |
  #include “freertos/queue.h” | |
  #include “freertos/semphr.h” | |
} | |
#else | |
#if (_ASYNC_UDP_WT32_ETH01_LOGLEVEL_ > 2) | |
  #warning Using code for ESP32 core v1.0.6- in AsyncUdp_WT32_ETH01.h | |
#endif | |
#define ASYNC_UDP_WT32_ETH01_VERSION “AsyncUdp_WT32_ETH01 v2.1.0 for core v1.0.6-“ | |
extern “C” | |
{ | |
 #include “lwip/ip_addr.h” | |
 #include <tcpip_adapter.h> | |
 #include “freertos/queue.h” | |
 #include “freertos/semphr.h” | |
} | |
#endif | |
#include “IPAddress.h” | |
#include “IPv6Address.h” | |
#include “Print.h” | |
#include <functional> | |
//////////////////////////////////////////////// | |
#include <WebServer_WT32_ETH01.h> // https://github.com/khoih-prog/WebServer_WT32_ETH01 | |
#include “AsyncUDP_WT32_ETH01_Debug.h” | |
#include “AsyncUDP_WT32_ETH01.hpp” | |
#include “AsyncUDP_WT32_ETH01_Impl.h” | |
//////////////////////////////////////////////// | |
#endif //ASYNC_UDP_WT32_ETH01_H |
#pragma once | |
#ifndef ASYNC_UDP_WT32_ETH01_HPP | |
#define ASYNC_UDP_WT32_ETH01_HPP | |
//////////////////////////////////////////////// | |
#include <WebServer_WT32_ETH01.hpp> // https://github.com/khoih-prog/WebServer_WT32_ETH01 | |
class AsyncUDP; | |
class AsyncUDPPacket; | |
class AsyncUDPMessage; | |
struct udp_pcb; | |
struct pbuf; | |
struct netif; | |
typedef std::function<void(AsyncUDPPacket& packet)> AuPacketHandlerFunction; | |
typedef std::function<void(void * arg, AsyncUDPPacket& packet)> AuPacketHandlerFunctionWithArg; | |
//////////////////////////////////////////////// | |
class AsyncUDPMessage : public Print | |
{ protected: | |
 uint8_t * _buffer; | |
 size_t _index; | |
 size_t _size; | |
 public: | |
 AsyncUDPMessage(size_t size = CONFIG_TCP_MSS); | |
 virtual ~AsyncUDPMessage(); | |
 size_t write(const uint8_t *data, size_t len); | |
 size_t write(uint8_t data); | |
 size_t space(); | |
 size_t length(); | |
 void flush(); | |
operator bool() | |
{ | |
 return _buffer != NULL; | |
} | |
}; | |
//////////////////////////////////////////////// | |
class AsyncUDPPacket : public Stream | |
{ protected: | |
 AsyncUDP * _udp; | |
 pbuf * _pb; | |
 tcpip_adapter_if_t _if; | |
 ip_addr_t _localIp; | |
 uint16_t _localPort; | |
 ip_addr_t _remoteIp; | |
 uint16_t _remotePort; | |
 uint8_t _remoteMac[6]; | |
 uint8_t * _data; | |
 size_t _len; | |
 size_t _index; | |
public: | |
 AsyncUDPPacket(AsyncUDPPacket &packet); | |
 AsyncUDPPacket(AsyncUDP *udp, pbuf *pb, const ip_addr_t *addr, uint16_t port, struct netif * netif); | |
 virtual ~AsyncUDPPacket(); | |
 uint8_t * data(); | |
 size_t length(); | |
 bool isBroadcast(); | |
 bool isMulticast(); | |
 bool isIPv6(); | |
 tcpip_adapter_if_t interface(); | |
 IPAddress localIP(); | |
 IPv6Address localIPv6(); | |
 uint16_t localPort(); | |
 IPAddress remoteIP(); | |
 IPv6Address remoteIPv6(); | |
 uint16_t remotePort(); | |
 void remoteMac(uint8_t * mac); | |
 size_t send(AsyncUDPMessage &message); | |
 int available(); | |
 size_t read(uint8_t *data, size_t len); | |
 int read(); | |
 int peek(); | |
 void flush(); | |
 size_t write(const uint8_t *data, size_t len); | |
 size_t write(uint8_t data); | |
}; | |
//////////////////////////////////////////////// | |
class AsyncUDP : public Print | |
{ protected: | |
 udp_pcb *_pcb; | |
 //xSemaphoreHandle _lock; | |
 bool _connected; | |
 esp_err_t _lastErr; | |
 AuPacketHandlerFunction _handler; | |
 bool _init(); | |
 void _recv(udp_pcb *upcb, pbuf *pb, const ip_addr_t *addr, uint16_t port, struct netif * netif); | |
 public: | |
 AsyncUDP(); | |
 virtual ~AsyncUDP(); | |
void onPacket(AuPacketHandlerFunctionWithArg cb, void * arg = NULL); | |
 void onPacket(AuPacketHandlerFunction cb); | |
 bool listen(const ip_addr_t *addr, uint16_t port); | |
 bool listen(const IPAddress addr, uint16_t port); | |
 bool listen(const IPv6Address addr, uint16_t port); | |
 bool listen(uint16_t port); | |
 bool listenMulticast(const ip_addr_t *addr, uint16_t port, uint8_t ttl = 1, tcpip_adapter_if_t tcpip_if = TCPIP_ADAPTER_IF_MAX); | |
 bool listenMulticast(const IPAddress addr, uint16_t port, uint8_t ttl = 1, tcpip_adapter_if_t tcpip_if = TCPIP_ADAPTER_IF_MAX); | |
 bool listenMulticast(const IPv6Address addr, uint16_t port, uint8_t ttl = 1, tcpip_adapter_if_t tcpip_if = TCPIP_ADAPTER_IF_MAX); | |
 bool connect(const ip_addr_t *addr, uint16_t port); | |
 bool connect(const IPAddress addr, uint16_t port); | |
 bool connect(const IPv6Address addr, uint16_t port); | |
 void close(); | |
 size_t writeTo(const uint8_t *data, size_t len, const ip_addr_t *addr, uint16_t port, tcpip_adapter_if_t tcpip_if = TCPIP_ADAPTER_IF_MAX); | |
 size_t writeTo(const uint8_t *data, size_t len, const IPAddress addr, uint16_t port, tcpip_adapter_if_t tcpip_if = TCPIP_ADAPTER_IF_MAX); | |
size_t writeTo(const uint8_t *data, size_t len, const IPv6Address addr, uint16_t port, tcpip_adapter_if_t tcpip_if = TCPIP_ADAPTER_IF_MAX); | |
 size_t write(const uint8_t *data, size_t len); | |
 size_t write(uint8_t data); | |
 size_t broadcastTo(uint8_t *data, size_t len, uint16_t port, tcpip_adapter_if_t tcpip_if = TCPIP_ADAPTER_IF_MAX); | |
 size_t broadcastTo(const char * data, uint16_t port, tcpip_adapter_if_t tcpip_if = TCPIP_ADAPTER_IF_MAX); | |
 size_t broadcast(uint8_t *data, size_t len); | |
size_t broadcast(const char * data); | |
 size_t sendTo(AsyncUDPMessage &message, const ip_addr_t *addr, uint16_t port, tcpip_adapter_if_t tcpip_if = TCPIP_ADAPTER_IF_MAX); | |
 size_t sendTo(AsyncUDPMessage &message, const IPAddress addr, uint16_t port, tcpip_adapter_if_t tcpip_if = TCPIP_ADAPTER_IF_MAX); | |
 size_t sendTo(AsyncUDPMessage &message, const IPv6Address addr, uint16_t port, tcpip_adapter_if_t tcpip_if = TCPIP_ADAPTER_IF_MAX); | |
 size_t send(AsyncUDPMessage &message); | |
 size_t broadcastTo(AsyncUDPMessage &message, uint16_t port, tcpip_adapter_if_t tcpip_if = TCPIP_ADAPTER_IF_MAX); | |
 size_t broadcast(AsyncUDPMessage &message); | |
 IPAddress listenIP(); | |
{ | |
 return _buffer != NULL; | |
 IPv6Address listenIPv6(); | |
 bool connected(); | |
 esp_err_t lastErr(); | |
 operator bool(); | |
 static void _s_recv(void *arg, udp_pcb *upcb, pbuf *p, const ip_addr_t *addr, uint16_t port, struct netif * netif); | |
}; | |
//////////////////////////////////////////////// | |
#endif //ASYNC_UDP_WT32_ETH01_HPP |