Hello
Im having an issue with the esp8266 esp-01 module and the ds3231 working together using an Arduino Uno.
When I upload the code below something is causing major issues like disconnects and it wont send notification, date & time to the blynk app. I have tested by removing the RTC libraries, functions and timers and only left the send notification and it works perfect, sends the notification. Can someone look at my sketch and see right off what my problem might be? Or what ds3231 Library and sketch that will work with this setup
Thanks
/*************************************************************
Download latest Blynk library here:
https://github.com/blynkkk/blynk-library/releases/latest
Blynk is a platform with iOS and Android apps to control
Arduino, Raspberry Pi and the likes over the Internet.
You can easily build graphic interfaces for all your
projects by simply dragging and dropping widgets.
Downloads, docs, tutorials: http://www.blynk.cc
Sketch generator: http://examples.blynk.cc
Blynk community: http://community.blynk.cc
Follow us: http://www.fb.com/blynkapp
http://twitter.com/blynk_app
Blynk library is licensed under MIT license
This example code is in public domain.
*************************************************************
WARNING!
It's very tricky to get it working. Please read this article:
http://help.blynk.cc/hardware-and-libraries/arduino/esp8266-with-at-firmware
Simple push notification example
App project setup:
Push widget
Connect a button to pin 2 and GND...
Pressing this button will also push a message! ;)
*************************************************************/
/* Comment this out to disable prints and save space */
#define BLYNK_PRINT Serial
#include <ESP8266_Lib.h>
#include <BlynkSimpleShieldEsp8266.h>
#include <RTClib.h>
#include <Wire.h>
// the timer object
BlynkTimer timer;
RTC_DS3231 rtc;
// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "*************************";
// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "***************";
char pass[] = "*************";
// Hardware Serial on Mega, Leonardo, Micro...
//#define EspSerial Serial1
// or Software Serial on Uno, Nano...
#include <SoftwareSerial.h>
SoftwareSerial EspSerial(2, 3); // RX, TX
// Your ESP8266 baud rate:
#define ESP8266_BAUD 9600
ESP8266 wifi(&EspSerial);
void sendTime()
{
DateTime now = rtc.now();
char dateBuffer[12];
sprintf(dateBuffer, "%02u:%02u ", now.hour(), now.minute());
Serial.println(dateBuffer);
Blynk.virtualWrite(V10, dateBuffer);
}
void setup()
{
// Debug console
Serial.begin(9600);
// Set ESP8266 baud rate
EspSerial.begin(ESP8266_BAUD);
delay(10);
Blynk.begin(auth, wifi, ssid, pass);
// You can also specify server:
//Blynk.begin(auth, wifi, ssid, pass, "blynk-cloud.com", 8442);
//Blynk.begin(auth, wifi, ssid, pass, IPAddress(192,168,1,100), 8442);
Blynk.notify("Chicken Coop Online");
timer.setInterval(1000L, sendTime );
}
void loop()
{
Blynk.run();
timer.run();
}