-2

This question already has an answer here:

I have bought an ESP8266-01 Wifi module last month, and I am trying to connect Arduino Uno to network so that I could connect to the MQTT broker. However, I failed to upload the sketch/communicate with ESP8266 module due to the error:

espcomm_open failed 
espcomm_upload_mem failed 
espcomm_upload_mem failed

I think the problem is wiring problem or power supply is unstable because the ESP8266 is required 3.3V to communicate. This is how I connect ESP8266 Wifi module to Arduino Uno, and I just simply connect Arduino Uno to USB port on my laptop:

Connection

I've been searching solutions on Internet and watching tutorials but ending up with getting the same error. In addition, I am not using any resistor, capacitor when I do the connection between ESP8266 & Arduino Uno.

These are my confusions as below:

  1. What is the best/easiest way to connect Arduino Uno to Wifi?
  2. How can I avoid power supply issues? Maybe a Serial Adapter Wireless development board or module?
  3. What do I need to connect Arduino Uno to Wifi?
  4. Is it possible to connect Arduino Uno to MQTT broker without using network? I found this Ardulink but I don't know how to deal with it
  5. Can external wifi shield solve my problem instead of using ESP8266-01?

Thank in advance

marked as duplicate by Juraj, VE7JRO, sempaiscuba, jsotola, per1234 Nov 8 '18 at 0:43

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • Are you trying to program the ESP8266 or program the Uno? – Majenko Nov 7 '18 at 17:53
  • @Majenko I'm trying to program ESP8266, I have selected the Generic ESP8266 Board and correct COM port before I upload the sketch. – Conard Nov 7 '18 at 18:15
  • By the way, is it possible to program Uno & ESP8266 at the same time? I mean I have code for recording student attendance and it is uploaded to Uno, and I would like to publish attendance record which is stored inside EEPROM through MQTT broker to database by using ESP8266 – Conard Nov 7 '18 at 18:20
  • 1
    why do you open new question same as the previous? – Juraj Nov 7 '18 at 18:20
  • your question is too broad. solve one thing at a time. if you have a sketch in Uno, did you consider to use the esp0-01 with AT firmware with WiFiEsp library? without uploading your code to esp-01. – Juraj Nov 7 '18 at 18:50
0

The Arduino board does not have enough current available to power the ESP8266. You should have a 3.3 volt supply that is capable of at least 500mA. The average current consumption is typically 80mA but the peak currents can go to 600mA during a start up calibration.

You also need to use a proper level converter to connect the RX and TX of each board. The ESP8266 is NOT 5 volt tolerant.

The ESP8266 can be programmed under the Arduino framework. This is how most people use it. (rather than using the AT command set the board comes with. This is what I suggest, but is not a requirement. If you do go that way I suggest you get a NodeMCU or a Wemos type board to learn with. Just working with the ESP8266 alone. They are cheap, they have a USB to serial converter, and they have a proper regulator for Vcc.

The ESP modules are not simple to power. You have to use a good regulator and have it electrically close to the board. No 20cm jumper wires.

Continuing on with your electrical connections. Reset is not connected to ground. It should be pulled up to 3.3 volts with a resistor, typically 10K.

And external WiFi shield is a simpler option. I prefer the ESP8266 since it has a fast processor, 80 or 160Mhz. Lots of ram and up to 1MB of program space. It is my go-to board. It is a little light on IO but that is easy to add. It is cheap, and there is a huge user base for it.

  • I am not really familiar with these electrical connection stuffs, is that any simple way for the beginners like me? To avoid these kind of problems like power supply issues. – Conard Nov 7 '18 at 18:26
  • By the way, thank for the reply. It's really informative – Conard Nov 7 '18 at 18:27
  • The simplest way to work with the ESP8266 is to start with a development board. The ESP-01 has too few pins and less flash memory than modules like the ESP-12F, or the boards I listed. It is OK if you need to do an interface with RX/TX as you had planned. But like I said, it needs to be 3.3V. If the 3.3 volt power/signal level is acceptable for the application I would consider doing it all with the ESP. I did a data logger for work with the ESP. SD card, a current measuring chip, LCD, 3 button input, and no WiFi, as I didn't need it. Lots of power for cheap. Check out esp8266.com – Rudy Nov 8 '18 at 0:15
  • The website I listed above is a great place to get help and answers. Some of the websites, blogs, that show how someone did something is pretty hit and miss. Some good information, and some bad. And if you don't already know the right answers then you often don't know if it is good or not. The ESP8266 with the Arduino framework has been around for a few years and it is much easier to start with it now compared to 2015 when things were starting to get developed with it. This is a good introduction arduino-esp8266.readthedocs.io/en/latest It all is pretty overwhelming at first. – Rudy Nov 8 '18 at 0:23

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