user51951: I am facing a issue with the ESP8266-01 as the following below:
chksum 0x42
csum 0x42
~ld
ets Jan 8 2013,rst cause:4, boot mode:(1,0)
wdt reset
Anyone has the solution please help!!
#include <LiquidCrystal.h>  //Load liquid Crystal Library
LiquidCrystal LCD(12, 11, 5, 4, 3, 2);  //Create Liquid Crystal Object called LCD
#include <ESP8266WiFi.h>

const char* ssid     = "your-ssid";
const char* password = "your-password";
const char* host = "your-localhost";

#define in 7
#define out 8
#define trigPin 10
#define echoPin 13
#define relay 2
#define led 6            //red color
#define led2 A0           //yellow color
#define led3 9           //green color

int count = 0;

int distanceCm;
long duration;

void IN()
{
    count++;
    LCD.clear();
    LCD.print("Number of Item:");
    LCD.setCursor(0,1);
    LCD.print(count);
    delay(10);
    LCD.setCursor(3,1);
    LCD.print(distanceCm);
    delay(10);
    LCD.setCursor(6,1);
    LCD.print(" cm");
    if(distanceCm <= 3){
     delayMicroseconds(10);
     LCD.setCursor(10,1);
     LCD.print("Full");
     digitalWrite(led, HIGH);
  }else{
    digitalWrite(led, LOW);
  }

  if(distanceCm > 3 && distanceCm <= 5){
     delayMicroseconds(10);
     LCD.setCursor(10,1);
     LCD.print("Enable");
     digitalWrite(led2, HIGH);
  } else{
    digitalWrite(led2, LOW);
  }

  if(distanceCm > 5){
     delayMicroseconds(10);
     LCD.setCursor(10,1);
     LCD.print("Empty");
     digitalWrite(led3, HIGH);
  } else {
    digitalWrite(led3, LOW);
  }
  delay(500);
}

void OUT()
{
  count--;
  LCD.clear();
  LCD.print("Number of Item:");
  LCD.setCursor(0,1);
  LCD.print(count);
  delay(10);
  LCD.setCursor(3,1);
  LCD.print(distanceCm);
  LCD.setCursor(6,1);
  LCD.print(" cm");
   if(distanceCm <= 3){
     delayMicroseconds(10);
     LCD.setCursor(10,1);
     LCD.print("Full");
     digitalWrite(led, HIGH);
  }else{
    digitalWrite(led, LOW);
  }

  if(distanceCm > 3 && distanceCm <= 5){
     delayMicroseconds(10);
     LCD.setCursor(10,1);
     LCD.print("Enable");
     digitalWrite(led2, HIGH);
  } else{
    digitalWrite(led2, LOW);
  }

  if(distanceCm > 5){
     delayMicroseconds(10);
     LCD.setCursor(10,1);
     LCD.print("Empty");
     digitalWrite(led3, HIGH);
  } else {
    digitalWrite(led3, LOW);
  }
  delay(500);
}

void setup() {
  // put your setup code here, to run once:
  Serial.begin(115200);
  delay(10);

  pinMode(trigPin, OUTPUT);
  pinMode(echoPin, INPUT);

  pinMode(led, OUTPUT);
  pinMode(led2, OUTPUT);
  pinMode(led3, OUTPUT);

  LCD.begin(16,2);
  LCD.print("Item Counter");
  delay(2000);

  pinMode(in, INPUT);
  pinMode(out, INPUT);
  pinMode(relay, OUTPUT);

  LCD.clear();
  LCD.print("Item In Box:");
  LCD.setCursor(0,1);
  LCD.print(count);

  // We start by connecting to a WiFi network

  Serial.println();
  Serial.println();
  Serial.print("Connecting to ");
  Serial.println(ssid);

  WiFi.begin(ssid, password);

  while (WiFi.status() != WL_CONNECTED) {
    delay(500);
    Serial.print(".");
     // ESP.wdtFeed();
  }

  Serial.println("");
  Serial.println("WiFi connected");  
  Serial.println("IP address: ");
  Serial.println(WiFi.localIP());

 // ESP.restart();
}

int value = 0;

void loop() {

 delay(0);
 delay(5000);
  ++value;

  digitalWrite(trigPin, LOW);
  delayMicroseconds(10);
  digitalWrite(trigPin, HIGH);
  delayMicroseconds(50);
  digitalWrite(trigPin, LOW);

  duration = pulseIn(echoPin, HIGH);
  distanceCm = duration * 0.034/2;

//******************************************************//
//IR Sensor Counting Object
  if(digitalRead(in))
  IN();
  if(digitalRead(out))
  OUT();

  if(count<=0)
  {
    LCD.clear();
    digitalWrite(relay, LOW);
    LCD.clear();
    LCD.print("No Item in box");
    LCD.setCursor(0,1);
    LCD.print("box is empty");
    delay(200);
  }
   else{
    digitalWrite(relay, HIGH);
   }

  Serial.print("connecting to ");
  Serial.println(host);

  // Use WiFiClient class to create TCP connections
  WiFiClient client;
  const int httpPort = 8095;
  if (!client.connect(host, httpPort)) {
    Serial.println("connection failed");
    return;
  }
  if(WiFi.status() != WL_CONNECTED){
    WiFi.begin(ssid,password);
    while (WiFi.status()!= WL_CONNECTED)
    {
      Serial.println("Waiting for connection");
      delay(0);
    }
  }

  String IRCount, myDistance;
  IRCount = String(count);
  myDistance = String(distanceCm);
  // We now create a URI for the request
  String url = "/Registration/write_data.php";
  url += "?item=";
  url += IRCount;
  url += "&distance=";
  url += myDistance;

  Serial.print("Requesting URL: ");
  Serial.println(url);

  // This will send the request to the server
  client.print(String("GET ") + url + " HTTP/1.1\r\n" +
               "Host: " + host + "\r\n" + 
               "Connection: close\r\n\r\n");
  int timeout = millis() + 5000;
  while (client.available() == 0) {
    if (timeout - millis() < 0) {
      Serial.println(">>> Client Timeout !");
      client.stop();
      return;
    }
  }

  // Read all the lines of the reply from server and print them to Serial
  while(client.available()){
    String line = client.readStringUntil('\r');
    Serial.print(line);
  }

  Serial.println();
  Serial.println("closing connection");
  delay(0);
}


user37622: esp-01 has 4 io pins: RX, TX, io 0 and io 2. other pins are not accessible. io 6 to io 11 are wired to on-board flash memory and can't be used.
what are you thinking by using other pins then 0 and 2? how did you wire those sensors and leds to esp-01?

51951: <p>I am facing a issue with the ESP8266-01 as the following below:</p>

<p>chksum 0x42
csum 0x42
~ld
ets Jan 8 2013,rst cause:4, boot mode:(1,0)
wdt reset</p>

<p>Anyone has the solution please help!!</p>

<pre><code>#include &lt;LiquidCrystal.h&gt;  //Load liquid Crystal Library
LiquidCrystal LCD(12, 11, 5, 4, 3, 2);  //Create Liquid Crystal Object called LCD
#include &lt;ESP8266WiFi.h&gt;

const char* ssid     = "your-ssid";
const char* password = "your-password";
const char* host = "your-localhost";

#define in 7
#define out 8
#define trigPin 10
#define echoPin 13
#define relay 2
#define led 6            //red color
#define led2 A0           //yellow color
#define led3 9           //green color

int count = 0;

int distanceCm;
long duration;

void IN()
{
    count++;
    LCD.clear();
    LCD.print("Number of Item:");
    LCD.setCursor(0,1);
    LCD.print(count);
    delay(10);
    LCD.setCursor(3,1);
    LCD.print(distanceCm);
    delay(10);
    LCD.setCursor(6,1);
    LCD.print(" cm");
    if(distanceCm &lt;= 3){
     delayMicroseconds(10);
     LCD.setCursor(10,1);
     LCD.print("Full");
     digitalWrite(led, HIGH);
  }else{
    digitalWrite(led, LOW);
  }

  if(distanceCm &gt; 3 &amp;&amp; distanceCm &lt;= 5){
     delayMicroseconds(10);
     LCD.setCursor(10,1);
     LCD.print("Enable");
     digitalWrite(led2, HIGH);
  } else{
    digitalWrite(led2, LOW);
  }

  if(distanceCm &gt; 5){
     delayMicroseconds(10);
     LCD.setCursor(10,1);
     LCD.print("Empty");
     digitalWrite(led3, HIGH);
  } else {
    digitalWrite(led3, LOW);
  }
  delay(500);
}

void OUT()
{
  count--;
  LCD.clear();
  LCD.print("Number of Item:");
  LCD.setCursor(0,1);
  LCD.print(count);
  delay(10);
  LCD.setCursor(3,1);
  LCD.print(distanceCm);
  LCD.setCursor(6,1);
  LCD.print(" cm");
   if(distanceCm &lt;= 3){
     delayMicroseconds(10);
     LCD.setCursor(10,1);
     LCD.print("Full");
     digitalWrite(led, HIGH);
  }else{
    digitalWrite(led, LOW);
  }

  if(distanceCm &gt; 3 &amp;&amp; distanceCm &lt;= 5){
     delayMicroseconds(10);
     LCD.setCursor(10,1);
     LCD.print("Enable");
     digitalWrite(led2, HIGH);
  } else{
    digitalWrite(led2, LOW);
  }

  if(distanceCm &gt; 5){
     delayMicroseconds(10);
     LCD.setCursor(10,1);
     LCD.print("Empty");
     digitalWrite(led3, HIGH);
  } else {
    digitalWrite(led3, LOW);
  }
  delay(500);
}

void setup() {
  // put your setup code here, to run once:
  Serial.begin(115200);
  delay(10);

  pinMode(trigPin, OUTPUT);
  pinMode(echoPin, INPUT);

  pinMode(led, OUTPUT);
  pinMode(led2, OUTPUT);
  pinMode(led3, OUTPUT);

  LCD.begin(16,2);
  LCD.print("Item Counter");
  delay(2000);

  pinMode(in, INPUT);
  pinMode(out, INPUT);
  pinMode(relay, OUTPUT);

  LCD.clear();
  LCD.print("Item In Box:");
  LCD.setCursor(0,1);
  LCD.print(count);

  // We start by connecting to a WiFi network

  Serial.println();
  Serial.println();
  Serial.print("Connecting to ");
  Serial.println(ssid);

  WiFi.begin(ssid, password);

  while (WiFi.status() != WL_CONNECTED) {
    delay(500);
    Serial.print(".");
     // ESP.wdtFeed();
  }

  Serial.println("");
  Serial.println("WiFi connected");  
  Serial.println("IP address: ");
  Serial.println(WiFi.localIP());

 // ESP.restart();
}

int value = 0;

void loop() {

 delay(0);
 delay(5000);
  ++value;

  digitalWrite(trigPin, LOW);
  delayMicroseconds(10);
  digitalWrite(trigPin, HIGH);
  delayMicroseconds(50);
  digitalWrite(trigPin, LOW);

  duration = pulseIn(echoPin, HIGH);
  distanceCm = duration * 0.034/2;

//******************************************************//
//IR Sensor Counting Object
  if(digitalRead(in))
  IN();
  if(digitalRead(out))
  OUT();

  if(count&lt;=0)
  {
    LCD.clear();
    digitalWrite(relay, LOW);
    LCD.clear();
    LCD.print("No Item in box");
    LCD.setCursor(0,1);
    LCD.print("box is empty");
    delay(200);
  }
   else{
    digitalWrite(relay, HIGH);
   }

  Serial.print("connecting to ");
  Serial.println(host);

  // Use WiFiClient class to create TCP connections
  WiFiClient client;
  const int httpPort = 8095;
  if (!client.connect(host, httpPort)) {
    Serial.println("connection failed");
    return;
  }
  if(WiFi.status() != WL_CONNECTED){
    WiFi.begin(ssid,password);
    while (WiFi.status()!= WL_CONNECTED)
    {
      Serial.println("Waiting for connection");
      delay(0);
    }
  }

  String IRCount, myDistance;
  IRCount = String(count);
  myDistance = String(distanceCm);
  // We now create a URI for the request
  String url = "/Registration/write_data.php";
  url += "?item=";
  url += IRCount;
  url += "&amp;distance=";
  url += myDistance;

  Serial.print("Requesting URL: ");
  Serial.println(url);

  // This will send the request to the server
  client.print(String("GET ") + url + " HTTP/1.1\r\n" +
               "Host: " + host + "\r\n" + 
               "Connection: close\r\n\r\n");
  int timeout = millis() + 5000;
  while (client.available() == 0) {
    if (timeout - millis() &lt; 0) {
      Serial.println("&gt;&gt;&gt; Client Timeout !");
      client.stop();
      return;
    }
  }

  // Read all the lines of the reply from server and print them to Serial
  while(client.available()){
    String line = client.readStringUntil('\r');
    Serial.print(line);
  }

  Serial.println();
  Serial.println("closing connection");
  delay(0);
}
</code></pre>
 37622: <p>esp-01 has 4 io pins: RX, TX, io 0 and io 2. other pins are not accessible. io 6 to io 11 are wired to on-board flash memory and can't be used.</p>

<p>what are you thinking by using other pins then 0 and 2? how did you wire those sensors and leds to esp-01?</p>
