Example sketches for the new Arduino IDE for ESP8266

Moderator: igrr

User avatar
By kas
#29978
I'm not convinced I have the same *h *cpp source code as you but I'm mostly sure I have the same IDE and compiler.

Make sure there is only one MQTT.h / MQTT.cpp on your machine

This is my pubsubclient-master folder
Move (don't rename) your folder to a safe place, unzip my files in ...\Arduino\libraries, and test
You do not have the required permissions to view the files attached to this post.
User avatar
By picstart
#30004 Make sure there is only one MQTT.h / MQTT.cpp on your machine ..done

This is my pubsubclient-master folder
Move (don't rename) your folder to a safe place, unzip my files in ...\Arduino\libraries, and test '....done

Result
There are far fewer compile errors but still there is probably a hidden dependency on a file containing type defs that results in the compile error below.
My compiling is with Windows 7 pro 64 bit ....Are you compiling with Unix?
Kas ....Thanks for helping

Errors

[code]
In file included from C:\Program Files (x86)\Arduino\libraries\pubsubclient-master\src/PubSubClient.h:17:0,
from MQTT_led_V1.06.ino:18:
C:\Program Files (x86)\Arduino\libraries\pubsubclient-master\src/MQTT.h:278:33: error: '__FlashStringHelper' does not name a type
Publish(String topic, const __FlashStringHelper* payload);
^
C:\Program Files (x86)\Arduino\libraries\pubsubclient-master\src/MQTT.h:278:54: error: ISO C++ forbids declaration of 'payload' with no type [-fpermissive]
Publish(String topic, const __FlashStringHelper* payload);
^
Error compiling.[/code]
User avatar
By kas
#30033 OK, last try ;)

For some reasons, you may have an outdated WString.h
Make sure you only have one WString.h/WString.cpp on your machine
Please replace WString.h/WString.cpp with mines
They should be burried there: C:\Users\...\AppData\...\Arduino15\packages\esp8266\hardware\esp8266\1.6.5-...\cores\esp8266\
Let me know the outcome, I am really eager to have this matter solved

FWIW, this page may be of interest
.
You do not have the required permissions to view the files attached to this post.
User avatar
By picstart
#30048 Most IDE's are unduly convoluted ( way too many files and interdependence between files) Arduino is no exception. I come from a PIC development system in which stable coding encourages few *h files and few inter dependencies between *h and *c files.
In that regard Arduino provides a window on the dependencies actually used but can only point out the inconsistencies via error in the compilation.
Below is the verbose information from the failed compile.
Action
Please replace WString.h/WString.cpp with mines
They should be burried there: C:\Users\...\AppData\...\Arduino15\packages\esp8266\hardware\esp8266\1.6.5-...\cores\esp8266\...done

The error persists

[code]Arduino: 1.6.5 (Windows 7), Board: "Generic ESP8266 board"

Using library ESP8266WiFi in folder: C:\Users\******\Documents\Arduino\hardware\arduino-esp8266-master\esp8266\libraries\ESP8266WiFi
Using library PubSubClient in folder: C:\Program Files (x86)\Arduino\libraries\pubsubclient-master
Using library Ticker in folder: C:\Users\******\Documents\Arduino\hardware\arduino-esp8266-master\esp8266\libraries\Ticker

C:\Users\******\Documents\Arduino\hardware\arduino-esp8266-master/tools/xtensa-lx106-elf/bin/xtensa-lx106-elf-g++ -D__ets__ -DICACHE_FLASH -IC:\Users\******\Documents\Arduino\hardware\arduino-esp8266-master/tools/sdk//include -c -Os -mlongcalls -mtext-section-literals -fno-exceptions -fno-rtti -std=c++11 -MMD -DF_CPU=80000000L -DARDUINO=10605 -DARDUINO_ESP8266_ESP01 -DARDUINO_ARCH_ESP8266 -IC:\Users\******\Documents\Arduino\hardware\arduino-esp8266-master\esp8266\cores\esp8266 -IC:\Users\******\Documents\Arduino\hardware\arduino-esp8266-master\esp8266\variants\esp01 -IC:\Users\******\Documents\Arduino\hardware\arduino-esp8266-master\esp8266\libraries\ESP8266WiFi\src -IC:\Program Files (x86)\Arduino\libraries\pubsubclient-master\src -IC:\Users\******\Documents\Arduino\hardware\arduino-esp8266-master\esp8266\libraries\Ticker C:\Users\******\AppData\Local\Temp\build3416804306679904140.tmp\MQTT_led_V1.06.cpp -o C:\Users\******\AppData\Local\Temp\build3416804306679904140.tmp\MQTT_led_V1.06.cpp.o
In file included from C:\Program Files (x86)\Arduino\libraries\pubsubclient-master\src/PubSubClient.h:17:0,
from MQTT_led_V1.06.ino:23:
C:\Program Files (x86)\Arduino\libraries\pubsubclient-master\src/MQTT.h:278:33: error: '__FlashStringHelper' does not name a type
Publish(String topic, const __FlashStringHelper* payload);
^
C:\Program Files (x86)\Arduino\libraries\pubsubclient-master\src/MQTT.h:278:54: error: ISO C++ forbids declaration of 'payload' with no type [-fpermissive]
Publish(String topic, const __FlashStringHelper* payload);
^
Error compiling.
[/code]
Kas again thanks for helping with this