Tuned for OS2 to reduce flash code size for smaller MCU's. Added further functions since 2018 v1.7 firmware. Improved faster large web page sending. Built in fast NTP Client time and RTC setting function. ATParser message handling improvements and updated.

Dependencies:  

Dependents:   ESP8266-NTP-Test

Files at this revision

API Documentation at this revision

Comitter:
star297
Date:
Thu Feb 14 00:25:33 2019 +0000
Parent:
2:072248e430d0
Commit message:
Improve getFirmware functions, other minor timing changes.

Changed in this revision

ESP8266.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r 072248e430d0 -r ffdde9d17dd1 ESP8266.cpp
--- a/ESP8266.cpp	Mon Feb 11 23:33:54 2019 +0000
+++ b/ESP8266.cpp	Thu Feb 14 00:25:33 2019 +0000
@@ -213,7 +213,7 @@
 int32_t ESP8266::getNTP(char * NTPpool,int tzoffset, int setRTC)
 {
     // example NTPpool = "1.nl.pool.ntp.org"
-    // serial.printf("Seconds ince 1970 = %d\r\n", esp.getNTP("1.nl.pool.ntp.org",3600));    
+    // serial.printf("Seconds since 1970 = %d\r\n", esp.getNTP("1.nl.pool.ntp.org",3600));    
     const int NTP_PACKET_SIZE = 48;
     unsigned char packetBuffer[NTP_PACKET_SIZE];
     int NTP_OFFSET = (2208988800 - tzoffset);
@@ -247,7 +247,7 @@
     close(1);
     if(recv_size==48){
         uint32_t secsSince1970=((packetBuffer[40]<<24)|(packetBuffer[41]<<16)|(packetBuffer[42]<<8)|packetBuffer[43])-NTP_OFFSET;
-        if (setRTC){set_time(secsSince1970);}
+        if (setRTC){set_time(secsSince1970);} // may need to add a second to offset any MCU delay
         return secsSince1970;
     }
     else{return 0;}