I tried to connect using MQTT Explorer to the P1P MQTT server but then it immediately disconnects.
Also, I’m trying to create a timelapse with an external camera and read messages for a new layer. I’m using a single ESP8266 and Arduino PubSubClient library to try to connect to the P1P MQTT server. It connects successfully in setup but then disconnects in the loop. I’ve tried connecting to port 1883 (error connecting), adding a 60 sec keep alive (still disconnects).
I’ve also tried connecting while printing and not printing, and I was wondering if the P1P MQTT server runs only when printing or continuously. Also was wondering if there were any issues subscribing to all topics (#).
Repeated Output:
Connected to MQTT broker
connectToMQTTBroker connected: 1
connectToMQTTBroker state: 0
Loop connected: 0
Loop state: -3
Code:
Sidenote: I needed the break inside of the connectToMQTTBroker otherwise that would continuously run for some reason.