I've just gotten my Omega 2 board today, and I'm thinking along very similar lines — I want my Onion boards to either send MQTT messages when something happens to their connected hardware, or do something with that hardware according to MQTT messages received.
Like you (Sebastian), I see no point in running an MQTT broker on the device — the broker will be elsewhere; these are edge devices that should merely be MQTT clients.
I see you solved it by using some clever files and shell scripting. But did you consider using Python? From other threads, it looks like paho-mqtt can be installed for python, which should make it pretty easy (and possibly more efficient) to subscribe to topics and do stuff in response (or conversely, to publish MQTT messages in reaction to anything you can sense in Python).
Just wondering if I am somehow barking up the wrong tree, or whether this is a sensible way to do it.
@mark-doutre Thanks - found that. :-) Though I think it would still be good if there was a more direct method of stopping it.
Regarding the running of the broker on the Omega, I agree with your comment. So far I have just been playing with MQTT and having a local broker under one's own control is a valuable part of getting to understand it all. In the real world, using a separate broker somewhere else is probably the way to go.
Any way, thanks for your interest and comments :-)
Looks like your connection to Onion Community was lost, please wait while we try to reconnect.