Example sketches for the new Arduino IDE for ESP8266

Moderator: igrr

User avatar
By Rigyu
#22971 Have been testing your awesome project but have found some bug...

The client connects successfully but after some message it drops the connection.

This is a sample output, have tested with 3 different servers. ¿Any help?

Code: Select all.....
WiFi connected
Connecting to MQTT server test.mosquitto.org as WiFiSwitch-18:fe:34:9f:9b:30
Connected to MQTT broker
Subsribed to topic.
MQTT message arrived: topic: test message: 1
Light is 0
Switching light to high
MQTT message arrived: topic: test message: 1
Light is 1
Switching light to high
Connecting to MQTT server test.mosquitto.org as WiFiSwitch-18:fe:34:9f:9b:30-18:fe:34:9f:9b:30
MQTT connect failed!
Connecting to MQTT server test.mosquitto.org as WiFiSwitch-18:fe:34:9f:9b:30-18:fe:34:9f:9b:30-18:fe:34:9f:9b:30
MQTT connect failed!
Connecting to MQTT server test.mosquitto.org as WiFiSwitch-18:fe:34:9f:9b:30-18:fe:34:9f:9b:30-18:fe:34:9f:9b:30-18:fe:34:9f:9b:30
MQTT connect failed!
Connecting to MQTT server test.mosquitto.org as WiFiSwitch-18:fe:34:9f:9b:30-18:fe:34:9f:9b:30-18:fe:34:9f:9b:30-18:fe:34:9f:9b:30-18:fe:34:9f:9b:30


Also tested in a private sever with mosquitto 1.4.2.

Sorry about bothering you, have read and not found any solution....
User avatar
By biobier
#26365 Thanks :)
Not sure what you are looking for but a good starting point might be:
http://mqtt.org/
I've installed the MQTT broker called Mosquitto on my debian based router. If you have a raspberry you can use that one too!
An overview for MQTT broker is here https://github.com/mqtt/mqtt.github.io/wiki/servers and also some client tools https://github.com/mqtt/mqtt.github.io/wiki/tools#desktop-tools But I'm using http://mqttfx.jfx4ee.org/
A client tool is always usefull when developing to send and recieve messages.