Hi,
I use a Aduino Nano with an ESP8266. The attached sketch worked before, but fails to work now.
The terminal output shows that the msg [02|00|01|00] is repeated. The blynk app on my iPhone show the Arduino is offline.
What do I have to change?
___ __ __
/ _ )/ /_ _____ / /__
/ _ / / // / _ \/ '_/
/____/_/\_, /_//_/_/\_\
/___/ v0.4.3 on Arduino Nano
[41] Free RAM: 1017
[551] Connecting to MY_SSID
[3645] AT version:0.51.0.0(Nov 27 2015 13:37:21)
SDK version:1.5.0
compile time:Nov 27 2015 13:57:56
OK
[8813] +CIFSR:STAIP,"192.XXX.XXX.XXX"
+CIFSR:STAMAC,"18:fe:XX:XX:XX:XX"
[8818] Connected to WiFi
[20696] <[02|00|01|00] XXXXXXXX37364b07bde84b75XXXXXXXX
[30915] <[02|00|01|00] XXXXXXXX37364b07bde84b75XXXXXXXX
[41115] <[02|00|01|00] XXXXXXXX37364b07bde84b75XXXXXXXX
[51305] <[02|00|01|00] XXXXXXXX37364b07bde84b75XXXXXXXX
[61498] <[02|00|01|00] XXXXXXXX37364b07bde84b75XXXXXXXX
[71693] <[02|00|01|00] XXXXXXXX37364b07bde84b75XXXXXXXX
Sketch:
char ssid[] = "XXXX";
char password[] = "XXXX";
char token[] = "MY_TOKEN";
#include <SimpleTimer.h>
#define BLYNK_DEBUG
#define BLYNK_PRINT Serial // Comment this out to disable prints and save space
//#define BLYNK_NO_INFO
#include <ESP8266_Lib.h>
#include <BlynkSimpleShieldEsp8266.h>
// Set ESP8266 Serial object
#include <SoftwareSerial.h>
SoftwareSerial EspSerial(11, 12); // RX, TX
SimpleTimer updateTimer;
ESP8266 wifi(&EspSerial);
// variable defs left out
void setup() {
// Set console baud rate
Serial.begin(19200);
EspSerial.begin(19200);
Blynk.begin(token, ssid, password);
//Serial.println("Starting ...");
pinMode(relais, OUTPUT); //Der Pin mit dem relais (Pin 5) ist jetzt ein Ausgang.
pinMode(bewegung, INPUT); //Der Pin mit dem Bewegungsmelder (Pin 7) ist jetzt ein Eingang.
//Serial.println("Starting timer!");
//timer for resetting alarm
updateTimer.setInterval(60000L, updateMeasure);
}
void loop() {
Blynk.run();
updateTimer.run();
if (bewegungsstatus == LOW) {
bewegungsstatusNew=digitalRead(bewegung);
// Licht sofort anschalten
if (bewegungsstatusNew == HIGH) {
bewegungsstatus = bewegungsstatusNew;
updateMeasure();
}
}
delay (1000);
}