Is there a way to use esp8266 with arduino uno without using AT commands?

Hi ! Recently i have started to messing around with esp8266 wifi module(esp8266 esp-01) with arduino uno. I am using SoftwareSerial library and sending AT commands to communicate with the module. Today i tried to update the esp8266 module's AT firmware and after many attemps and couple hours wasted, i did it. It works the same right now. When running codes like" esp8266.println("AT") " or " esp8266.println("AT+CWMODE=1") ", i'm not getting OK responses sometimes(btw this is why i tried to update the firmware).

However if i bypass the arduino and connect esp8266 to arduino's hardware tx-rx, and type AT commands directly on serial monitor, it works flawlessly... This situation made me think "is there a better way to do this setup??". Or a proper way to do what im doing rightnow...
** //I'm using this setup to send some sensor data from arduino to thingspeak via esp8266.

While i was trying to update the AT firmware, i saw some other firmware options for esp8266. So can we use any other firmware option or different techniques to achive my goal here ?? Any other method to communicate with esp8266 through arduino uno?...

**//info: i'm powering esp8266 with arduino's 3.3V and using a 2200uF capasitor to provide more stable power (bec. i heard that esp8266 voltage spikes can cause malfunctioning sometimes) ///using pins 10,11 for software serial.
module that im using : esp8266 esp-01

///////////////////////////////*///////
/
///////* UPDATE ///**/////*/

i solved this issue:

i was powering esp01 with 3.3v from arduino and wasn't using voltage level shifter on the line to RX pin of esp01. Also i was using my esp01 at 115200 baut.

And here:

the problem with this was: i forgot to connect the GND of arduino to GND of the external power suply. it turns out they need to share a common GND to send signals to each other properly. you can read the details here: The Importance of Sharing Grounds | Majenko's Hardware Hacking Blog

Now im powering my esp01 externally through "AMS1117 3V3" regulator module. also im using a 16V 2200uF capacitor, and using a voltage level shifter (three 1k resistors) on the line to esp RX pin.
i set the baud rate of the esp01 to 9600 too. Now this setup works without any issue...

And for my original question "Is there a way to use esp8266 with arduino without using AT commands?" maybe instead of AT commands, i think i can still use the serial communication but this time with directly programing the esp8266-01 to read-send serial data between arduino. arduino will send data to esp01 through serial comm. esp01 will listen to get this sensor data from arduino and send this data to thingspeak with its own code.
i have no idea if this kind of setup would work but im gonna try and update next week.

Mistake. It really needs it's own 3.3V supply,

What ESP module are you using? Oh, you say ESP-01. Yes that can be used with an adapter board, or equivalent. I hope you are also using level translation resistors on the RX/TX lines

I tried to power it with "AMS1117 3V3" regulator module like this: I have a phone charger which has 5V & 1.55A output. I soldered two jumpers on its cable. im powering "AMS1117 3V3" with it and powering esp8266 with AMS1117's 3.3V output (with 2200uF capacitor). This setup powers the esp8266 but it doesnt respond to anything on serial monitor. I also tried to power AMS1117 through arduinos 5V output, this runs esp8266 and when i open serial monitor esp8266 says "ready" but then "wifi disconnected", and when i send "AT" it returns "ERROR". i dont have much knowledge about all of this so i dont know what im doin wrong here but it seems like i can make esp run normally with arduino 3.3V out since it doesnt give me any error when sending AT commands on serial monitor.

i saw many applications that directly connects rx-tx without resistors so i didnt use any logic level converters. This didnt seem like a problem to me since esp works perfectly fine when i directly communicate with it on serial monitor via hardware tx-rx.(like it connects to wifi, sends data without a problem everytime)

Online? I recently saw someone dump spaghetti on their head there. Doesn't mean I want to do it.

What are you using to test it with? The SerialPassthrough sketch?

I consider it a waste of time to support projects that don't follow normal engineering rules. Good luck.

It sounds like, you can connect to the ESP serial port, but when you try to go online with wifi, it fails. The device transmitter is turned off when there is no connection, so the supply current is much less. So, this is an indication that likely, it's not getting stable power.

Kindly check if the sender and receiver are working at the same baud rate.

If not, there would be no AT response that is readable. But that is why is asked about SerialPassThrough...

Yes there is but programming ESP8266-01 is uncomfortable.
You need a programming adapater like this
https://asperon.de/products/usb-auf-esp-01-esp8266-adapter-fur-programmierung-serial

The whole thing becomes much easier as soon as you use an ESP32-nodeMCU-board.
WIth the ESP32-nodeMCU-board
the ESP32-nodeMCU replaces the Ardunio totally.

Yes for sure.

You can kick out and left away the arduino, because the ESP32-nodeMCU can be programmed with the Arduino-IDE the exact same way as an arduino. Just plug in a USB-cable into the ESp32-nodeMCU-board and flash the code the eact same way as flashing an arduino

best regards Stefan

My own experience with the Uno and esp8266 was liberally using the delay command. Try the software serial and put delay(1000) or delay (2000) after each AT command.

i can send data online when i connect hardware rx tx and send this AT command set in serial monitor:
AT
AT+CWMODE=1
AT+CWJAP="wifiName","wifiPass"
AT+CIPSTART="TCP","ip",80
AT+CIPSEND="lenght"
"GET https://api.thingspeak.com/update?api_key=blablabla&field1=something"

this is why i think esp was working fine...

but when i use softwareSerial and use "esp8266.println("AT") " or " esp8266.println("AT+CWMODE=1") " in arduino code, i cant get OK most of the times. This i couldnt understand...

I CLEARLY said :

which means i'm not an engineer and i dont know anything about "normal engineering rules". So you can either help kindly or save your precious time and don't reply at all. Thank you.

its same yes, i checked :ok_hand:

yess it looks like im gonna switch to NodeMCU.... esp8266 is just pain.

Well, you don't have to be an engineer to follow common engineering advice. I never blame anyone for lack of knowledge, I once knew nothing. But, if you basically thumb your nose at it when you are told about it, you can't expect much sympathy.

I had some ideas for you but I'm out.

its not my fault that u didnt pay attention that i said "i dont know this stuff" and answered "I consider it a waste of time to support projects that don't follow normal engineering rules. Good luck."....

instead of that, you could simply reply "dude you should use logic level converters and a proper power suply then u can get more stable results" and i could say"ohh okay man im gonna try that and inform you"... dont act like im the arrogant one here...

You say you can’t get OK most of the time, does that mean sometimes you do?

Try delay(1000) right after your AT command and before you read the response,

yess with my old setup i can say 50-50 to getting OK or ERROR and i was using delay between AT commands but it turns the problem was this:

i solved it now and working good, didnt get any errors:

And GND of arduino to GND of external power suply....

if there is really a need for an Arduino beside the ESP8266 - you could consider to communicate via I2C (ESP as Master, Arduino as Slave). But honestly I think you can replace the Arduino by a larger NodeMCU or Wemos D1 as already mentioned.
One Microcontroller --> no Problem
Two Microcontrollers --> one Problem
... you can expand that list.

Its not really necessary to use arduino and esp8266-01 together. Im trying to work this out only bec. it became an obsession to make them work fine :smile:
Also im learning a lot of stuff on the way so i cant say they are wasting my time. Im not the "gotta reach the finish line asap" guy, im enjoying the ride and learning process. But im gonna start using NodeMCU boards like u recommend when i make a serious project.

Thank you so much, i will search for I2C connection that u mentioned. But i have 2 other things connected to arduino via I2C (one rtc and one aht10 sensor). I hope they dont cause a problem. //Update: i forgot these tiny esp01 modules only has 2 gpio's and they only support SPI so i think i can't connect it via I2C.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.