Comments (4)
Either would do, I just happened to pick on NtpClient, they look near identical, I'll check it out.
from esp8266-ntp-time-on-an-oled-with-wifi-manager.
OK, after further investigation I have determined there is little capability difference between the two libraries, although the NtpClient library you refer to needs an additional library of time.h so adding to the code overhead. There is no 'official' NtpClient' library as far as I know. Thanks for pointing out this other library.
from esp8266-ntp-time-on-an-oled-with-wifi-manager.
Mmmm.
I am using the Arduino NtpClient Lib from here,
I am getting an error on this line.
NTPClient
timeClient(time_udp,"time.nist.gov", TimeZone * 3600, 60000); // (logical name, address of server, time-zone offset in seconds, refresh-rate in mSec)
the error output is
ntp_test_3:33: error: no matching function for call to 'NTPClient::NTPClient(WiFiUDP&, const char [14], int, int)'
NTPClient timeClient(time_udp,"time.nist.gov", TimeZone * 3600, 60000); // (logical name, address of server, time-zone offset in seconds, refresh-rate in mSec)
^
C:\Users\Glenorchy DSE\Documents\Arduino\ntp_test_3\ntp_test_3.ino:33:70: note: candidates are:
In file included from C:\Users\Glenorchy DSE\Documents\Arduino\ntp_test_3\ntp_test_3.ino:5:0:
C:\Users\Glenorchy DSE\Documents\Arduino\libraries\NTPClient/NTPClient.h:33:5: note: NTPClient::NTPClient(const char*, int, int)
NTPClient(const char* poolServerName, int timeOffset, int updateInterval);
^
C:\Users\Glenorchy DSE\Documents\Arduino\libraries\NTPClient/NTPClient.h:33:5: note: candidate expects 3 arguments, 4 provided
C:\Users\Glenorchy DSE\Documents\Arduino\libraries\NTPClient/NTPClient.h:32:5: note: NTPClient::NTPClient(const char*, int)
NTPClient(const char* poolServerName, int timeOffset);
^
C:\Users\Glenorchy DSE\Documents\Arduino\libraries\NTPClient/NTPClient.h:32:5: note: candidate expects 2 arguments, 4 provided
C:\Users\Glenorchy DSE\Documents\Arduino\libraries\NTPClient/NTPClient.h:31:5: note: NTPClient::NTPClient(const char*)
NTPClient(const char* poolServerName);
^
C:\Users\Glenorchy DSE\Documents\Arduino\libraries\NTPClient/NTPClient.h:31:5: note: candidate expects 1 argument, 4 provided
C:\Users\Glenorchy DSE\Documents\Arduino\libraries\NTPClient/NTPClient.h:30:5: note: NTPClient::NTPClient(int)
NTPClient(int timeOffset);
^
C:\Users\Glenorchy DSE\Documents\Arduino\libraries\NTPClient/NTPClient.h:30:5: note: candidate expects 1 argument, 4 provided
C:\Users\Glenorchy DSE\Documents\Arduino\libraries\NTPClient/NTPClient.h:29:5: note: NTPClient::NTPClient()
NTPClient();
^
C:\Users\Glenorchy DSE\Documents\Arduino\libraries\NTPClient/NTPClient.h:29:5: note: candidate expects 0 arguments, 4 provided
C:\Users\Glenorchy DSE\Documents\Arduino\libraries\NTPClient/NTPClient.h:11:7: note: NTPClient::NTPClient(const NTPClient&)
class NTPClient {
^
C:\Users\Glenorchy DSE\Documents\Arduino\libraries\NTPClient/NTPClient.h:11:7: note: candidate expects 1 argument, 4 provided
C:\Users\Glenorchy DSE\Documents\Arduino\libraries\NTPClient/NTPClient.h:11:7: note: NTPClient::NTPClient(NTPClient&&)
C:\Users\Glenorchy DSE\Documents\Arduino\libraries\NTPClient/NTPClient.h:11:7: note: candidate expects 1 argument, 4 provided
C:\Users\Glenorchy DSE\Documents\Arduino\ntp_test_3\ntp_test_3.ino: In function 'void setup()':
ntp_test_3:58: error: 'class NTPClient' has no member named 'begin'
timeClient.begin(); // Start the NTP service for time
^
ntp_test_3:65: error: 'display_time' was not declared in this scope
screen_update.attach_ms(1000, display_time); // Call display routine every 1-sec. Tick units are 1.024mS
^
ntp_test_3:67: error: 'class NTPClient' has no member named 'getEpochTime'
epoch = timeClient.getEpochTime(); // You can test moving time forward or back by adding or subtracting the required number of seconds 1-day = 24_60_60
^
C:\Users\Glenorchy DSE\Documents\Arduino\ntp_test_3\ntp_test_3.ino: In function 'void loop()':
ntp_test_3:75: error: 'class NTPClient' has no member named 'getEpochTime'
epoch = timeClient.getEpochTime(); // You can test moving time forward or back by adding or subtracting the required number of seconds 1-day = 24*60*60
from esp8266-ntp-time-on-an-oled-with-wifi-manager.
Wrong library, this is the one I'm using: https://github.com/arduino-libraries/NTPClient
I've added the link to the readme too
Don't forget to remove the other library
from esp8266-ntp-time-on-an-oled-with-wifi-manager.
Related Issues (6)
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 esp8266-ntp-time-on-an-oled-with-wifi-manager.