MQTTany - GPIO and more over MQTT

MQTTany v0.14.1

>>> Raspberry Pi 4 support is here in v0.14.1! <<<

MQTTany is the evolution of a simple Python program I wrote to allow me to control the GPIO pins on a Raspberry Pi 3 from my openHAB server.

MQTTany is designed to make it easy to connect hardware on single board computers to your home automation solution. It is built around the concept of modules, each with a specific purpose, so that only the components that are needed for your use case are loaded. Communication Modules are responsible for connections to the outside, like an MQTT broker, to allow publishing states and receiving commands. Interface Modules provide access to hardware on or connected to the platform that MQTTany is running on.

Communication Modules

  • MQTT - Connects to an MQTT broker to allow output to controllers and receive commands.

Interface Modules

  • GPIO - Allows you to control GPIO pins on single board computers.
  • I2C - Provides access to devices over I2C using the Linux kernel drivers.
  • OneWire - Provides access to Dallas OneWire devices using the w1 kernel module.
  • LED - Provides control of WS281x and similar LEDs through animation scripts.
  • XSET - Allows xset commands to be executed to set screensaver and display power options.

You can get MQTTany from the GitHub repo and the documentation is available on GitHub pages.

If you have any questions or need help getting it set up you can post in the Discussions on GitHub or here. If you encounter any bugs please open an issue on GitHub.

3 Likes

Looks very interesting.
Is it possible to read input pins via interrupt instead of polling?
I need to read two magnetic reed sensors from my garage door …
Nice Homie addition in your latest release :+1:

Hmm, forgot about this post, it needs an update!

Interrupts have been supported from the beginning actually. I use both so that I have immediate response but also a heartbeat update in openHAB.

Homie is not in there yet, but the ground work is so adding it won’t be much more work. If you’re interested you could have a go at it, I’m pretty far down the OH3 rabbit hole at the moment so won’t have time to work on it for a bit.

1 Like

So far it (v0.12.0) works pretty good: installed on a raspberry with attached 8 channel relay module.

1 Like

@CrazyIvan359, I need to ask one question , though:

During boot up of the RPi, as soon as the MQTTAny service starts, all configured output pins, attached to a relay, make the relay switch to ON (the relays are energized through a low output pin). At the moment I have two output pins attached to relays and one input pin.
initial state: OFF in the config file has no effect, this is also true for invert: false or resistor: 'pullup', although I don’t see any error messages while using them.
As one of the relays is attached to my garage door it would be very bad that the door opens when power is attached to the RPi.
Any ideas? Thx.

Edit: Great documentation, by the way :+1:

I’m almost certain I tested this with all the GPIO changes in v0.12.0, I think this may be a configuration problem. If you read any documentation prior to v0.12.0 it might be confusing as I added more nested configuration to fit better with different GPIO pin modes.

Your configuration should look like this:

gpio:
  my-pin:
    pin mode: 'output'
    digital:
      invert: true
      initial state: OFF

but if you saw older docs you might be trying something like this which wouldn’t work:

gpio:
  my-pin:
    pin mode: 'output'
    invert: true
    initial state: OFF

I think so too.
Unfortunately I can’t make it to work: switching on and off works as intended, but the initial state: OFF does not work. As soon as I add that the gpio module does not start anymore:

gpio:

  ### Pin Numbering Mode
  #mode: 'SOC'

  ### Polling Interval
  #polling interval: 60 # interval in seconds to poll all pins

  ### Interrupt Debounce
  #debounce: 50 # in milliseconds

  ### Single Pin Configuration
  my-pin:

    ### Pin Number
    pin: 5

    ### Pin Name
    # Subsitutions:
    # - {pin} = pin number
    # - {pin:02d} = pin number padded with 0's to always be 2 numbers
    # - {pin_id} = name of this section
    #name: '{pin_id}'

    ### Pin Mode
    pin mode: 'output' # can be 'input' or 'output'
    digital:
      initial state: OFF

    ### Pin Resistor
    #resistor: 'off' # can be 'pullup', 'pulldown', or 'off'

Output:

Dez 05 19:06:32 pigarage python3[1466]:     pin_object = build_pin(id, named_config)
Dez 05 19:06:32 pigarage python3[1466]:   File "/opt/mqttany/mqttany/modules/gpio/core.py", line 83, in build_pin
Dez 05 19:06:32 pigarage python3[1466]:     clazz = clazz(pin, CONFIG[CONF_KEY_MODE], id, name, pin_config)
Dez 05 19:06:32 pigarage python3[1466]:   File "/opt/mqttany/mqttany/modules/gpio/pin/digital.py", line 119, in __init__
Dez 05 19:06:32 pigarage python3[1466]:     self._edge = pin_config[CONF_KEY_DIGITAL][CONF_KEY_INTERRUPT]
Dez 05 19:06:32 pigarage python3[1466]: KeyError: 'digital'
Dez 05 19:06:32 pigarage python3[1466]:
Dez 05 19:06:32 pigarage python3[1466]: 2020-12-05 19:06:32,840 [WARN ] [core                    ] Module 'gpio' load failed
Dez 05 19:06:32 pigarage python3[1466]: 2020-12-05 19:06:32,847 [INFO ] [core                    ] Module 'mqtt' started successfully
Dez 05 19:06:32 pigarage python3[1466]: 2020-12-05 19:06:32,873 [INFO ] [mqtt                    ] Connected to broker '192.168.2.211:1883'

This would appear to be a bug. Please open an issue on github and post your full GPIO config section and attach a full log from when MQTTany starts.

Thanks for looking into this.

Done

@CrazyIvan359 thanks for the fast fix.
Everything is working as expected now.
This is a really, really great and well documented project.

Thank you! It’s my first stand-alone piece of software so it’s always great to see the user base increasing and getting more feedback on what people like and what doesn’t work that I’ve missed.

2 Likes

I need to ask another question:
the output pins for my relays are working flawlessly, now I tried to configure input pins to read magnetic contacts.
I tried everything I can think of:

  • pulling the input pin to low using a resistor and applying a high to trigger the pin
  • pulling the input pin to high using a resistor and applying a low to trigger the pin
  • not pulling the input pin to anything and applying a high or a low to trigger the pin
  • configuring the input pin as ‘input’ or as ‘counter’ and do all the triggering stuff again

Nothing happens on the mqtt broker side (which is working fine as I can see the state change of the output pins for the relays).

Do you have any idea what I am doing wrong?

mqttany.yml:

######## GPIO Module ########
gpio:

  ### Pin Numbering Mode
  #mode: 'SOC'

  ### Polling Interval
  #polling interval: 60 # interval in seconds to poll all pins

  ### Interrupt Debounce
  #debounce: 50 # in milliseconds

  ### Single Pin Configuration
  markise-auf:

    ### Pin Number
    pin: 5

    ### Pin Name
    # Subsitutions:
    # - {pin} = pin number
    # - {pin:02d} = pin number padded with 0's to always be 2 numbers
    # - {pin_id} = name of this section
    #name: '{pin_id}'

    ### Pin Mode
    pin mode: 'output'
#  markise-zu:
#    pin: 17
#    pin mode: 'output'
  testinput17:
    pin: 17
    pin mode: 'input'
  testinput27:
    pin: 27
    pin mode: 'counter'
    digital:
      counter:
  ### Multiple Pin Configuration
  # alternatively a list of pins can be given.
  # actual id's will be '{batch-id}-{index + first index}'
  # all options from a single pin configuration apply, except those shown below
  #batch-id:

    ### Pin Name
    # a single name may be given, or a list of names the same length as the
    # list of pins can be provided. if a single name is given then actual names will
    # be '{name} {index + first index}'
    # Subsitutions:
    # - {pin} = pin number
    # - {pin:02d} = pin number padded with 0's to always be 2 numbers
    # - {pin_id} = name of this section
    # - {index} = the pin's index in the list of pins plus 'first index'
    #name: '{pin_id}'

    ### Pin Numbers
    #pin: []

    ### First Index
    # this number will be added to 'index' when substituting '{index}' in id's and names
    #first index: 0



######## I2C Module ########

mqttany.log:

2020-12-08 08:08:22,071 [INFO ] [core                    ] MQTTany 0.12.1 starting
2020-12-08 08:08:22,521 [INFO ] [core.gpio               ] Detected board: RASPBERRY_PI_2B
2020-12-08 08:08:23,152 [INFO ] [core                    ] Module 'mqtt' started successfully
2020-12-08 08:08:23,166 [INFO ] [core                    ] Module 'gpio' started successfully
2020-12-08 08:08:23,183 [INFO ] [gpio.digital            ] Setting up 'markise-auf' on GPIO05 as OUTPUT
2020-12-08 08:08:23,189 [INFO ] [gpio.digital            ] Setting up 'markise-stop' on GPIO06 as OUTPUT
2020-12-08 08:08:23,192 [INFO ] [gpio.digital            ] Setting up 'testinput17' on GPIO17 as INPUT
2020-12-08 08:08:23,195 [INFO ] [gpio.counter            ] Setting up 'testinput27' on GPIO27 as INPUT
2020-12-08 08:08:23,208 [INFO ] [mqtt                    ] Connected to broker '192.168.2.211:1883'

grafik

You will want to set an interrupt option for them, by default input pins have no interrupts set.

The counter pin has a default edge, but it will only publish periodically because MQTTany handles the timing.

Thanks for your ongoing support.
I did this now but only get state changes of the pin from polling, not from interrupts:

  testinput17:
    pin: 17
    pin mode: 'input'
    digital:
      interrupt: 'both'


 mqttany.service - MQTTany service
   Loaded: loaded (/etc/systemd/system/mqttany.service; enabled; vendor preset: enabled)
   Active: active (running) since Tue 2020-12-08 16:30:22 CET; 35s ago
 Main PID: 2656 (python3)
    Tasks: 11 (limit: 2063)
   CGroup: /system.slice/mqttany.service
           ├─2656 /usr/bin/python3 mqttany.py
           ├─2659 /usr/bin/python3 mqttany.py
           └─2660 /usr/bin/python3 mqttany.py

Dez 08 16:30:22 pidachboden systemd[1]: Started MQTTany service.
Dez 08 16:30:23 pidachboden python3[2656]: 2020-12-08 16:30:23,376 [INFO ] [core                    ] MQTTany 0.12.1 starting
Dez 08 16:30:23 pidachboden python3[2656]: 2020-12-08 16:30:23,822 [INFO ] [core.gpio               ] Detected board: RASPBERRY_PI_2B
Dez 08 16:30:24 pidachboden python3[2656]: 2020-12-08 16:30:24,431 [INFO ] [core                    ] Module 'mqtt' started successfully
Dez 08 16:30:24 pidachboden python3[2656]: 2020-12-08 16:30:24,445 [INFO ] [core                    ] Module 'gpio' started successfully
Dez 08 16:30:24 pidachboden python3[2656]: 2020-12-08 16:30:24,462 [INFO ] [gpio.digital            ] Setting up 'testinput17' on GPIO17 as INPUT
Dez 08 16:30:24 pidachboden python3[2656]: 2020-12-08 16:30:24,485 [INFO ] [mqtt                    ] Connected to broker '192.168.2.211:1883'

Could you try adding the -v flag to get debug logging, look at the pin setup log entry and confirm it has set the options correctly. I am actively using this feature in v0.12.0 in my production environment so I know it works.

1 Like

Could you take a look please? Polling time was set to 5 seconds.

pi@pidachboden:/opt/mqttany $ python3 mqttany/mqttany.py -v
2020-12-08 18:37:29,542 [INFO ] [core    ] [core                    ] MQTTany 0.12.1 starting
2020-12-08 18:37:29,983 [INFO ] [core    ] [core.gpio               ] Detected board: RASPBERRY_PI_2B
2020-12-08 18:37:29,985 [DEBUG] [core    ] [core.gpio               ] Detected GPIO character device
2020-12-08 18:37:29,987 [DEBUG] [core    ] [config                  ] Loading config file
2020-12-08 18:37:30,142 [DEBUG] [core    ] [core                    ] Loading module 'mqtt'
2020-12-08 18:37:30,211 [DEBUG] [core    ] [core                    ] Module 'mqtt' is a communication module
2020-12-08 18:37:30,461 [DEBUG] [core    ] [mqtt                    ] Parsing config
2020-12-08 18:37:30,464 [DEBUG] [core    ] [mqtt                    ] Config loaded successfully
2020-12-08 18:37:30,466 [DEBUG] [core    ] [core                    ] Module 'mqtt' loaded successfully
2020-12-08 18:37:30,468 [DEBUG] [core    ] [bus                     ] Module 'mqtt' added as a receiver
2020-12-08 18:37:30,476 [DEBUG] [core    ] [bus                     ] Module 'mqtt' added as a transmitter
2020-12-08 18:37:30,478 [DEBUG] [core    ] [core                    ] Loading module 'gpio'
2020-12-08 18:37:30,553 [DEBUG] [core    ] [core                    ] Module 'gpio' is an interface module
2020-12-08 18:37:30,558 [DEBUG] [core    ] [gpio                    ] Parsing config
2020-12-08 18:37:30,562 [DEBUG] [core    ] [gpio                    ] Config loaded
2020-12-08 18:37:30,606 [DEBUG] [core    ] [core.gpio.board         ] 'gpio.pin.digital' acquired lock on GPIO17 (GPIO17)
2020-12-08 18:37:30,609 [DEBUG] [core    ] [gpio.digital            ] Configured 'testinput17' on GPIO17 with options: {'ID': 'testinput17', 'pin mode': 'INPUT', 'interrupt': 'BOTH', 'resistor': 'NONE', 'invert': False, 'initial state': 'OFF'}
2020-12-08 18:37:30,611 [DEBUG] [core    ] [core                    ] Module 'gpio' loaded successfully
2020-12-08 18:37:30,613 [DEBUG] [core    ] [bus                     ] Module 'gpio' added as a publisher
2020-12-08 18:37:30,617 [DEBUG] [core    ] [bus                     ] Module 'gpio' added as a subscriber
2020-12-08 18:37:30,629 [INFO ] [core    ] [core                    ] Module 'mqtt' started successfully
2020-12-08 18:37:30,644 [INFO ] [core    ] [core                    ] Module 'gpio' started successfully
2020-12-08 18:37:30,646 [DEBUG] [mqtt    ] [mqtt                    ] Creating MQTT client
2020-12-08 18:37:30,653 [DEBUG] [core    ] [bus                     ] Starting Message Bus Receive thread
2020-12-08 18:37:30,655 [DEBUG] [mqtt    ] [mqtt                    ] Attaching callbacks
2020-12-08 18:37:30,660 [DEBUG] [mqtt    ] [mqtt                    ] Queuing connect event
2020-12-08 18:37:30,660 [DEBUG] [core    ] [bus                     ] Starting Message Bus Transmit thread
2020-12-08 18:37:30,661 [DEBUG] [gpio    ] [gpio                    ] Setting up hardware
2020-12-08 18:37:30,662 [DEBUG] [mqtt    ] [mqtt                    ] Starting MQTT client thread
2020-12-08 18:37:30,664 [INFO ] [gpio    ] [gpio.digital            ] Setting up 'testinput17' on GPIO17 as INPUT
2020-12-08 18:37:30,668 [DEBUG] [gpio    ] [core.gpio.pin.digital   ] Setting up pin GPIO17 using chardev
2020-12-08 18:37:30,675 [DEBUG] [gpio    ] [gpio                    ] Starting polling timer with interval of 5s
2020-12-08 18:37:30,682 [DEBUG] [gpio    ] [gpio                    ] Polling all pins
2020-12-08 18:37:30,687 [DEBUG] [gpio    ] [gpio.digital            ] Read state OFF logic LOW from 'testinput17' on GPIO17
2020-12-08 18:37:30,694 [DEBUG] [mqtt    ] [mqtt.client             ] Sending CONNECT (u1, p1, wr1, wq0, wf1, c0, k15) client_id=b'pidachboden'
2020-12-08 18:37:30,699 [DEBUG] [mqtt    ] [mqtt.client             ] Received CONNACK (1, 0)
2020-12-08 18:37:30,702 [DEBUG] [mqtt    ] [mqtt.client             ] Sending PUBLISH (d0, q0, r1, m1), 'b'pidachboden/gpio/polling-interval'', ... (1 bytes)
2020-12-08 18:37:30,705 [INFO ] [mqtt    ] [mqtt                    ] Connected to broker '192.168.2.211:1883'
2020-12-08 18:37:30,709 [DEBUG] [mqtt    ] [mqtt                    ] Resuming previous session
2020-12-08 18:37:30,711 [DEBUG] [mqtt    ] [mqtt.client             ] Sending SUBSCRIBE (d0, m2) [(b'pidachboden/+/+/+/#', 0)]
2020-12-08 18:37:30,713 [DEBUG] [mqtt    ] [mqtt                    ] Heartbeat
2020-12-08 18:37:30,715 [DEBUG] [mqtt    ] [mqtt.client             ] Sending PUBLISH (d0, q0, r1, m3), 'b'pidachboden/lwt'', ... (6 bytes)
2020-12-08 18:37:30,718 [DEBUG] [mqtt    ] [mqtt.client             ] Sending PUBLISH (d0, q0, r0, m4), 'b'pidachboden/version'', ... (6 bytes)
2020-12-08 18:37:30,723 [DEBUG] [mqtt    ] [mqtt.client             ] Sending PUBLISH (d0, q0, r0, m5), 'b'pidachboden/gpio/testinput17'', ... (3 bytes)
2020-12-08 18:37:30,766 [DEBUG] [mqtt    ] [mqtt.client             ] Received SUBACK
2020-12-08 18:37:35,681 [DEBUG] [gpio    ] [gpio                    ] Polling timer fired
2020-12-08 18:37:35,685 [DEBUG] [gpio    ] [gpio                    ] Polling all pins
2020-12-08 18:37:35,688 [DEBUG] [gpio    ] [gpio.digital            ] Read state OFF logic LOW from 'testinput17' on GPIO17
2020-12-08 18:37:35,719 [DEBUG] [mqtt    ] [mqtt.client             ] Sending PUBLISH (d0, q0, r0, m6), 'b'pidachboden/gpio/testinput17'', ... (3 bytes)
2020-12-08 18:37:40,685 [DEBUG] [gpio    ] [gpio                    ] Polling timer fired
2020-12-08 18:37:40,695 [DEBUG] [gpio    ] [gpio                    ] Polling all pins
2020-12-08 18:37:40,698 [DEBUG] [gpio    ] [gpio.digital            ] Read state OFF logic LOW from 'testinput17' on GPIO17
2020-12-08 18:37:40,722 [DEBUG] [mqtt    ] [mqtt.client             ] Sending PUBLISH (d0, q0, r0, m7), 'b'pidachboden/gpio/testinput17'', ... (3 bytes)
2020-12-08 18:37:45,695 [DEBUG] [gpio    ] [gpio                    ] Polling timer fired
2020-12-08 18:37:45,700 [DEBUG] [gpio    ] [gpio                    ] Polling all pins
2020-12-08 18:37:45,704 [DEBUG] [gpio    ] [gpio.digital            ] Read state OFF logic LOW from 'testinput17' on GPIO17
2020-12-08 18:37:45,724 [DEBUG] [mqtt    ] [mqtt.client             ] Sending PUBLISH (d0, q0, r0, m8), 'b'pidachboden/gpio/testinput17'', ... (3 bytes)
2020-12-08 18:37:46,731 [DEBUG] [mqtt    ] [mqtt.client             ] Sending PINGREQ
2020-12-08 18:37:46,736 [DEBUG] [mqtt    ] [mqtt.client             ] Received PINGRESP
2020-12-08 18:37:50,700 [DEBUG] [gpio    ] [gpio                    ] Polling timer fired
2020-12-08 18:37:50,704 [DEBUG] [gpio    ] [gpio                    ] Polling all pins
2020-12-08 18:37:50,709 [DEBUG] [gpio    ] [gpio.digital            ] Read state OFF logic LOW from 'testinput17' on GPIO17
2020-12-08 18:37:50,724 [DEBUG] [mqtt    ] [mqtt.client             ] Sending PUBLISH (d0, q0, r0, m9), 'b'pidachboden/gpio/testinput17'', ... (3 bytes)
2020-12-08 18:37:55,705 [DEBUG] [gpio    ] [gpio                    ] Polling timer fired
2020-12-08 18:37:55,715 [DEBUG] [gpio    ] [gpio                    ] Polling all pins
2020-12-08 18:37:55,719 [DEBUG] [gpio    ] [gpio.digital            ] Read state OFF logic LOW from 'testinput17' on GPIO17
2020-12-08 18:37:55,750 [DEBUG] [mqtt    ] [mqtt.client             ] Sending PUBLISH (d0, q0, r0, m10), 'b'pidachboden/gpio/testinput17'', ... (3 bytes)
2020-12-08 18:38:00,715 [DEBUG] [gpio    ] [gpio                    ] Polling timer fired
2020-12-08 18:38:00,719 [DEBUG] [gpio    ] [gpio                    ] Polling all pins
2020-12-08 18:38:00,725 [DEBUG] [gpio    ] [gpio.digital            ] Read state OFF logic LOW from 'testinput17' on GPIO17
2020-12-08 18:38:00,750 [DEBUG] [mqtt    ] [mqtt.client             ] Sending PUBLISH (d0, q0, r0, m11), 'b'pidachboden/gpio/testinput17'', ... (3 bytes)
2020-12-08 18:38:01,756 [DEBUG] [mqtt    ] [mqtt.client             ] Sending PINGREQ
2020-12-08 18:38:01,761 [DEBUG] [mqtt    ] [mqtt.client             ] Received PINGRESP
2020-12-08 18:38:05,719 [DEBUG] [gpio    ] [gpio                    ] Polling timer fired
2020-12-08 18:38:05,731 [DEBUG] [gpio    ] [gpio                    ] Polling all pins
2020-12-08 18:38:05,734 [DEBUG] [gpio    ] [gpio.digital            ] Read state ON logic HIGH from 'testinput17' on GPIO17
2020-12-08 18:38:05,749 [DEBUG] [mqtt    ] [mqtt.client             ] Sending PUBLISH (d0, q0, r0, m12), 'b'pidachboden/gpio/testinput17'', ... (2 bytes)
2020-12-08 18:38:10,731 [DEBUG] [gpio    ] [gpio                    ] Polling timer fired
2020-12-08 18:38:10,740 [DEBUG] [gpio    ] [gpio                    ] Polling all pins
2020-12-08 18:38:10,743 [DEBUG] [gpio    ] [gpio.digital            ] Read state OFF logic LOW from 'testinput17' on GPIO17
2020-12-08 18:38:10,775 [DEBUG] [mqtt    ] [mqtt.client             ] Sending PUBLISH (d0, q0, r0, m13), 'b'pidachboden/gpio/testinput17'', ... (3 bytes)
2020-12-08 18:38:15,740 [DEBUG] [gpio    ] [gpio                    ] Polling timer fired
2020-12-08 18:38:15,747 [DEBUG] [gpio    ] [gpio                    ] Polling all pins
2020-12-08 18:38:15,751 [DEBUG] [gpio    ] [gpio.digital            ] Read state ON logic HIGH from 'testinput17' on GPIO17
2020-12-08 18:38:15,772 [DEBUG] [mqtt    ] [mqtt.client             ] Sending PUBLISH (d0, q0, r0, m14), 'b'pidachboden/gpio/testinput17'', ... (2 bytes)
2020-12-08 18:38:16,778 [DEBUG] [mqtt    ] [mqtt.client             ] Sending PINGREQ
2020-12-08 18:38:16,784 [DEBUG] [mqtt    ] [mqtt.client             ] Received PINGRESP
2020-12-08 18:38:20,747 [DEBUG] [gpio    ] [gpio                    ] Polling timer fired
2020-12-08 18:38:20,751 [DEBUG] [gpio    ] [gpio                    ] Polling all pins
2020-12-08 18:38:20,756 [DEBUG] [gpio    ] [gpio.digital            ] Read state ON logic HIGH from 'testinput17' on GPIO17
2020-12-08 18:38:20,773 [DEBUG] [mqtt    ] [mqtt.client             ] Sending PUBLISH (d0, q0, r0, m15), 'b'pidachboden/gpio/testinput17'', ... (2 bytes)
2020-12-08 18:38:25,751 [DEBUG] [gpio    ] [gpio                    ] Polling timer fired
2020-12-08 18:38:25,755 [DEBUG] [gpio    ] [gpio                    ] Polling all pins
2020-12-08 18:38:25,760 [DEBUG] [gpio    ] [gpio.digital            ] Read state ON logic HIGH from 'testinput17' on GPIO17
2020-12-08 18:38:25,774 [DEBUG] [mqtt    ] [mqtt.client             ] Sending PUBLISH (d0, q0, r0, m16), 'b'pidachboden/gpio/testinput17'', ... (2 bytes)
2020-12-08 18:38:30,755 [DEBUG] [gpio    ] [gpio                    ] Polling timer fired
2020-12-08 18:38:30,761 [DEBUG] [gpio    ] [gpio                    ] Polling all pins
2020-12-08 18:38:30,765 [DEBUG] [gpio    ] [gpio.digital            ] Read state ON logic HIGH from 'testinput17' on GPIO17
2020-12-08 18:38:30,776 [DEBUG] [mqtt    ] [mqtt.client             ] Sending PUBLISH (d0, q0, r0, m17), 'b'pidachboden/gpio/testinput17'', ... (2 bytes)
2020-12-08 18:38:32,784 [DEBUG] [mqtt    ] [mqtt.client             ] Sending PINGREQ
2020-12-08 18:38:32,789 [DEBUG] [mqtt    ] [mqtt.client             ] Received PINGRESP
2020-12-08 18:38:35,761 [DEBUG] [gpio    ] [gpio                    ] Polling timer fired
2020-12-08 18:38:35,765 [DEBUG] [gpio    ] [gpio                    ] Polling all pins
2020-12-08 18:38:35,770 [DEBUG] [gpio    ] [gpio.digital            ] Read state ON logic HIGH from 'testinput17' on GPIO17
2020-12-08 18:38:35,777 [DEBUG] [mqtt    ] [mqtt.client             ] Sending PUBLISH (d0, q0, r0, m18), 'b'pidachboden/gpio/testinput17'', ... (2 bytes)
2020-12-08 18:38:40,765 [DEBUG] [gpio    ] [gpio                    ] Polling timer fired
2020-12-08 18:38:40,770 [DEBUG] [gpio    ] [gpio                    ] Polling all pins
2020-12-08 18:38:40,776 [DEBUG] [gpio    ] [gpio.digital            ] Read state ON logic HIGH from 'testinput17' on GPIO17
2020-12-08 18:38:40,801 [DEBUG] [mqtt    ] [mqtt.client             ] Sending PUBLISH (d0, q0, r0, m19), 'b'pidachboden/gpio/testinput17'', ... (2 bytes)
2020-12-08 18:38:45,770 [DEBUG] [gpio    ] [gpio                    ] Polling timer fired
2020-12-08 18:38:45,775 [DEBUG] [gpio    ] [gpio                    ] Polling all pins
2020-12-08 18:38:45,780 [DEBUG] [gpio    ] [gpio.digital            ] Read state ON logic HIGH from 'testinput17' on GPIO17
2020-12-08 18:38:45,800 [DEBUG] [mqtt    ] [mqtt.client             ] Sending PUBLISH (d0, q0, r0, m20), 'b'pidachboden/gpio/testinput17'', ... (2 bytes)
2020-12-08 18:38:47,807 [DEBUG] [mqtt    ] [mqtt.client             ] Sending PINGREQ
2020-12-08 18:38:47,813 [DEBUG] [mqtt    ] [mqtt.client             ] Received PINGRESP
2020-12-08 18:38:50,775 [DEBUG] [gpio    ] [gpio                    ] Polling timer fired
2020-12-08 18:38:50,779 [DEBUG] [gpio    ] [gpio                    ] Polling all pins
2020-12-08 18:38:50,784 [DEBUG] [gpio    ] [gpio.digital            ] Read state OFF logic LOW from 'testinput17' on GPIO17
2020-12-08 18:38:50,800 [DEBUG] [mqtt    ] [mqtt.client             ] Sending PUBLISH (d0, q0, r0, m21), 'b'pidachboden/gpio/testinput17'', ... (3 bytes)
^C
2020-12-08 18:38:53,550 [DEBUG] [gpio    ] [gpio                    ] Stopping polling timer
2020-12-08 18:38:53,553 [DEBUG] [gpio    ] [gpio                    ] Running pin cleanup
2020-12-08 18:38:53,695 [DEBUG] [core    ] [core                    ] Subproccess for module 'gpio' stopped cleanly
2020-12-08 18:38:53,698 [INFO ] [core    ] [core                    ] Module 'gpio' unloaded
2020-12-08 18:38:53,726 [DEBUG] [mqtt    ] [mqtt                    ] Disconnecting
2020-12-08 18:38:53,729 [DEBUG] [mqtt    ] [mqtt.client             ] Sending PUBLISH (d0, q0, r1, m22), 'b'pidachboden/lwt'', ... (7 bytes)
2020-12-08 18:38:53,733 [DEBUG] [mqtt    ] [mqtt.client             ] Sending DISCONNECT
2020-12-08 18:38:53,736 [DEBUG] [mqtt    ] [mqtt                    ] Stopping MQTT client loop
2020-12-08 18:38:53,750 [DEBUG] [core    ] [core                    ] Subproccess for module 'mqtt' stopped cleanly
2020-12-08 18:38:53,753 [INFO ] [core    ] [core                    ] Module 'mqtt' unloaded
2020-12-08 18:38:53,759 [DEBUG] [core    ] [bus.receive             ] Message Bus Receive thread stopped cleanly
2020-12-08 18:38:53,793 [DEBUG] [core    ] [bus.transmit            ] Message Bus Transmit thread stopped cleanly
2020-12-08 18:38:53,795 [INFO ] [core    ] [core                    ] MQTTany stopped

I reverted to v0.12.0 and am seeing the same problem. I must doing something silly but I can’t find it.

Hmm, everything looks like it should work but isn’t. I will investigate when I get home.

Well my tests worked, I don’t have an RPi2 to test with though.

I want you to test using the older sysfs system, but MQTTany has no way for the user to select that. Modify the permissions on the file /dev/gpiochip0 so that the account you are running MQTTany as does not have read access. Run MQTTany again, with the -v option, and see if that works.

In v0.12.0 I moved to the new character device for accessing GPIO, with a fallback to sysfs. The cdev kernel module does not report capabilities anywhere, so if interrupts are not supported by it it will not advertise that anywhere.

I could do the tests with a 3B too.

Looks like it still does not work:

pi@pidachboden:/opt/mqttany $ python3 mqttany/mqttany.py -v
2020-12-09 08:24:54,388 [INFO ] [core    ] [core                    ] MQTTany 0.12.0 starting
2020-12-09 08:24:54,839 [INFO ] [core    ] [core.gpio               ] Detected board: RASPBERRY_PI_2B
2020-12-09 08:24:54,843 [WARN ] [core    ] [core.gpio               ] Detected GPIO character device but this account (pi) does not have R/W permissions
2020-12-09 08:24:54,845 [WARN ] [core    ] [core.gpio               ] Read/Write access is required on the following files: ['/dev/gpiochip0']
2020-12-09 08:24:54,847 [WARN ] [core    ] [core.gpio               ] Attempting to fall back to sysfs
2020-12-09 08:24:54,849 [DEBUG] [core    ] [core.gpio               ] Falling back to sysfs
2020-12-09 08:24:54,851 [DEBUG] [core    ] [config                  ] Loading config file
2020-12-09 08:24:55,005 [DEBUG] [core    ] [core                    ] Loading module 'mqtt'
2020-12-09 08:24:55,072 [DEBUG] [core    ] [core                    ] Module 'mqtt' is a communication module
2020-12-09 08:24:55,324 [DEBUG] [core    ] [mqtt                    ] Parsing config
2020-12-09 08:24:55,327 [DEBUG] [core    ] [mqtt                    ] Config loaded successfully
2020-12-09 08:24:55,329 [DEBUG] [core    ] [core                    ] Module 'mqtt' loaded successfully
2020-12-09 08:24:55,331 [DEBUG] [core    ] [bus                     ] Module 'mqtt' added as a receiver
2020-12-09 08:24:55,339 [DEBUG] [core    ] [bus                     ] Module 'mqtt' added as a transmitter
2020-12-09 08:24:55,341 [DEBUG] [core    ] [core                    ] Loading module 'gpio'
2020-12-09 08:24:55,416 [DEBUG] [core    ] [core                    ] Module 'gpio' is an interface module
2020-12-09 08:24:55,421 [DEBUG] [core    ] [gpio                    ] Parsing config
2020-12-09 08:24:55,425 [DEBUG] [core    ] [gpio                    ] Config loaded
2020-12-09 08:24:55,469 [DEBUG] [core    ] [core.gpio.board         ] 'gpio.pin.digital' acquired lock on GPIO17 (GPIO17)
2020-12-09 08:24:55,472 [DEBUG] [core    ] [gpio.digital            ] Configured 'testinput17' on GPIO17 with options: {'ID': 'testinput17', 'pin mode': 'INPUT', 'interrupt': 'RISING', 'resistor': 'NONE', 'invert': False, 'initial state': 'OFF'}
2020-12-09 08:24:55,474 [DEBUG] [core    ] [core                    ] Module 'gpio' loaded successfully
2020-12-09 08:24:55,476 [DEBUG] [core    ] [bus                     ] Module 'gpio' added as a publisher
2020-12-09 08:24:55,480 [DEBUG] [core    ] [bus                     ] Module 'gpio' added as a subscriber
2020-12-09 08:24:55,492 [INFO ] [core    ] [core                    ] Module 'mqtt' started successfully
2020-12-09 08:24:55,506 [INFO ] [core    ] [core                    ] Module 'gpio' started successfully
2020-12-09 08:24:55,508 [DEBUG] [mqtt    ] [mqtt                    ] Creating MQTT client
2020-12-09 08:24:55,515 [DEBUG] [core    ] [bus                     ] Starting Message Bus Receive thread
2020-12-09 08:24:55,517 [DEBUG] [mqtt    ] [mqtt                    ] Attaching callbacks
2020-12-09 08:24:55,522 [DEBUG] [mqtt    ] [mqtt                    ] Queuing connect event
2020-12-09 08:24:55,522 [DEBUG] [core    ] [bus                     ] Starting Message Bus Transmit thread
2020-12-09 08:24:55,523 [DEBUG] [gpio    ] [gpio                    ] Setting up hardware
2020-12-09 08:24:55,524 [DEBUG] [mqtt    ] [mqtt                    ] Starting MQTT client thread
2020-12-09 08:24:55,527 [INFO ] [gpio    ] [gpio.digital            ] Setting up 'testinput17' on GPIO17 as INPUT
2020-12-09 08:24:55,531 [DEBUG] [gpio    ] [core.gpio.pin.digital   ] Setting up pin GPIO17 using sysfs
2020-12-09 08:24:55,559 [DEBUG] [mqtt    ] [mqtt.client             ] Sending CONNECT (u1, p1, wr1, wq0, wf1, c0, k15) client_id=b'pidachboden'
2020-12-09 08:24:55,564 [DEBUG] [mqtt    ] [mqtt.client             ] Received CONNACK (1, 0)
2020-12-09 08:24:55,567 [INFO ] [mqtt    ] [mqtt                    ] Connected to broker '192.168.2.211:1883'
2020-12-09 08:24:55,570 [DEBUG] [mqtt    ] [mqtt                    ] Resuming previous session
2020-12-09 08:24:55,572 [DEBUG] [mqtt    ] [mqtt.client             ] Sending SUBSCRIBE (d0, m1) [(b'pidachboden/+/+/+/#', 0)]
2020-12-09 08:24:55,575 [DEBUG] [mqtt    ] [mqtt                    ] Heartbeat
2020-12-09 08:24:55,578 [DEBUG] [mqtt    ] [mqtt.client             ] Sending PUBLISH (d0, q0, r1, m2), 'b'pidachboden/lwt'', ... (6 bytes)
2020-12-09 08:24:55,582 [DEBUG] [mqtt    ] [mqtt.client             ] Sending PUBLISH (d0, q0, r0, m3), 'b'pidachboden/version'', ... (6 bytes)
2020-12-09 08:24:55,590 [DEBUG] [mqtt    ] [mqtt.client             ] Received SUBACK
2020-12-09 08:24:55,641 [DEBUG] [gpio    ] [gpio                    ] Starting polling timer with interval of 5s
2020-12-09 08:24:55,646 [DEBUG] [gpio    ] [gpio                    ] Polling all pins
2020-12-09 08:24:55,652 [DEBUG] [gpio    ] [gpio.digital            ] Read state ON logic HIGH from 'testinput17' on GPIO17
2020-12-09 08:24:55,663 [DEBUG] [mqtt    ] [mqtt.client             ] Sending PUBLISH (d0, q0, r1, m4), 'b'pidachboden/gpio/polling-interval'', ... (1 bytes)
2020-12-09 08:24:55,667 [DEBUG] [mqtt    ] [mqtt.client             ] Sending PUBLISH (d0, q0, r0, m5), 'b'pidachboden/gpio/testinput17'', ... (2 bytes)
2020-12-09 08:25:00,646 [DEBUG] [gpio    ] [gpio                    ] Polling timer fired
2020-12-09 08:25:00,652 [DEBUG] [gpio    ] [gpio                    ] Polling all pins
2020-12-09 08:25:00,655 [DEBUG] [gpio    ] [gpio.digital            ] Read state ON logic HIGH from 'testinput17' on GPIO17
2020-12-09 08:25:00,666 [DEBUG] [mqtt    ] [mqtt.client             ] Sending PUBLISH (d0, q0, r0, m6), 'b'pidachboden/gpio/testinput17'', ... (2 bytes)
2020-12-09 08:25:05,652 [DEBUG] [gpio    ] [gpio                    ] Polling timer fired
2020-12-09 08:25:05,662 [DEBUG] [gpio    ] [gpio                    ] Polling all pins
2020-12-09 08:25:05,665 [DEBUG] [gpio    ] [gpio.digital            ] Read state ON logic HIGH from 'testinput17' on GPIO17
2020-12-09 08:25:05,694 [DEBUG] [mqtt    ] [mqtt.client             ] Sending PUBLISH (d0, q0, r0, m7), 'b'pidachboden/gpio/testinput17'', ... (2 bytes)
2020-12-09 08:25:10,662 [DEBUG] [gpio    ] [gpio                    ] Polling timer fired
2020-12-09 08:25:10,672 [DEBUG] [gpio    ] [gpio                    ] Polling all pins
2020-12-09 08:25:10,674 [DEBUG] [gpio    ] [gpio.digital            ] Read state ON logic HIGH from 'testinput17' on GPIO17
2020-12-09 08:25:10,697 [DEBUG] [mqtt    ] [mqtt.client             ] Sending PUBLISH (d0, q0, r0, m8), 'b'pidachboden/gpio/testinput17'', ... (2 bytes)
2020-12-09 08:25:10,702 [DEBUG] [mqtt    ] [mqtt.client             ] Sending PINGREQ
2020-12-09 08:25:10,708 [DEBUG] [mqtt    ] [mqtt.client             ] Received PINGRESP
2020-12-09 08:25:15,672 [DEBUG] [gpio    ] [gpio                    ] Polling timer fired
2020-12-09 08:25:15,676 [DEBUG] [gpio    ] [gpio                    ] Polling all pins
2020-12-09 08:25:15,680 [DEBUG] [gpio    ] [gpio.digital            ] Read state ON logic HIGH from 'testinput17' on GPIO17
2020-12-09 08:25:15,700 [DEBUG] [mqtt    ] [mqtt.client             ] Sending PUBLISH (d0, q0, r0, m9), 'b'pidachboden/gpio/testinput17'', ... (2 bytes)
2020-12-09 08:25:20,676 [DEBUG] [gpio    ] [gpio                    ] Polling timer fired
2020-12-09 08:25:20,681 [DEBUG] [gpio    ] [gpio                    ] Polling all pins
2020-12-09 08:25:20,686 [DEBUG] [gpio    ] [gpio.digital            ] Read state ON logic HIGH from 'testinput17' on GPIO17
2020-12-09 08:25:20,702 [DEBUG] [mqtt    ] [mqtt.client             ] Sending PUBLISH (d0, q0, r0, m10), 'b'pidachboden/gpio/testinput17'', ... (2 bytes)
2020-12-09 08:25:25,681 [DEBUG] [gpio    ] [gpio                    ] Polling timer fired
2020-12-09 08:25:25,685 [DEBUG] [gpio    ] [gpio                    ] Polling all pins
2020-12-09 08:25:25,690 [DEBUG] [gpio    ] [gpio.digital            ] Read state ON logic HIGH from 'testinput17' on GPIO17
2020-12-09 08:25:25,706 [DEBUG] [mqtt    ] [mqtt.client             ] Sending PUBLISH (d0, q0, r0, m11), 'b'pidachboden/gpio/testinput17'', ... (2 bytes)
2020-12-09 08:25:26,712 [DEBUG] [mqtt    ] [mqtt.client             ] Sending PINGREQ
2020-12-09 08:25:26,718 [DEBUG] [mqtt    ] [mqtt.client             ] Received PINGRESP
2020-12-09 08:25:30,685 [DEBUG] [gpio    ] [gpio                    ] Polling timer fired
2020-12-09 08:25:30,690 [DEBUG] [gpio    ] [gpio                    ] Polling all pins
2020-12-09 08:25:30,696 [DEBUG] [gpio    ] [gpio.digital            ] Read state ON logic HIGH from 'testinput17' on GPIO17
2020-12-09 08:25:30,710 [DEBUG] [mqtt    ] [mqtt.client             ] Sending PUBLISH (d0, q0, r0, m12), 'b'pidachboden/gpio/testinput17'', ... (2 bytes)
2020-12-09 08:25:35,690 [DEBUG] [gpio    ] [gpio                    ] Polling timer fired
2020-12-09 08:25:35,694 [DEBUG] [gpio    ] [gpio                    ] Polling all pins
2020-12-09 08:25:35,699 [DEBUG] [gpio    ] [gpio.digital            ] Read state ON logic HIGH from 'testinput17' on GPIO17
2020-12-09 08:25:35,713 [DEBUG] [mqtt    ] [mqtt.client             ] Sending PUBLISH (d0, q0, r0, m13), 'b'pidachboden/gpio/testinput17'', ... (2 bytes)
2020-12-09 08:25:40,694 [DEBUG] [gpio    ] [gpio                    ] Polling timer fired
2020-12-09 08:25:40,700 [DEBUG] [gpio    ] [gpio                    ] Polling all pins
2020-12-09 08:25:40,704 [DEBUG] [gpio    ] [gpio.digital            ] Read state ON logic HIGH from 'testinput17' on GPIO17
2020-12-09 08:25:40,715 [DEBUG] [mqtt    ] [mqtt.client             ] Sending PUBLISH (d0, q0, r0, m14), 'b'pidachboden/gpio/testinput17'', ... (2 bytes)
2020-12-09 08:25:41,721 [DEBUG] [mqtt    ] [mqtt.client             ] Sending PINGREQ
2020-12-09 08:25:41,728 [DEBUG] [mqtt    ] [mqtt.client             ] Received PINGRESP
2020-12-09 08:25:45,700 [DEBUG] [gpio    ] [gpio                    ] Polling timer fired
2020-12-09 08:25:45,704 [DEBUG] [gpio    ] [gpio                    ] Polling all pins
2020-12-09 08:25:45,709 [DEBUG] [gpio    ] [gpio.digital            ] Read state OFF logic LOW from 'testinput17' on GPIO17
2020-12-09 08:25:45,718 [DEBUG] [mqtt    ] [mqtt.client             ] Sending PUBLISH (d0, q0, r0, m15), 'b'pidachboden/gpio/testinput17'', ... (3 bytes)
2020-12-09 08:25:50,705 [DEBUG] [gpio    ] [gpio                    ] Polling timer fired
2020-12-09 08:25:50,710 [DEBUG] [gpio    ] [gpio                    ] Polling all pins
2020-12-09 08:25:50,714 [DEBUG] [gpio    ] [gpio.digital            ] Read state ON logic HIGH from 'testinput17' on GPIO17
2020-12-09 08:25:50,722 [DEBUG] [mqtt    ] [mqtt.client             ] Sending PUBLISH (d0, q0, r0, m16), 'b'pidachboden/gpio/testinput17'', ... (2 bytes)
2020-12-09 08:25:55,710 [DEBUG] [gpio    ] [gpio                    ] Polling timer fired
2020-12-09 08:25:55,714 [DEBUG] [gpio    ] [gpio                    ] Polling all pins
2020-12-09 08:25:55,719 [DEBUG] [gpio    ] [gpio.digital            ] Read state OFF logic LOW from 'testinput17' on GPIO17
2020-12-09 08:25:55,727 [DEBUG] [mqtt    ] [mqtt.client             ] Sending PUBLISH (d0, q0, r0, m17), 'b'pidachboden/gpio/testinput17'', ... (3 bytes)
2020-12-09 08:25:57,732 [DEBUG] [mqtt    ] [mqtt.client             ] Sending PINGREQ
2020-12-09 08:25:57,738 [DEBUG] [mqtt    ] [mqtt.client             ] Received PINGRESP
2020-12-09 08:26:00,714 [DEBUG] [gpio    ] [gpio                    ] Polling timer fired
2020-12-09 08:26:00,719 [DEBUG] [gpio    ] [gpio                    ] Polling all pins
2020-12-09 08:26:00,724 [DEBUG] [gpio    ] [gpio.digital            ] Read state ON logic HIGH from 'testinput17' on GPIO17
2020-12-09 08:26:00,732 [DEBUG] [mqtt    ] [mqtt.client             ] Sending PUBLISH (d0, q0, r0, m18), 'b'pidachboden/gpio/testinput17'', ... (2 bytes)
2020-12-09 08:26:05,719 [DEBUG] [gpio    ] [gpio                    ] Polling timer fired
2020-12-09 08:26:05,730 [DEBUG] [gpio    ] [gpio                    ] Polling all pins
2020-12-09 08:26:05,733 [DEBUG] [gpio    ] [gpio.digital            ] Read state OFF logic LOW from 'testinput17' on GPIO17
2020-12-09 08:26:05,761 [DEBUG] [mqtt    ] [mqtt.client             ] Sending PUBLISH (d0, q0, r0, m19), 'b'pidachboden/gpio/testinput17'', ... (3 bytes)
2020-12-09 08:26:10,730 [DEBUG] [gpio    ] [gpio                    ] Polling timer fired
2020-12-09 08:26:10,734 [DEBUG] [gpio    ] [gpio                    ] Polling all pins
2020-12-09 08:26:10,739 [DEBUG] [gpio    ] [gpio.digital            ] Read state OFF logic LOW from 'testinput17' on GPIO17
2020-12-09 08:26:10,765 [DEBUG] [mqtt    ] [mqtt.client             ] Sending PUBLISH (d0, q0, r0, m20), 'b'pidachboden/gpio/testinput17'', ... (3 bytes)
2020-12-09 08:26:12,772 [DEBUG] [mqtt    ] [mqtt.client             ] Sending PINGREQ
2020-12-09 08:26:12,777 [DEBUG] [mqtt    ] [mqtt.client             ] Received PINGRESP
2020-12-09 08:26:15,734 [DEBUG] [gpio    ] [gpio                    ] Polling timer fired
2020-12-09 08:26:15,739 [DEBUG] [gpio    ] [gpio                    ] Polling all pins
2020-12-09 08:26:15,744 [DEBUG] [gpio    ] [gpio.digital            ] Read state OFF logic LOW from 'testinput17' on GPIO17
2020-12-09 08:26:15,766 [DEBUG] [mqtt    ] [mqtt.client             ] Sending PUBLISH (d0, q0, r0, m21), 'b'pidachboden/gpio/testinput17'', ... (3 bytes)
2020-12-09 08:26:20,740 [DEBUG] [gpio    ] [gpio                    ] Polling timer fired
2020-12-09 08:26:20,750 [DEBUG] [gpio    ] [gpio                    ] Polling all pins
2020-12-09 08:26:20,753 [DEBUG] [gpio    ] [gpio.digital            ] Read state OFF logic LOW from 'testinput17' on GPIO17
2020-12-09 08:26:20,765 [DEBUG] [mqtt    ] [mqtt.client             ] Sending PUBLISH (d0, q0, r0, m22), 'b'pidachboden/gpio/testinput17'', ... (3 bytes)
2020-12-09 08:26:25,750 [DEBUG] [gpio    ] [gpio                    ] Polling timer fired
2020-12-09 08:26:25,754 [DEBUG] [gpio    ] [gpio                    ] Polling all pins
2020-12-09 08:26:25,759 [DEBUG] [gpio    ] [gpio.digital            ] Read state OFF logic LOW from 'testinput17' on GPIO17
2020-12-09 08:26:25,791 [DEBUG] [mqtt    ] [mqtt.client             ] Sending PUBLISH (d0, q0, r0, m23), 'b'pidachboden/gpio/testinput17'', ... (3 bytes)
2020-12-09 08:26:27,797 [DEBUG] [mqtt    ] [mqtt.client             ] Sending PINGREQ
2020-12-09 08:26:27,802 [DEBUG] [mqtt    ] [mqtt.client             ] Received PINGRESP
2020-12-09 08:26:28,186 [DEBUG] [gpio    ] [gpio                    ] Stopping polling timer
2020-12-09 08:26:28,189 [DEBUG] [gpio    ] [gpio                    ] Running pin cleanup
2020-12-09 08:26:28,771 [DEBUG] [core    ] [core                    ] Subproccess for module 'gpio' stopped cleanly
2020-12-09 08:26:28,776 [INFO ] [core    ] [core                    ] Module 'gpio' unloaded
2020-12-09 08:26:28,798 [DEBUG] [mqtt    ] [mqtt                    ] Disconnecting
2020-12-09 08:26:28,801 [DEBUG] [mqtt    ] [mqtt.client             ] Sending PUBLISH (d0, q0, r1, m24), 'b'pidachboden/lwt'', ... (7 bytes)
2020-12-09 08:26:28,806 [DEBUG] [mqtt    ] [mqtt.client             ] Sending DISCONNECT
2020-12-09 08:26:28,809 [DEBUG] [mqtt    ] [mqtt                    ] Stopping MQTT client loop
2020-12-09 08:26:28,825 [DEBUG] [core    ] [core                    ] Subproccess for module 'mqtt' stopped cleanly
2020-12-09 08:26:28,828 [INFO ] [core    ] [core                    ] Module 'mqtt' unloaded
2020-12-09 08:26:29,650 [DEBUG] [core    ] [bus.receive             ] Message Bus Receive thread stopped cleanly
2020-12-09 08:26:29,770 [DEBUG] [core    ] [bus.transmit            ] Message Bus Transmit thread stopped cleanly
2020-12-09 08:26:29,773 [INFO ] [core    ] [core                    ] MQTTany stopped