3

I have an Arduino Uno and ESP8266. I want to connect and control an LED from a web server. I made a connection referring to this:

enter image description here

I uploaded the WifiWebServer code to the Arduino, and applied my router's credentials.

char ssid[] = "Router SSID";      // your network SSID (name) 
char pass[] = "Router's WPA Password"; `

I'm getting a "Wifi Shield not present" message from the Serial Monitor. I even tried giving external 3.3v power supply to my ESP8266 module, but no change. What am I missing here? Can someone help me fix this issue?

3
  • The WifWebServer isn't compatible with the ESP8266, look up example code for the ESP8266 in stead.
    – TheDoctor
    Dec 26, 2015 at 20:37
  • Yes, I looked up ESP8266 samples, sounds like we need to have FTDI to load WifiWebServer into ESP... Is there any other way to load Wifiserver into esp directly without FTDI?
    – ABI
    Dec 28, 2015 at 5:28
  • Actually I made a mistake assuming esp8266 itself can act as a Wifi-Shield when it is connected with Arduino Uno, But it won't. So we can't use any Wifi shield examples for Arduino with esp8266
    – ABI
    Jan 6, 2016 at 5:09

7 Answers 7

1

From your diagram, you appear to be using an ESP8266-01?

Another ESP8266 AT command library that may be of interest/use.

Note that the AT command libraries are very dependent on the version of the firmware that you have on the device. Depending on when/where you bought the device, this firmware will vary significantly. I've not had any of the libraries work correctly with current versions of the firmware.

Run the AT+GMR at command (using your serial terminal) to determine the firmware version. If you're on Windows/PC updating the firmware to a previous version (the 0.9.x.x range seems to be the most stable according to my research) is relatively straightforward. If you're on Mac, it's not as straightforward...

Official/current release of the firmware is available from Espressif's Github repo.

There are plenty of directions on the net for getting firmware onto the ESP8266 for both Mac and Windows/PC. YMMV as to their accuracy/ease of use.

Note that different versions of the firmware default to different baud rates. Some default to 115200, others to 9600. If you decide to use SoftwareSerial (rather than Serial, which your diagram suggests is what you're currently using) you'll need it to run on 9600. I've not personally tested what Serial supports up to (but my understanding is that you can run up to 115200). Note that there are different commands for setting the ESP8266 AT command firmware baud rate depending on the firmware version/supplier. The official SDK uses the AT+IPR=9600 command. This stores the baud rate to the device (i.e. you don't need to send it every time, just once and it's then persistent).

If you haven't already, I'd recommend you get the system working with a simple serial terminal program (CoolTerm, for example) before getting into Arduino-land.

Note that the ESP8266 does not reliably run from the 3v3 power rail on the Arduino. The ESP8266 requires up to 300mA, the Arduino is capability of around 50mA to my understanding. Symptoms of insufficient power include random resetting of the device. Best to run a separate 3v3 source to the ESP, or if you have a strong enough 5v supply, use a step-down converter. Your diagram indicates you're using a standard Arduino, which runs 5v out of the serial pins (or digital outs), but your comments indicate you're running 3v3 (which means you're probably running a 3v3 Pro Mini or similar)? If you're not running a 3v3 device, you'll definitely need to run a 5v-3v3 logic level converter (I can't link to examples due to not having enough reputation points—but these are relatively easy to get from SparkFun or similar. I picked up a combined step-down converter with logic level converter which does both tasks.

Lastly, If you don't need the ADC from the Arduino device for your application (which it sounds like you don't given your project description) I'd strongly recommend you reconsider the advice from gmag11 and yeti re: running Arduino on the ESP8266. It is much more stable, and the extra SRAM will make a big difference with processing/building HTTP request strings etc. I wasted a lot of time (unsuccessfully) trying to get AT commands working before switching to Arduino on the ESP8266, which has been a breeze by comparison.

3

You can program and upload code to ESP8266 using Arduino programming environment, reusing code and libraries with small changes. Check https://github.com/esp8266/Arduino for more information.

For most tasks ESP8266 may substitute Arduino board completely. It has more flash, more RAM and integrated WiFi, and is faster (80MHz).

2

The WiFiWebServer tutorial describes how to use the ArduinoWiFiShield. This shield is based on different WiFi hardware than the ESP8266 modules.

You need a WiFi library driving the ESP8266 modules instead, e.g WeeESP8266.

Your favourite internet finding machine sure will find lots of similar libraries.

A different approach would be ArduinESP (https://github.com/esp8266/Arduino), which means to develop code to run on the ESP8266 module directly.


...aaaand please rethink your wiring. The ESP8266 modules are a pure 3.3V pets and your wiring connects a 5V logic signal directly to the ESP8266 and this may send your ESP8266 into the digital heaven with or without waving goodbye using blue smoke...

1
  • Have ESP8266 library in my arduino & connected with 3.3V only, I don't want to directly upload firmware into ESP8266, but via Arduino Uno. and Wifi Shield is different from ESP8266 module. I use esp8266 only
    – ABI
    Dec 22, 2015 at 8:47
1

ArangaNathan has posted another Fritzing diagram with the same errors as the opening diagram:

  1. You can't drive the ESP8266 from the Arduino 3.3V pin as it can only supply 50mA but the ESP requires > 200mA to transmit properly.
  2. All I/O wires between Arduino and ESP must be level shifted from 5V to 3.3V otherwise you will damage the ESP. It may not happen straight away, but it will happen.
  3. If you wire Arduino Tx <-> ESP Tx and Arduino RX <-> ESP Rx you must remove the Arduino MCU chip completely before powering on, and use the Arduino IDE monitor to send commands to the ESP.
  4. If you don't remove the MCU then you have to wire Arduino TX->RX and Arduino Rx<-TX.
  5. If also you want to use the Arduino IDE in this mode (MCU installed) then you can't wire ESP TX/RX to D0/D1 and must use other pins instead (e.g. D2/D3) and SoftSerial to create another serial UART port.
0

Fritzing's wiring diagram has errors. 1) the serial connections wrong way around. You need to swap them so that Arduino TX -> ESP Rx and Arduino RX <- ESP Tx. Also 2) the ESP-01 require more than 200mA so supplying voltage reg cannot be provided from the Arduino 5V pin. It must be supplied by VIN with a supply able to provide 1A.

0

For the esp you must use an external 3.3v power source (300 mA or more), and a logic level converter for the esp Rx (arduino Tx is in 5v logic).

-1

Here is how to send commands to an ESP8266, without using an FTDI Programmer (NOTE: the IC used is LM117 (5V to 3.3v) IC for level shifting.)

ESP8266 connection diagram

1
  • Wait, it does not shift anything else than 5V to 3.3V. You have to shift other pins too.
    – Avamander
    Feb 9, 2016 at 20:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.