I've been using Flespi for a while now (coming from CloudMQTT), and so far it's not been great. I've found some guides and there is some documentation, but in the end nothing is clear or complete. I've been experiencing silent disconnects (where the bridge appears connected but Flespi doesn't send messages), and connecting problems. For about a few weeks now, I've not been able to connect, while my settings haven't changed. My goal of this post is to fix my setup, and to provide some sort of guide for others.

My original setup, which worked until a few weeks ago and then failed silently.
connection FlespiBroker
protocol mqtt
address mqtt.flespi.io:8883
remote_username [token goes here]
bridge_insecure false
try_private false
bridge_cafile /etc/mosquitto/certs/flespi/flespi-io-chain.pem
bridge_certfile /etc/mosquitto/certs/flespi/flespi.cert
notification true
notification_topic admin/bridge
keepalive_interval 60
start_type automatic
restart_timeout 10 180
topic message/# out 0
clientid test_client

I've tried all kinds of things, including websockets, getting the certificates again, switching from SSL. My most basic setup:
connection FlespiBroker
address mqtt.flespi.io:1883
remote_username [token goes here]
topic message/#
clientid test_client

But everything results in:
0: Connecting bridge FlespiBroker1 (mqtt.flespi.io:1883)
0: Error creating bridge: Try again.
0: Warning: Unable to connect to bridge FlespiBroker.
0: mosquitto version 2.0.12 running

Does anybody have a conf from a stable bridge connection?

    This is somewhat outdated, (bridge_tls_version wasn't needed anymore), and technically inconsistent with the official docs (flespi supports mqtt 5, although it won't really work with mqtt 5). Right now I've exposed a separate docker container (using ddns), which works, and CloudMQTT, Heroku, Azure, and even the Google IoT thing all work flawlessly. It's just Flespi that's giving issues. EDIT: issues like the silent disconnects are also not solved through this example.

    Does anyone have a broker conf that works? Ideally, one which incorporates ssl and ws?

      • Edited

      Hmmm I successfully configured 2.0.12 mosquitto bridge with mqttv5

      connection FlespiBroker
      bridge_protocol_version mqttv50
      bridge_cafile /etc/mosquitto/flespi-io-chain.pem
      bridge_tls_version tlsv1.3
      bridge_insecure false
      
      
      protocol mqtt
      address mqtt.flespi.io:8883
      remote_username XXXXXXXXXXXXXXXXFLESPITOKENXXXXXXXXXXXXXXXXXXXX
      try_private false
      notifications true
      notification_topic admin/bridge
      keepalive_interval 60
      start_type automatic
      restart_timeout 10 180
      topic message/# out 0
      clientid test_client

      Very interesting, as I'm getting the message from the broker stating
      Error: Protocol tlsv1.3 not supported
      So, I set
      bridge_tls_version tlsv1.2
      And it appears to connect. If I then create a listener, I get messages for a while, and then the bridge becomes silent (no new messages in MQTT explorer), while admin/bridge reports 1, and I'm still sending a random heartbeat to Flespi, which I can clearly see recieved and transmitted (another instance of MQTT explorer).

        Write a Reply...