I’ve spent a lot of time searching and working on this today, and I’ve worked myself into a wall.
I know that my ESP is connecting to the wireless okay, and I know that it and the Blynk server can communicate (pinging back and forth).
This is a Adafruit Feather HUZZAH ESP8266 and the server is running on a Raspberry Pi Zero W, running server server-0.34.2-java8.jar
I previously had this working with these two pieces of hardware. I had to work on the code on the ESP to get it to do something differently, but it was working previously. I also upgraded from server-0.30.2-java8.jar today. I may try rolling that back and seeing it helps?
here is the dummy code I am using right now to try and figure out what’s goign on:
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
#include <SimpleTimer.h>
SimpleTimer timer;
char auth[] = "[REDACTED]";
char ssid[] = "[REDACTED]";
char pass[] = "[REDACTED]";
bool Connected2Blynk = false;
void setup() {
Serial.begin(115200);
WiFi.begin(ssid, pass);
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}
Serial.println("");
Serial.println("WiFi connected");
Serial.println("IP address: ");
Serial.println(WiFi.localIP());
Blynk.begin(auth, ssid, pass, IPAddress(192,168,1,104));
Blynk.connect(3333); // timeout set to 10 seconds and then continue without Blynk
while (Blynk.connect() == false) {
// Wait until connected
}
Serial.println("Connected to Blynk server");
timer.setInterval(11000L, CheckConnection); // check if still connected every 11 seconds
}
void CheckConnection(){
Connected2Blynk = Blynk.connected();
if(!Connected2Blynk){
Serial.println("Not connected to Blynk server");
Blynk.connect(3333); // timeout set to 10 seconds and then continue without Blynk
}
else{
Serial.println("Connected to Blynk server");
}
}
void loop() {
if(Connected2Blynk){
Blynk.run();
}
timer.run();
}
And here is the output from the serial monitior:
WiFi connected
IP address:
192.168.1.110
[29187] Connecting to [REDACTED]
[29687] Connected to WiFi
[29687] IP: 192.168.1.110
[29687]
___ __ __
/ _ )/ /_ _____ / /__
/ _ / / // / _ \/ '_/
/____/_/\_, /_//_/_/\_\
/___/ v0.5.2 on ESP-12
[29693] Connecting to 192.168.1.104
[34694] Connecting to 192.168.1.104
[39695] Connecting to 192.168.1.104
[44696] Connecting to 192.168.1.104
[49697] Connecting to 192.168.1.104
[54698] Connecting to 192.168.1.104
[59699] Connecting to 192.168.1.104
[64700] Connecting to 192.168.1.104
[69701] Connecting to 192.168.1.104