MQTTany - GPIO and more over MQTT

Well this is puzzling indeed. I appreciate your willingness to get to the bottom of this.

Could you run it again with -vv, once with and once without access to /dev/gpiochip0 since neither wants to work.

I would be interested to see if it’s working for you on a 3B, yes.

Appreciation is on my side for you taking all the time to support.

Now on a 3b, mqttany v0.12.0 is running under user pi:

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

/dev/gpiochip0 set to root:gpio:

Summary
pi@pigarage:/opt/mqttany $ python3 mqttany/mqttany.py -vv
2020-12-09 14:10:49,501 [INFO ] [core    ] [core                    ] MQTTany 0.12.0 starting
2020-12-09 14:10:49,738 [INFO ] [core    ] [core.gpio               ] Detected board: RASPBERRY_PI_3B
2020-12-09 14:10:49,739 [DEBUG] [core    ] [core.gpio               ] Detected GPIO character device
2020-12-09 14:10:49,740 [DEBUG] [core    ] [config                  ] Loading config file
2020-12-09 14:10:49,833 [DEBUG] [core    ] [core                    ] Loading module 'mqtt'
2020-12-09 14:10:49,871 [DEBUG] [core    ] [core                    ] Module 'mqtt' is a communication module
2020-12-09 14:10:50,013 [DEBUG] [core    ] [mqtt                    ] Parsing config
2020-12-09 14:10:50,014 [TRACE] [core    ] [mqtt                    ] Got value '192.168.2.211' for config option 'host'
2020-12-09 14:10:50,015 [TRACE] [core    ] [mqtt                    ] Using default value '1883' for config option 'port'
2020-12-09 14:10:50,016 [TRACE] [core    ] [mqtt                    ] Using default value '{hostname}' for config option 'client id'
2020-12-09 14:10:50,017 [TRACE] [core    ] [mqtt                    ] Using default value '' for config option 'username'
2020-12-09 14:10:50,018 [TRACE] [core    ] [mqtt                    ] Using default value '' for config option 'password'
2020-12-09 14:10:50,019 [TRACE] [core    ] [mqtt                    ] Using default value '0' for config option 'qos'
2020-12-09 14:10:50,019 [TRACE] [core    ] [mqtt                    ] Using default value 'False' for config option 'retain'
2020-12-09 14:10:50,020 [TRACE] [core    ] [mqtt                    ] Using default value '{client_id}' for config option 'root topic'
2020-12-09 14:10:50,021 [TRACE] [core    ] [mqtt                    ] Using default value 'lwt' for config option 'lwt topic'
2020-12-09 14:10:50,022 [TRACE] [core    ] [mqtt                    ] Using default value '300' for config option 'heartbeat interval'
2020-12-09 14:10:50,023 [DEBUG] [core    ] [mqtt                    ] Config loaded successfully
2020-12-09 14:10:50,024 [DEBUG] [core    ] [core                    ] Module 'mqtt' loaded successfully
2020-12-09 14:10:50,025 [DEBUG] [core    ] [bus                     ] Module 'mqtt' added as a receiver
2020-12-09 14:10:50,029 [DEBUG] [core    ] [bus                     ] Module 'mqtt' added as a transmitter
2020-12-09 14:10:50,030 [DEBUG] [core    ] [core                    ] Loading module 'gpio'
2020-12-09 14:10:50,071 [DEBUG] [core    ] [core                    ] Module 'gpio' is an interface module
2020-12-09 14:10:50,074 [DEBUG] [core    ] [gpio                    ] Parsing config
2020-12-09 14:10:50,075 [TRACE] [core    ] [gpio                    ] Using default value 'Mode.SOC' for config option 'mode'
2020-12-09 14:10:50,076 [TRACE] [core    ] [gpio                    ] Got value '5' for config option 'polling interval'
2020-12-09 14:10:50,077 [TRACE] [core    ] [gpio                    ] Using default value '50' for config option 'debounce'
2020-12-09 14:10:50,078 [TRACE] [core    ] [gpio                    ] Found regex '.+' in options
2020-12-09 14:10:50,079 [TRACE] [core    ] [gpio                    ] Config key 'testinput17' matched to options regex '.+'
2020-12-09 14:10:50,080 [TRACE] [core    ] [gpio                    ] Descending into section 'testinput17'
2020-12-09 14:10:50,081 [TRACE] [core    ] [gpio                    ] Got value '17' for config option 'pin'
2020-12-09 14:10:50,082 [TRACE] [core    ] [gpio                    ] Using default value '{pin_id}' for config option 'name'
2020-12-09 14:10:50,083 [TRACE] [core    ] [gpio                    ] Using default value '0' for config option 'first index'
2020-12-09 14:10:50,084 [TRACE] [core    ] [gpio                    ] Got selection 'input' for config option 'pin mode'
2020-12-09 14:10:50,085 [TRACE] [core    ] [gpio                    ] Using default value 'PinBias.NONE' for config option 'resistor'
2020-12-09 14:10:50,085 [TRACE] [core    ] [gpio                    ] Condition 'pin mode==PinMode.INPUT' matched for 'digital'
2020-12-09 14:10:50,086 [TRACE] [core    ] [gpio                    ] Descending into section 'digital'
2020-12-09 14:10:50,087 [TRACE] [core    ] [gpio                    ] Got selection 'both' for config option 'interrupt'
2020-12-09 14:10:50,088 [TRACE] [core    ] [gpio                    ] Using default value 'False' for config option 'invert'
2020-12-09 14:10:50,089 [TRACE] [core    ] [gpio                    ] Using default value 'False' for config option 'initial state'
2020-12-09 14:10:50,090 [TRACE] [core    ] [gpio                    ] Skipping 'counter' as no conditions matched
2020-12-09 14:10:50,091 [DEBUG] [core    ] [gpio                    ] Config loaded
2020-12-09 14:10:50,115 [DEBUG] [core    ] [core.gpio.board         ] 'gpio.pin.digital' acquired lock on GPIO17 (GPIO17)
2020-12-09 14:10:50,117 [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-09 14:10:50,118 [DEBUG] [core    ] [core                    ] Module 'gpio' loaded successfully
2020-12-09 14:10:50,119 [DEBUG] [core    ] [bus                     ] Module 'gpio' added as a publisher
2020-12-09 14:10:50,121 [DEBUG] [core    ] [bus                     ] Module 'gpio' added as a subscriber
2020-12-09 14:10:50,122 [TRACE] [core    ] [core                    ] Creating process for 'mqtt'
2020-12-09 14:10:50,123 [TRACE] [core    ] [core                    ] Process created successfully for module 'mqtt'
2020-12-09 14:10:50,124 [TRACE] [core    ] [core                    ] Starting process for 'mqtt'
2020-12-09 14:10:50,130 [INFO ] [core    ] [core                    ] Module 'mqtt' started successfully
2020-12-09 14:10:50,133 [TRACE] [core    ] [core                    ] Creating process for 'gpio'
2020-12-09 14:10:50,135 [TRACE] [core    ] [core                    ] Process created successfully for module 'gpio'
2020-12-09 14:10:50,136 [TRACE] [core    ] [core                    ] Starting process for 'gpio'
2020-12-09 14:10:50,138 [DEBUG] [mqtt    ] [mqtt                    ] Creating MQTT client
2020-12-09 14:10:50,143 [DEBUG] [mqtt    ] [mqtt                    ] Attaching callbacks
2020-12-09 14:10:50,142 [INFO ] [core    ] [core                    ] Module 'gpio' started successfully
2020-12-09 14:10:50,146 [DEBUG] [mqtt    ] [mqtt                    ] Queuing connect event
2020-12-09 14:10:50,147 [DEBUG] [core    ] [bus                     ] Starting Message Bus Receive thread
2020-12-09 14:10:50,147 [DEBUG] [mqtt    ] [mqtt                    ] Starting MQTT client thread
2020-12-09 14:10:50,150 [TRACE] [core    ] [bus.receive             ] Message Bus Receive thread started successfully
2020-12-09 14:10:50,150 [DEBUG] [core    ] [bus                     ] Starting Message Bus Transmit thread
2020-12-09 14:10:50,153 [DEBUG] [gpio    ] [gpio                    ] Setting up hardware
2020-12-09 14:10:50,155 [TRACE] [core    ] [bus.transmit            ] Message Bus Transmit thread started successfully
2020-12-09 14:10:50,156 [INFO ] [gpio    ] [gpio.digital            ] Setting up 'testinput17' on GPIO17 as INPUT
2020-12-09 14:10:50,157 [DEBUG] [gpio    ] [core.gpio.pin.digital   ] Setting up pin GPIO17 using chardev
2020-12-09 14:10:50,161 [DEBUG] [gpio    ] [gpio                    ] Starting polling timer with interval of 5s
2020-12-09 14:10:50,164 [DEBUG] [gpio    ] [gpio                    ] Polling all pins
2020-12-09 14:10:50,167 [DEBUG] [gpio    ] [gpio.digital            ] Read state OFF logic LOW from 'testinput17' on GPIO17
2020-12-09 14:10:50,167 [TRACE] [core    ] [bus.transmit            ] Message received on publish queue: Message('gpio/polling-interval', '5')
2020-12-09 14:10:50,169 [DEBUG] [mqtt    ] [mqtt.client             ] Sending CONNECT (u1, p1, wr1, wq0, wf1, c0, k15) client_id=b'pigarage'
2020-12-09 14:10:50,170 [TRACE] [core    ] [bus.transmit            ] Message received on publish queue: Message('gpio/testinput17', 'OFF')
2020-12-09 14:10:50,173 [DEBUG] [mqtt    ] [mqtt.client             ] Received CONNACK (1, 0)
2020-12-09 14:10:50,174 [INFO ] [mqtt    ] [mqtt                    ] Connected to broker '192.168.2.211:1883'
2020-12-09 14:10:50,175 [DEBUG] [mqtt    ] [mqtt                    ] Resuming previous session
2020-12-09 14:10:50,176 [DEBUG] [mqtt    ] [mqtt.client             ] Sending SUBSCRIBE (d0, m1) [(b'pigarage/+/+/+/#', 0)]
2020-12-09 14:10:50,178 [TRACE] [mqtt    ] [mqtt                    ] Message received to transmit: Message('gpio/polling-interval', '5')
2020-12-09 14:10:50,180 [DEBUG] [mqtt    ] [mqtt                    ] Heartbeat
2020-12-09 14:10:50,181 [DEBUG] [mqtt    ] [mqtt.client             ] Sending PUBLISH (d0, q0, r1, m2), 'b'pigarage/gpio/polling-interval'', ... (1 bytes)
2020-12-09 14:10:50,182 [DEBUG] [mqtt    ] [mqtt.client             ] Sending PUBLISH (d0, q0, r1, m3), 'b'pigarage/lwt'', ... (6 bytes)
2020-12-09 14:10:50,184 [TRACE] [mqtt    ] [mqtt                    ] Message received to transmit: Message('gpio/testinput17', 'OFF')
2020-12-09 14:10:50,185 [DEBUG] [mqtt    ] [mqtt.client             ] Sending PUBLISH (d0, q0, r0, m4), 'b'pigarage/version'', ... (6 bytes)
2020-12-09 14:10:50,186 [DEBUG] [mqtt    ] [mqtt.client             ] Sending PUBLISH (d0, q0, r0, m5), 'b'pigarage/gpio/testinput17'', ... (3 bytes)
2020-12-09 14:10:50,190 [DEBUG] [mqtt    ] [mqtt.client             ] Received SUBACK
2020-12-09 14:10:55,164 [DEBUG] [gpio    ] [gpio                    ] Polling timer fired
2020-12-09 14:10:55,166 [DEBUG] [gpio    ] [gpio                    ] Polling all pins
2020-12-09 14:10:55,168 [DEBUG] [gpio    ] [gpio.digital            ] Read state OFF logic LOW from 'testinput17' on GPIO17
2020-12-09 14:10:55,172 [TRACE] [core    ] [bus.transmit            ] Message received on publish queue: Message('gpio/testinput17', 'OFF')
2020-12-09 14:10:55,198 [TRACE] [mqtt    ] [mqtt                    ] Message received to transmit: Message('gpio/testinput17', 'OFF')
2020-12-09 14:10:55,200 [DEBUG] [mqtt    ] [mqtt.client             ] Sending PUBLISH (d0, q0, r0, m6), 'b'pigarage/gpio/testinput17'', ... (3 bytes)
2020-12-09 14:11:00,167 [DEBUG] [gpio    ] [gpio                    ] Polling timer fired
2020-12-09 14:11:00,169 [DEBUG] [gpio    ] [gpio                    ] Polling all pins
2020-12-09 14:11:00,171 [DEBUG] [gpio    ] [gpio.digital            ] Read state OFF logic LOW from 'testinput17' on GPIO17
2020-12-09 14:11:00,174 [TRACE] [core    ] [bus.transmit            ] Message received on publish queue: Message('gpio/testinput17', 'OFF')
2020-12-09 14:11:00,192 [TRACE] [mqtt    ] [mqtt                    ] Message received to transmit: Message('gpio/testinput17', 'OFF')
2020-12-09 14:11:00,194 [DEBUG] [mqtt    ] [mqtt.client             ] Sending PUBLISH (d0, q0, r0, m7), 'b'pigarage/gpio/testinput17'', ... (3 bytes)
2020-12-09 14:11:05,169 [DEBUG] [gpio    ] [gpio                    ] Polling timer fired
2020-12-09 14:11:05,203 [DEBUG] [mqtt    ] [mqtt.client             ] Sending PINGREQ
2020-12-09 14:11:05,312 [DEBUG] [gpio    ] [gpio                    ] Polling all pins
2020-12-09 14:11:05,312 [DEBUG] [mqtt    ] [mqtt.client             ] Received PINGRESP
2020-12-09 14:11:05,315 [DEBUG] [gpio    ] [gpio.digital            ] Read state OFF logic LOW from 'testinput17' on GPIO17
2020-12-09 14:11:05,318 [TRACE] [core    ] [bus.transmit            ] Message received on publish queue: Message('gpio/testinput17', 'OFF')
2020-12-09 14:11:05,341 [TRACE] [mqtt    ] [mqtt                    ] Message received to transmit: Message('gpio/testinput17', 'OFF')
2020-12-09 14:11:05,343 [DEBUG] [mqtt    ] [mqtt.client             ] Sending PUBLISH (d0, q0, r0, m8), 'b'pigarage/gpio/testinput17'', ... (3 bytes)
2020-12-09 14:11:10,312 [DEBUG] [gpio    ] [gpio                    ] Polling timer fired
2020-12-09 14:11:10,314 [DEBUG] [gpio    ] [gpio                    ] Polling all pins
2020-12-09 14:11:10,451 [DEBUG] [gpio    ] [gpio.digital            ] Read state OFF logic LOW from 'testinput17' on GPIO17
2020-12-09 14:11:10,454 [TRACE] [core    ] [bus.transmit            ] Message received on publish queue: Message('gpio/testinput17', 'OFF')
2020-12-09 14:11:10,463 [TRACE] [mqtt    ] [mqtt                    ] Message received to transmit: Message('gpio/testinput17', 'OFF')
2020-12-09 14:11:10,466 [DEBUG] [mqtt    ] [mqtt.client             ] Sending PUBLISH (d0, q0, r0, m9), 'b'pigarage/gpio/testinput17'', ... (3 bytes)
2020-12-09 14:11:10,836 [TRACE] [core    ] [core                    ] Stopping subprocess for 'gpio' with 10s timeout
2020-12-09 14:11:10,840 [TRACE] [gpio    ] [gpio                    ] Module stopping
2020-12-09 14:11:10,842 [DEBUG] [gpio    ] [gpio                    ] Stopping polling timer
2020-12-09 14:11:10,845 [DEBUG] [gpio    ] [gpio                    ] Running pin cleanup
2020-12-09 14:11:11,197 [DEBUG] [core    ] [core                    ] Subproccess for module 'gpio' stopped cleanly
2020-12-09 14:11:11,199 [INFO ] [core    ] [core                    ] Module 'gpio' unloaded
2020-12-09 14:11:11,201 [TRACE] [core    ] [core                    ] Stopping subprocess for 'mqtt' with 10s timeout
2020-12-09 14:11:11,207 [TRACE] [mqtt    ] [mqtt                    ] Module stopping
2020-12-09 14:11:11,209 [DEBUG] [mqtt    ] [mqtt                    ] Disconnecting
2020-12-09 14:11:11,211 [DEBUG] [mqtt    ] [mqtt.client             ] Sending PUBLISH (d0, q0, r1, m10), 'b'pigarage/lwt'', ... (7 bytes)
2020-12-09 14:11:11,214 [DEBUG] [mqtt    ] [mqtt.client             ] Sending DISCONNECT
2020-12-09 14:11:11,217 [DEBUG] [mqtt    ] [mqtt                    ] Stopping MQTT client loop
2020-12-09 14:11:11,229 [DEBUG] [core    ] [core                    ] Subproccess for module 'mqtt' stopped cleanly
2020-12-09 14:11:11,231 [INFO ] [core    ] [core                    ] Module 'mqtt' unloaded
2020-12-09 14:11:11,232 [TRACE] [core    ] [bus                     ] Stopping Message Bus threads
2020-12-09 14:11:11,234 [TRACE] [core    ] [bus                     ] Stopping Message Bus Receive thread with 10s timeout
2020-12-09 14:11:11,458 [DEBUG] [core    ] [bus.transmit            ] Message Bus Transmit thread stopped cleanly
2020-12-09 14:11:12,183 [DEBUG] [core    ] [bus.receive             ] Message Bus Receive thread stopped 

/dev/gpiochip0 set to root:root:

Summary
pi@pigarage:/opt/mqttany $ python3 mqttany/mqttany.py -vv
2020-12-09 14:12:06,505 [INFO ] [core    ] [core                    ] MQTTany 0.12.0 starting
2020-12-09 14:12:06,741 [INFO ] [core    ] [core.gpio               ] Detected board: RASPBERRY_PI_3B
2020-12-09 14:12:06,743 [WARN ] [core    ] [core.gpio               ] Detected GPIO character device but this account (pi) does not have R/W permissions
2020-12-09 14:12:06,745 [WARN ] [core    ] [core.gpio               ] Read/Write access is required on the following files: ['/dev/gpiochip0']
2020-12-09 14:12:06,746 [WARN ] [core    ] [core.gpio               ] Attempting to fall back to sysfs
2020-12-09 14:12:06,747 [DEBUG] [core    ] [core.gpio               ] Falling back to sysfs
2020-12-09 14:12:06,747 [DEBUG] [core    ] [config                  ] Loading config file
2020-12-09 14:12:06,839 [DEBUG] [core    ] [core                    ] Loading module 'mqtt'
2020-12-09 14:12:06,878 [DEBUG] [core    ] [core                    ] Module 'mqtt' is a communication module
2020-12-09 14:12:07,019 [DEBUG] [core    ] [mqtt                    ] Parsing config
2020-12-09 14:12:07,021 [TRACE] [core    ] [mqtt                    ] Got value '192.168.2.211' for config option 'host'
2020-12-09 14:12:07,022 [TRACE] [core    ] [mqtt                    ] Using default value '1883' for config option 'port'
2020-12-09 14:12:07,023 [TRACE] [core    ] [mqtt                    ] Using default value '{hostname}' for config option 'client id'
2020-12-09 14:12:07,023 [TRACE] [core    ] [mqtt                    ] Using default value '' for config option 'username'
2020-12-09 14:12:07,024 [TRACE] [core    ] [mqtt                    ] Using default value '' for config option 'password'
2020-12-09 14:12:07,025 [TRACE] [core    ] [mqtt                    ] Using default value '0' for config option 'qos'
2020-12-09 14:12:07,026 [TRACE] [core    ] [mqtt                    ] Using default value 'False' for config option 'retain'
2020-12-09 14:12:07,027 [TRACE] [core    ] [mqtt                    ] Using default value '{client_id}' for config option 'root topic'
2020-12-09 14:12:07,028 [TRACE] [core    ] [mqtt                    ] Using default value 'lwt' for config option 'lwt topic'
2020-12-09 14:12:07,029 [TRACE] [core    ] [mqtt                    ] Using default value '300' for config option 'heartbeat interval'
2020-12-09 14:12:07,030 [DEBUG] [core    ] [mqtt                    ] Config loaded successfully
2020-12-09 14:12:07,031 [DEBUG] [core    ] [core                    ] Module 'mqtt' loaded successfully
2020-12-09 14:12:07,032 [DEBUG] [core    ] [bus                     ] Module 'mqtt' added as a receiver
2020-12-09 14:12:07,036 [DEBUG] [core    ] [bus                     ] Module 'mqtt' added as a transmitter
2020-12-09 14:12:07,037 [DEBUG] [core    ] [core                    ] Loading module 'gpio'
2020-12-09 14:12:07,078 [DEBUG] [core    ] [core                    ] Module 'gpio' is an interface module
2020-12-09 14:12:07,081 [DEBUG] [core    ] [gpio                    ] Parsing config
2020-12-09 14:12:07,082 [TRACE] [core    ] [gpio                    ] Using default value 'Mode.SOC' for config option 'mode'
2020-12-09 14:12:07,083 [TRACE] [core    ] [gpio                    ] Got value '5' for config option 'polling interval'
2020-12-09 14:12:07,084 [TRACE] [core    ] [gpio                    ] Using default value '50' for config option 'debounce'
2020-12-09 14:12:07,084 [TRACE] [core    ] [gpio                    ] Found regex '.+' in options
2020-12-09 14:12:07,086 [TRACE] [core    ] [gpio                    ] Config key 'testinput17' matched to options regex '.+'
2020-12-09 14:12:07,087 [TRACE] [core    ] [gpio                    ] Descending into section 'testinput17'
2020-12-09 14:12:07,088 [TRACE] [core    ] [gpio                    ] Got value '17' for config option 'pin'
2020-12-09 14:12:07,089 [TRACE] [core    ] [gpio                    ] Using default value '{pin_id}' for config option 'name'
2020-12-09 14:12:07,089 [TRACE] [core    ] [gpio                    ] Using default value '0' for config option 'first index'
2020-12-09 14:12:07,090 [TRACE] [core    ] [gpio                    ] Got selection 'input' for config option 'pin mode'
2020-12-09 14:12:07,091 [TRACE] [core    ] [gpio                    ] Using default value 'PinBias.NONE' for config option 'resistor'
2020-12-09 14:12:07,092 [TRACE] [core    ] [gpio                    ] Condition 'pin mode==PinMode.INPUT' matched for 'digital'
2020-12-09 14:12:07,093 [TRACE] [core    ] [gpio                    ] Descending into section 'digital'
2020-12-09 14:12:07,094 [TRACE] [core    ] [gpio                    ] Got selection 'both' for config option 'interrupt'
2020-12-09 14:12:07,095 [TRACE] [core    ] [gpio                    ] Using default value 'False' for config option 'invert'
2020-12-09 14:12:07,096 [TRACE] [core    ] [gpio                    ] Using default value 'False' for config option 'initial state'
2020-12-09 14:12:07,096 [TRACE] [core    ] [gpio                    ] Skipping 'counter' as no conditions matched
2020-12-09 14:12:07,097 [DEBUG] [core    ] [gpio                    ] Config loaded
2020-12-09 14:12:07,122 [DEBUG] [core    ] [core.gpio.board         ] 'gpio.pin.digital' acquired lock on GPIO17 (GPIO17)
2020-12-09 14:12:07,123 [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-09 14:12:07,124 [DEBUG] [core    ] [core                    ] Module 'gpio' loaded successfully
2020-12-09 14:12:07,125 [DEBUG] [core    ] [bus                     ] Module 'gpio' added as a publisher
2020-12-09 14:12:07,128 [DEBUG] [core    ] [bus                     ] Module 'gpio' added as a subscriber
2020-12-09 14:12:07,129 [TRACE] [core    ] [core                    ] Creating process for 'mqtt'
2020-12-09 14:12:07,130 [TRACE] [core    ] [core                    ] Process created successfully for module 'mqtt'
2020-12-09 14:12:07,130 [TRACE] [core    ] [core                    ] Starting process for 'mqtt'
2020-12-09 14:12:07,137 [INFO ] [core    ] [core                    ] Module 'mqtt' started successfully
2020-12-09 14:12:07,140 [TRACE] [core    ] [core                    ] Creating process for 'gpio'
2020-12-09 14:12:07,142 [TRACE] [core    ] [core                    ] Process created successfully for module 'gpio'
2020-12-09 14:12:07,143 [TRACE] [core    ] [core                    ] Starting process for 'gpio'
2020-12-09 14:12:07,145 [DEBUG] [mqtt    ] [mqtt                    ] Creating MQTT client
2020-12-09 14:12:07,150 [DEBUG] [mqtt    ] [mqtt                    ] Attaching callbacks
2020-12-09 14:12:07,149 [INFO ] [core    ] [core                    ] Module 'gpio' started successfully
2020-12-09 14:12:07,152 [DEBUG] [mqtt    ] [mqtt                    ] Queuing connect event
2020-12-09 14:12:07,154 [DEBUG] [mqtt    ] [mqtt                    ] Starting MQTT client thread
2020-12-09 14:12:07,154 [DEBUG] [core    ] [bus                     ] Starting Message Bus Receive thread
2020-12-09 14:12:07,156 [TRACE] [core    ] [bus.receive             ] Message Bus Receive thread started successfully
2020-12-09 14:12:07,159 [DEBUG] [gpio    ] [gpio                    ] Setting up hardware
2020-12-09 14:12:07,158 [DEBUG] [core    ] [bus                     ] Starting Message Bus Transmit thread
2020-12-09 14:12:07,161 [INFO ] [gpio    ] [gpio.digital            ] Setting up 'testinput17' on GPIO17 as INPUT
2020-12-09 14:12:07,163 [DEBUG] [gpio    ] [core.gpio.pin.digital   ] Setting up pin GPIO17 using sysfs
2020-12-09 14:12:07,163 [TRACE] [core    ] [bus.transmit            ] Message Bus Transmit thread started successfully
2020-12-09 14:12:07,176 [DEBUG] [mqtt    ] [mqtt.client             ] Sending CONNECT (u1, p1, wr1, wq0, wf1, c0, k15) client_id=b'pigarage'
2020-12-09 14:12:07,180 [DEBUG] [mqtt    ] [mqtt.client             ] Received CONNACK (1, 0)
2020-12-09 14:12:07,181 [INFO ] [mqtt    ] [mqtt                    ] Connected to broker '192.168.2.211:1883'
2020-12-09 14:12:07,182 [DEBUG] [mqtt    ] [mqtt                    ] Resuming previous session
2020-12-09 14:12:07,183 [DEBUG] [mqtt    ] [mqtt.client             ] Sending SUBSCRIBE (d0, m1) [(b'pigarage/+/+/+/#', 0)]
2020-12-09 14:12:07,187 [DEBUG] [mqtt    ] [mqtt                    ] Heartbeat
2020-12-09 14:12:07,188 [DEBUG] [mqtt    ] [mqtt.client             ] Sending PUBLISH (d0, q0, r1, m2), 'b'pigarage/lwt'', ... (6 bytes)
2020-12-09 14:12:07,190 [DEBUG] [mqtt    ] [mqtt.client             ] Sending PUBLISH (d0, q0, r0, m3), 'b'pigarage/version'', ... (6 bytes)
2020-12-09 14:12:07,195 [DEBUG] [mqtt    ] [mqtt.client             ] Received SUBACK
2020-12-09 14:12:07,269 [DEBUG] [gpio    ] [gpio                    ] Starting polling timer with interval of 5s
2020-12-09 14:12:07,271 [DEBUG] [gpio    ] [gpio                    ] Polling all pins
2020-12-09 14:12:07,272 [DEBUG] [gpio    ] [gpio.digital            ] Read state OFF logic LOW from 'testinput17' on GPIO17
2020-12-09 14:12:07,275 [TRACE] [core    ] [bus.transmit            ] Message received on publish queue: Message('gpio/polling-interval', '5')
2020-12-09 14:12:07,278 [TRACE] [core    ] [bus.transmit            ] Message received on publish queue: Message('gpio/testinput17', 'OFF')
2020-12-09 14:12:07,287 [TRACE] [mqtt    ] [mqtt                    ] Message received to transmit: Message('gpio/polling-interval', '5')
2020-12-09 14:12:07,289 [DEBUG] [mqtt    ] [mqtt.client             ] Sending PUBLISH (d0, q0, r1, m4), 'b'pigarage/gpio/polling-interval'', ... (1 bytes)
2020-12-09 14:12:07,291 [TRACE] [mqtt    ] [mqtt                    ] Message received to transmit: Message('gpio/testinput17', 'OFF')
2020-12-09 14:12:07,292 [DEBUG] [mqtt    ] [mqtt.client             ] Sending PUBLISH (d0, q0, r0, m5), 'b'pigarage/gpio/testinput17'', ... (3 bytes)
2020-12-09 14:12:12,271 [DEBUG] [gpio    ] [gpio                    ] Polling timer fired
2020-12-09 14:12:12,274 [DEBUG] [gpio    ] [gpio                    ] Polling all pins
2020-12-09 14:12:12,277 [DEBUG] [gpio    ] [gpio.digital            ] Read state OFF logic LOW from 'testinput17' on GPIO17
2020-12-09 14:12:12,280 [TRACE] [core    ] [bus.transmit            ] Message received on publish queue: Message('gpio/testinput17', 'OFF')
2020-12-09 14:12:12,305 [TRACE] [mqtt    ] [mqtt                    ] Message received to transmit: Message('gpio/testinput17', 'OFF')
2020-12-09 14:12:12,307 [DEBUG] [mqtt    ] [mqtt.client             ] Sending PUBLISH (d0, q0, r0, m6), 'b'pigarage/gpio/testinput17'', ... (3 bytes)
2020-12-09 14:12:17,274 [DEBUG] [gpio    ] [gpio                    ] Polling timer fired
2020-12-09 14:12:17,277 [DEBUG] [gpio    ] [gpio                    ] Polling all pins
2020-12-09 14:12:17,415 [DEBUG] [gpio    ] [gpio.digital            ] Read state OFF logic LOW from 'testinput17' on GPIO17
2020-12-09 14:12:17,418 [TRACE] [core    ] [bus.transmit            ] Message received on publish queue: Message('gpio/testinput17', 'OFF')
2020-12-09 14:12:17,427 [TRACE] [mqtt    ] [mqtt                    ] Message received to transmit: Message('gpio/testinput17', 'OFF')
2020-12-09 14:12:17,429 [DEBUG] [mqtt    ] [mqtt.client             ] Sending PUBLISH (d0, q0, r0, m7), 'b'pigarage/gpio/testinput17'', ... (3 bytes)
2020-12-09 14:12:22,277 [DEBUG] [gpio    ] [gpio                    ] Polling timer fired
2020-12-09 14:12:22,280 [DEBUG] [gpio    ] [gpio                    ] Polling all pins
2020-12-09 14:12:22,416 [DEBUG] [gpio    ] [gpio.digital            ] Read state OFF logic LOW from 'testinput17' on GPIO17
2020-12-09 14:12:22,419 [TRACE] [core    ] [bus.transmit            ] Message received on publish queue: Message('gpio/testinput17', 'OFF')
2020-12-09 14:12:22,422 [TRACE] [mqtt    ] [mqtt                    ] Message received to transmit: Message('gpio/testinput17', 'OFF')
2020-12-09 14:12:22,424 [DEBUG] [mqtt    ] [mqtt.client             ] Sending PUBLISH (d0, q0, r0, m8), 'b'pigarage/gpio/testinput17'', ... (3 bytes)
2020-12-09 14:12:22,427 [DEBUG] [mqtt    ] [mqtt.client             ] Sending PINGREQ
2020-12-09 14:12:22,431 [DEBUG] [mqtt    ] [mqtt.client             ] Received PINGRESP
2020-12-09 14:12:27,280 [DEBUG] [gpio    ] [gpio                    ] Polling timer fired
2020-12-09 14:12:27,282 [DEBUG] [gpio    ] [gpio                    ] Polling all pins
2020-12-09 14:12:27,419 [DEBUG] [gpio    ] [gpio.digital            ] Read state OFF logic LOW from 'testinput17' on GPIO17
2020-12-09 14:12:27,422 [TRACE] [core    ] [bus.transmit            ] Message received on publish queue: Message('gpio/testinput17', 'OFF')
2020-12-09 14:12:27,443 [TRACE] [mqtt    ] [mqtt                    ] Message received to transmit: Message('gpio/testinput17', 'OFF')
2020-12-09 14:12:27,445 [DEBUG] [mqtt    ] [mqtt.client             ] Sending PUBLISH (d0, q0, r0, m9), 'b'pigarage/gpio/testinput17'', ... (3 bytes)
2020-12-09 14:12:32,283 [DEBUG] [gpio    ] [gpio                    ] Polling timer fired
2020-12-09 14:12:32,286 [DEBUG] [gpio    ] [gpio                    ] Polling all pins
2020-12-09 14:12:32,558 [DEBUG] [gpio    ] [gpio.digital            ] Read state OFF logic LOW from 'testinput17' on GPIO17
2020-12-09 14:12:32,562 [TRACE] [core    ] [bus.transmit            ] Message received on publish queue: Message('gpio/testinput17', 'OFF')
2020-12-09 14:12:32,567 [TRACE] [mqtt    ] [mqtt                    ] Message received to transmit: Message('gpio/testinput17', 'OFF')
2020-12-09 14:12:32,569 [DEBUG] [mqtt    ] [mqtt.client             ] Sending PUBLISH (d0, q0, r0, m10), 'b'pigarage/gpio/testinput17'', ... (3 bytes)
2020-12-09 14:12:33,764 [TRACE] [core    ] [core                    ] Stopping subprocess for 'gpio' with 10s timeout
2020-12-09 14:12:33,769 [TRACE] [gpio    ] [gpio                    ] Module stopping
2020-12-09 14:12:33,771 [DEBUG] [gpio    ] [gpio                    ] Stopping polling timer
2020-12-09 14:12:33,772 [DEBUG] [gpio    ] [gpio                    ] Running pin cleanup
2020-12-09 14:12:34,311 [DEBUG] [core    ] [core                    ] Subproccess for module 'gpio' stopped cleanly
2020-12-09 14:12:34,313 [INFO ] [core    ] [core                    ] Module 'gpio' unloaded
2020-12-09 14:12:34,315 [TRACE] [core    ] [core                    ] Stopping subprocess for 'mqtt' with 10s timeout
2020-12-09 14:12:34,333 [TRACE] [mqtt    ] [mqtt                    ] Module stopping
2020-12-09 14:12:34,335 [DEBUG] [mqtt    ] [mqtt                    ] Disconnecting
2020-12-09 14:12:34,336 [DEBUG] [mqtt    ] [mqtt.client             ] Sending PUBLISH (d0, q0, r1, m11), 'b'pigarage/lwt'', ... (7 bytes)
2020-12-09 14:12:34,339 [DEBUG] [mqtt    ] [mqtt.client             ] Sending DISCONNECT
2020-12-09 14:12:34,343 [DEBUG] [mqtt    ] [mqtt                    ] Stopping MQTT client loop
2020-12-09 14:12:34,359 [DEBUG] [core    ] [core                    ] Subproccess for module 'mqtt' stopped cleanly
2020-12-09 14:12:34,361 [INFO ] [core    ] [core                    ] Module 'mqtt' unloaded
2020-12-09 14:12:34,363 [TRACE] [core    ] [bus                     ] Stopping Message Bus threads
2020-12-09 14:12:34,364 [TRACE] [core    ] [bus                     ] Stopping Message Bus Receive thread with 10s timeout
2020-12-09 14:12:34,566 [DEBUG] [core    ] [bus.transmit            ] Message Bus Transmit thread stopped cleanly
2020-12-09 14:12:35,198 [DEBUG] [core    ] [bus.receive             ] Message Bus Receive thread stopped cleanly
2020-12-09 14:12:35,200 [INFO ] [core    ] [core                    ] MQTTany stopped

Unfortunately I even don’t see the state changes from the polling anymore :joy:

Edit:

So I just swapped the sd cards from the 3b to the 2b and the polling works again. I’m lost …

Summary
pi@pigarage:/opt/mqttany $ python3 mqttany/mqttany.py -vv
2020-12-09 16:37:46,573 [INFO ] [core    ] [core                    ] MQTTany 0.12.0 starting
2020-12-09 16:37:47,010 [INFO ] [core    ] [core.gpio               ] Detected board: RASPBERRY_PI_2B
2020-12-09 16:37:47,012 [DEBUG] [core    ] [core.gpio               ] Detected GPIO character device
2020-12-09 16:37:47,014 [DEBUG] [core    ] [config                  ] Loading config file
2020-12-09 16:37:47,171 [DEBUG] [core    ] [core                    ] Loading module 'mqtt'
2020-12-09 16:37:47,239 [DEBUG] [core    ] [core                    ] Module 'mqtt' is a communication module
2020-12-09 16:37:47,490 [DEBUG] [core    ] [mqtt                    ] Parsing config
2020-12-09 16:37:47,492 [TRACE] [core    ] [mqtt                    ] Got value '192.168.2.211' for config option 'host'
2020-12-09 16:37:47,494 [TRACE] [core    ] [mqtt                    ] Using default value '1883' for config option 'port'
2020-12-09 16:37:47,496 [TRACE] [core    ] [mqtt                    ] Using default value '{hostname}' for config option 'client id'
2020-12-09 16:37:47,498 [TRACE] [core    ] [mqtt                    ] Using default value '' for config option 'username'
2020-12-09 16:37:47,499 [TRACE] [core    ] [mqtt                    ] Using default value '' for config option 'password'
2020-12-09 16:37:47,501 [TRACE] [core    ] [mqtt                    ] Using default value '0' for config option 'qos'
2020-12-09 16:37:47,503 [TRACE] [core    ] [mqtt                    ] Using default value 'False' for config option 'retain'
2020-12-09 16:37:47,505 [TRACE] [core    ] [mqtt                    ] Using default value '{client_id}' for config option 'root topic'
2020-12-09 16:37:47,506 [TRACE] [core    ] [mqtt                    ] Using default value 'lwt' for config option 'lwt topic'
2020-12-09 16:37:47,508 [TRACE] [core    ] [mqtt                    ] Using default value '300' for config option 'heartbeat interval'
2020-12-09 16:37:47,509 [DEBUG] [core    ] [mqtt                    ] Config loaded successfully
2020-12-09 16:37:47,511 [DEBUG] [core    ] [core                    ] Module 'mqtt' loaded successfully
2020-12-09 16:37:47,513 [DEBUG] [core    ] [bus                     ] Module 'mqtt' added as a receiver
2020-12-09 16:37:47,521 [DEBUG] [core    ] [bus                     ] Module 'mqtt' added as a transmitter
2020-12-09 16:37:47,523 [DEBUG] [core    ] [core                    ] Loading module 'gpio'
2020-12-09 16:37:47,598 [DEBUG] [core    ] [core                    ] Module 'gpio' is an interface module
2020-12-09 16:37:47,603 [DEBUG] [core    ] [gpio                    ] Parsing config
2020-12-09 16:37:47,605 [TRACE] [core    ] [gpio                    ] Using default value 'Mode.SOC' for config option 'mode'
2020-12-09 16:37:47,607 [TRACE] [core    ] [gpio                    ] Got value '5' for config option 'polling interval'
2020-12-09 16:37:47,608 [TRACE] [core    ] [gpio                    ] Using default value '50' for config option 'debounce'
2020-12-09 16:37:47,610 [TRACE] [core    ] [gpio                    ] Found regex '.+' in options
2020-12-09 16:37:47,613 [TRACE] [core    ] [gpio                    ] Config key 'testinput17' matched to options regex '.+'
2020-12-09 16:37:47,614 [TRACE] [core    ] [gpio                    ] Descending into section 'testinput17'
2020-12-09 16:37:47,616 [TRACE] [core    ] [gpio                    ] Got value '17' for config option 'pin'
2020-12-09 16:37:47,618 [TRACE] [core    ] [gpio                    ] Using default value '{pin_id}' for config option 'name'
2020-12-09 16:37:47,619 [TRACE] [core    ] [gpio                    ] Using default value '0' for config option 'first index'
2020-12-09 16:37:47,621 [TRACE] [core    ] [gpio                    ] Got selection 'input' for config option 'pin mode'
2020-12-09 16:37:47,623 [TRACE] [core    ] [gpio                    ] Using default value 'PinBias.NONE' for config option 'resistor'
2020-12-09 16:37:47,625 [TRACE] [core    ] [gpio                    ] Condition 'pin mode==PinMode.INPUT' matched for 'digital'
2020-12-09 16:37:47,626 [TRACE] [core    ] [gpio                    ] Descending into section 'digital'
2020-12-09 16:37:47,628 [TRACE] [core    ] [gpio                    ] Got selection 'both' for config option 'interrupt'
2020-12-09 16:37:47,629 [TRACE] [core    ] [gpio                    ] Using default value 'False' for config option 'invert'
2020-12-09 16:37:47,631 [TRACE] [core    ] [gpio                    ] Using default value 'False' for config option 'initial state'
2020-12-09 16:37:47,633 [TRACE] [core    ] [gpio                    ] Skipping 'counter' as no conditions matched
2020-12-09 16:37:47,634 [DEBUG] [core    ] [gpio                    ] Config loaded
2020-12-09 16:37:47,679 [DEBUG] [core    ] [core.gpio.board         ] 'gpio.pin.digital' acquired lock on GPIO17 (GPIO17)
2020-12-09 16:37:47,681 [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-09 16:37:47,683 [DEBUG] [core    ] [core                    ] Module 'gpio' loaded successfully
2020-12-09 16:37:47,685 [DEBUG] [core    ] [bus                     ] Module 'gpio' added as a publisher
2020-12-09 16:37:47,689 [DEBUG] [core    ] [bus                     ] Module 'gpio' added as a subscriber
2020-12-09 16:37:47,691 [TRACE] [core    ] [core                    ] Creating process for 'mqtt'
2020-12-09 16:37:47,693 [TRACE] [core    ] [core                    ] Process created successfully for module 'mqtt'
2020-12-09 16:37:47,695 [TRACE] [core    ] [core                    ] Starting process for 'mqtt'
2020-12-09 16:37:47,706 [INFO ] [core    ] [core                    ] Module 'mqtt' started successfully
2020-12-09 16:37:47,712 [TRACE] [core    ] [core                    ] Creating process for 'gpio'
2020-12-09 16:37:47,715 [TRACE] [core    ] [core                    ] Process created successfully for module 'gpio'
2020-12-09 16:37:47,718 [TRACE] [core    ] [core                    ] Starting process for 'gpio'
2020-12-09 16:37:47,722 [DEBUG] [mqtt    ] [mqtt                    ] Creating MQTT client
2020-12-09 16:37:47,729 [INFO ] [core    ] [core                    ] Module 'gpio' started successfully
2020-12-09 16:37:47,731 [DEBUG] [mqtt    ] [mqtt                    ] Attaching callbacks
2020-12-09 16:37:47,736 [DEBUG] [mqtt    ] [mqtt                    ] Queuing connect event
2020-12-09 16:37:47,737 [DEBUG] [core    ] [bus                     ] Starting Message Bus Receive thread
2020-12-09 16:37:47,739 [DEBUG] [mqtt    ] [mqtt                    ] Starting MQTT client thread
2020-12-09 16:37:47,742 [TRACE] [core    ] [bus.receive             ] Message Bus Receive thread started successfully
2020-12-09 16:37:47,743 [DEBUG] [core    ] [bus                     ] Starting Message Bus Transmit thread
2020-12-09 16:37:47,746 [DEBUG] [gpio    ] [gpio                    ] Setting up hardware
2020-12-09 16:37:47,751 [INFO ] [gpio    ] [gpio.digital            ] Setting up 'testinput17' on GPIO17 as INPUT
2020-12-09 16:37:47,751 [TRACE] [core    ] [bus.transmit            ] Message Bus Transmit thread started successfully
2020-12-09 16:37:47,754 [DEBUG] [gpio    ] [core.gpio.pin.digital   ] Setting up pin GPIO17 using chardev
2020-12-09 16:37:47,763 [DEBUG] [gpio    ] [gpio                    ] Starting polling timer with interval of 5s
2020-12-09 16:37:47,769 [DEBUG] [gpio    ] [gpio                    ] Polling all pins
2020-12-09 16:37:47,771 [DEBUG] [gpio    ] [gpio.digital            ] Read state ON logic HIGH from 'testinput17' on GPIO17
2020-12-09 16:37:47,775 [TRACE] [core    ] [bus.transmit            ] Message received on publish queue: Message('gpio/polling-interval', '5')
2020-12-09 16:37:47,774 [DEBUG] [mqtt    ] [mqtt.client             ] Sending CONNECT (u1, p1, wr1, wq0, wf1, c0, k15) client_id=b'pigarage'
2020-12-09 16:37:47,782 [DEBUG] [mqtt    ] [mqtt.client             ] Received CONNACK (1, 0)
2020-12-09 16:37:47,783 [TRACE] [core    ] [bus.transmit            ] Message received on publish queue: Message('gpio/testinput17', 'ON')
2020-12-09 16:37:47,784 [INFO ] [mqtt    ] [mqtt                    ] Connected to broker '192.168.2.211:1883'
2020-12-09 16:37:47,787 [DEBUG] [mqtt    ] [mqtt                    ] Resuming previous session
2020-12-09 16:37:47,789 [DEBUG] [mqtt    ] [mqtt.client             ] Sending SUBSCRIBE (d0, m1) [(b'pigarage/+/+/+/#', 0)]
2020-12-09 16:37:47,791 [DEBUG] [mqtt    ] [mqtt                    ] Heartbeat
2020-12-09 16:37:47,794 [DEBUG] [mqtt    ] [mqtt.client             ] Sending PUBLISH (d0, q0, r1, m2), 'b'pigarage/lwt'', ... (6 bytes)
2020-12-09 16:37:47,796 [DEBUG] [mqtt    ] [mqtt.client             ] Sending PUBLISH (d0, q0, r0, m3), 'b'pigarage/version'', ... (6 bytes)
2020-12-09 16:37:47,802 [DEBUG] [mqtt    ] [mqtt.client             ] Received SUBACK
2020-12-09 16:37:47,805 [TRACE] [mqtt    ] [mqtt                    ] Message received to transmit: Message('gpio/polling-interval', '5')
2020-12-09 16:37:47,811 [DEBUG] [mqtt    ] [mqtt.client             ] Sending PUBLISH (d0, q0, r1, m4), 'b'pigarage/gpio/polling-interval'', ... (1 bytes)
2020-12-09 16:37:47,815 [TRACE] [mqtt    ] [mqtt                    ] Message received to transmit: Message('gpio/testinput17', 'ON')
2020-12-09 16:37:47,818 [DEBUG] [mqtt    ] [mqtt.client             ] Sending PUBLISH (d0, q0, r0, m5), 'b'pigarage/gpio/testinput17'', ... (2 bytes)
2020-12-09 16:37:52,767 [DEBUG] [gpio    ] [gpio                    ] Polling timer fired
2020-12-09 16:37:52,771 [DEBUG] [gpio    ] [gpio                    ] Polling all pins
2020-12-09 16:37:52,773 [DEBUG] [gpio    ] [gpio.digital            ] Read state OFF logic LOW from 'testinput17' on GPIO17
2020-12-09 16:37:52,778 [TRACE] [core    ] [bus.transmit            ] Message received on publish queue: Message('gpio/testinput17', 'OFF')
2020-12-09 16:37:52,790 [TRACE] [mqtt    ] [mqtt                    ] Message received to transmit: Message('gpio/testinput17', 'OFF')
2020-12-09 16:37:52,794 [DEBUG] [mqtt    ] [mqtt.client             ] Sending PUBLISH (d0, q0, r0, m6), 'b'pigarage/gpio/testinput17'', ... (3 bytes)
2020-12-09 16:37:57,771 [DEBUG] [gpio    ] [gpio                    ] Polling timer fired
2020-12-09 16:37:57,776 [DEBUG] [gpio    ] [gpio                    ] Polling all pins
2020-12-09 16:37:58,050 [DEBUG] [gpio    ] [gpio.digital            ] Read state OFF logic LOW from 'testinput17' on GPIO17
2020-12-09 16:37:58,055 [TRACE] [core    ] [bus.transmit            ] Message received on publish queue: Message('gpio/testinput17', 'OFF')
2020-12-09 16:37:58,078 [TRACE] [mqtt    ] [mqtt                    ] Message received to transmit: Message('gpio/testinput17', 'OFF')
2020-12-09 16:37:58,081 [DEBUG] [mqtt    ] [mqtt.client             ] Sending PUBLISH (d0, q0, r0, m7), 'b'pigarage/gpio/testinput17'', ... (3 bytes)
2020-12-09 16:38:02,776 [DEBUG] [gpio    ] [gpio                    ] Polling timer fired
2020-12-09 16:38:02,781 [DEBUG] [gpio    ] [gpio                    ] Polling all pins
2020-12-09 16:38:03,053 [DEBUG] [gpio    ] [gpio.digital            ] Read state ON logic HIGH from 'testinput17' on GPIO17
2020-12-09 16:38:03,058 [TRACE] [core    ] [bus.transmit            ] Message received on publish queue: Message('gpio/testinput17', 'ON')
2020-12-09 16:38:03,080 [TRACE] [mqtt    ] [mqtt                    ] Message received to transmit: Message('gpio/testinput17', 'ON')
2020-12-09 16:38:03,083 [DEBUG] [mqtt    ] [mqtt.client             ] Sending PUBLISH (d0, q0, r0, m8), 'b'pigarage/gpio/testinput17'', ... (2 bytes)
2020-12-09 16:38:03,086 [DEBUG] [mqtt    ] [mqtt.client             ] Sending PINGREQ
2020-12-09 16:38:03,092 [DEBUG] [mqtt    ] [mqtt.client             ] Received PINGRESP
2020-12-09 16:38:07,781 [DEBUG] [gpio    ] [gpio                    ] Polling timer fired
2020-12-09 16:38:07,785 [DEBUG] [gpio    ] [gpio                    ] Polling all pins
2020-12-09 16:38:07,923 [DEBUG] [gpio    ] [gpio.digital            ] Read state OFF logic LOW from 'testinput17' on GPIO17
2020-12-09 16:38:07,928 [TRACE] [core    ] [bus.transmit            ] Message received on publish queue: Message('gpio/testinput17', 'OFF')
2020-12-09 16:38:07,958 [TRACE] [mqtt    ] [mqtt                    ] Message received to transmit: Message('gpio/testinput17', 'OFF')
2020-12-09 16:38:07,961 [DEBUG] [mqtt    ] [mqtt.client             ] Sending PUBLISH (d0, q0, r0, m9), 'b'pigarage/gpio/testinput17'', ... (3 bytes)
2020-12-09 16:38:08,555 [TRACE] [core    ] [core                    ] Stopping subprocess for 'gpio' with 10s timeout
2020-12-09 16:38:08,562 [TRACE] [gpio    ] [gpio                    ] Module stopping
2020-12-09 16:38:08,565 [DEBUG] [gpio    ] [gpio                    ] Stopping polling timer
2020-12-09 16:38:08,568 [DEBUG] [gpio    ] [gpio                    ] Running pin cleanup
2020-12-09 16:38:08,949 [DEBUG] [core    ] [core                    ] Subproccess for module 'gpio' stopped cleanly
2020-12-09 16:38:08,952 [INFO ] [core    ] [core                    ] Module 'gpio' unloaded
2020-12-09 16:38:08,955 [TRACE] [core    ] [core                    ] Stopping subprocess for 'mqtt' with 10s timeout
2020-12-09 16:38:08,966 [TRACE] [mqtt    ] [mqtt                    ] Module stopping
2020-12-09 16:38:08,969 [DEBUG] [mqtt    ] [mqtt                    ] Disconnecting
2020-12-09 16:38:08,972 [DEBUG] [mqtt    ] [mqtt.client             ] Sending PUBLISH (d0, q0, r1, m10), 'b'pigarage/lwt'', ... (7 bytes)
2020-12-09 16:38:08,976 [DEBUG] [mqtt    ] [mqtt.client             ] Sending DISCONNECT
2020-12-09 16:38:08,979 [DEBUG] [mqtt    ] [mqtt                    ] Stopping MQTT client loop
2020-12-09 16:38:08,995 [DEBUG] [core    ] [core                    ] Subproccess for module 'mqtt' stopped cleanly
2020-12-09 16:38:08,999 [INFO ] [core    ] [core                    ] Module 'mqtt' unloaded
2020-12-09 16:38:09,002 [TRACE] [core    ] [bus                     ] Stopping Message Bus threads
2020-12-09 16:38:09,005 [TRACE] [core    ] [bus                     ] Stopping Message Bus Receive thread with 10s timeout
2020-12-09 16:38:09,776 [DEBUG] [core    ] [bus.receive             ] Message Bus Receive thread stopped cleanly
2020-12-09 16:38:09,779 [TRACE] [core    ] [bus                     ] Stopping Message Bus Transmit thread with 10s timeout
2020-12-09 16:38:09,933 [DEBUG] [core    ] [bus.transmit            ] Message Bus Transmit thread stopped cleanly
2020-12-09 16:38:09,937 [INFO ] [core    ] [core                    ] MQTTany stopped

What OS, version, and kernel version are you running? Not that it should matter.

Next thing I want to do is find out why I didn’t put any logging in the GPIO interrupt thread class… That wasn’t smart. If you want time and feel like it, put some logging into the Interrupt class __init__, start, and stop methods in mqttany/gpio/pins/digital.py. See if the thread is starting and stopping (if it doesn’t stop then it must have errored). If you can’t/don’t have time I will tackle it when I get home, I should have put some debug/trace logging in there when I wrote it.

Most of the testing was done with a fresh install (including latest upgrades) of

Raspberry Pi OS Lite https://www.raspberrypi.org/software/operating-systems/

My installation steps were:

python3 --version: Python 3.7.3
sudo pip3 install paho-mqtt
cd /opt
sudo git clone -b v0.12.1 https://github.com/CrazyIvan359/mqttany.git
cd mqttany
sudo chown -hR pi:pi /opt/mqttany
sudo chmod -R g+rw /opt/mqttany
pip3 install -r requirements/mqttany.txt
sudo mkdir /etc/mqttany
sudo cp /opt/mqttany/mqttany/config/mqttany.yml /etc/mqttany/mqttany.yml

Version:

pi@pigarage:~ $ cat /etc/os-release
PRETTY_NAME="Raspbian GNU/Linux 10 (buster)"
NAME="Raspbian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"

Kernel:

pi@pigarage:~ $ uname -a
Linux pigarage 5.4.79-v7+ #1373 SMP Mon Nov 23 13:22:33 GMT 2020 armv7l GNU/Linux

During testing I did a fresh install of the “Raspberry Pi OS with desktop and recommended software” without any upgrading but the behavior did not change, so I am using the Lite version again.

It is not lack of time, it is lack of knowledge, sorry :innocent:

Well host environment isn’t the issue, I’ve got Armbian on an OPi0 and Raspbian on an RPi3B that work.

Not a problem, give me about 7 hours and I’ll push a branch to test with.

I think we should also move this discussion over to the new GitHub Discussions that I added to the repo last night.

Done:

@sihui the issue we found is now fixed in version 0.12.2

1 Like

How can I configure GPIO as client on RP4

@maheshdada1 there is an open issue to add support, but I am waiting on some needed information. If you can provide that info I should be able to add support tomorrow.

1 Like

Great idea CrazyIvan!!!

Since a long time I had been looking for a Tasmota like software for Raspberry pi, as a gateway to Mqtt for the great variety of arduino sensors you can connect to the Pi.

I look forward to the next versions with more supported devices.

1 Like

@jpalacio thank you!

If there are devices you would like to see support for please open an issue and give me links to any documentation you have on the device. I will also need you to help with debugging if I don’t have the device myself, but I can guide you a little with that.

@CrazyIvan359 One of the sensors I’m interested on is the BME280 that you have now in your schedule. It should be interesting the posibility to add support for a I2C digital to Analog converter like the ADS1115. Of course I am ready to help you with the debugging.

On the other hand, I think there is a bug in the Raspberry 3 gpio support. I have set 2 gpio inputs with pulldown option. When Mqttany starts shows an error, warning that it is not supported. That is not correct, as I have physically check it and also I have set it throught the gpio mode command of the wiringpy utility.

2021-01-16 08:59:51,128 [INFO ] [core ] MQTTany 0.13.0 starting
2021-01-16 08:59:51,993 [INFO ] [core.gpio ] Detected board: RASPBERRY_PI_3B
2021-01-16 08:59:53,614 [WARN ] [core.gpio.board ] GPIO10 does not support bias PULL_DOWN, defaulting to NONE
2021-01-16 08:59:53,663 [WARN ] [core.gpio.board ] GPIO15 does not support bias PULL_DOWN, defaulting to NONE

mode: ‘SOC’
sensor-voltaje:
pin: 10
pin mode: input
resistor: pulldown
digital:
interrupt: both
invert: true

sensor-puerta-entrada:
pin: 15
pin mode: input
resistor: pulldown
digital:
interrupt: both
invert: true

Thank you in advance.

The ADS1115 is also on my radar, I have a project that will require GPIO, BME280, DS18B20, ADS1115, and PCA9685 support, it just keeps getting pushed back. I think there is another device with more/fewer channels ADS1112 or something I should be able to add with the same module.

It’s not a bug, it seems to be me never having seen that pull downs are supported by RPis… See discussion on this issue. I have not had time to work on this since my last comment on there, perhaps this week or next weekend I will. The pull downs are simple enough, but there is another problem where any resistor setting other than off is resulting in an error from periphery/cdev.

There are notes on what to modify in that issue if you want to try the pull downs.

Hi,

i´m trying to use mqttany, but i have a problem. Mqttany seems to communicate with openhabian, but the relais dosn´t switch to on or of. These is my config:

Things:

Bridge mqtt:broker:openhabian [ host="192.168.1.91" ] {
Thing mqtt:topic:relays "Relais" @ "Relais" {
    Channels:
		//Type switch : channel1 "Relay Channel 1" [ stateTopic="openhabian/relay/1", commandTopic="openhabian/relay/1/set", on="ON", off="OFF" ]
		//Type switch : channel2 "Relay Channel 2" [ stateTopic="openhabian/relay/2", commandTopic="openhabian/relay/2/set", on="ON", off="OFF" ]
		//Type switch : channel3 "Relay Channel 3" [ stateTopic="openhabian/relay/3", commandTopic="openhabian/relay/3/set", on="ON", off="OFF" ]
        Type switch : testchannel4 "Relay Channel 4" [ stateTopic="openhabian/relay/4", commandTopic="openhabian/relay/4/set", on="ON", off="OFF" ]
        Type switch : testchannel5 "Relay Channel 5" [ stateTopic="openhabian/relay/5", commandTopic="openhabian/relay/5/set", on="ON", off="OFF" ]
        Type switch : testchannel6 "Relay Channel 6" [ stateTopic="openhabian/relay/6", commandTopic="openhabian/relay/6/set", on="ON", off="OFF" ]
        Type switch : testchannel7 "Relay Channel 7" [ stateTopic="openhabian/relay/7", commandTopic="openhabian/relay/7/set", on="ON", off="OFF" ]
		Type switch : testchannel8 "Relay Channel 8" [ stateTopic="openhabian/relay/8", commandTopic="openhabian/relay/8/set", on="ON", off="OFF" ]
    }
}

Items:

//Relays
//Switch channel1 "Relay Channel 1" { channel="mqtt:topic:openhabian:relay:channel1" }
//Switch channel2 "Relay Channel 2" { channel="mqtt:topic:openhabian:relay:channel2" }
//Switch channel3 "Relay Channel 3" { channel="mqtt:topic:openhabian:relay:channel3" }
Switch testchannel4 "Relay Channel 4" { channel="mqtt:topic:openhabian:relay:testchannel4" }
Switch testchannel5 "Relay Channel 5" { channel="mqtt:topic:openhabian:relay:testchannel5" }
Switch testchannel6 "Relay Channel 6" { channel="mqtt:topic:openhabian:relay:testchannel6" }
Switch testchannel7 "Relay Channel 7" { channel="mqtt:topic:openhabian:relay:testchannel7" }
Switch testchannel8 "Relay Channel 8" { channel="mqtt:topic:openhabian:relay:testchannel8" }

mqttany.yml:

mqtt:
 host: 'xxx.xxx.xxx.xxx'
 root topic: 'openhabian'
gpio:
  channels:
    pin: [16, 19, 20, 21, 26]  # a list of the pins your relays are connected to, in the order you want them numbered
    name: 'testchannel{index}'
    pin mode: output
    first index: 4
    digital:
      invert: true
      initial state: 'ON'

But this is what the Debug option says…

[07:44:20] root@openhabian:/opt/mqttany# python3 mqttany/mqttany.py -v
2021-01-19 07:44:23,513 [INFO ] [core    ] [core                    ] MQTTany 0.13.0 starting
2021-01-19 07:44:23,637 [INFO ] [core    ] [core.gpio               ] Detected board: RASPBERRY_PI_4B
2021-01-19 07:44:23,639 [DEBUG] [core    ] [core.gpio               ] Detected GPIO character device
2021-01-19 07:44:23,640 [DEBUG] [core    ] [config                  ] Loading config file
2021-01-19 07:44:23,752 [DEBUG] [core    ] [core                    ] Loading module 'mqtt'
2021-01-19 07:44:24,001 [DEBUG] [core    ] [core                    ] Module 'mqtt' is a communication module
2021-01-19 07:44:24,004 [DEBUG] [core    ] [mqtt                    ] Parsing config
2021-01-19 07:44:24,006 [DEBUG] [core    ] [mqtt                    ] Config loaded successfully
2021-01-19 07:44:24,008 [DEBUG] [core    ] [core                    ] Module 'mqtt' loaded successfully
2021-01-19 07:44:24,010 [DEBUG] [core    ] [bus                     ] Module 'mqtt' added as a receiver
2021-01-19 07:44:24,015 [DEBUG] [core    ] [bus                     ] Module 'mqtt' added as a transmitter
2021-01-19 07:44:24,017 [DEBUG] [core    ] [core                    ] Loading module 'gpio'
2021-01-19 07:44:24,077 [DEBUG] [core    ] [core                    ] Module 'gpio' is an interface module
2021-01-19 07:44:24,082 [DEBUG] [core    ] [gpio                    ] Parsing config
2021-01-19 07:44:24,085 [DEBUG] [core    ] [gpio                    ] Config loaded
2021-01-19 07:44:24,102 [DEBUG] [core    ] [core.gpio.board         ] 'gpio.pin.digital' acquired lock on GPIO16 (GPIO16)
2021-01-19 07:44:24,104 [DEBUG] [core    ] [gpio.digital            ] Configured 'testchannel4' on GPIO16 with options: {'ID': 'channels-4', 'pin mode': 'OUTPUT', 'interrupt': 'NONE', 'resistor': 'NONE', 'invert': True, 'initial state': 'ON'}
2021-01-19 07:44:24,112 [DEBUG] [core    ] [core.gpio.board         ] 'gpio.pin.digital' acquired lock on GPIO19 (GPIO19)
2021-01-19 07:44:24,113 [DEBUG] [core    ] [gpio.digital            ] Configured 'testchannel5' on GPIO19 with options: {'ID': 'channels-5', 'pin mode': 'OUTPUT', 'interrupt': 'NONE', 'resistor': 'NONE', 'invert': True, 'initial state': 'ON'}
2021-01-19 07:44:24,118 [DEBUG] [core    ] [core.gpio.board         ] 'gpio.pin.digital' acquired lock on GPIO20 (GPIO20)
2021-01-19 07:44:24,119 [DEBUG] [core    ] [gpio.digital            ] Configured 'testchannel6' on GPIO20 with options: {'ID': 'channels-6', 'pin mode': 'OUTPUT', 'interrupt': 'NONE', 'resistor': 'NONE', 'invert': True, 'initial state': 'ON'}
2021-01-19 07:44:24,124 [DEBUG] [core    ] [core.gpio.board         ] 'gpio.pin.digital' acquired lock on GPIO21 (GPIO21)
2021-01-19 07:44:24,125 [DEBUG] [core    ] [gpio.digital            ] Configured 'testchannel7' on GPIO21 with options: {'ID': 'channels-7', 'pin mode': 'OUTPUT', 'interrupt': 'NONE', 'resistor': 'NONE', 'invert': True, 'initial state': 'ON'}
2021-01-19 07:44:24,130 [DEBUG] [core    ] [core.gpio.board         ] 'gpio.pin.digital' acquired lock on GPIO26 (GPIO26)
2021-01-19 07:44:24,132 [DEBUG] [core    ] [gpio.digital            ] Configured 'testchannel8' on GPIO26 with options: {'ID': 'channels-8', 'pin mode': 'OUTPUT', 'interrupt': 'NONE', 'resistor': 'NONE', 'invert': True, 'initial state': 'ON'}
2021-01-19 07:44:24,134 [DEBUG] [core    ] [core                    ] Module 'gpio' loaded successfully
2021-01-19 07:44:24,135 [DEBUG] [core    ] [bus                     ] Module 'gpio' added as a publisher
2021-01-19 07:44:24,138 [DEBUG] [core    ] [bus                     ] Module 'gpio' added as a subscriber
2021-01-19 07:44:24,151 [INFO ] [core    ] [core                    ] Module 'mqtt' started successfully
2021-01-19 07:44:24,169 [DEBUG] [mqtt    ] [mqtt                    ] Creating MQTT client
2021-01-19 07:44:24,168 [INFO ] [core    ] [core                    ] Module 'gpio' started successfully
2021-01-19 07:44:24,177 [DEBUG] [mqtt    ] [mqtt                    ] Attaching callbacks
2021-01-19 07:44:24,177 [DEBUG] [core    ] [bus                     ] Starting Message Bus Receive thread
2021-01-19 07:44:24,180 [DEBUG] [mqtt    ] [mqtt                    ] Queuing connect event
2021-01-19 07:44:24,181 [DEBUG] [mqtt    ] [mqtt                    ] Starting MQTT client thread
2021-01-19 07:44:24,182 [DEBUG] [core    ] [bus                     ] Starting Message Bus Transmit thread
2021-01-19 07:44:24,184 [DEBUG] [gpio    ] [gpio                    ] Setting up hardware
2021-01-19 07:44:24,187 [INFO ] [gpio    ] [gpio.digital            ] Setting up 'testchannel4' on GPIO16 as OUTPUT
2021-01-19 07:44:24,189 [DEBUG] [gpio    ] [core.gpio.pin.digital   ] Setting up pin GPIO16 using chardev
2021-01-19 07:44:24,193 [DEBUG] [gpio    ] [gpio.digital            ] Set 'testchannel4' on GPIO16 to OFF logic HIGH
2021-01-19 07:44:24,195 [INFO ] [gpio    ] [gpio.digital            ] Setting up 'testchannel5' on GPIO19 as OUTPUT
2021-01-19 07:44:24,196 [DEBUG] [gpio    ] [core.gpio.pin.digital   ] Setting up pin GPIO19 using chardev
2021-01-19 07:44:24,198 [DEBUG] [gpio    ] [gpio.digital            ] Set 'testchannel5' on GPIO19 to OFF logic HIGH
2021-01-19 07:44:24,199 [INFO ] [gpio    ] [gpio.digital            ] Setting up 'testchannel6' on GPIO20 as OUTPUT
2021-01-19 07:44:24,200 [DEBUG] [gpio    ] [core.gpio.pin.digital   ] Setting up pin GPIO20 using chardev
2021-01-19 07:44:24,201 [DEBUG] [gpio    ] [gpio.digital            ] Set 'testchannel6' on GPIO20 to OFF logic HIGH
2021-01-19 07:44:24,202 [INFO ] [gpio    ] [gpio.digital            ] Setting up 'testchannel7' on GPIO21 as OUTPUT
2021-01-19 07:44:24,204 [DEBUG] [gpio    ] [core.gpio.pin.digital   ] Setting up pin GPIO21 using chardev
2021-01-19 07:44:24,205 [DEBUG] [gpio    ] [gpio.digital            ] Set 'testchannel7' on GPIO21 to OFF logic HIGH
2021-01-19 07:44:24,206 [INFO ] [gpio    ] [gpio.digital            ] Setting up 'testchannel8' on GPIO26 as OUTPUT
2021-01-19 07:44:24,207 [DEBUG] [gpio    ] [core.gpio.pin.digital   ] Setting up pin GPIO26 using chardev
2021-01-19 07:44:24,209 [DEBUG] [gpio    ] [gpio.digital            ] Set 'testchannel8' on GPIO26 to OFF logic HIGH
2021-01-19 07:44:24,210 [DEBUG] [gpio    ] [gpio                    ] Starting polling timer with interval of 60s
2021-01-19 07:44:24,213 [INFO ] [mqtt    ] [mqtt                    ] Connected to broker '192.168.1.91:1883'
2021-01-19 07:44:24,215 [DEBUG] [mqtt    ] [mqtt                    ] Resuming previous session
2021-01-19 07:44:24,215 [DEBUG] [gpio    ] [gpio                    ] Polling all pins
2021-01-19 07:44:24,217 [DEBUG] [mqtt    ] [mqtt                    ] Heartbeat
2021-01-19 07:44:24,218 [DEBUG] [gpio    ] [gpio.digital            ] Read state OFF logic HIGH from 'testchannel4' on GPIO16
2021-01-19 07:44:24,219 [DEBUG] [gpio    ] [gpio.digital            ] Read state OFF logic HIGH from 'testchannel5' on GPIO19
2021-01-19 07:44:24,220 [DEBUG] [gpio    ] [gpio.digital            ] Read state OFF logic HIGH from 'testchannel6' on GPIO20
2021-01-19 07:44:24,224 [DEBUG] [gpio    ] [gpio.digital            ] Read state OFF logic HIGH from 'testchannel7' on GPIO21
2021-01-19 07:44:24,226 [DEBUG] [gpio    ] [gpio.digital            ] Read state OFF logic HIGH from 'testchannel8' on GPIO26
2021-01-19 07:44:29,666 [DEBUG] [core    ] [bus.receive             ] Received message on unregistered path: SubscribeMessage('relay/8/set', 'OFF')
2021-01-19 07:44:30,274 [DEBUG] [core    ] [bus.receive             ] Received message on unregistered path: SubscribeMessage('relay/8/set', 'ON')

Please update your post to use code fences, I have put some examples below.

The problem is your MQTT topics in openHAB, you are using testchannel/4 but the topics will be testchannel4 etc.

```csv
put your items and things each here
```
```yaml
put your MQTTany config here
```
```log
put your log here
```

Ok, i updated my post, but where do you see the topic testchannel/4, can you explain what you mean ?

Type switch : testchannel4 "Relay Channel 4" [ stateTopic="openhabian/relay/4", commandTopic="openhabian/relay/4/set", on="ON", off="OFF" ]

Switch testchannel4 "Relay Channel 4" { channel="mqtt:topic:openhabian:relay:testchannel4" }

Oops, answered that too quick. I’m referring to your Thing Channels.

You actually have the stateTopic and commandTopic using openhabian/relay/4 and openhabian/relay/4/set but those are not the topics you have configured. MQTTany is using the topics openhabian/gpio/testchannel4 and openhabian/gpio/testchannel4/set.

Hi again,

sorry i need your help again, it still dosn´t work… Do you mean something like this ?

Switch testchannel8 “Relay Channel 8” { channel=“mqtt:topic:openhabian:gpio:testchannel8” }

and

Thing mqtt:topic:gpio //“Relais” @ “Relais”
{
Channels:
Type switch : testchannel8 “Relay Channel 8” [ stateTopic=“openhabian/gpio/testchannel8”, commandTopic=“openhabian/gpio/testchannel8/set”, on=“ON”, off=“OFF” ]
}

Greetings

Looks like you’re mixing and matching your thing configuration methods.

You can either have the channels as part of the broker thing like this:

Bridge mqtt:broker:openhabian [ host="192.168.1.91" ] {
Thing topic relays "Relais" @ "Relais" {
    Channels:
        Type switch : testchannel4 "Relay Channel 4" [ stateTopic="openhabian/relay/4", commandTopic="openhabian/relay/4/set", on="ON", off="OFF" ]
        Type switch : testchannel5 "Relay Channel 5" [ stateTopic="openhabian/relay/5", commandTopic="openhabian/relay/5/set", on="ON", off="OFF" ]
    }
}

or you can have separate broker and generic things:

Bridge mqtt:broker:openhabian [ host="192.168.1.91" ]


Thing mqtt:topic:relays "Relais" @ "Relais" (mqtt:broker:openhabian) {
    Channels:
        Type switch : testchannel4 "Relay Channel 4" [ stateTopic="openhabian/relay/4", commandTopic="openhabian/relay/4/set", on="ON", off="OFF" ]
        Type switch : testchannel5 "Relay Channel 5" [ stateTopic="openhabian/relay/5", commandTopic="openhabian/relay/5/set", on="ON", off="OFF" ]
}

Hello,
I also have a problem with MQTTany, I hope you can help me… MQTTany is up and running on a raspberry PI 4 hosting openhab3. I have connected a contact to GPIO4, which is pin#7

mqttany has:

gpio:
pintest:
pin : 7
pin mode: 'input' 

MQTTany reports it is working:

Mär 14 16:23:41 raspberrypi2 systemd[1]: Started MQTTany service.
Mär 14 16:23:41 raspberrypi2 python3[3970]: 2021-03-14 16:23:41,940 [INFO ] [core                    ] MQTTany 0.14.3 starting
Mär 14 16:23:42 raspberrypi2 python3[3970]: 2021-03-14 16:23:42,007 [INFO ] [core.gpio               ] Detected board: RASPBERRY_PI_4B
Mär 14 16:23:42 raspberrypi2 python3[3970]: 2021-03-14 16:23:42,169 [INFO ] [core                    ] Module 'mqtt' started successfully
Mär 14 16:23:42 raspberrypi2 python3[3970]: 2021-03-14 16:23:42,176 [INFO ] [core                    ] Module 'gpio' started successfully
Mär 14 16:23:42 raspberrypi2 python3[3970]: 2021-03-14 16:23:42,184 [INFO ] [gpio.digital            ] Setting up 'pintest' on GPIO07 as INPUT
Mär 14 16:23:42 raspberrypi2 python3[3970]: 2021-03-14 16:23:42,193 [INFO ] [mqtt                    ] Connected to broker 'localhost:1883'

My first question, on which channel do I have to listen with MQTT to see if the contact is open/closed?

Is there any other possibility to check whether my GPIO-Setup is working at all from a hardware point of view?

Thank you!!
Meschmesch