Example sketches for the new Arduino IDE for ESP8266

Moderator: igrr

User avatar
By kas
#29876
Godfather wrote:Good stuff Kas, just tested it with MQTT.fx client work great.
Would like to try the Android ap, but I can't seem to PM you

Easy, just click my avatar
hum... doesn't work :oops:

User Control Panel > private message > compose message > search "kas"
I am sure there is an easier way :shock:
User avatar
By picstart
#29921 This does not compile here is an example of the many many errors
info
MQTT.cpp is dated 8/6/2015 and the arduino ide is running on Win7
MQTT_led_v106.ino was downloaded from an earlier post in this thread

observation
It could be useful to have all the file links needed for a successful compile posted in a single response

error

[quote]
In file included from MQTT.cpp:20:0:
MQTT.h:278:33: error: '__FlashStringHelper' does not name a type
Publish(String topic, const __FlashStringHelper* payload);
^
MQTT.h:278:54: error: ISO C++ forbids declaration of 'payload' with no type [-fpermissive]
Publish(String topic, const __FlashStringHelper* payload);
^
MQTT.h:280:44: error: 'PGM_P' has not been declared
friend Publish Publish_P(String topic, PGM_P payload, uint32_t length);[/quote]
User avatar
By kas
#29922 From MQTT_led_V1.06.ino:
Code: Select all...
#include <ESP8266WiFi.h>
#include <PubSubClient.h>                             //  ** MQTT library from http://github.com/Imroy/pubsubclient **
#include <Ticker.h>
...

Please double check your PubSubClient library ;)
User avatar
By picstart
#29930 The MQTT_led_v106.ino is collected from an earlier post and the PubSubClient from http://github.com/Imroy/pubsubclient

With the hopefully latest MQTT_led_v106 things aren't compiling
Issue
it will not compile in the arduino IDE for a generic 8266 board
The MQTT.cpp is not compiling with the arduino IDE perhaps others are using an earlier version this thread might be helped if there was a recent posting of code that compiles instead of the references to earlier posting that may or may not be uptodate and may or may not be compatible with the current version of PubSubClient on github

[code]#include <ESP8266WiFi.h>
#include <PubSubClient.h> // MQTT library from http://github.com/Imroy/pubsubclient
#include <Ticker.h>
[/code]
of the many many compile errors below is a sample

[code]
In file included from MQTT.cpp:20:0:
MQTT.h:278:33: error: '__FlashStringHelper' does not name a type
Publish(String topic, const __FlashStringHelper* payload);
^
MQTT.h:278:54: error: ISO C++ forbids declaration of 'payload' with no type [-fpermissive]
Publish(String topic, const __FlashStringHelper* payload);
^
MQTT.h:280:44: error: 'PGM_P' has not been declared
friend Publish Publish_P(String topic, PGM_P payload, uint32_t length);[/code]