Comments (7)
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.
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.
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.
@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.
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.
I will do more testing once I have an ESP32 free.
from ntpclient.
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)
- Problem in ESP32 HOT 2
- General dependency on ESP8266 library errors on ESP32 HOT 1
- Beta 3.0.2 version fails with ESP32 HOT 8
- ESPAsyncUDP dependency on esp32 HOT 3
- reference to 'map' is ambiguous HOT 3
- DST HOT 1
- Wrong time in NTPClientAvr example HOT 2
- ESP32 : memory leak ? HOT 6
- [idea] let the library wrap the SNTP SDK functions of ESP8266 and ESP32 HOT 4
- Please... is there any way to get the day of the week ? (Sunday, Monday etc.) Thanks HOT 2
- Getting error: "reference to 'byte' is ambiguous" with Arduino IDE1.8.15 HOT 11
- DST not working for USA default to EU Why? HOT 1
- Update PlatformIO Version HOT 1
- Hi, I know this is an old thread, but it annoys me.... And maybe it does not relate to you code, but any help would be appreciated. HOT 1
- _uptime definition error [Bug]
- The client and server's times differ by 136 years
- Arduino Library
- Failed DNS lookup leads to exception in ' void NTPClient::s_dnsFound ' HOT 1
- Dependency on Time lib 5.1; latest is 1.5 HOT 1
- Crash when in Async UDP library on ESP32 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ntpclient.