I have a local MQTT broker running at home (Mosquitto on a Raspberry Pi). I’m interested in “bridging” it to Cayenne’s MQTT broker so that I can easily integrate my home setup with Cayenne without reprogramming my devices.

There is ample info online on setting up Mosquitto to bridge to external brokers. I think I’ve set up the config file correctly, Mosquitto’s output seems to show that messages are going out to Cayenne, but Cayenne doesn’t seem to be receiving them.

Required items:
Raspberry Pi with the newest image of Raspbian Jessie (Node-RED is pre-installed) A client device (Arduino, Pi, or any other microcontroller that has an MQTT library) Arduino IDE
Overview:
Cayenne will be a display for our data and easy to use interface. The Raspberry Pi will be a local server for our client device to send data to. Through Node-RED we can create functions that are currently missing from Cayenne such as time delay buttons, GPIO interrupts, and add sensors t…

@adam Node-RED is an interesting approach. Maybe not as elegant as in-built MQTT remapping but it should work!

I’ve tried it two ways with Node-RED (my own code, and the one you provide for import) and the issue I have is that the node that connects to the Cayenne MQTT server can only stay connected intermittently. It’s “disconnected” most of the time. I’ve checked username / password / ClientID and they’re all good. Not sure what is going on.

I thought that too. But I created a new Bring Your Own Thing device and put its ClientID everywhere and still get the same problem. “Disconnected”. I’m wondering if Node-RED has an issue with long ClientID fields (I had a related MQTT issue with a desktop MQTT client not “playing nice” with Cayenne for that very reason)

Not sure it matters, though, as the “disconnected” symbol next to the Cayenne MQTT node would seem to indicate that it’s not getting through to the Cayenne MQTT broker at all.

I tried hooking up the output of the node that generates the message back to my own MQTT broker and everything comes through fine. It’s something about how I have Node-RED set up with the Cayenne MQTT server. I’m wondering if Node-RED somehow is truncating my Cayenne Client ID (as I had an issue recently with this)

Can I ask what you’re using in the settings? Keep alive time, clean session, etc.? And what version of Node-RED you’re using?

For anyone interested, I figured out the problem – Node-RED seems to silently truncate passwords when, after setting up the MQTT server information, you re-visit the MQTT server settings field on an MQTT node. A bit complicated but it seems that “set it and forget it” is the best option.