Go Down

Topic: Has anyone succeeded in getting this ESP8266 shield working with an Arduino? (Read 5949 times) previous topic - next topic

pert

Farady.
Had you understand what are the proposes of switches? Can you share some information about it?
1:connects Arduino pin 0(RX) to ESP8266 TX. Must be turned off when uploading to Arduino
2:connects Arduino pin 1(TX) to ESP8266 RX. Can be left on when uploading to Arduino
3: Enable ESP8266 firmware update. Leave off unless uploading firmware to ESP8266 via serial
4: connected to DFU LED. I believe this just provides a status indicator for ESP8266 firmware updates. Leave off unless uploading firmware to ESP8266 via serial

Do you have information about Pins? With one is in use by this shield and with I will be able to use on a next shield layer?
As I said before, the ESP8266 is connected to pins 0 and 1. All the other pins are unused.

Or better to use software serial for the wifi shield.
You will also need to connect the shield to pins other than 0 and 1 if you are going to do that

>If yes then do I just set the esp8266 to AP mode or do I have to set any other configuration in order to accept data over wifi?
You can use the ESP8266 in AP mode, which creates an access point you will need to connect your Android device to using the SSID and optionally password you configured in your sketch. You can also use it in STA(station) mode where the ESP8266 will connect to your existing network and any device connected to that network can communicate with the ESP8266.

The ESP8266 is running the AT firmware so you need to send the special AT commands to it over the serial connection to control the ESP8266. If you want an API similar to the Arduino Ethernet and WiFi libraries then I recommend the WiFiEsp library:
https://github.com/bportaluri/WiFiEsp
which handles all the AT commands for you.

Note that the WiFiEsp library will not work with the shield connected to pins 0 and 1 unless you edit the library to turn off the debug output(https://github.com/bportaluri/WiFiEsp/pull/46/files). If you use pins other than 0 and 1 that isn't necessary.


soellicha

Hello,

Pert thanks for the reply.  In addition to the above I just need your estimate opinion- not a solution , I will try to dig around with manuals-  ;  so, when I connect my android to the SSID of the arduino uno wifi >how do I send data? Plain data as string "hello"  or AT commands?
*That I know of AT commands usually are send over serial hardwired Tx/Rx pins and not over wifi

where do I find the story behind APIs?  I try and search the Github files for any mentioning of the AT commands and in the only file I see this , is in the EspDrv.cpp,  So is this the "translator" of the AT commands to Arduino language?

I connect to arduino wifi SSID with my phone and I send AT commands but with no response! Also after 20 seconds or so the TCP telnet connection is automatically closed on my phone!
*I think there must be another configuration in order to send AT commands through wifi!
Maybe configure ESP via putty first?

Thank you

pert

when I connect my android to the SSID of the arduino uno wifi >how do I send data? Plain data as string "hello"  or AT commands?
*That I know of AT commands usually are send over serial hardwired Tx/Rx pins and not over wifi
You're correct that you don't send AT commands over WiFi. There are various options. Probably the easiest for this application will be HTTP. An example is found at File > Examples > WebServerLED. So when a client connects to the ESP8266 the Arduino detects this and sends HTML to the client. In that example you are just clicking on links to control the LED but you can also serve HTML forms that allow you to easily send more complex data. Once the ESP8266 receives the HTTP request from the client the Arduino has to parse through it for the data and then respond as you wish. This system allows you to use the web browser on your Android device to control the Arduino.

where do I find the story behind APIs?
I'm not sure exactly what you mean by that. If you are asking where you can find documentation of the WiFiEsp API you need to understand that the library as much as possible to the same API as the Arduino WiFi library.This is very nice because it allows you to easily convert code written for the Arduino WiFi library and even the Arduino Ethernet library (which also has a similar API). The differences between the WiFiEsp library and the Arduino WiFi library are documented here:
https://github.com/bportaluri/WiFiEsp#supported-apis

I try and search the Github files for any mentioning of the AT commands and in the only file I see this , is in the EspDrv.cpp,  So is this the "translator" of the AT commands to Arduino language?
Not to the Arduino language, there is no Arduino language. It translates the WiFiEsp API to AT commands.

*I think there must be another configuration in order to send AT commands through wifi!
If you wanted to send an AT command to the ESP8266 through WiFi you'd need to send an arbitrary command from the Android device to the Arduino through the ESP8266 and have code running on the Arduino that then sends an AT command to the ESP8266 over serial.

JB38

Hello,
For those interested in,
after quite a long search on different topics I succeeded to make it working fine as a client transmitting Arduino variables to a PHP script on a server and getting back a value to transmit to Arduino :

https://projectsjb38.blogspot.com/2018/09/arduino-et-esp8266-esp-12e-uart-wifi.html


If it can save time to someone.

Go Up