ESP8266 IC, the ESP-13 Wifi Shield HELP

This little bugger just won't seem to work? It spits out error after error... I bought it from jaycar NZ (https://www.jaycar.co.nz/arduino-compatible-esp-13-wifi-shield/p/XC4614) and it looked like it was gonna be easy! But no... it didn't come with the advertised Doit firmware instead it was some kind of AI-Think or something! I want to use this chip as an Arduino extension as it just slips on top perfectly. My end goal is to transmit temperature of my house to the world wide web for me to access at work... it seems simple enough on paper but its turning out to be an absolute nightmare.

What I'm begging for :sob:

  • Should i flash DoIt and how would i go about doing it..
  • Has anyone managed to get this board working?
  • Can i get much harder???

Cheers in advance guys I'm really clueless what to do here!

First of all, I'm afraid they ripped you off at Jaycar, (you can get a similar board/module with the exact same chipset for $3), so they should at least be able to give you some support for that astronomical price. The amount of documentation they have on their site is just a shame (especially at that price point).

The ESP8266 comes preloaded with an AT-firmware. You can send AT commands to it over the serial connection (UART). For example, if you send AT+CWJAP="My-WiFi-Network","password123", it will try to connect to a WiFi access point called "My-WiFi-Network" using the password "password123". (JAP = Join Access Point)
The ESP will then respond with "OK" on success, or return an error code if it fails.

Handling this communication all by yourself in your Arduino code by using Serial.print and Serial.read (e.g. Serial.println("AT+CWJAP=\"My-WiFi-Network\",\"password123\"");) is a real pain.
There should be some high-level libraries out there that handle the low-level communication for you, but I still have to find one that does everything I want and that is well documented.

As mentioned before, communication is done over a Serial UART connection. The Arduino UNO has only one hardware UART, that is used for debugging and programming the Arduino as well. That's why this shield has two DIP switches that connect and disconnect the ESP from the Arduino's UART pins. When uploading code to the Arduino, you have to disconnect it, when running the code using WiFi, you have to connect it. When it's connected, you can't use Serial.print for debugging, and in the Arduino Serial monitor you can only read the commands the Arduino sends to the ESP, not the responses/results of the ESP.
As you can see, it is a complete nightmare to debug.

An alternative would be to use SoftwareSerial (a UART on normal I/O pins emulated in software on the Arduino) to communicate with the ESP. This means that you can use the Hardware UART (the one connected to the USB connection) for debugging.
However, your board doesn't seam to support it. (You could use some jumper wires to connect the TX and RX of the ESP to some different pins of the Arduino, but you'll probably need a level shifter on RX.)

You could program the ESP directly as well, which is much easier (you can just program it like a normal Arduino).
Actually, the ESP8266's processor is 5 to 10 times faster than the one found on an Arduino UNO or MEGA, it has 40 times more RAM than an UNO, has up to 4MB of flash memory, and so on.
If you just want to send the temperature to a server, I would (personally) forget about the UNO and the shield, and get an ESP8266 development board. It has a USB interface that allows for Plug 'N' Play programming, just like an Arduino UNO, using the Arduino IDE. It has 11 I/O pins that you can use for reading your temperature sensor, and the WiFi code is much, much simpler and more readable than using AT commands.
You can get a WeMos D1 Mini clone for about $3.50.

Here's an example of a fully functional temperature logger with web interface, using only an ESP8266 and a temperature sensor:
https://tttapa.github.io/ESP8266/Chap16%20-%20Data%20Logging.html
And here's example code for sending sensor data to a server (complete with server-side PHP code as well):

Pieter

First things first, thank you so much for such a detailed and understandable response! You've answered questions I didn't even know the question for!

So I should be able to upload this code "Serial.println("AT+CWJAP="My-WiFi-Network","password123"");)" to my Arduino with the ESP switch 1 turned off and then with no hassle turn it on and it should run that code and connect to the defined network or is their something I'm missing?

Cheers Zak

Yes, pretty much. Just remember that the Arduino will start executing the code right away, before you connect the ESP, so you have to reset it after flicking the switches. Also make sure the baud rate is correct.

The difficult part is that you can't see the response of the ESP.
You could connect the RX line of a USB-to-Serial converter to the ESP's TX line. Then you can see what it's saying.
You can get these 3.3V/5V FT232 boards for $2 or $3 on Ebay etc:


You can also use it to upload code or new firmware to the ESP if you'd want to.
(You could also use a second Arduino as a USB-to-Serial adapter if you have one lying around.)

To check if the ESP is successfully connected to your network, you can use a tool like Fing (Android/iOS app) to perform a ping sweep. It will list all devices on the network.

Pieter

PieterP:
There should be some high-level libraries out there that handle the low-level communication for you, but I still have to find one that does everything I want and that is well documented.

I think WiFi Link is a candidate. I write some documentation for it, but for now Uno WiFi specific.
I like it because the library has the same api as Ethernet and WiFi library and the ESP side is an Arduino sketch for the ESP8266 using esp core libraries.
Uno WiFi & WiFi Link unofficial documentation