Open gabrielbravov opened 2 months ago
If you set core debug level to verbose, do you get any additional logging about what fails?
If you set core debug level to verbose, do you get any additional logging about what fails?
Nothing strange, just this:
17:43:16.216 -> #�����a8�D��l��W(��ٴ�Oh�[ 68][V][esp32-hal-uart.c:463] uartBegin(): UART0 initialization done. 17:43:18.192 -> Direccion IP: 192.168.10.126 17:43:43.202 -> No time available (yet) 17:44:03.215 -> No time available (yet) 17:44:28.218 -> No time available (yet) 17:44:48.227 -> No time available (yet)
are you sure that you are using "latest master (checkout manually)"?
the Arduino Ethernet library doesn't configure and use the ESP32 networking and the ESP32 SNTP is part of that.
@gabrielbravov seems that you are running Arduino v2.0.17 through PlatformIO. I suggest to update to v3.0.4 (@Jason2866 can help with pio config) and then use our new ETH.h
library, which is fully integrated with the network stack
@gabrielbravov Easy when you already using Platformio. Go to https://github.com/pioarduino/platform-espressif32 It is described in the repo readme what change is needed.
It was solved with me-no-dev recommendation about to use ETH Library from espressif and changing the platform core from platformio.ini as Jason2866 recommended.
Thanks for the work.
Just a additional comment, the ETH Library has very few examples to understand how to change mac address or how to use static ip adresses, it would be useful if you can add more examples. Too, i would like to have a ping library (icmp echo) to work with framework arduino, the actual avaliable libraries from github are old, don't work with ethernet and are unsupported.
@gabrielbravov, my EthernetESP32 library is an alternative to ETH which is much more similar to Arduino Ethernet library. and it has some examples. https://github.com/Networking-for-Arduino/EthernetESP32
Too, i would like to have a ping library (icmp echo) to work with framework arduino, the actual avaliable libraries from github are old, don't work with ethernet and are unsupported.
The esp-idf includes a ping library based on lwip. It would not be a huge effort to wrap some oop around it, but that really is outside the scope of arduino-esp32 and should be implemented as a 3rd party library.
@gabrielbravov to use static IP you init ETH as follows:
// ETH pins
#define ETH_CS 15
#define ETH_IRQ 4
#define ETH_RST 5
// SPI pins
#define ETH_SPI_SCK 14
#define ETH_SPI_MISO 12
#define ETH_SPI_MOSI 13
void setup() {
IPAddress ip(192, 168, 0, 8);
IPAddress gw(192, 168, 0, 1);
IPAddress mask(255, 255, 255, 0);
IPAddress dns(192, 168, 0, 1);
SPI.begin(ETH_SPI_SCK, ETH_SPI_MISO, ETH_SPI_MOSI);
ETH.begin(ETH_PHY_W5500, 1, ETH_CS, ETH_IRQ, ETH_RST, SPI);
ETH.config(ip, gw, mask, dns);
}
Board
ESP32 Dev Module Breakout Board (aliexpress version)
Device Description
I have an ESP32 Wroom Breakout Board and Ethernet Module with W5500 IC connected trough SPI and CS pin attached to GPIO5.
Hardware Configuration
No, just the w5500 module.
W5500 ESP32 MOSI-> GPIO23 MISO-> GPIO19 CLK -> GPIO18 CS -> GPIO5 VCC -> +3V3 GND -> GND
Version
latest master (checkout manually)
IDE Name
Platformio
Operating System
Ubuntu 22.04 LTS
Flash frequency
default config
PSRAM enabled
yes
Upload speed
9600
Description
NTP Example from https://github.com/espressif/arduino-esp32/blob/master/libraries/ESP32/examples/Time/SimpleTime/SimpleTime.ino works nice with WiFi, but when i change the code to use Ethernet with static ip, the code never reach the NTP server to recieve actual date and time and just answer via Serial Monitor "No time available (yet)".
I created an example code to works with both configurations (WiFi and Ethernet), if a comment the line N° 11 that says "#define Ethernet" it connects via WiFi and if i uncomment this line, it's connect via Ethernet.
I tried to make an NTP request using the same port using my linux machine via CLI with the command "ntpdate -q ntp.shoa.cl" (without quotation marks) and the server answer ok in my computer via ethernet but not in my esp32 via ethernet. I too tried other NTP servers from local network and outside without success.
This it's the platformio.ini code: `[env:esp32dev] platform = espressif32 board = esp32dev framework = arduino
monitor_speed = 9600 monitor_filters = time
lib_deps =
RECOMMENDED
Accept new functionality in a backwards compatible manner and patches
arduino-libraries/Ethernet`
Sketch
Debug Message
Other Steps to Reproduce
No response
I have checked existing issues, online documentation and the Troubleshooting Guide