UniversalDevicesInc/polyglot-v2

Ubuntu installation: minor install error and conflict with MQTT-broker

Closed this issue · 5 comments

minor error. I had to change python-pip to python3-pip in install.sh and the installation went fine.

My reason for using ubuntu is that I don't want to have a lot of boxes. I'm dedicating an HP box (x64, 16GB ram, 1T disc, ubuntu 20) which will be able to run a lot of my various software (mostly to collect data on electric energy from 4 sources). I already have an ISY994iZW which handles the lighting. Right now I have my MQTT-broker running on an RPi but the RPi is running real-time processes that I don't want to slow down. This box seems like a good candidate for the MQTT-broker.

But when I installed an MQTT-broker (using apt-get or snap) before or after I installed Polyglot, Polyglot no longer loaded on boot. In the debug file I found that Polyglot was trying to use the MQTT port and failed to load. I had to reinstall the OS three times to figure this out. (feature request: uninstall program for Polyglot)

It appears that Polyglot with the MQTT node server installed is not an MQTT-broker as I am unable to connect to it using MQTT Explorer.

How do I get an MQTT broker running along side Polyglot?

Yes, I'm way out of my depth here but with your kind help I'm sure I can learn to swim.

Polyglot does run an MQTT broker, but it is restricted and is only used for communication between Polyglot and node servers.

You can change the port that Polyglot uses and then run a standard MQTT broker along side it. I believe you have to set the environment variable POLYGLOTMQTTPORT=

The standard port for an MQTT broker is 1883 so you can use something around there for Polyglot

Brilliant! OK, two questions. Polyglot starts as a service and I assume the environment variable has to be set before that service starts. How do I do that? Is it in some configuration file? Secondly, all of the node servers would have to use this port. How do they get this information?

Thanks for your help!

The node server get configuration information like that from PG2 when it starts the node server, so you don't have to worry about that part.

You can set the environment variables in the startup file. /usr/local/etc/rc.d/polyglot similar to the MQTT_CERTPATH one that is already being set there.

I believe the actual environment variable you need to set is "MQTT_PORT"

First off, thanks for getting me pointed in the right direction, @bpaauwe! Setting the Polyglot MQTT port was the trick and I did that in Polyglot Settings.

I installed version 2.2.11 (frontend 2.2.9-5) per the description currently found here on this very site. The section To start Polyglot on Boot do the following: describes how to install Polyglot as a service. This is a different configuration than the one you describe. I've had more than a bit of frustration with mismatched documentation, and, again, I appreciate you helping me find my way!

I'm closing this issue as it was resolving the conflict. My next issue will be "Where do I find the documentation that will guide me to be able to set a variable in an ISY994i from a device that sends MQTT messages" ;)

The solution is: In Polyglot 2.2.11 (frontend 2.2.9-5), in Polyglot Settings, change MQTT port