I'm trying to use the SNTP client in an esp8266 with the Arduino IDE. Having some trouble, no doubt caused by misunderstanding.
#include<sntp.h> //works
under setup
sntp_set_timezone(-5); //works
sntp_setserver(u8_t index, ip_addr_t *addr) //this I can't figure out
I found these functions in Kolban's esp8266 book. I'm no programmer by any measure, but usually beat my way through any problems by means of persistence, google, and wine(not the Linux kind
)
The 1st parameter is the servers index, no problem here it accepts 0, 1, or 2. The address has me stumped. I'm trying to use my local NTP server, located at 192.168.0.105 and accessed by several devices on my LAN. I can't figure out how to enter that address. I've tried:
192.168.0.105(error: too many decimal points in number)
"192.168.0.105" (error: cannot convert 'const char*' to 'ip_addr_t* {aka ip4_addr*}' for argument '2' to 'void sntp_setserver(unsigned char, ip_addr_t*)')
192,168,0,105 (error: too many arguments to function 'void sntp_setserver(unsigned char, ip_addr_t*)')
"192,168,0,105"(error: cannot convert 'const char*' to 'ip_addr_t* {aka ip4_addr*}' for argument '2' to 'void sntp_setserver(unsigned char, ip_addr_t*)')
I can't think of any other way to express that address. What am I doing wrong?