Arduino UNO WiFi keeps reconnecting to MQTT server


hi! have problem uno wifi. keeps reconnecting mqtt server.
here's code based on example provided unowifideved library:

quote
#include <wire.h>
#include <unowifideved.h>

#define connector "mqtt"
#define topic "sensors/alerts"
#define board_connected_code "101"

void setup() {
  ciao.begin();
}

void loop(){

  delay(5000);
  ciao.write(connector, topic, board_connected_code);
}

//code arduino wifi
the board connected internet through router, made sure of that.
i set broker.hivemq.com broker connect in settings panel.
all in debug console is:


quote
120473> mqtt: connect broker.hivemq.com:1883 0x3fff5da8
120475> mqtt: ip 35.156.1.237
120475> mqtt: connecting...
120529> mqtt: tcp connected broker.hivemq.com:1883
120529> mqtt: send type=type_connect id=0000 len=21
120608> mqtt: recv type=connack id=0000 len=4; pend type=null id=00
120608> mqtt: recv type=connack id=0000 len=4; pend type=null id=00
124515> mqtt: connect broker.hivemq.com:1883 0x3fff91a8
124535> mqtt: ip 52.58.157.180
124535> mqtt: connecting...
124617> mqtt: tcp connected broker.hivemq.com:1883
124617> mqtt: send type=type_connect id=0000 len=21
124674> mqtt: disconnect cb, freeing espconn 0x3fff5da8
124674> mqtt: disconnected broker.hivemq.com:1883
124678> mqtt error: recv in invalid state 1
124678> mqtt: disconnecting broker.hivemq.com:1883 (0x3fff91a8)
124678> mqtt: disconnect cb, freeing espconn 0x3fff91a8
126515> mqtt: connect broker.hivemq.com:1883 0x3fff5da8
126516> mqtt: ip 35.156.1.237
126516> mqtt: connecting...
126570> mqtt: tcp connected broker.hivemq.com:1883
126570> mqtt: send type=type_connect id=0000 len=21
126640> mqtt: recv type=connack id=0000 len=4; pend type=null id=00
126640> mqtt: recv type=connack id=0000 len=4; pend type=null id=00

i facing same problem arduino uno wifi. did able solve problem?


Arduino Forum > Using Arduino > Programming Questions > Arduino UNO WiFi keeps reconnecting to MQTT server


arduino

Comments

Popular posts from this blog

Flip address is out of range arduino uno r3

Arduino DUE ADC to DAC Piezo 30 Khz-100Khz

Indesign and MathType fonts