1

I've searched the internet quite a bit and all I find is how to make two esp8266 communicate. What I am trying to do is connect a single esp8266 to the arduino and have a two-way communication between them.

I want to send and receive data on both the Arduino and ESP8266. The concept is to send data to the esp8266 over WiFi connection and then send that data to the Arduino. The Arduino will manipulate it and send it back over WiFi.

I feel like this would be a common beginner example to have a two-way communication over a TX/RX connection, but I can't seem to find any. All examples I find are strictly one as sender and other as receiver.

  • 1
    Are you using the AIThinker AT firmware for the ESP8266? – Majenko Jan 18 '17 at 23:01
1

See How can I verify that my ESP8266 is working? asked 2 hours before.

use something like https://www.sparkfun.com/products/12009 or https://learn.adafruit.com/arduino-tips-tricks-and-techniques/3-3v-conversion

Usual way is let the Arduino direct the ESP, but if you are able to program ESP too, then any communication can work the same way as between twou ESPs or two Arduinos (with the level shift in mind)

0

The best way for connecting ESP8266, Arduinos and devices like displays, RTC, etc., is using the serial protocol I2C.

I2C is a master-slave protocol. In this case, ESP8266 will be your master, and every other device (including Arduino) will be a slave. Every slave had an address, for id purposes. You can have up to 127 slaves, in theory, but real limits is determined by space, distance, capacitance, etc.

Only masters can initiate communication, so you have to program your ESP8266 to poll the the Arduino for sending back the processed information.

Connection is simple. For a I2C device (slave or master), you need Vcc and GND, plus two lines for communication: SDA and SCL.

For programming, you have lots of tutorials and examples on how to use I2C.

Both ESP8266 and Arduino (an many others MCU I think) can speak I2C. I strongly recommend you to adopt this protocol for everything. If you want to buy some device (like a display), always looks for the I2C version.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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