Cant connect to esp8266 using uno r3

Hi all,

I’m relatively new to electronics and the esp8266 so any help would be appreciated.

I am trying to connect to my esp8266 using my Arduino Uno R3 then have it send information from a sensor to the internet so I can access it with my phone. I also have tried using remotexy to control my arduino through the esp8266 using this guide with a voltage divider.
http://remotexy.com/en/help/start/arduino-esp8266-ss/

I can’t even get my esp to respond to AT commands in the serial monitor.

I upload a “bareminimum” sketch to my arduino to use it to communicate with my esp8266.
I put this "http://arduino.esp8266.com/stable/package_esp8266com_index.json " in my preferences in the arduino ide then download the esp8266 library in the board manager.

Here is the error message I get if I try to send a sketch to the esp8266 once I have selected it in the boards list:

Arduino: 1.8.9 (Windows 10), Board: “Generic ESP8266 Module, 80 MHz, Flash, Disabled, All SSL ciphers (most compatible), ck, 26 MHz, 40MHz, DOUT (compatible), 512K (no SPIFFS), 2, nonos-sdk 2.2.1 (legacy), v2 Lower Memory, Disabled, None, Only Sketch, 115200”

Build options changed, rebuilding all
Sketch uses 257096 bytes (51%) of program storage space. Maximum is 499696 bytes.
Global variables use 26540 bytes (32%) of dynamic memory, leaving 55380 bytes for local variables. Maximum is 81920 bytes.
esptool.py v2.6
2.6
esptool.py v2.6
Serial port COM9
Connecting……____Traceback (most recent call last):
File “C:\Users\Michael\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2/tools/upload.py”, line 25, in
esptool.main(fakeargs)
File “C:/Users/Michael/AppData/Local/Arduino15/packages/esp8266/hardware/esp8266/2.5.2/tools/esptool\esptool.py”, line 2653, in main
esp.connect(args.before)
File “C:/Users/Michael/AppData/Local/Arduino15/packages/esp8266/hardware/esp8266/2.5.2/tools/esptool\esptool.py”, line 468, in connect
raise FatalError(‘Failed to connect to %s: %s’ % (self.CHIP_NAME, last_error))
esptool.FatalError: Failed to connect to ESP8266: Timed out waiting for packet header
esptool.FatalError: Failed to connect to ESP8266: Timed out waiting for packet header

I tried deleteing the reinstalling the esp8266 library as that looks like were the issue is but I a bit out of my depth.
Are there better modules/easier ways for connecting your arduino to the net.
Although with the esp8266 I like the idea that you can use it as a standalone micro controller even if it doesnt have many GPIO pins.

Please help!
Regards, Michael from New Zealand

How do you have your ESP8266 wired to the Uno?

The same as this guide:
http://remotexy.com/en/help/start/arduino-esp8266-ss/
The one with the voltge divider in step 5
Would appreciate your help!
Cheers

That is the wiring you would use when communicating between a sketch running on your Uno and the ESP8266. However, you're not doing that. You're just using the Uno as a USB to TTL serial adapter to communicate directly between your computer and the ESP8266. For that usage, you need to switch the connections on the Uno. The Uno's pin 0 should be connected to the RX pin on the ESP8266 and the Uno's pin 1 should be connected to the TX pin on the ESP8266. Leave the voltage divider on the RX pin of the ESP8266 as you have it now.

Hi Pert,

So I connected up the esp8266 as you said but still not response from the AT command. I'm guessing the AT command needs to be in capitals and tried all the different baud rates but no luck.
I have uploaded the "bareminimum" sketch to my uno to use it as a serial converter.
The red led is turned on on the esp which is the power light and when I uploaded the bare minimum sketch it made the blue led on the esp flash if that makes any difference.

On a side note when I was trying to connect it to the remotexy app I did the following:
Uploaded the sketch from remotexy to turn the uno's led on pin 13 on and off.
This made the esp's blue light flash once a second.
In my serial monitor it showed the time with an arrow and AT next to it.
It would continue to do that for about 10 seconds before stopping.
I tried connecting to the esp's wifi on the app on my phone but it wouldn't pick it up

Ideally I want to communicate to the esp using AT commands then work my way up to uploading data to a server to access from my phone.

When I select the generic esp8266 in the board menu is shows heaps of different settings. Do I need to change these to match what version my esp is or does it automatically pick these up from the esp?

Sorry for all the questions...

Cheers

what esp8266 module do you have? how did you wire it? do you know how to activate and deactivate the flashing mode?

for AT firmware, the baud rate is 115200 baud and don't forget to select both line ends in the Serial Monitor line ending selection.

focus on one thing. don't mix AT firmware and Arduino esp8266 boards package. they are mutually exclusive.
which one do you want to solve first?

I have an esp 01 - the black version and I have wired it the same as this guide:
http://remotexy.com/en/help/start/arduino-esp8266-ss/
The one with the voltage divider in step 5 except of have changed over the rx and tx lines as Pert mentioned above.

No I don't really know how to activate/deactivate flashing mode. Seems to be a lot of conflicting messages on the net about esps...

From what I gather using the AT commands is the easiest way to set up the esp to connect to the net e.g changing the wifi mode or connecting to an access point.

I guess I just way to use the esp module. My first project is to use a ESP8266 ESP-01 + DHT11 Shield to upload temperature and humidity to the net so I can use my phone to see it and then be able to turn a relay on or off for watering my garden. At this stage i'm trying to use my uno as a serial converter to talk to and upload code to my esp.

Later I may want to add other inputs and outputs using my arduino as the esp01 only has 2 gpio pins.
Would other esp modules be easier for a beginner like me?

Any help is greatly appreciated!
Cheers, Michael

if you want to use the esp-01 as network adapter, focus on AT firmware. a new esp-01 has AT firmware. so forget the flashing mode and the esp8266 arduino boards package for now.
do you have an usb-to-ttl-serial adapter to connect the esp-01 to PC USB?

I have already done the following:
I put this "http://arduino.esp8266.com/stable/package_esp8266com_index.json " in my preferences in the arduino ide then downloaded the esp8266 library in the board manager.

Should I delete the esp8266 library if I'm just using At commands?

No I don't have a USB to TTL serial adapter so I am using my uno r3 as one by uploading a bare minimum sketch and wiring as I described above.

Would it be easier for me if I just got an adapter or used another module like a WeMos D1 R2 like this:

Thanks, Michael

you can let the esp8266 package installed.
the Wemos D1 is an esp8266 development board for esp8266 arduino. it has problems too. don’t jump from one thing to other. you have an esp-01, make it work.

so you have the esp-01 on RX and TX pins of Uno, RX to RX, TX to TX. the esp-01 has ground and 3.3 V wired to Uno. you select the COM port, open the Serial monitor, select 115200 baud, both line ends and enter AT. what happens.

Yea so I do exactly what you have said and when I press send the AT disappears and the TX led on the uno flashes and thats it.

I have 'Both NL and CR' and '115200 baud rate' selected, with autoscroll and timestamp as well. I have the generic esp8266 module selected as the board. Not sure if all the settings below that are correct... Does it get that information from the esp or do I have to find that stuff out about my board and change the settings manually?

Appreciate your help.

michaelb33:
Yea so I do exactly what you have said and when I press send the AT disappears and the TX led on the uno flashes and thats it.

I have 'Both NL and CR' and '115200 baud rate' selected, with autoscroll and timestamp as well. I have the generic esp8266 module selected as the board. Not sure if all the settings below that are correct... Does it get that information from the esp or do I have to find that stuff out about my board and change the settings manually?

Appreciate your help.

try to wire EN (CH_PD) pin of esp-01 to 3.3 V

Juraj:
try to wire EN (CH_PD) pin of esp-01 to 3.3 V

I do have the CH_PD connected to 3.3v the same as this guide
http://remotexy.com/en/help/start/arduino-esp8266-ss/

With the only difference being the rx and tx line of the arduino are switched around so its rx to rx and tx to tx.

michaelb33:
I do have the CH_PD connected to 3.3v the same as this guide
Arduino UNO + ESP8266 as a WiFi access point

With the only difference being the rx and tx line of the arduino are switched around so its rx to rx and tx to tx.

yes RX to RX is ok as Per explained above.
try to pull-up io 0 HIGH (over a resistor).
on esp-01S it should be pulled-up on board, but on esp-01 without S it is not

How do I do that?

Do I have the 3.3v going to one end of a resistor (what resistor? I have 220ohm, 1k and 10k)
then the other end going to ground with the gpio0 connected on the ground end of the resistor?

Cheers

I connected it the way I described above using 10k ohm resistor and I still get the same response. The only difference is when I connected the gpio0 pin to the ground end of the resistor it made the blue led on the esp flash once.

Cheers

michaelb33:
How do I do that?

Do I have the 3.3v going to one end of a resistor (what resistor? I have 220ohm, 1k and 10k)
then the other end going to ground with the gpio0 connected on the ground end of the resistor?

Cheers

10kOhm between 3.3V and io 0

I connected it the way you described above using 10k ohm resistor and I still get the same response. The only difference is when I connected the gpio0 pin to the resistor it made the blue led on the esp flash once.

Cheers

michaelb33:
I connected it the way you described above using 10k ohm resistor and I still get the same response. The only difference is when I connected the gpio0 pin to the resistor it made the blue led on the esp flash once.

Cheers

you wired it on power? the state is read at boot.

Yes I have one end of the 10k resistor connected to the power line of my bread board which is connected to the 3.3v of the uno as well as the vcc and ch pd of the esp. And the other end of the 10k connected to the gpio0 on the esp.

Is it likely my esp isn’t working correctly even thought the leds on it work?

Cheers