Hi,
For some time now I only use Wemos D1 mini pro. This will work all my projects. Now I have bought a D1 mini, because this is perfectly adequate for small projects.
Unfortunately I have problems with it.
If I use the following example code
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "50e8a37b17644ef5xxxxxxxxxxxxxxxxxxxxxxx";
// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "xxxxxxxxx";
char pass[] = "xxxxxxxxxxxxx";
IPAddress device_ip (192, 168, 1, 200);
IPAddress dns_ip (192, 168, 1, 10);
IPAddress gateway_ip (192, 168, 1, 10);
IPAddress subnet_mask(255, 255, 255, 0);
void setup()
{
// Debug console
Serial.begin(115200);
// Setup WiFi network
WiFi.config(device_ip, gateway_ip, subnet_mask);
WiFi.begin(ssid, pass);
// Setup Blynk
Blynk.config(auth);
}
void loop()
{
Blynk.run();
i got
[144]
___ __ __
/ _ )/ /_ _____ / /__
/ _ / / // / _ \/ '_/
/____/_/\_, /_//_/_/\_\
/___/ v0.6.1 on ESP8266
[148] Connecting to blynk-cloud.com:80
[5149] Connecting to blynk-cloud.com:80
[10150] Connecting to blynk-cloud.com:80
[15151] Connecting to blynk-cloud.com:80
[20152] Connecting to blynk-cloud.com:80
…
if i use that code
#define BLYNK_PRINT Serial
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "50e8a37b17644ef5xxxxxxxxxxxxxx";
// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "xxxxxxxxxxxxxx";
char pass[] = "xxxxxxxxxxxx";
IPAddress device_ip (192, 168, 1, 200);
IPAddress dns_ip (192, 168, 1, 10);
IPAddress gateway_ip (192, 168, 1, 10);
IPAddress subnet_mask(255, 255, 255, 0);
void setup()
{
// Debug console
Serial.begin(115200);
// Setup WiFi network
WiFi.config(device_ip, gateway_ip, subnet_mask);
WiFi.begin(ssid, pass);
// Setup Blynk
Blynk.config(auth);
}
void loop()
{
Blynk.run();
}
i got
⸮⸮⸮⸮⸮⸮⸮⸮⸮`⸮⸮d$⸮⸮l ⸮⸮n⸮[145]
/ _ )/ /_ _____ / /__
/ _ / / // / _ \/ '_/
/____/_/\_, /_//_/_/\_\
/___/ v0.6.1 on ESP8266
[148] Connecting to blynk-cloud.com:80
[5149] Connecting to blynk-cloud.com:80
[10150] Connecting to blynk-cloud.com:80
[15151] Connecting to blynk-cloud.com:80
[20152] Connecting to blynk-cloud.com:80
[25153] Connecting to blynk-cloud.com:80
[30154] Connecting to blynk-cloud.com:80
…
if i use this code
#define serielleAusgabe //Serieller Monitor einschalten
#define BLYNK_PRINT Serial /* Comment this out to disable prints and save space */
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
#include <PubSubClient.h>
char auth[] = "xxxxxxxxxxxxxxxxxx";
char ssid[] = "xxxxxxxxxxx";
char pass[] = "xxxxxxxxxxxxxx";
IPAddress arduino_ip ( 192, 168, 1, 151);
IPAddress dns_ip ( 192, 168, 1, 10);
IPAddress gateway_ip ( 192, 168, 1, 10);
IPAddress subnet_mask ( 255, 255, 255, 0);
unsigned long startCheckConnection;
void setup() {
#ifdef serielleAusgabe
Serial.begin(115000);
delay(10);
#endif
MyWiFi();
}
void MyWiFi() {
int mytimeout = millis() / 1000;
WiFi.config(arduino_ip, dns_ip, gateway_ip, subnet_mask);
WiFi.begin(ssid, pass);
while (WiFi.status() != WL_CONNECTED) {
delay(500);
if ((millis() / 1000) > mytimeout + 2) {
break;
}
}
delay(100);
Blynk.config(auth);
mytimeout = millis() / 1000;
while (Blynk.connect() == false) {
if ((millis() / 1000) > mytimeout + 3) {
break;
}
}
}
void CheckConnection() {
if ( millis() > startCheckConnection + 60 * 1000) { //check Wifi und Blynk every minute
if (!Blynk.connected()) {
startCheckConnection = millis();
MyWiFi();
}
}
}
void loop() {
if (Blynk.connected()) {
Blynk.run();
}
else {
CheckConnection();
}
}
Blynk connect without problems
/ _ )/ /_ _____ / /__
/ _ / / // / _ \/ '_/
/____/_/\_, /_//_/_/\_\
/___/ v0.6.1 on ESP8266
[4065] Connecting to blynk-cloud.com:80
[5098] Ready (ping: 17ms).
If i use all same code on a wemos mini pro i have no problems
i can not find the mistake or i am blind
please help me.
Uwe