Using the new Arduino IDE for ESP8266 and found bugs, report them here

Moderator: igrr

User avatar
By JohnSL
#16521 I'm getting really frustrated with a single line of code:

Code: Select allWiFi.begin(ssid, password);

This line works perfectly with Arduino IDE 1.6.1 that I downloaded from the esp8266/Arduino GitHub release. However, when I try the exact same line using Arduino IDE 1.6.3 downloaded from Arduino.cc, along with version 0.0.4 of sandeepmistry/esp8266-Arduino, it refuses to connect. Instead, I get a bunch of what looks like logging information from that single call:

Code: Select allsl
scandone
usl
sul 7 0
Status: 6reconnect
rm match
pm close 7 0 0/14711153
scandone
add 0
aid 5
pm open phy_2,type:2 0 0

connected with socha, channel 1
dhcp client start...
cnt

Please, can someone tell me what's going on here? I'd really like to use Visual Micro, and I'm not able to get Visual Micro to work with IDE 1.6.1.

Thanks,
-- John
Last edited by JohnSL on Wed May 06, 2015 9:35 am, edited 1 time in total.
User avatar
By JohnSL
#16701 I did finally get Visual Micro to work with 1.6.1. What I didn't realize is that I needed to reload the tool change after changing platform.txt (using Tools => Visual Micro => Reload Toolchains).

I'd still like to know why I can't get WiFi.begin to work correctly with IDE 1.6.3. Any ideas?
User avatar
By jwatte
#17103 I have found that begin() may not return the online status right away, but if you wait a little bit and ask for the status, it will show as online.
Thus, you might want to do something like:
Code: Select allwifi.begin(ssid, key);
unsigned long now = millis();
while (millis() - now < 10000) {
  if (wifi.status() == WL_CONNECTED) {
    return SUCCESS;
  }
  delay(100);
}
return TIMEOUT;


The nice thing about this is that rather than sit in a delay loop inside the library, you can do other things while waiting for a connection. (I check the online status in my main loop, making it entirely event based.)