-->
Page 1 of 3

ESP-01, Arduino IDE 1.64, no Serial communications

PostPosted: Thu Jun 11, 2015 4:35 pm
by Jpissarro
Hi,

Started a project with an ESP-01, and trying to debug via Serial channel, but nothing appears on the Arduino IDE monitor. I can load the sketch via the same communication channel (COM13).

Tryied with a very simple sketch.


Code: Select all/* switch
 *
 * Each time the input pin goes from LOW to HIGH (e.g. because of a push-button
 * press), the output pin is toggled from LOW to HIGH or HIGH to LOW.  There's
 * a minimum delay between toggles to debounce the circuit (i.e. to ignore
 * noise). 
 *
 * David A. Mellis
 * 21 November 2006
 */

int inPin = 0;         // the number of the input pin
int outPin = 2;       // the number of the output pin

int state = HIGH;      // the current state of the output pin
int reading;           // the current reading from the input pin
int previous = HIGH;    // the previous reading from the input pin

// the follow variables are long's because the time, measured in miliseconds,
// will quickly become a bigger number than can be stored in an int.
long time = 0;         // the last time the output pin was toggled
long debounce = 200;   // the debounce time, increase if the output flickers

void setup()
{
  pinMode(inPin, INPUT);
  pinMode(outPin, OUTPUT);
  Serial.begin(115200);
  //Serial.swap();
  Serial.println("Program started!!!!!");
}

void loop()
{
  reading = digitalRead(inPin);

  // if the input just went from LOW and HIGH and we've waited long enough
  // to ignore any noise on the circuit, toggle the output pin and remember
  // the time
  if (reading == LOW && previous == HIGH && millis() - time > debounce) {
    if (state == HIGH)
      state = LOW;
    else
      state = HIGH;

    time = millis();
    Serial.println("Key pressed..."); 
  }

  digitalWrite(outPin, state);
 
  previous = reading;
}


What am I doing wrong?

Thanks
JP

Re: ESP-01, Arduino IDE 1.64, no Serial communications

PostPosted: Thu Jun 11, 2015 8:47 pm
by tytower
did your device blue light flash a lot when you up loaded code
did you leave the usb plugged in


Serial.begin(115200);

got your terminal set to 115200?
does your LED turn on at all

Re: ESP-01, Arduino IDE 1.64, no Serial communications

PostPosted: Thu Jun 11, 2015 11:58 pm
by Jpissarro
Think for the reply,

Yes, the blue LED blinkt during upload, the code is working (output is controlled by the input). And yes the USB is Still pluged in. The baudrate on the monitor is 115200.

On another sketch (webserver) If the serial monitor is open, the server does not accept connections (even a Ping to this IP adress). Very strange.

Re: ESP-01, Arduino IDE 1.64, no Serial communications

PostPosted: Fri Jun 12, 2015 2:58 am
by tytower
Jpissarro wrote:On another sketch (webserver) If the serial monitor is open, the server does not accept connections (even a Ping to this IP adress). Very strange.

Which webserver and what do you get out anything ? Ill load it up and have a look.