Example sketches for the new Arduino IDE for ESP8266

Moderator: igrr

User avatar
By Ins4neuk
#58592 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?
User avatar
By Touliloup
#58823 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 )
User avatar
By maker1
#59614 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?
User avatar
By andylomb
#62222 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