Example sketches for the new Arduino IDE for ESP8266

Moderator: igrr

User avatar
By bobcroft
#37450 Aj, I think your problem is due to using the wrong pubclientlibrary. It is very confusing because there are at least two libraries with the same name, one is by Nick O'leary and the other one is a variation of that library by Imroy. I completely removed the O'Leary library and installed the Imroy version. I could then compile the included examples and later my own sketches. Once you change libraries you need to re-start the Arduino IDE for it to register the new library. I strongly suggest try the include examples with the library. also you need to be running version 1.6.5 of the IDE and the latest stable version of ESPArduino which was released in November (version 2 I think)

Bob
User avatar
By David Pickel
#40299 im having the same issue. im unable to compile the example to the esp8266 01
any help?

ajafferji wrote: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
User avatar
By krzychb
#40440 @David Pickel
@pyrotecbln

I really think you should follow post by bobcroft.
ESP8266 compatible library by Imroy is available here.

Then do the test using exact example sketch taken from the above library - I do not see any mqtt_esp8266.ino among examples in this library.


Krzysztof