Chat freely about anything...

User avatar
By microdot
#33110 I have my ESP8266 configured as a station.

It has a static IP address from the WIFI router in my house - assigned by DHCP reservation - so it is always the same IP address.

The ESP8266 is attached to the hardware serial pins (0 and 1) of my Arduino Duo (I think it is a genuine one).

Using the serial monitor of the Arduino software I can send AT commands to the ESP8266 just fine.

In this way, typing AT commands directly into serial monitor I can pass values successfully to a Thingspeak channel - hoorah! :D

The problem is, as soon as I try to do the same thing via a sketch running on the Arduino it is as if the serial comms between the Arduino and the ESP8266 have been lost.

The LED on the arduino board illuminates when data is sent from the serial monitor on the PC (the PC is connected to the Arduino's USB port) but the AT commands to not seem to execute on the ESP8266 - or at least there is no response to those AT commands being shown in the serial monitor on the PC.

I'm convinced that I must be going wrong somewhere on something very simple.

Can anyone please help?
User avatar
By microdot
#33621 I managed to get it working.

The fix was to have the arduino connected to the laptop via the USB cable connected to the arduino's serial pins (0 and 1) and to have the ESP8266 connected to the arduino on another pair of serial pins (I used 10 and 11) and write the sketch so that any serial data intended for the ESP8266 was sent/received on pins 10 and 11 using the softwareserial.h library.

I also learned that configured in this way any output from the ESP8266 isn't automatically echoed back to the serial monitor on the laptop so if I want any debug messages to be written to the serial monitor I have to actually write code in my sketch to do that.

I'm a complete noob at this but I'm making progress - slowly :geek: