Example sketches for the new Arduino IDE for ESP8266

Moderator: igrr

User avatar
By igrr
#12777 One of the nice features of the ESP8266WiFi library bundled with the IDE is that it is mostly compatible with the standard Arduino WiFi Shield library. Some libraries like PubSubClient can therefore use ESP8266WiFi library without modifications.
Here is an example sketch that shows how to use PubSubClient on ESP8266:
https://gist.github.com/igrr/7f7e7973366fc01d6393
User avatar
By Mikejstb
#12828 I just downloaded the ESP-Arduino package, tried to compile your example, got the compile error so copied libiconv-2.dll over - now when I try to compile I get this -
Code: Select allArduino: 1.6.1 (Windows 8.1), Board: "Generic ESP8266 board"

[i]esp8266_pubsubclient.ino:1:26: fatal error: PubSubClient.h: No such file or directory

compilation terminated.

Error compiling.
[/i]

here's the verbose error info -
Code: Select allArduino: 1.6.1 (Windows 8.1), Board: "Generic ESP8266 board"

Build options changed, rebuilding all

Using library ESP8266WiFi in folder: D:\ESP8266\tools-utilites\arduino-1.6.1-windows\arduino-1.6.1\hardware\esp8266com\esp8266\libraries\ESP8266WiFi



D:\ESP8266\tools-utilites\arduino-1.6.1-windows\arduino-1.6.1/hardware/tools/esp8266/xtensa-lx106-elf/bin/xtensa-lx106-elf-g++ -D__ets__ -DICACHE_FLASH -ID:\ESP8266\tools-utilites\arduino-1.6.1-windows\arduino-1.6.1/hardware/tools/esp8266/sdk//include -c -Os -mlongcalls -mtext-section-literals -fno-exceptions -fno-rtti -std=c++11 -MMD -DF_CPU=80000000L -DARDUINO=10601 -DARDUINO_ESP8266_ESP01 -DARDUINO_ARCH_ESP8266 -ID:\ESP8266\tools-utilites\arduino-1.6.1-windows\arduino-1.6.1\hardware\esp8266com\esp8266\cores\esp8266 -ID:\ESP8266\tools-utilites\arduino-1.6.1-windows\arduino-1.6.1\hardware\esp8266com\esp8266\variants\esp01 -ID:\ESP8266\tools-utilites\arduino-1.6.1-windows\arduino-1.6.1\hardware\esp8266com\esp8266\libraries\ESP8266WiFi\src C:\Users\Michael\AppData\Local\Temp\build7464644365248102153.tmp\esp8266_pubsubclient.cpp -o C:\Users\Michael\AppData\Local\Temp\build7464644365248102153.tmp\esp8266_pubsubclient.cpp.o

esp8266_pubsubclient.ino:1:26: fatal error: PubSubClient.h: No such file or directory

compilation terminated.

Error compiling.


any ideas?

BTW - thanks for what must have been a ton of work to make this Arduino environment happen!
User avatar
By igrr
#12833 @Mikejstb
Did you get the PubSubClient library from Github? You need to unpack it and place it into your My Documents/Arduino/libraries directory (or whatever directory is configured as your sketch directory in Arduinio preferences).