Forwarding MQTT messages to external server

Hi there,

If I want to send all local MQTT messages to an external MQTT server, what would be the best way to do this? Essentially, all the data that the Decawave web-manager is using, I’d like to also send to my MQTT server that is hosted in the cloud. Is this just a matter of changing some config files, or do I have to make an MQTT client on the Pi that then publishes to my hosted MQTT server?

Regards,
Andrew.

both solutions could be done :
u can enter some files of the processs of dwm daemon, dwm proxy and mousquitto
use ps
then
ps -ef | grep 777 (as 777 number of the process
identify the 3 processors location and change them to ur new mqtt broker with user and pass.

second solution new mqtt broker that points on the dwm mqtt broker on the py. this is very easy with python or javascript with node js. search more

andrew-gretel, another solution.
Read this article:

http://www.steves-internet-guide.com/mosquitto-bridge-configuration/

Works for me.

So did you manage to get data into local mosquitto broker on Raspi? and read it with a MQTT client on PC?
Based on my trials the dwm-proxy is broken and does not deliver to local MQTT broker (mosquitto) any data…

Thanks for the replies, much appreciated.

I ended up following ramg’s link and it was exactly what I was after.

For anyone that finds this thread later, I followed the ‘DWM1001 Gateway Quick Deployment Guide’, and confirmed I was able to receive messages in MQTT.fx.

Then to forward the same messages to my broker in the cloud I ran this on the pi:
sudo nano /etc/mosquitto/mosquitto.conf

Inside that file I added the following to the bottom (replace domain, username, and password with yours, and make sure to save when you’re done):
connection bridge-cloud
address mydomain.com:1883
topic # out 0
remote_username myusername
remote_password mypassword

Then I ran:
sudo systemctl restart mosquitto

After this I was able to use MQTT.fx to subscribe to my broker in the cloud and it was outputting all the messages.

Are you saying that you automatically getting position info into MQTT.fx ?
I tried it many times at no avail…beats me…I observe many errors in mosquitto.log and in dwm-proxy.log
So as far as I am concerned, I am:

  • shelving MQTT.fx
  • wrote python COM port reader that also uses Paho MQTT client that delivers the position to C# MQTT client that I wrote on Win10.

I followed ‘DWM1001_Gateway_Quick_Deployment_Guide.pdf’ through till the end, and I was then able to receive messages in MQTT.fx.

The steps were essentially flashing the Pi with the provided Raspbian image, modifying /etc/dwm1001/dwm1001.config to change the panid to the same id as in the app, setting up a device as a bridge (through Tera Term, or ‘sudo minicom -D /dev/serial0’ if connected through serial pin on Pi) and connecting it to the pins on the Pi, and then making sure all the other devices were registered/setup in the app. After that I was just subscribed to the # topic in MQTT.fx to see all topics/messages, I didn’t touch mosquitto or dwm1001-proxy.config to get to that stage.

The only other thing I did was update the devices firmware in the app.

Sorry I can’t help further, this is all new stuff to me.

1 Like

Hi guys,

a more proper solution would be to change the configuration of the DWM Daemon and DWM Proxy and then restart those services (or Raspberry). See files
/etc/dwm1001/dwm1001.config
/etc/dwm1001/dwm1001-proxy.config

And also this post

Cheers,
TDK

Hi,
Can I send MQTT data on a remote MQTT Broker with TLS ?
I tried but I get openSSL error, probably because on the dwm1001-proxy.config file I didn’t specify the fact that the connection must be made on TLS sockets.
Can you help me?

Hi Ivan,

unfortunately the DWM Daemon and DWM Proxy do not support TLS.

I think one of the solution can be to create a bridge between local MQTT Broker and the cloud one and use TLS between them.

Cheers,
TDK