-->
Page 3 of 6

Re: Fully working MQTT examples

PostPosted: Wed Nov 23, 2016 7:39 pm
by Ins4neuk
Hi. Ive noticed that on the top sketch including a button when im running it its started going into a massive loop section at connecting to mqtt server. Says connected but then trys again. Eventually it stopps or i get the rc2 time out Any suggestions?

Re: Fully working MQTT examples

PostPosted: Tue Nov 29, 2016 3:39 am
by Touliloup
Another good project for MQTT powered ESP is this one:
https://github.com/corbanmailloux/esp-mqtt-rgb-led

It allows you to control an RGB led strip/single led or a white led strip/single led via MQTT.
I tested it with home-assistant embedded MQTT and it worked without issue.

The project is also well documented on github (which is rare enough to be pointed out :D )

Re: Fully working MQTT examples

PostPosted: Sat Dec 17, 2016 2:56 pm
by maker1
I am trying Relay with button Example
But after wifi successful connection
I get an error:
Attempting MQTT connection...failed, rc=2 try again in 5 seconds

I installed mosquitto
run it:
mosquitto -c "c:\Program Files (x86)\mosquitto\mosquitto.conf" -v
but I can't see any respond
can someone help here?

Re: Fully working MQTT examples

PostPosted: Tue Feb 07, 2017 9:07 am
by andylomb
I have a problem in the sketch compilation
There are errors in the library and I can not get out

THESE ARE MY MISTAKES









sketch_feb07a: 38: error: 'WiFiClient' does not name a type

  WiFiClient espClient;

  ^

sketch_feb07a: 39: error: 'espClient' was not declared in this scope

  PubSubClient client (espClient);

                      ^

C: \ Users \ andreal \ Documents \ Arduino \ sketch_feb07a \ sketch_feb07a.ino: In function 'void setup_wifi ()':

sketch_feb07a: 50: error: 'WiFi' was not declared in this scope

    WiFi.begin (SSID, password);

    ^

sketch_feb07a: 52: error: 'WL_CONNECTED' was not declared in this scope

    while (WiFi.status ()! = WL_CONNECTED) {

                            ^

Over a library found for "ESP8266wifi.h"
Used: C: \ Users \ andreal \ Documents \ Arduino \ libraries \ ESP8266wifi-master
Not used: C: \ Users \ andreal \ Documents \ Arduino \ libraries \ ESP8266WiFi
exit status 1
'WiFiClient' does not name a type