FarmBot / farmbot_os

The operating system and all related software that runs on FarmBot's Raspberry Pi.
MIT License
1.09k stars 266 forks source link

how can i change the broker ? #1486

Open bahanni opened 2 years ago

bahanni commented 2 years ago

I create a new Broker in HiveMQ and i want change the broker for sending and receiving a data (position x y z, emergency lock ....) between Raspberry and HiveMQ. I installed paho-MQTT I created an account in HiveMQ how i can do it ?

jsimmonds2 commented 2 years ago

want change the broker for sending and receiving

You need to be self-hosting the Web App code, pretty sure.

In the FBOS code, check out this process Supervisor code to see where Authentication Credentials come from :)

RickCarlino commented 2 years ago

To add some details to what @jsimmonds2 said, the MQTT broker was not intended to be a replaceable component. RabbitMQ is the only supported broker. The software stack's MQTT usage was intentionally built with tight coupling to the API server for security reasons. To use a non-FarmBot MQTT server you would need to self-host your FarmBot and set a custom MQTT_HOST ENV var on the server-side. You would then need to double-check that the server still operates correctly with your vendor's specific MQTT broker (no guarantee that it will work). After that, you will need to ensure that the MQTT broker is secure since the Web App will not be able to control access to the MQTT server. The Web App's default MQTT server has security mechanisms, but they are specific to RabbitMQ, it will not be able to control access if you do not use RabbitMQ.

I would not recommend changing the default MQTT server since it will require you to make modifications to the software source code in multiple places. It will also require you to understand the security risks involved.