logo elektroda
logo elektroda
X
logo elektroda

[Solved] How to transfer data from ESP8266 to Arduino via serial port?

2775 3
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
  • #1 16891073
    Anonymous
    Anonymous  
  • ADVERTISEMENT
  • #2 16931969
    chemik22
    Level 14  
    Programming the ESP8266 can be done in an arduino environment just like other 'arduino' boards, the ESP8266 is basically a chip with quite a lot of capabilities. In principle you can transfer data freely as in this tutorial what you have shown between the ESP8266 and another arduino via the serial port.


    To start with, I advise you to buy an ESP8266 that has a serial to USB port converter right away to make it easy to program.... This makes it easier to upload software and work with this chip.... Something like NodeMCU v3 or v2 (if you are working on a contact board then rather v2 because it is a bit narrower). As a general rule, both are cool to start with and more. You can get one on Ali for a few zlotys and in PL the price is not discouraging either....
  • ADVERTISEMENT
  • #3 16932016
    aso824
    Level 13  
    The ESP8266-01 shown (as well as any other in this family) can work as a modem for any uC or run a standalone program.
    By default, when you buy the ESP8266-01 you should have firmware installed that will respond to AT commands on the terminal. You can then connect the ESP to the Arduino, send it AT commands, read the results.... it's a bit of an ordeal, because there is no good library to handle all this - at least I haven't found anything nice.
    On the other hand, I recommend the route of using the ESP with your own software, it's a really powerful CPU compared to the Arduino and on it you can program all the data processing by writing normally in the Arduino IDE and C++ (or even LUA after uploading NodeMCU - whatever you like) and send it via serial or I2C to anything else.

    I myself have recently shed my first blood in battle with ESP :D and I recommend just doing all the network logic on the ESP side, and possibly communicating with something else using any I2C type standard. An example project I did in a while, based just on ESP: https://eryk.io/2016/04/temperature-logging-to-thingspeak-using-esp8266-and-dht22/
    Note that there are no AT commands in the code, you don't have to worry about transmission, all the work is done by ESP.
  • #4 17157386
    Anonymous
    Anonymous  
ADVERTISEMENT