-->
Page 2 of 3

Re: MQTT + Easy Web Config

PostPosted: Wed Nov 02, 2016 3:36 am
by EREN MERT
Hello
great example and I also started reading your blog thank you.
I want to try this but i got an error. I tried with v1.9 and last version of pubsubclient. Do I need other libraries?


In file included from C:\xxx\Desktop\MqttTimer\MqttTimer.ino:39:0:
sketch\globals.h: In function 'void ConnectMQTT()':
globals.h:195: error: 'MQTT' has not been declared
while (!client.connect(MQTT::Connect(config.clientID).set_auth(config.MQTTuser, config.MQTTpass)) && retries--)
^
In file included from C:\xxx\Desktop\MqttTimer\MqttTimer.ino:40:0:
sketch\MQTTHandler.h: At global scope:
MQTTHandler.h:7: error: 'MQTT' does not name a type
void callback(const MQTT::Publish& pub)
^
MQTTHandler.h:7: error: expected unqualified-id before '&' token
void callback(const MQTT::Publish& pub)
^
MQTTHandler.h:7: error: expected ')' before '&' token
MQTTHandler.h:7: error: expected initializer before 'pub'
void callback(const MQTT::Publish& pub)
^
exit status 1
'MQTT' has not been declared

Re: MQTT + Easy Web Config

PostPosted: Wed Nov 02, 2016 11:44 pm
by Godfather
Hi not sure why you're getting errors like that?

Pubsubclient should be v1.9 also make sure you don't change the order of the include libraries in the main
sketch.

Re: MQTT + Easy Web Config

PostPosted: Thu Nov 03, 2016 5:21 am
by ChenBH
That was the next stage in my home automation project!

I needed the knowledge and implementation of MQTT and NTP to make some timer-controled devices.

Thanks man.

Re: MQTT + Easy Web Config

PostPosted: Wed Aug 23, 2017 7:14 pm
by guille36
I have got the same errors pointed by Eren. Do you have any clue? I am using mqtt v 1.9 and arduino ide 1.68.