[Solved] WeMos (ESP8266 Chip) connecting to 0.0.0.0:0

Hello im programming my WeMos chip as a water alarm and i’ve tested it on my Moa Lua chip and it works fine. When i try to do it on my WeMos chip all i get from “Blynk Debug” is ‘Connecting to 0.0.0.0:0’. The SSID and Password are stored in the EEPROM and are returning the correct values, and again it worked on my Moa Lua chip. This is the code i used:

The code is to long to put in the body so if you need it i will have to send it to you the other way, and by the way i even tried the sample code

So, thank you`

put your code in code tags or use

three of these characters: ` to precede your code followed by a carrriage return and three again to end it

#define BLYNK_PRINT Serial
//#define BLYNK_DEBUG
#include <Wire.h>
#include <SPI.h>
#include <WiFiClient.h>
#include <EepromUtil.h>
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
#include <EEPROM.h>

#define RED_PIN 5
#define GREEN_PIN 4
#define BLUE_PIN 0

bool RED_STATUS = false;
bool GREEN_STATUS = false;
bool BLUE_STATUS = false;

bool continue_check = false;
bool disable_blynk = false;
bool connected_to_computer = false;

#define DEVICE_ID 7161660957


char auth[] = "3fc68efc006a460d971ed3d32543d4d2";
String SSID;
String PASS;
String EMAIL;
String NAME;

void Serial_Check() {
  if (Serial.available() > 0) {
    char c;
    while (Serial.available() > 0) {
      digitalWrite(16, HIGH);
      c = Serial.read();
      if (c == 'c') {
        connected_to_computer = true;
        Serial.write('c');
      }
      if (c == 'T') {
        //        sendAlert();
      }
      if (c == 's') {
        String ssid = Serial.readString();
        EEPROM.write(0, ssid.length());
        char buf[ssid.length()];
        ssid.toCharArray(buf, 32);
        for (int i = 0; i < 32; i++) {
          EEPROM.write(i + 1, (uint8_t)buf[i]);
        }
        EEPROM.commit();
        Serial.write('o');

      }
      if (c == 'p') {
        String pass = Serial.readString();
        EEPROM.write(33, pass.length());
        char buf[pass.length()];
        pass.toCharArray(buf, 63);
        for (int i = 0; i < 63; i++) {
          EEPROM.write(i + 34, (uint8_t)buf[i]);
        }
        EEPROM.commit();
        Serial.write('o');
      }
      if (c == 'e') {
        String email = Serial.readString();
        EEPROM.write(98, email.length());
        char buf[email.length()];
        email.toCharArray(buf, 40);
        for (int i = 0; i < 39; i++) {
          EEPROM.write(i + 99, (uint8_t)buf[i]);
        }
        EEPROM.commit();
        Serial.write('o');
      }
      if (c == 'n') {
        String name = Serial.readString();
        EEPROM.write(140, name.length());
        char buf[name.length()];
        name.toCharArray(buf, 40);
        for (int i = 0; i < 39; i++) {
          EEPROM.write(i + 141, (uint8_t) buf[i]);
        }
        Serial.write('o');
      }
      if (c == 'z') {
        continue_check = true;
        disable_blynk = false;
      }
      digitalWrite(16, LOW);
    }
  }
}

void redOn() {
  pinMode(RED_PIN, OUTPUT);
  digitalWrite(RED_PIN, LOW);
  RED_STATUS = true;
}
void redOff() {
  pinMode(RED_PIN, OUTPUT);
  digitalWrite(RED_PIN, HIGH);
  RED_STATUS = false;
}
void greenOn() {
  pinMode(GREEN_PIN, OUTPUT);
  digitalWrite(GREEN_PIN, LOW);
  GREEN_STATUS = true;
}
void greenOff() {
  pinMode(GREEN_PIN, OUTPUT);
  digitalWrite(GREEN_PIN, HIGH);
  GREEN_STATUS = false;
}
void blueOn() {
  pinMode(BLUE_PIN, OUTPUT);
  digitalWrite(BLUE_PIN, LOW);
  BLUE_STATUS = true;
}
void blueOff() {
  pinMode(BLUE_PIN, OUTPUT);
  digitalWrite(BLUE_PIN, HIGH);
  BLUE_STATUS = true;
}
void doLightStart() {
  redOff();
  blueOff();
  greenOff();
  for (int i = 0; i < 5; i++) {
    redOn();
    delay(500);
    redOff();
    greenOn();
    delay(500);
    greenOff();
  }
}

void setup() {
  pinMode(16, OUTPUT);
  Serial.begin(9600);
  EEPROM.begin(512);
  doLightStart();
  int SSID_L = EEPROM.read(0);
  char SSIDtemp[SSID_L];
  for (int i = 0; i < SSID_L + 1; i++) {
    SSIDtemp[i] = (char (EEPROM.read(i + 1)));
  }
  Serial.println(SSIDtemp);
  int PASS_L = EEPROM.read(33);
  if (PASS_L > 64) {
    EEPROM.write(33, 0);
    EEPROM.commit();
  }
  char PASStemp[PASS_L];
  for (int i = 0; i < PASS_L + 1; i++) {
    PASStemp[i] = (char (EEPROM.read(i + 34)));
  }
  Serial.print(PASStemp);
  int EMAIL_L = EEPROM.read(98);
  if (EMAIL_L > 40) {
    EEPROM.write(98, 0);
    EEPROM.commit();
  }
  char EMAILtemp[EMAIL_L];
  for (int i = 0; i < EMAIL_L + 1; i++) {
    EMAILtemp[i] = (char (EEPROM.read(i + 99)));
  }
  int NAME_L = EEPROM.read(140);
  if (NAME_L > 40) {
    EEPROM.write(140, 0);
    EEPROM.commit();
  }
  char NAMEtemp[NAME_L];
  for (int i = 0; i < NAME_L + 1; i++) {
    NAMEtemp[i] = (char (EEPROM.read(i + 141)));
  }

  int timer = 0;
  while (continue_check == false) {
    if (timer == 60) {
      continue_check = true;
    }
    if (Serial.available() > 0) {
      continue_check = true;
      disable_blynk = true;
    }
    redOn();
    delay(500);
    redOff();
    blueOn();
    delay(500);
    blueOff();
    timer++;
  }

  redOn();
  if (disable_blynk == false) {
    redOff();
    greenOn();
    Blynk.begin(auth, SSIDtemp, PASStemp);
  }

}




void loop() {
  while (connected_to_computer == true) {
    redOff();
    blueOn();
    greenOff();
    Serial_Check();
  }
  if (Serial.available() > 0) {
    digitalWrite(16, HIGH);
    delay(1000);
    digitalWrite(16, LOW);
    Serial_Check();
  }

  if (disable_blynk == true) {
    redOff();
    blueOff();
    greenOn();
    delay(500);
    greenOff();
    delay(500);
  }

  if (disable_blynk == false) {
    Blynk.run();
  }
}


@FunguyPro when I tried your sketch the SSID included a terminating carriage return. I don’t know where it comes from but it obviously fails with an incorrect SSID.

What do you have connected to GPIO16 (D0)? At first I thought it was tied to the reset pin but I’m not sure when I look at your code.

The SSID and PASs comes from the eeprom, I don’t have anything connected to D0, and like I said before even the example sketch doesn’t work

I know where the SSID and PWD come from:

c
sMySSID
pmypd
emyemail@google.com
nmyname
z

Why are you writing to GPIO 16 (D0) if you don’t have anything on D0?

You are missing a EEPROM.commit(); for the name and in my version I have switched the high and low signals for the LED’s.

When I used your token it said it wasn’t valid so you might want to check the token.

Ok ill fix the write to D0/GPIO16, for the name and the high to low for me are reversed because im using a common anode rgb LED, and ill also check the auth token then get back to you, thanks.

ok so i fixed all of that and im still getting “Connecting to 0.0.0.0:0”

here’s my updated code

#define BLYNK_PRINT Serial
//#define BLYNK_DEBUG
#include <Wire.h>
#include <SPI.h>
#include <WiFiClient.h>
#include <EepromUtil.h>
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
#include <EEPROM.h>

#define RED_PIN 5
#define GREEN_PIN 4
#define BLUE_PIN 0

bool RED_STATUS = false;
bool GREEN_STATUS = false;
bool BLUE_STATUS = false;

bool continue_check = false;
bool disable_blynk = false;
bool connected_to_computer = false;

#define DEVICE_ID 7161660957


char auth[] = "faf3480f6cc143418b19d55370eba7a8";
String SSID;
String PASS;
String EMAIL;
String NAME;

void Serial_Check() {
  if (Serial.available() > 0) {
    char c;
    while (Serial.available() > 0) {
      c = Serial.read();
      if (c == 'c') {
        connected_to_computer = true;
        Serial.write('c');
      }
      if (c == 'T') {
        //        sendAlert();
      }
      if (c == 's') {
        String ssid = Serial.readString();
        EEPROM.write(0, ssid.length());
        char buf[ssid.length()];
        ssid.toCharArray(buf, 32);
        for (int i = 0; i < 32; i++) {
          EEPROM.write(i + 1, (uint8_t)buf[i]);
        }
        EEPROM.commit();
        Serial.write('o');

      }
      if (c == 'p') {
        String pass = Serial.readString();
        EEPROM.write(33, pass.length());
        char buf[pass.length()];
        pass.toCharArray(buf, 63);
        for (int i = 0; i < 63; i++) {
          EEPROM.write(i + 34, (uint8_t)buf[i]);
        }
        EEPROM.commit();
        Serial.write('o');
      }
      if (c == 'e') {
        String email = Serial.readString();
        EEPROM.write(98, email.length());
        char buf[email.length()];
        email.toCharArray(buf, 40);
        for (int i = 0; i < 39; i++) {
          EEPROM.write(i + 99, (uint8_t)buf[i]);
        }
        EEPROM.commit();
        Serial.write('o');
      }
      if (c == 'n') {
        String name = Serial.readString();
        EEPROM.write(140, name.length());
        char buf[name.length()];
        name.toCharArray(buf, 40);
        for (int i = 0; i < 39; i++) {
          EEPROM.write(i + 141, (uint8_t) buf[i]);
        }
        Serial.write('o');
      }
      if (c == 'z') {
        continue_check = true;
        disable_blynk = false;
      }
      digitalWrite(16, LOW);
    }
  }
}

void redOn() {
  pinMode(RED_PIN, OUTPUT);
  digitalWrite(RED_PIN, LOW);
  RED_STATUS = true;
}
void redOff() {
  pinMode(RED_PIN, OUTPUT);
  digitalWrite(RED_PIN, HIGH);
  RED_STATUS = false;
}
void greenOn() {
  pinMode(GREEN_PIN, OUTPUT);
  digitalWrite(GREEN_PIN, LOW);
  GREEN_STATUS = true;
}
void greenOff() {
  pinMode(GREEN_PIN, OUTPUT);
  digitalWrite(GREEN_PIN, HIGH);
  GREEN_STATUS = false;
}
void blueOn() {
  pinMode(BLUE_PIN, OUTPUT);
  digitalWrite(BLUE_PIN, LOW);
  BLUE_STATUS = true;
}
void blueOff() {
  pinMode(BLUE_PIN, OUTPUT);
  digitalWrite(BLUE_PIN, HIGH);
  BLUE_STATUS = true;
}
void doLightStart() {
  redOff();
  blueOff();
  greenOff();
  for (int i = 0; i < 5; i++) {
    redOn();
    delay(500);
    redOff();
    greenOn();
    delay(500);
    greenOff();
  }
}

void setup() {
  Serial.begin(9600);
  EEPROM.begin(512);
  doLightStart();
  int SSID_L = EEPROM.read(0);
  char SSIDtemp[SSID_L];
  for (int i = 0; i < SSID_L + 1; i++) {
    SSIDtemp[i] = (char (EEPROM.read(i + 1)));
  }
  Serial.println(SSIDtemp);
  int PASS_L = EEPROM.read(33);
  if (PASS_L > 64) {
    EEPROM.write(33, 0);
    EEPROM.commit();
  }
  char PASStemp[PASS_L];
  for (int i = 0; i < PASS_L + 1; i++) {
    PASStemp[i] = (char (EEPROM.read(i + 34)));
  }
  Serial.print(PASStemp);
  int EMAIL_L = EEPROM.read(98);
  if (EMAIL_L > 40) {
    EEPROM.write(98, 0);
    EEPROM.commit();
  }
  char EMAILtemp[EMAIL_L];
  for (int i = 0; i < EMAIL_L + 1; i++) {
    EMAILtemp[i] = (char (EEPROM.read(i + 99)));
  }
  int NAME_L = EEPROM.read(140);
  if (NAME_L > 40) {
    EEPROM.write(140, 0);
    EEPROM.commit();
  }
  char NAMEtemp[NAME_L];
  for (int i = 0; i < NAME_L + 1; i++) {
    NAMEtemp[i] = (char (EEPROM.read(i + 141)));
  }

  int timer = 0;
  while (continue_check == false) {
    if (timer == 60) {
      continue_check = true;
    }
    if (Serial.available() > 0) {
      continue_check = true;
      disable_blynk = true;
    }
    redOn();
    delay(500);
    redOff();
    blueOn();
    delay(500);
    blueOff();
    timer++;
  }

  redOn();
  if (disable_blynk == false) {
    redOff();
    greenOn();
    Blynk.begin(auth, SSIDtemp, PASStemp);
  }

}




void loop() {
  while (connected_to_computer == true) {
    redOff();
    blueOn();
    greenOff();
    Serial_Check();
  }
  if (Serial.available() > 0) {
    digitalWrite(16, HIGH);
    delay(1000);
    digitalWrite(16, LOW);
    Serial_Check();
  }

  if (disable_blynk == true) {
    redOff();
    blueOff();
    greenOn();
    delay(500);
    greenOff();
    delay(500);
  }

  if (disable_blynk == false) {
    Blynk.run();
  }
}



And you are right about the SSID this is what im getting:

The first part is the ESP mumble jumble but the ‘ÿ’ is problably whats screwing it up
ÈDpÈtAhlE¬ìxCÉðøBlueChairpsomewhereinthesun
ÿlueChairpsomewhereinthesun[7250] Connecting to 0.0.0.0:0
[12251] Connecting to 0.0.0.0:0
[17252] Connecting to 0.0.0.0:0
[22253] Connecting to 0.0.0.0:0
[27254] Connecting to 0.0.0.0:0

All the EEPROM variables are being saved with a CR (ascii 13).

Quick fix is to trim all the variables to remove all whitespace, not ideal as you will not be able to connect to SSID’s that contain spaces.

My WeMos connects ok now.

Try this Serial_Check with the trim’s included, providing your SSID doesn’t include spaces and let me know if it works.

void Serial_Check() {
  if (Serial.available() > 0) {
    char c;
    while (Serial.available() > 0) {
      c = Serial.read();
      if (c == 'c') {
        connected_to_computer = true;
        Serial.write('c');
      }
      if (c == 'T') {
        //        sendAlert();
      }
      if (c == 's') {
        String ssid = Serial.readString();
        ssid.trim();
        EEPROM.write(0, ssid.length());
        char buf[ssid.length()];
        ssid.toCharArray(buf, 32);
        for (int i = 0; i < 32; i++) {
          EEPROM.write(i + 1, (uint8_t)buf[i]);
        }
        EEPROM.commit();
        Serial.write('o');

      }
      if (c == 'p') {
        String pass = Serial.readString();
        pass.trim();
        EEPROM.write(33, pass.length());
        char buf[pass.length()];
        pass.toCharArray(buf, 63);
        for (int i = 0; i < 63; i++) {
          EEPROM.write(i + 34, (uint8_t)buf[i]);
        }
        EEPROM.commit();
        Serial.write('o');
      }
      if (c == 'e') {
        String email = Serial.readString();
        email.trim();
        EEPROM.write(98, email.length());
        char buf[email.length()];
        email.toCharArray(buf, 40);
        for (int i = 0; i < 39; i++) {
          EEPROM.write(i + 99, (uint8_t)buf[i]);
        }
        EEPROM.commit();
        Serial.write('o');
      }
      if (c == 'n') {
        String name = Serial.readString();
        name.trim();
        EEPROM.write(140, name.length());
        char buf[name.length()];
        name.toCharArray(buf, 40);
        for (int i = 0; i < 39; i++) {
          EEPROM.write(i + 141, (uint8_t) buf[i]);
        }
        Serial.write('o');
      }
      if (c == 'z') {
        continue_check = true;
        disable_blynk = false;
      }
      digitalWrite(16, LOW);
    }
  }
}

Thanks, but unfortunatly for me im still getting this in my terminal:

¶Hè‰ØhÉø@xàiÿBlueChair
somewhereinthesun[15252] Connecting to 0.0.0.0:0
[20253] Connecting to 0.0.0.0:0
[25254] Connecting to 0.0.0.0:0
[30255] Connecting to 0.0.0.0:0
[35256] Connecting to 0.0.0.0:0
[40257] Connecting to 0.0.0.0:0
[45258] Connecting to 0.0.0.0:0
[50259] Connecting to 0.0.0.0:0
[55260] Connecting to 0.0.0.0:0
[60261] Connecting to 0.0.0.0:0
[65262] Connecting to 0.0.0.0:0
[70263] Connecting to 0.0.0.0:0
[75264] Connecting to 0.0.0.0:0
[80265] Connecting to 0.0.0.0:0
[85266] Connecting to 0.0.0.0:0
[90267] Connecting to 0.0.0.0:0
[95268] Connecting to 0.0.0.0:0
[100269] Connecting to 0.0.0.0:0
[105270] Connecting to 0.0.0.0:0

Try a regular Blynk sketch as you have problems elsewhere.

It works fine and connects almost instantly

I don’t like ip 0.0.0.0 with port 0.

Describe your “internet connection” details.

my SSID is BlueChair
my Password is somewhereinthesun
its using DHCP
has no VPN or Port Forwarding
what else are you looking for?

Hey good news i found the problem hurray, when i let it sit for a minute without skipping using ‘z’ it connected, so now i will have to find out why this is happening!!

1 Like

I reduced timer from 60 to 10.

ok, ill try that. the reason i had it longer was because it took time for my device to respond to the program i wrote but i guess if it works the extra time wont matter - THANK YOU SO MUCH FOR YOUR HELP COSTAS

I’m facing the same problem, can you please explain in a little bit more detail how did you fix that.

This is a six year old topic which uses the legacy version of Blynk (which will be retired permanently in 96 days).

I suggest that you create a new “need help with my project” topic and provide ALL of the information that is requested when you do this.

Pete.