We often get the CORS error when we try to run some code from localhost or XAMPP. The following steps will help to solve it. Please note you will need access to server side code or server configurations. Set Access-Control-Allow-Origin to “*” in the code Set Header set Access-Control-Allow-Headers to “*” in the code If… Continue reading Cross Origin or CORS Issue
Month: May 2021
ESP-8266 and NTP = onboard timekeeping
We can sync the time of a ESP-8266 with a NTP server and then keep time count on the device. It will not need any other additional devices like a DS1307 clock. And once synced with the NTP server it can keep the time even if there is no internet – very handy. The time… Continue reading ESP-8266 and NTP = onboard timekeeping
Sync Ds1302 with NTP
This code first syncs the DS1302 chip with a NTP server and then reads time from the DS1302 chip. Every time the system is booted the clock is synced with a NTP server. #include <ESP8266WiFi.h> #include “TinyDHT.h” // Adafruit library https://github.com/adafruit/TinyDHT #include <ThreeWire.h> // needed by rtc #include <RtcDS1302.h> // Makuna library https://github.com/Makuna/Rtc const char… Continue reading Sync Ds1302 with NTP