Git Product home page Git Product logo

Comments (7)

gmag11 avatar gmag11 commented on July 17, 2024

I've tried to keep compatibility with old versions. There is no change needed. I've tested latest code using both ESP32 and ESP8266 with latest Arduino cores.
What version are you using?

from ntpclient.

bill-orange avatar bill-orange commented on July 17, 2024

I tried running what the Arduino IDE presents as 3.0.0-Beta. I am not sure how that corresponds to your three versions in GitHub.

Version 2.5.1 runs fine. In response to your reply, I loaded 3.0.0-Beta up again and tried running the examples on an ESP32. I don't have any spare ESP8266 to test with right now. The result was a crash as shown below. This is from the ESP32 example. The Basic example does the same. Just a thought, could you be testing with a different Lwip version than I am?

[WiFi-event] event: 4
Connected to testnet. Asking for IP address.
[WiFi-event] event: 7
Got IP: 192.168.0.27
Connected: yes
NTP request Sent
assertion "pbuf_free: p->ref > 0" failed: file "/Users/ficeto/Desktop/ESP32/ESP32/esp-idf-public/components/lwip/lwip/src/core/pbuf.c", line 765, function: pbuf_free
abort() was called at PC 0x400d8ce3 on core 1

Backtrace: 0x4008c818:0x3ffc8cc0 0x4008ca49:0x3ffc8ce0 0x400d8ce3:0x3ffc8d00 0x400f3903:0x3ffc8d30 0x400d3c23:0x3ffc8d50 0x400d3c73:0x3ffc8de0 0x400887b5:0x3ffc8e10

The exception decoder reports:

Decoding 7 results
0x4008c818: invoke_abort at /Users/ficeto/Desktop/ESP32/ESP32/esp-idf-public/components/esp32/panic.c line 707
0x4008ca49: abort at /Users/ficeto/Desktop/ESP32/ESP32/esp-idf-public/components/esp32/panic.c line 707
0x400d8ce3: __assert_func at /Users/ivan/e/newlib_xtensa-2.2.0-bin/newlib_xtensa-2.2.0/xtensa-esp32-elf/newlib/libc/stdlib/../../../.././newlib/libc/stdlib/assert.c line 63 (discriminator 8)
0x400f3903: pbuf_free at /Users/ficeto/Desktop/ESP32/ESP32/esp-idf-public/components/lwip/lwip/src/core/pbuf.c line 1331
0x400d3c23: AsyncUDP::_recv(udp_pcb*, pbuf*, ip_addr const*, unsigned short, netif*) at C:\Users\William\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.2\libraries\AsyncUDP\src/AsyncUDP.cpp line 875
0x400d3c73: AsyncUDP::_s_recv(void*, udp_pcb*, pbuf*, ip_addr const*, unsigned short, netif*) at C:\Users\William\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.2\libraries\AsyncUDP\src/AsyncUDP.cpp line 875
:  (inlined by) _udp_task at C:\Users\William\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.2\libraries\AsyncUDP\src/AsyncUDP.cpp line 137
0x400887b5: vPortTaskWrapper at /Users/ficeto/Desktop/ESP32/ESP32/esp-idf-public/components/freertos/port.c line 355 (discriminator 1)


from ntpclient.

mcspr avatar mcspr commented on July 17, 2024

This was reported as arduino-esp32 1.0.2 bug. See:
espressif/arduino-esp32#2685 (comment)

You can undo that commit here (see backtrace paths):
C:\Users\William\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.2\libraries\AsyncUDP\src\AsyncUDP.cpp

from ntpclient.

bill-orange avatar bill-orange commented on July 17, 2024

@mcspr Good Catch!

Unfortunately, now I can not compile with this error : Dies right at the begin

sketch\OWM_forecast_ESP32_SPIFFSg.ino.cpp.o:(.literal._Z5setupv+0x88): undefined reference to NTPClient::begin(String, signed char, bool, signed char, AsyncUDP*)
This is on my code, not the example. The offending line (which worked before) is:

NTP.begin("pool.ntp.org", TIMEZONE, false);

where TIMEZONE is: an int equal to -7

from ntpclient.

mcspr avatar mcspr commented on July 17, 2024

IDE does not actually build NtpClientLib?
e.g. if we included NtpClientLib.h, but NtpClientLib library was not built:

$ cat test.cpp
void some();

int main(int argc, char** argv) {
    some();
}
$ g++ -o test test.cpp
/tmp/ccuzaFSD.o: In function `main':
test.cpp:(.text+0x10): undefined reference to `some()'
collect2: error: ld returned 1 exit status

IDE log should have something like this:

Compiling library "NtpClient"
xtensa-esp32-elf-g++ ...long-buildflags-string... ".../Arduino/libraries/NtpClient/src/NTPClientLib.cpp" -o ".../arduino_build_134966/libraries/NtpClient/NTPClientLib.cpp.o"

edit: Or sketch mixes old and new NtpClientLib source (including it as part of the sketch?)

from ntpclient.

bill-orange avatar bill-orange commented on July 17, 2024

I will do more testing once I have an ESP32 free.

from ntpclient.

bill-orange avatar bill-orange commented on July 17, 2024

I don't know if something changed on the GitHub side or I just had a bad download of 3.0.0-Beta. I reinstalled the Beta in the Arduino IDE and all is well now. I tested both on ESP8266 and ESP32.

So far so good.

from ntpclient.

Related Issues (20)

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.