0

I recently installed HiveMQ on a Ubuntu machine and everything works fine. Being new to Linux( I am more on windows guy) , I am stuck with following question.

  1. I started HiveMQ with command as ./bin/run.sh . A window opens and confirm that HiveMQ is running..Great !!!. I started this with putty and when I close the putty , HiveMQ also stops. How to make HiveMQ run all the time ?.

  2. I am using the HiveMQ for my IoT projects ( raspberry pi). I know to subscribe and publish to HiveMQ broker from python , but what confuses me is , should I be running the python program continuously to make this work ?. Assuming I need to trigger 2+ GPIO on Pi , can I write one program and keep it running by making it subscribe to 2+ topic for trigger events ?.

Any help is greatly appreciated.

Thanks

bp581
  • 859
  • 1
  • 16
  • 47

2 Answers2

1
  1. Start HiveMQ with the following: ./bin/run.sh &

  2. Yes it is possible to subscribe to two topics from the same application, but you need to create separate subscribers within your python application.

Andrei
  • 7,509
  • 7
  • 32
  • 63
1

In order to start HiveMQ in the background, you can install it as a service. The details are covered in the documentation here. If you have a debian based system, execute the following commands:

cp /opt/hivemq/bin/init-script/hivemq-debian /etc/init.d/hivemq
chmod +x /etc/init.d/hivemq

For other Linux Systems the following should do it:

cp /opt/hivemq/bin/init-script/hivemq /etc/init.d/hivemq
chmod +x /etc/init.d/hivemq

Now you can start HiveMQ in the background with /etc/init.d/hivemq start.

Dominik Obermaier
  • 5,610
  • 4
  • 34
  • 45
  • In my machine its running as service(Windows machine) but how can I use it? I mean what address should i give for hiveMQ in my android client application, please answer this as soon as possible – blackHawk Apr 28 '17 at 03:15
  • @blackHawk: The instructions for installing it as a windows service can be found in the official documentation: http://www.hivemq.com/docs/hivemq/latest/#hivemqdocs_installation_for_specific_operating_systems – Dominik Obermaier May 02 '17 at 13:54