wvdkuil
New Member
Posts: 4
Raspberry Pi: No
Other Device: Arduino AQ and SDL
|
Post by wvdkuil on Apr 14, 2018 2:35:58 GMT -8
If this question is answered somewhere else on this board, i used the search function, but did not find the answer. If there are errors to the english language, sorry for that, my native language is dutch. My problem:I am stuck with the Thunderboard Arduino version. WiFi is set up correctly. It detects lightning, uploads to PubNub, the freeboard shows all data correctly. But the dates are wrong. All times start at 0 (=01011970) every restart. I tried to find the code to access an ntp server, can not find it in the supplied code. The examples in the time.zip do not work as they use different libraries. And adapting the examples with "trial and error" does only result in errors. My question: Does anyone knows how to add ntp support to the SDL_Arduino_ThunderBoard_IOTWim van der Kuil Attachments:
|
|
|
Post by Powderjockey on Apr 14, 2018 10:01:05 GMT -8
Maybe it requires a "Realtime"Clock add-on board to the Arduino. Shouldn't have too, but a suggestion. Perhaps something from this page will work playground.arduino.cc/Code/NTPclient
|
|
|
Post by Powderjockey on Apr 14, 2018 11:08:45 GMT -8
I downloaded the Arduino_IOT_ThunderBoard and see there is a time.zip file in the directory. This is the timelib.h library for Arduino and if needed, should be added to the Arduino library thru Manage Libraries.
Are you getting the proper times in the Serial Monitor?
|
|
wvdkuil
New Member
Posts: 4
Raspberry Pi: No
Other Device: Arduino AQ and SDL
|
Post by wvdkuil on Apr 14, 2018 23:10:38 GMT -8
I downloaded the Arduino_IOT_ThunderBoard and see there is a time.zip file in the directory. This is the timelib.h library for Arduino and if needed, should be added to the Arduino library thru Manage Libraries. Are you getting the proper times in the Serial Monitor? Thanks for your help. The Time folder is in the correct place I think (see attached screenshot) and all compiles are without any errors This is the first part of the serial monitor, as soon as the WiFi is operational a time message is displayed, it shows 30 seconds after 0. As i write this post, the system runs for 19 hours so the time message shows 19:26:34 1 1 1970 ------------------------------
Thunder Board IOT
SwitchDoc Labs
Version 004ARD
------------------------------
Initializing and Calibrating
bestTune = 0
Difference =26
Noise floor is: 1
Spike rejection is: 2
Watchdog threshold is: 2
AT+RST
AT
AT+UART_DEF=19200,8,1,0,0
[WiFiEsp] Initializing ESP module
[WiFiEsp] Initilization successful - 2.0.0
ssid=valleistraatN
[WiFiEsp] Connected to valleistraatN
0:00:30 1 1 1970
time in seconds =30
IP=192.168.1.36
PubNub set up
IRQ Triggered=1
Noise level too high, try adjusting noise floor
0:01:00 1 1 1970
publishing a message
{ "SV": "004ARD","NF":"1","IS":"0","MS":"0","MD":"0","LIR":"1","LLR":""}
Size=72
[WiFiEsp] Connecting to pubsub.pubnub.com
{ "SV": "004ARD","LC":"0","LTS":"0:00:00","IC":"1","LLD":"0","LPTS":"0:01:08","ITS":"0:00:30"}
Size=94
I have no idea where to find the code to get the time from a time server. All examples in the Time/examples/ folder use different ethernet/wifi code. === I think that adding a RTC chip would not help either as that also needs to be set with the correct time. Attachments:
|
|
|
Post by SDL on Apr 15, 2018 8:05:57 GMT -8
|
|
wvdkuil
New Member
Posts: 4
Raspberry Pi: No
Other Device: Arduino AQ and SDL
|
Post by wvdkuil on Apr 16, 2018 7:41:39 GMT -8
Good day sir, I studied the link, but I can not locate the connector on my GroveProMiniLP There is a 6 hole connector JP10, is that the one? There are also 3 spare "white" Grove connectors If I order the RTC it will be 19.99$ including least expensive shipping, excluding import costs, so I want to be sure that it can connect it. I also checked the coding examples, so i assume i have to write a small scetch with a combination of Arduino/libraries/WiFiEsp/examples/UdpNTPclient to get the current time, and the example code in DS3231_TEST to start the RTC? Thanks in advance for your answer Wim
|
|
wvdkuil
New Member
Posts: 4
Raspberry Pi: No
Other Device: Arduino AQ and SDL
|
Post by wvdkuil on Apr 16, 2018 8:05:03 GMT -8
Conclusion: A software approach will not work even when using the stripped down example script from the Arduino/libraries/WiFiEsp/examples/UdpNTPclient Running it stand-alone works like a charm. But adding the first 2 lines from the example to SDL_Arduino_Thunderboard_IOT
#include "WiFiEspUdp.h" WiFiEspUDP Udp; gives a warning about to much memory used, and that the system will be unstable. Without any other lines added, there are no compile errors but running it gives all kind of errors.
So I will try the proposed hardware solution, i can set the RTC and then upload the SDL_Arduino_ThunderBoard_IOT
To be continued,
Wim
|
|
|
Post by SDL on Apr 17, 2018 11:00:17 GMT -8
|
|