Hello, as i am trying to set up MCP23017 on OH3 and not able to do that with MCP23017 binding, i try to do it with MqttAny.py. the problem is that i guess somthing is wrong with my configuration. In The logs it seems that connection is successfull to the mcp but i dont get any events to the gpios. and nothing is mentioned in the log that any of the pins where allocated.
this is my config:
mosquitto_sub -v -h 127.0.0.1 -p 1883 -t ‘#’
mqtt:
host: ‘127.0.0.1’
port: 1883
i2c:
mcp23017-1:
device: ‘mcp23017’
bus: 1
address: 0x20
mcp23017:
batch-01:
pin: [01,02,03,04,05,06,07,08,09,10,11,12,13,14,15,16]
name: ‘{pin_id}’
direction: ‘output’
initial state: OFF
mcp23017-2:
device: ‘mcp23017’
bus: 1
address: 0x21
mcp23017:
batch-01:
pin: [01,02,03,04,05,06,07,08,09,10,11,12,13,14,15,16]
name: ‘{pin_id}’
direction: ‘output’
initial state: OFF
mcp23017-3:
device: ‘mcp23017’
bus: 1
address: 0x22
mcp23017:
batch-01:
pin: [01,02,03,04,05,06,07,08,09,10,11,12,13,14,15,16]
name: ‘{pin_id}’
direction: ‘output’
initial state: OFF
mcp23017-5:
polling interval: 1
device: ‘mcp23017’
bus: 1
address: 0x24
mcp23017:
batch-01:
pin: [01,02,03,04,05,06,07,08,09,10,11,12,13,14,15,16]
name: ‘{pin_id}’
direction: ‘input’
resistor: ‘pullup’
initial state: OFF
mcp23017-6:
polling interval: 1
device: ‘mcp23017’
bus: 1
address: 0x25
mcp23017:
batch-01:
pin: [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16]
name: '{pin_id}'
direction: 'input'
resistor: 'pullup'
initial state: OFF
mcp23017-7:
polling interval: 1
device: ‘mcp23017’
bus: 1
address: 0x26
mcp23017:
pin-a1:
pin: 01
name: ‘{pin_id}’
direction: ‘input’
resistor: ‘pullup’
initial state: OFF
and this is the log:
2021-09-15 11:00:45,081 [INFO] [core ] [core ] MQTTany 0.14.3 starting
2021-09-15 11:00:45,215 [INFO] [core ] [core.gpio ] Detected board: RASPBERRY_PI_3B
2021-09-15 11:00:45,217 [DEBUG] [core ] [core.gpio ] Detected GPIO character device
2021-09-15 11:00:45,219 [DEBUG] [core ] [core.gpio ] Detected sysfs GPIO interface
2021-09-15 11:00:45,221 [DEBUG] [core ] [config ] Loading config file
2021-09-15 11:00:45,402 [DEBUG] [core ] [core ] Loading module ‘mqtt’
2021-09-15 11:00:45,561 [DEBUG] [core ] [core ] Module ‘mqtt’ is a communication module
2021-09-15 11:00:45,564 [DEBUG] [core ] [mqtt ] Parsing config
2021-09-15 11:00:45,566 [DEBUG] [core ] [mqtt ] Config loaded successfully
2021-09-15 11:00:45,568 [DEBUG] [core ] [core ] Module ‘mqtt’ loaded successfully
2021-09-15 11:00:45,570 [DEBUG] [core ] [bus ] Module ‘mqtt’ added as a receiver
2021-09-15 11:00:45,574 [DEBUG] [core ] [bus ] Module ‘mqtt’ added as a transmitter
2021-09-15 11:00:45,576 [DEBUG] [core ] [core ] Loading module ‘i2c’
2021-09-15 11:00:45,605 [DEBUG] [core ] [core ] Module ‘i2c’ is an interface module
2021-09-15 11:00:45,615 [DEBUG] [core ] [i2c ] Parsing config
2021-09-15 11:00:45,620 [DEBUG] [core ] [i2c ] Config loaded
2021-09-15 11:00:45,622 [DEBUG] [core ] [i2c ] Configuring MCP23017 ‘mcp23017-1’ at address 0x20 on bus ‘/dev/i2c-1’
2021-09-15 11:00:45,624 [DEBUG] [core ] [i2c ] Configuring MCP23017 ‘mcp23017-2’ at address 0x21 on bus ‘/dev/i2c-1’
2021-09-15 11:00:45,627 [DEBUG] [core ] [i2c ] Configuring MCP23017 ‘mcp23017-3’ at address 0x22 on bus ‘/dev/i2c-1’
2021-09-15 11:00:45,629 [DEBUG] [core ] [i2c ] Configuring MCP23017 ‘mcp23017-5’ at address 0x24 on bus ‘/dev/i2c-1’
2021-09-15 11:00:45,632 [DEBUG] [core ] [i2c ] Configuring MCP23017 ‘mcp23017-6’ at address 0x25 on bus ‘/dev/i2c-1’
2021-09-15 11:00:45,634 [DEBUG] [core ] [i2c ] Configuring MCP23017 ‘mcp23017-7’ at address 0x26 on bus ‘/dev/i2c-1’
2021-09-15 11:00:45,636 [DEBUG] [core ] [core ] Module ‘i2c’ loaded successfully
2021-09-15 11:00:45,638 [DEBUG] [core ] [bus ] Module ‘i2c’ added as a publisher
2021-09-15 11:00:45,642 [DEBUG] [core ] [bus ] Module ‘i2c’ added as a subscriber
2021-09-15 11:00:45,649 [INFO] [core ] [core ] Module ‘mqtt’ started successfully
2021-09-15 11:00:45,655 [DEBUG] [mqtt ] [mqtt ] Creating MQTT client
2021-09-15 11:00:45,658 [INFO] [core ] [core ] Module ‘i2c’ started successfully
2021-09-15 11:00:45,662 [DEBUG] [mqtt ] [mqtt ] Attaching callbacks
2021-09-15 11:00:45,665 [DEBUG] [core ] [bus ] Starting Message Bus Receive thread
2021-09-15 11:00:45,665 [DEBUG] [i2c ] [i2c ] Opening I2C bus streams
2021-09-15 11:00:45,666 [DEBUG] [mqtt ] [mqtt ] Queuing connect event
2021-09-15 11:00:45,670 [DEBUG] [core ] [bus ] Starting Message Bus Transmit thread
2021-09-15 11:00:45,670 [DEBUG] [mqtt ] [mqtt ] Starting MQTT client thread
2021-09-15 11:00:45,671 [DEBUG] [i2c ] [i2c.mcp23017 ] Writing initial values to registers of MCP23017 ‘mcp23017-1’ at address 0x20 on bus ‘/dev/i2c-1’
2021-09-15 11:00:45,678 [DEBUG] [i2c ] [i2c ] Successfully setup MCP23017 ‘mcp23017-1’
2021-09-15 11:00:45,681 [DEBUG] [i2c ] [i2c.mcp23017 ] Writing initial values to registers of MCP23017 ‘mcp23017-2’ at address 0x21 on bus ‘/dev/i2c-1’
2021-09-15 11:00:45,686 [DEBUG] [i2c ] [i2c ] Successfully setup MCP23017 ‘mcp23017-2’
2021-09-15 11:00:45,689 [DEBUG] [i2c ] [i2c.mcp23017 ] Writing initial values to registers of MCP23017 ‘mcp23017-3’ at address 0x22 on bus ‘/dev/i2c-1’
2021-09-15 11:00:45,691 [INFO] [mqtt ] [mqtt ] Connected to broker ‘127.0.0.1:1883’
2021-09-15 11:00:45,693 [DEBUG] [mqtt ] [mqtt ] Resuming previous session
2021-09-15 11:00:45,694 [DEBUG] [i2c ] [i2c ] Successfully setup MCP23017 ‘mcp23017-3’
2021-09-15 11:00:45,696 [DEBUG] [mqtt ] [mqtt ] Heartbeat
2021-09-15 11:00:45,697 [DEBUG] [i2c ] [i2c.mcp23017 ] Writing initial values to registers of MCP23017 ‘mcp23017-5’ at address 0x24 on bus ‘/dev/i2c-1’
2021-09-15 11:00:45,703 [DEBUG] [i2c ] [i2c ] Successfully setup MCP23017 ‘mcp23017-5’
2021-09-15 11:00:45,706 [DEBUG] [i2c ] [i2c.mcp23017 ] Writing initial values to registers of MCP23017 ‘mcp23017-6’ at address 0x25 on bus ‘/dev/i2c-1’
2021-09-15 11:00:45,712 [DEBUG] [i2c ] [i2c ] Successfully setup MCP23017 ‘mcp23017-6’
2021-09-15 11:00:45,714 [DEBUG] [i2c ] [i2c.mcp23017 ] Writing initial values to registers of MCP23017 ‘mcp23017-7’ at address 0x26 on bus ‘/dev/i2c-1’
2021-09-15 11:00:45,719 [DEBUG] [i2c ] [i2c ] Successfully setup MCP23017 ‘mcp23017-7’
2021-09-15 11:00:45,722 [DEBUG] [i2c ] [i2c ] Starting polling timer with interval of 60s