Example sketches for the new Arduino IDE for ESP8266

Moderator: igrr

User avatar
By danbicks
#13866 Byigrr,

Great example have it all connected and ticking.

My ESP loses connection I think this could be my router drops from time to time.

Does the current SDK build sort out a dropped connection, I know that in the new SDK they have addressed this problem. The Arduino IDE currently uses 9.5 sdk, do you know when it will be updated to 1.0 sdk compliant?

I will add some extra code in the void loop to check connection to client first, if not try and simply re connect without logging back in to the router, if this does not work I will re connect back to router and establish a client connection.

This should tell me if it is a router dropped connection issue or simply client has lost connection. If you have any other ideas please let me know.

PS: Is there any example of receiving a message from the broker and turning on an led if it recognizes a specific message? this would be great.


Big thanks Dans
User avatar
By amandaE
#14233 @ohra, did you figure your error out? I'm receiving the same error, using Yosemite, with ESP8266 WI07c Wifi Module purchased from Electrodragon roughly January 24th.
User avatar
By ajafferji
#36884 Hi, I am trying to compile the example sketch PubSubClient> mqtt_esp8266. My board is the NodeMCU 1.0.

I am however getting the following error. I have tried loads of things (installed new libraries, tried different versions of Arduino 1.6.5, 1.6.6 and today 1.6.7) but I always get the following error.

Arduino: 1.6.7 (Windows 7), Board: "NodeMCU 1.0 (ESP-12E Module), 80 MHz, Serial, 115200, 4M (3M SPIFFS)"

Build options changed, rebuilding all
C:\Users\Computer\Documents\Arduino\libraries\PubSubClient\examples\mqtt_esp8266\mqtt_esp8266.ino: In function 'void setup()':

mqtt_esp8266:44: error: 'setup_wifi' was not declared in this scope

setup_wifi();

^

mqtt_esp8266:46: error: 'callback' was not declared in this scope

client.setCallback(callback);

^

exit status 1
'setup_wifi' was not declared in this scope

This report would have more information with
"Show verbose output during compilation"
enabled in File > Preferences.


I am not sure what to try next, so any help would be appreciated.

Thanks