I try to do a small project via Wi-Fi, but the worst thing is to connect Uno and that damned ESP 8266. No matter which Firmware I use, no matter which library and attached examples, no matter even module itself - I bought 2 separated from different shops and both act exactly the same.
My every try cointains:
Arduino Uno
3.3V <-> 5V Logical Level Converter
ESP 8266
and nothing more.
Please, do me a favor and take a look at my latest try:
GPIO 0 and 2 are not connected. Tried even to switch pins 10/11 manually and as you may guess - nothing happened.
Program code:
#include <Arduino.h>
#include <SoftwareSerial.h>
#include <ESP8266_Simple.h>
// These are the SSID and PASSWORD to connect to your Wifi Network
#define ESP8266_SSID "name"
#define ESP8266_PASS "password"
ESP8266_Simple wifi(10,11);
// See HelloWorld example for further comments.
void setup()
{
Serial.begin(115200); // Reduce this if your Arduino has trouble talking so fast
Serial.println("ESP8266 Demo Sketch");
wifi.begin(9600);
wifi.setupAsWifiStation(ESP8266_SSID, ESP8266_PASS, &Serial);
// A blank line just for debug formatting
Serial.println();
}
void loop()
{
// This example is just to show you how to grab the IP address of your
// device after it has connected, in case you want to do something with
// it.
// You can get it either as a 16 byte string, or as a long unsigned integer
// representation.
char ipAddressString[16]; // 16 bytes needed
unsigned long ipAddressLong; // only 4 bytes needed
// Either way, you get the address exactly the same.
wifi.getIPAddress(ipAddressString);
wifi.getIPAddress(ipAddressLong);
// And then do what you like with it.
Serial.print("The string IP is: ");
Serial.println(ipAddressString);
Serial.print("The unsigned long IP is: ");
Serial.println(ipAddressLong);
// You can convert from one to the other
strcpy(ipAddressString,"127.0.0.1");
wifi.ipConvertDatatypeFromTo(ipAddressString,ipAddressLong);
Serial.print("The IP address "); Serial.print(ipAddressString);
Serial.print(" has integer value "); Serial.println(ipAddressLong);
ipAddressLong = 0x36F1256B;
wifi.ipConvertDatatypeFromTo(ipAddressLong,ipAddressString);
Serial.print("The integer value "); Serial.print(ipAddressLong);
Serial.print(" has IP address "); Serial.println(ipAddressString);
Serial.println("End of Demo");
Serial.println();
delay(5000);
}
You must buy a 3.3V AC adapter. The ESP8266 is power hungry and the Arduino Uno cannot supply the current that the ESP8266 needs.
Thanks for link, as I see it contains a lot of useful info, will check it when I wake up
In terms of power for ESP... It's not a big deal to get adapter, but then my question is - if it's required for ESP to work properly, why (at least) a dozen people managed to create working projects with ESP supplied with Uno?
Xenhil:
In terms of power for ESP... It's not a big deal to get adapter, but then my question is - if it's required for ESP to work properly, why (at least) a dozen people managed to create working projects with ESP supplied with Uno?
The AT firmware runs at 115200 baud by default. However, SoftwareSerial library does not work reliably at that speed. So you need to use the correct AT command to change the baud to 9600, which is the speed at which your sketch is currently configured to communicate with the ESP8266.
I also have a related question yet i'm a complete noob to arduino. And i have been following the guide in the link
to setup my wifishield with arduino uno. Also i am using a wifi router with no internet connection for the setup as my uni wifi restricts the usage. I proceed until recieving the IP then when i open it in the browser, the IP doesn't respond and fails to connect the server. any solution?
to setup my wifishield with arduino uno. Also i am using a wifi router with no internet connection for the setup as my uni wifi restricts the usage. I proceed until recieving the IP then when i open it in the browser, the IP doesn't respond and fails to connect the server. any solution?
to setup my wifishield with arduino uno. Also i am using a wifi router with no internet connection for the setup as my uni wifi restricts the usage. I proceed until recieving the IP then when i open it in the browser, the IP doesn't respond and fails to connect the server. any solution?
pert:
The AT firmware runs at 115200 baud by default. However, SoftwareSerial library does not work reliably at that speed. So you need to use the correct AT command to change the baud to 9600, which is the speed at which your sketch is currently configured to communicate with the ESP8266.
As far as I understand AT commands are used to control ESP, but my problem is -> I can't even "talk" to this module. I mean, it doesn't respond to any commands, not only checking IP/connecting to local network, but whole communication between me/arduino and the module doesn't work. ESP seems to be turned off even if red LED lights all the time on its surface.
However, while flashing firmware seems to work, I couldn't talk to my ESP using Arduino IDE serial monitor port - again, it doesn't respond to my AT command... well, AT command isn't even visible in that window:
Of course I picked correct COM port in Arduino IDE options, that's not a problem.
So my question is why can't I even insert simplest command "AT"? As I said in first post - no matter firmware version, no matter connection, no matter baud, no matter even supplying module -> got 3.3V adapter and still can't talk to my module.
Juraj:
and GPIO0 was grounded for flashing and is pulled HIGH for normal boot?
GPIO0 was grounded during flashing - no effects, as you can see in post above. For normal boot GPIO0 was unplugged, but decided to try high as you mentioned and still it didn't work.
Tried even using random program to check if ESP is visible. Well, it isn't. Beside flashing my module seems to be invisible in serial monitor and other places. The real question, is my device really updated? So it could connect through adapter to get flashed, but can't connect to let me communicate with him via AT commands? Seems weird...
ok. it is possible, that you flashed the firmware with wrong settings. if you have Windows, use the Espressif Flash Download Tool. it detects the settings and sets them into bootloader and the esp-init.bin before writing.