alexstocker / sensordata

Simple python scripts to read sensor data using adafruit and publish to SensorLogger for owncloud or nextcloud
15 stars 10 forks source link

Arduino (NodeMCU) Get Date from NTP #5

Open christoschronopoulos opened 5 years ago

christoschronopoulos commented 5 years ago

Platform you are using

owncloud

Sensors/Hardware

DHT22, NodeMCU

Your Goals

Simple temperature/humidity logger to my owncloud.

Your Question

I used the provided sample code for the Arduino IDE. It works well, but I cannot make it to get the date from NTP server. I also used the "0.europe.pool.ntp.org" and "time.google.com" but without any luck. What do I miss?

theonlytruth commented 5 years ago

I had the same problems with this when I tried it a few days ago. A very little number of times it worked but for now I didn't understand why or why not. I didn't find the time to check what the NTP-Server answers and what may go wrong with the sample code.

I'm interested in further improvements and explanations. :)

christoschronopoulos commented 5 years ago

By mistake, I posted the question regarding the sensorlogger in the sensordata issues. I apologise.

@theonlytruth I implemented the NTP library for Arduino and now it works like a charm! @alexstocker feel free to use it in the Arduino sample code.

https://github.com/alexstocker/sensorlogger/issues/78

alexstocker commented 5 years ago

@christoschronopoulos No worries! Thanx for your efforts. I am planning for building a more advanced appliance based on a more accurate sensor device than DHT11/22.