Chat here is you are connecting ESP-xx type modules to existing AVR based Arduino

Moderator: igrr

User avatar
By estratos
#77561 I have a code developped for the ESP8266 under the Arduino IDE that has been flashed on hundred of ESP-12E modules with great success. Yesterday I tried to flash this same code into multiple ITEAD Xbee ESP8266 modules (https://www.itead.cc/wee-serial-wifi-module.html). Flashing the modules works fine, serial comms works, AP mode works, everything seems to work fine... except connecting to an AP. I initially thought that different pin definitions could afect WiFi so I tried with multiple board definitions (Generic ESP8266, ESP-12E development board, etc). But nothing, WiFi.begin(ssid, password) never works despite of the time waiting for it to complete.

Has anyone experience with these modules from the Arduino IDE? Should I maybe use a different board definition not included in the standard ESP8266 Arduino release? One of the things that is driving me crazy is the fact that AP mode works but not connecting to an external AP.

As a side note, the default AT interface provided by ITEAD does not seem to work either when tryint to conect to an AP. Of course, I've also posted a support ticket on ITEAD's support center.

Thanks so much guys for your support. Kind regards,

Daniel.
User avatar
By QuickFix
#77562 This is what I should do:
  • Connect a brand new ("Clean") board to the Bee interface
  • Download the current AT firmware from Espressif and flash it to the board
  • Take your favorite terminal emulator (eg. PuTTY) and connect to your board
  • Play with the available AT-commands to see if everything works as expected
  • See where it fails, ie. switch modes between Station, SoftAP & AP with +CW_MODE
If it doesn't fail you know the ESP itself is working properly.
User avatar
By estratos
#77565 Thanks @QuickFix,

No need to flash the latest AT firmware since I made the default provided AT firmware work. I was simply forgetting to quote both the ssid and the password... :-(

AT+CWJAP="ssid","12345678"

Now that I know that the WiFi interface is working, I wonder what I should modify on my code (previously working on many ESP-12E modules) to make it work on the Xbee ESP8266 board as well. the following is the piece of code used to connect to the WiFi network:

Code: Select all// Connect to WiFi network
WiFi.begin(ssid, password);

Serial.print("\n\r \n\rWorking to connect");

// Wait for connection
while ((WiFi.status() != WL_CONNECTED))
{
  delay(500);
  Serial.print(".");
}

Serial.println(Connected!);


Printing WIFI.status() in the while loop shows mainly WL_DISCONNECTED statuses but also sometimes WL_CONNECT_FAILED and WL_NO_SSID_AVAIL. I feel like this ESP8266 Bee boards handle the WiFi differently, probably because the use an older ESP8266 IC, I don't know. My years working with the ESP-12E modules with great success made me think that working with other ESP8266 modules would not require me to change anything in my code. Moreover, there is very little information about these Bee modules in the network.

Thanks so much for your time.