256dpi / arduino-mqtt

MQTT library for Arduino
MIT License
1.01k stars 232 forks source link

Pb with MKR 1010 Wifi #208

Closed fmatray closed 4 years ago

fmatray commented 4 years ago

Hello, I tried the example ArduinoWiFi101 on a MKR 1010 Wifi. I just changed the driver to WifiNina. When receiving fast messages, the client disconnects and reconnects.

21:29:04.520 -> checking wifi...
21:29:04.520 -> connecting...
21:29:05.917 -> connected!
21:29:05.917 -> incoming: octoPrint/temperature/tool0 - {"_timestamp": 1591990144, "actual": 22.03, "target": 0.0}
21:29:05.917 -> incoming: octoPrint/temperature/bed - {"_timestamp": 1591990144, "actual": 21.41, "target": 0.0}
21:29:05.917 -> checking wifi...
21:29:05.917 -> connecting...
21:29:05.951 -> connected!
21:29:05.951 -> incoming: octoPrint/temperature/tool0 - {"_timestamp": 1591990144, "actual": 22.03, "target": 0.0}
21:29:05.951 -> incoming: octoPrint/temperature/bed - {"_timestamp": 1591990144, "actual": 21.41, "target": 0.0}
21:29:05.986 -> checking wifi...
21:29:05.986 -> connecting...
21:29:05.986 -> connected!
21:29:06.019 -> incoming: octoPrint/temperature/tool0 - {"_timestamp": 1591990144, "actual": 22.03, "target": 0.0}
21:29:06.019 -> incoming: octoPrint/temperature/bed - {"_timestamp": 1591990144, "actual": 21.41, "target": 0.0}
21:29:06.019 -> checking wifi...
21:29:06.019 -> connecting...
21:29:06.019 -> connected!
[...]

I this is the subscriptions :

  client.subscribe("octoPrint/temperature/#"); // tool0, tool1 and bed
  client.subscribe("octoPrint/event/#");  // Octoprint events

Any clue about this problem ? Thanks a lot.

fmatray commented 4 years ago

I tried with the example in wiki for the MKR 1010, including the delay(1000).

I want to subscribe to several topics

  client.subscribe("octoPrint/temperature/#");  // 2 topics tool0 and bed
  client.subscribe("octoPrint/event/PrinterStateChanged");
  client.subscribe("octoPrint/event/PowerOn");
  client.subscribe("octoPrint/event/PowerOff");
  client.subscribe("octoPrint/progress/printing");

I tried several configurations :

256dpi commented 4 years ago

Is it possible the message is bigger than the default buffer size of 128 bytes?

fmatray commented 4 years ago

Yes and the retain flag