Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OneWire Bug #120

Closed
EKNYESE opened this issue Aug 1, 2021 · 6 comments
Closed

OneWire Bug #120

EKNYESE opened this issue Aug 1, 2021 · 6 comments
Labels
OneWire OneWire Module

Comments

@EKNYESE
Copy link

EKNYESE commented Aug 1, 2021

Describe the bug

"pip3 install -r requirements/onewire.txt" not possible since missing!!

Expected behavior

"pip3 install -r requirements/onewire.txt" possible

Environment

  • MQTTany version: actual one
  • Platform: openHABian on RPi4

Configuration

# n/a because of missing example (although I have invested severals hours it was still not possible for me to get en example how to patch the config for several DS18B20..

Logs

Insert relevant log entries within code fences here,
or attach the entire log as a file.
@EKNYESE EKNYESE added bug Something isn't working OneWire OneWire Module labels Aug 1, 2021
@CrazyIvan359
Copy link
Owner

Looks like I did not remove the note in the docs to install One Wire requirements, there are none anymore. I wrote my own One Wire interface library so no external ones are needed.

What else are you hung up on getting your sensors working?

@EKNYESE
Copy link
Author

EKNYESE commented Aug 2, 2021

Unfortunately I was not able until now to use it for DS18B20. Maybe it is a problem with user-rights - I am using openhabian as base.

Do You have an idea, how to interpret this failure message?:
Could you please also give a concrete example, how to patch the config to read DS18B20? Right now I am not understanding the documentation and I am happy, that I have set it up right for reading GPIOs (also after several hours of tries because of spaces - needed by python etc..)..

[12:42:25] openhabian@openHABianRPi4:~$ /usr/bin/python3 /opt/mqttany/mqttany/mqttany.py
2021-08-02 12:42:37,987 [INFO ] [core                    ] MQTTany 0.14.3 starting
2021-08-02 12:42:38,074 [INFO ] [core.gpio               ] Detected board: RASPBERRY_PI_4B
2021-08-02 12:42:38,309 [ERROR] [onewire                 ] An exception occurred while running function 'load'
2021-08-02 12:42:38,311 [ERROR] [onewire                 ]

Traceback (most recent call last):
  File "/opt/mqttany/mqttany/modules/__init__.py", line 83, in call
    retval = func(**kwargs)
  File "/opt/mqttany/mqttany/modules/onewire/core.py", line 129, in load
    config_data = parse_config(config_raw, conf_options, log)
  File "/opt/mqttany/mqttany/config.py", line 261, in parse_config
    valid, config = parse_dict(data, options)
  File "/opt/mqttany/mqttany/config.py", line 250, in parse_dict
    config,
  File "/opt/mqttany/mqttany/config.py", line 170, in process_option
    if not isinstance(value, option["type"]):
TypeError: isinstance() arg 2 must be a type or tuple of types

2021-08-02 12:42:38,312 [WARN ] [core                    ] Module 'onewire' load failed

@CrazyIvan359
Copy link
Owner

That is possibly an issue with the One Wire module, I will need some more information to dig into it though. Please run MQTTany with the -vv option and paste the log from the start up to the error here. I would also like to see your One Wire section from the config file.

Please use code fences when posting logs or configs so that they are readable. Here are examples:

```log
Paste log here
```

```yaml
Paste config here
```

As for the possible access issues, I don't remember if openhabian has the udev rules or not, but you should follow the instructions on the One Wire page to install the ones included with MQTTany.

@EKNYESE
Copy link
Author

EKNYESE commented Aug 2, 2021

Thanks for your response!
Regarding the instructions: I have tried every line but it was also not possible for me to execute any udev rules.
I could not find any "udev/98-w1.rules"since "whereis 98-w1.rules" does not find anything related.
Btw.: I am not an linux-exper and do not want to add any additional unnecessary groups. So I hope, that fixing the onewire-module is enough to let mqtt communicate - as the gpio-input is also working right now..

Log
[17:10:06] openhabian@openHABianRPi4:~$ /usr/bin/python3 /opt/mqttany/mqttany/mqttany.py -vv
2021-08-02 17:10:20,775 [INFO ] [core    ] [core                    ] MQTTany 0.14.3 starting
2021-08-02 17:10:20,864 [INFO ] [core    ] [core.gpio               ] Detected board: RASPBERRY_PI_4B
2021-08-02 17:10:20,865 [DEBUG] [core    ] [core.gpio               ] Detected GPIO character device
2021-08-02 17:10:20,866 [DEBUG] [core    ] [core.gpio               ] Detected sysfs GPIO interface
2021-08-02 17:10:20,866 [DEBUG] [core    ] [config                  ] Loading config file
2021-08-02 17:10:20,935 [DEBUG] [core    ] [core                    ] Loading module 'mqtt'
2021-08-02 17:10:21,040 [DEBUG] [core    ] [core                    ] Module 'mqtt' is a communication module
2021-08-02 17:10:21,041 [DEBUG] [core    ] [mqtt                    ] Parsing config
2021-08-02 17:10:21,041 [TRACE] [core    ] [mqtt                    ] Got value 'openHABianRPi4' for config option 'host'
2021-08-02 17:10:21,042 [TRACE] [core    ] [mqtt                    ] Got value '1883' for config option 'port'
2021-08-02 17:10:21,042 [TRACE] [core    ] [mqtt                    ] Using default value '{hostname}' for config option 'client id'
2021-08-02 17:10:21,043 [TRACE] [core    ] [mqtt                    ] Using default value '' for config option 'username'
2021-08-02 17:10:21,043 [TRACE] [core    ] [mqtt                    ] Using default value '' for config option 'password'
2021-08-02 17:10:21,044 [TRACE] [core    ] [mqtt                    ] Using default value '0' for config option 'qos'
2021-08-02 17:10:21,044 [TRACE] [core    ] [mqtt                    ] Using default value 'False' for config option 'retain'
2021-08-02 17:10:21,045 [TRACE] [core    ] [mqtt                    ] Using default value '{client_id}' for config option 'root topic'
2021-08-02 17:10:21,045 [TRACE] [core    ] [mqtt                    ] Using default value 'lwt' for config option 'lwt topic'
2021-08-02 17:10:21,046 [TRACE] [core    ] [mqtt                    ] Got value '300' for config option 'heartbeat interval'
2021-08-02 17:10:21,046 [DEBUG] [core    ] [mqtt                    ] Config loaded successfully
2021-08-02 17:10:21,047 [DEBUG] [core    ] [core                    ] Module 'mqtt' loaded successfully
2021-08-02 17:10:21,047 [DEBUG] [core    ] [bus                     ] Module 'mqtt' added as a receiver
2021-08-02 17:10:21,052 [DEBUG] [core    ] [bus                     ] Module 'mqtt' added as a transmitter
2021-08-02 17:10:21,053 [DEBUG] [core    ] [core                    ] Loading module 'gpio'
2021-08-02 17:10:21,084 [DEBUG] [core    ] [core                    ] Module 'gpio' is an interface module
2021-08-02 17:10:21,087 [DEBUG] [core    ] [gpio                    ] Parsing config
2021-08-02 17:10:21,087 [TRACE] [core    ] [gpio                    ] Got selection 'SOC' for config option 'mode'
2021-08-02 17:10:21,088 [TRACE] [core    ] [gpio                    ] Got value '60' for config option 'polling interval'
2021-08-02 17:10:21,089 [TRACE] [core    ] [gpio                    ] Got value '50' for config option 'debounce'
2021-08-02 17:10:21,089 [TRACE] [core    ] [gpio                    ] Found regex '.+' in options
2021-08-02 17:10:21,090 [TRACE] [core    ] [gpio                    ] Config key 'pin05' matched to options regex '.+'
2021-08-02 17:10:21,090 [TRACE] [core    ] [gpio                    ] Descending into section 'pin05'
2021-08-02 17:10:21,091 [TRACE] [core    ] [gpio                    ] Got value '5' for config option 'pin'
2021-08-02 17:10:21,091 [TRACE] [core    ] [gpio                    ] Using default value '{pin_id}' for config option 'name'
2021-08-02 17:10:21,092 [TRACE] [core    ] [gpio                    ] Using default value '0' for config option 'first index'
2021-08-02 17:10:21,092 [TRACE] [core    ] [gpio                    ] Got selection 'input' for config option 'pin mode'
2021-08-02 17:10:21,093 [TRACE] [core    ] [gpio                    ] Got selection 'pullup' for config option 'resistor'
2021-08-02 17:10:21,093 [TRACE] [core    ] [gpio                    ] Condition 'pin mode==PinMode.INPUT' matched for 'digital'
2021-08-02 17:10:21,094 [TRACE] [core    ] [gpio                    ] Descending into section 'digital'
2021-08-02 17:10:21,094 [TRACE] [core    ] [gpio                    ] Got selection 'both' for config option 'interrupt'
2021-08-02 17:10:21,095 [TRACE] [core    ] [gpio                    ] Got value 'True' for config option 'invert'
2021-08-02 17:10:21,095 [TRACE] [core    ] [gpio                    ] Using default value 'False' for config option 'initial state'
2021-08-02 17:10:21,096 [TRACE] [core    ] [gpio                    ] Skipping 'counter' as no conditions matched
2021-08-02 17:10:21,096 [TRACE] [core    ] [gpio                    ] Config key 'pin06' matched to options regex '.+'
2021-08-02 17:10:21,096 [TRACE] [core    ] [gpio                    ] Descending into section 'pin06'
2021-08-02 17:10:21,097 [TRACE] [core    ] [gpio                    ] Got value '6' for config option 'pin'
2021-08-02 17:10:21,097 [TRACE] [core    ] [gpio                    ] Using default value '{pin_id}' for config option 'name'
2021-08-02 17:10:21,098 [TRACE] [core    ] [gpio                    ] Using default value '0' for config option 'first index'
2021-08-02 17:10:21,098 [TRACE] [core    ] [gpio                    ] Got selection 'input' for config option 'pin mode'
2021-08-02 17:10:21,099 [TRACE] [core    ] [gpio                    ] Got selection 'pulldown' for config option 'resistor'
2021-08-02 17:10:21,099 [TRACE] [core    ] [gpio                    ] Condition 'pin mode==PinMode.INPUT' matched for 'digital'
2021-08-02 17:10:21,100 [TRACE] [core    ] [gpio                    ] Descending into section 'digital'
2021-08-02 17:10:21,100 [TRACE] [core    ] [gpio                    ] Got selection 'both' for config option 'interrupt'
2021-08-02 17:10:21,101 [TRACE] [core    ] [gpio                    ] Got value 'False' for config option 'invert'
2021-08-02 17:10:21,101 [TRACE] [core    ] [gpio                    ] Using default value 'False' for config option 'initial state'
2021-08-02 17:10:21,101 [TRACE] [core    ] [gpio                    ] Skipping 'counter' as no conditions matched
2021-08-02 17:10:21,102 [TRACE] [core    ] [gpio                    ] Config key 'pin13' matched to options regex '.+'
2021-08-02 17:10:21,102 [TRACE] [core    ] [gpio                    ] Descending into section 'pin13'
2021-08-02 17:10:21,103 [TRACE] [core    ] [gpio                    ] Got value '13' for config option 'pin'
2021-08-02 17:10:21,103 [TRACE] [core    ] [gpio                    ] Using default value '{pin_id}' for config option 'name'
2021-08-02 17:10:21,104 [TRACE] [core    ] [gpio                    ] Using default value '0' for config option 'first index'
2021-08-02 17:10:21,104 [TRACE] [core    ] [gpio                    ] Got selection 'output' for config option 'pin mode'
2021-08-02 17:10:21,105 [TRACE] [core    ] [gpio                    ] Got selection 'pullup' for config option 'resistor'
2021-08-02 17:10:21,105 [TRACE] [core    ] [gpio                    ] Condition 'pin mode==PinMode.OUTPUT' matched for 'digital'
2021-08-02 17:10:21,108 [TRACE] [core    ] [gpio                    ] Descending into section 'digital'
2021-08-02 17:10:21,110 [TRACE] [core    ] [gpio                    ] Using default value 'PinEdge.NONE' for config option 'interrupt'
2021-08-02 17:10:21,111 [TRACE] [core    ] [gpio                    ] Got value 'True' for config option 'invert'
2021-08-02 17:10:21,112 [TRACE] [core    ] [gpio                    ] Got selection 'ON' for config option 'initial state'
2021-08-02 17:10:21,112 [TRACE] [core    ] [gpio                    ] Skipping 'counter' as no conditions matched
2021-08-02 17:10:21,112 [TRACE] [core    ] [gpio                    ] Config key 'pin19' matched to options regex '.+'
2021-08-02 17:10:21,113 [TRACE] [core    ] [gpio                    ] Descending into section 'pin19'
2021-08-02 17:10:21,113 [TRACE] [core    ] [gpio                    ] Got value '19' for config option 'pin'
2021-08-02 17:10:21,114 [TRACE] [core    ] [gpio                    ] Using default value '{pin_id}' for config option 'name'
2021-08-02 17:10:21,114 [TRACE] [core    ] [gpio                    ] Using default value '0' for config option 'first index'
2021-08-02 17:10:21,115 [TRACE] [core    ] [gpio                    ] Got selection 'output' for config option 'pin mode'
2021-08-02 17:10:21,115 [TRACE] [core    ] [gpio                    ] Got selection 'pullup' for config option 'resistor'
2021-08-02 17:10:21,116 [TRACE] [core    ] [gpio                    ] Condition 'pin mode==PinMode.OUTPUT' matched for 'digital'
2021-08-02 17:10:21,116 [TRACE] [core    ] [gpio                    ] Descending into section 'digital'
2021-08-02 17:10:21,117 [TRACE] [core    ] [gpio                    ] Using default value 'PinEdge.NONE' for config option 'interrupt'
2021-08-02 17:10:21,117 [TRACE] [core    ] [gpio                    ] Got value 'True' for config option 'invert'
2021-08-02 17:10:21,118 [TRACE] [core    ] [gpio                    ] Got selection 'ON' for config option 'initial state'
2021-08-02 17:10:21,118 [TRACE] [core    ] [gpio                    ] Skipping 'counter' as no conditions matched
2021-08-02 17:10:21,118 [TRACE] [core    ] [gpio                    ] Config key 'pin26' matched to options regex '.+'
2021-08-02 17:10:21,119 [TRACE] [core    ] [gpio                    ] Descending into section 'pin26'
2021-08-02 17:10:21,119 [TRACE] [core    ] [gpio                    ] Got value '26' for config option 'pin'
2021-08-02 17:10:21,120 [TRACE] [core    ] [gpio                    ] Using default value '{pin_id}' for config option 'name'
2021-08-02 17:10:21,120 [TRACE] [core    ] [gpio                    ] Using default value '0' for config option 'first index'
2021-08-02 17:10:21,121 [TRACE] [core    ] [gpio                    ] Got selection 'output' for config option 'pin mode'
2021-08-02 17:10:21,121 [TRACE] [core    ] [gpio                    ] Got selection 'pullup' for config option 'resistor'
2021-08-02 17:10:21,122 [TRACE] [core    ] [gpio                    ] Condition 'pin mode==PinMode.OUTPUT' matched for 'digital'
2021-08-02 17:10:21,122 [TRACE] [core    ] [gpio                    ] Descending into section 'digital'
2021-08-02 17:10:21,123 [TRACE] [core    ] [gpio                    ] Using default value 'PinEdge.NONE' for config option 'interrupt'
2021-08-02 17:10:21,123 [TRACE] [core    ] [gpio                    ] Got value 'True' for config option 'invert'
2021-08-02 17:10:21,124 [TRACE] [core    ] [gpio                    ] Got selection 'ON' for config option 'initial state'
2021-08-02 17:10:21,124 [TRACE] [core    ] [gpio                    ] Skipping 'counter' as no conditions matched
2021-08-02 17:10:21,124 [TRACE] [core    ] [gpio                    ] Config key 'pin16' matched to options regex '.+'
2021-08-02 17:10:21,125 [TRACE] [core    ] [gpio                    ] Descending into section 'pin16'
2021-08-02 17:10:21,125 [TRACE] [core    ] [gpio                    ] Got value '16' for config option 'pin'
2021-08-02 17:10:21,126 [TRACE] [core    ] [gpio                    ] Using default value '{pin_id}' for config option 'name'
2021-08-02 17:10:21,126 [TRACE] [core    ] [gpio                    ] Using default value '0' for config option 'first index'
2021-08-02 17:10:21,127 [TRACE] [core    ] [gpio                    ] Got selection 'output' for config option 'pin mode'
2021-08-02 17:10:21,127 [TRACE] [core    ] [gpio                    ] Got selection 'pullup' for config option 'resistor'
2021-08-02 17:10:21,128 [TRACE] [core    ] [gpio                    ] Condition 'pin mode==PinMode.OUTPUT' matched for 'digital'
2021-08-02 17:10:21,128 [TRACE] [core    ] [gpio                    ] Descending into section 'digital'
2021-08-02 17:10:21,128 [TRACE] [core    ] [gpio                    ] Using default value 'PinEdge.NONE' for config option 'interrupt'
2021-08-02 17:10:21,129 [TRACE] [core    ] [gpio                    ] Got value 'True' for config option 'invert'
2021-08-02 17:10:21,129 [TRACE] [core    ] [gpio                    ] Got selection 'ON' for config option 'initial state'
2021-08-02 17:10:21,130 [TRACE] [core    ] [gpio                    ] Skipping 'counter' as no conditions matched
2021-08-02 17:10:21,130 [DEBUG] [core    ] [gpio                    ] Config loaded
2021-08-02 17:10:21,140 [DEBUG] [core    ] [core.gpio.board         ] 'gpio.pin.digital' acquired lock on GPIO05 (GPIO05)
2021-08-02 17:10:21,141 [DEBUG] [core    ] [gpio.digital            ] Configured 'pin05' on GPIO05 with options: {'ID': 'pin05', 'pin mode': 'INPUT', 'interrupt': 'BOTH', 'resistor': 'PULL_UP', 'invert': True, 'initial state': 'OFF'}
2021-08-02 17:10:21,143 [DEBUG] [core    ] [core.gpio.board         ] 'gpio.pin.digital' acquired lock on GPIO06 (GPIO06)
2021-08-02 17:10:21,144 [DEBUG] [core    ] [gpio.digital            ] Configured 'pin06' on GPIO06 with options: {'ID': 'pin06', 'pin mode': 'INPUT', 'interrupt': 'BOTH', 'resistor': 'PULL_DOWN', 'invert': False, 'initial state': 'OFF'}
2021-08-02 17:10:21,146 [DEBUG] [core    ] [core.gpio.board         ] 'gpio.pin.digital' acquired lock on GPIO13 (GPIO13)
2021-08-02 17:10:21,147 [DEBUG] [core    ] [gpio.digital            ] Configured 'pin13' on GPIO13 with options: {'ID': 'pin13', 'pin mode': 'OUTPUT', 'interrupt': 'NONE', 'resistor': 'PULL_UP', 'invert': True, 'initial state': 'ON'}
2021-08-02 17:10:21,149 [DEBUG] [core    ] [core.gpio.board         ] 'gpio.pin.digital' acquired lock on GPIO19 (GPIO19)
2021-08-02 17:10:21,150 [DEBUG] [core    ] [gpio.digital            ] Configured 'pin19' on GPIO19 with options: {'ID': 'pin19', 'pin mode': 'OUTPUT', 'interrupt': 'NONE', 'resistor': 'PULL_UP', 'invert': True, 'initial state': 'ON'}
2021-08-02 17:10:21,152 [DEBUG] [core    ] [core.gpio.board         ] 'gpio.pin.digital' acquired lock on GPIO26 (GPIO26)
2021-08-02 17:10:21,152 [DEBUG] [core    ] [gpio.digital            ] Configured 'pin26' on GPIO26 with options: {'ID': 'pin26', 'pin mode': 'OUTPUT', 'interrupt': 'NONE', 'resistor': 'PULL_UP', 'invert': True, 'initial state': 'ON'}
2021-08-02 17:10:21,154 [DEBUG] [core    ] [core.gpio.board         ] 'gpio.pin.digital' acquired lock on GPIO16 (GPIO16)
2021-08-02 17:10:21,155 [DEBUG] [core    ] [gpio.digital            ] Configured 'pin16' on GPIO16 with options: {'ID': 'pin16', 'pin mode': 'OUTPUT', 'interrupt': 'NONE', 'resistor': 'PULL_UP', 'invert': True, 'initial state': 'ON'}
2021-08-02 17:10:21,156 [DEBUG] [core    ] [core                    ] Module 'gpio' loaded successfully
2021-08-02 17:10:21,156 [DEBUG] [core    ] [bus                     ] Module 'gpio' added as a publisher
2021-08-02 17:10:21,158 [DEBUG] [core    ] [bus                     ] Module 'gpio' added as a subscriber
2021-08-02 17:10:21,158 [DEBUG] [core    ] [core                    ] Loading module 'onewire'
2021-08-02 17:10:21,170 [DEBUG] [core    ] [core                    ] Module 'onewire' is an interface module
2021-08-02 17:10:21,171 [DEBUG] [core    ] [onewire                 ] Parsing config
2021-08-02 17:10:21,171 [TRACE] [core    ] [onewire                 ] Using default value 'w1' for config option 'bus interface'
2021-08-02 17:10:21,172 [TRACE] [core    ] [onewire                 ] Got value '10' for config option 'polling interval'
2021-08-02 17:10:21,172 [TRACE] [core    ] [onewire                 ] Got value 'True' for config option 'bus scan'
2021-08-02 17:10:21,173 [TRACE] [core    ] [onewire                 ] Found regex '.+' in options
2021-08-02 17:10:21,173 [TRACE] [core    ] [onewire                 ] Config key 'bus' matched to options regex '.+'
2021-08-02 17:10:21,173 [ERROR] [core    ] [onewire                 ] An exception occurred while running function 'load'
2021-08-02 17:10:21,175 [ERROR] [core    ] [onewire                 ]

Traceback (most recent call last):
  File "/opt/mqttany/mqttany/modules/__init__.py", line 83, in call
    retval = func(**kwargs)
  File "/opt/mqttany/mqttany/modules/onewire/core.py", line 129, in load
    config_data = parse_config(config_raw, conf_options, log)
  File "/opt/mqttany/mqttany/config.py", line 261, in parse_config
    valid, config = parse_dict(data, options)
  File "/opt/mqttany/mqttany/config.py", line 250, in parse_dict
    config,
  File "/opt/mqttany/mqttany/config.py", line 170, in process_option
    if not isinstance(value, option["type"]):
TypeError: isinstance() arg 2 must be a type or tuple of types

2021-08-02 17:10:21,175 [WARN ] [core    ] [core                    ] Module 'onewire' load failed
2021-08-02 17:10:21,176 [TRACE] [core    ] [core                    ] Creating process for 'mqtt'
2021-08-02 17:10:21,176 [TRACE] [core    ] [core                    ] Process created successfully for module 'mqtt'
2021-08-02 17:10:21,177 [TRACE] [core    ] [core                    ] Starting process for 'mqtt'
2021-08-02 17:10:21,181 [INFO ] [core    ] [core                    ] Module 'mqtt' started successfully
2021-08-02 17:10:21,184 [TRACE] [core    ] [core                    ] Creating process for 'gpio'
2021-08-02 17:10:21,185 [TRACE] [core    ] [core                    ] Process created successfully for module 'gpio'
2021-08-02 17:10:21,186 [TRACE] [core    ] [core                    ] Starting process for 'gpio'
2021-08-02 17:10:21,187 [DEBUG] [mqtt    ] [mqtt                    ] Creating MQTT client
2021-08-02 17:10:21,190 [INFO ] [core    ] [core                    ] Module 'gpio' started successfully
2021-08-02 17:10:21,193 [DEBUG] [mqtt    ] [mqtt                    ] Attaching callbacks
2021-08-02 17:10:21,194 [DEBUG] [core    ] [bus                     ] Starting Message Bus Receive thread
2021-08-02 17:10:21,196 [DEBUG] [mqtt    ] [mqtt                    ] Queuing connect event
2021-08-02 17:10:21,198 [DEBUG] [mqtt    ] [mqtt                    ] Starting MQTT client thread
2021-08-02 17:10:21,198 [TRACE] [core    ] [bus.receive             ] Message Bus Receive thread started successfully
2021-08-02 17:10:21,198 [DEBUG] [gpio    ] [gpio                    ] Setting up hardware
2021-08-02 17:10:21,200 [DEBUG] [core    ] [bus                     ] Starting Message Bus Transmit thread
2021-08-02 17:10:21,201 [INFO ] [gpio    ] [gpio.digital            ] Setting up 'pin05' on GPIO05 as INPUT
2021-08-02 17:10:21,202 [DEBUG] [gpio    ] [core.gpio.pin.digital   ] Setting up pin GPIO05 using chardev
2021-08-02 17:10:21,202 [TRACE] [core    ] [bus.transmit            ] Message Bus Transmit thread started successfully
2021-08-02 17:10:21,204 [ERROR] [gpio    ] [core.gpio.pin.digital   ] Failed to setup GPIO05 using cdev, pin is in use
2021-08-02 17:10:21,205 [WARN ] [gpio    ] [core.gpio.pin.digital   ] Unable to set resistor on GPIO05 as sysfs does not support this
2021-08-02 17:10:21,206 [DEBUG] [gpio    ] [core.gpio.pin.digital   ] Setting up pin GPIO05 using sysfs
2021-08-02 17:10:21,208 [ERROR] [gpio    ] [core.gpio.pin.digital   ] Failed to setup GPIO05 using sysfs, pin is in use
2021-08-02 17:10:21,209 [INFO ] [gpio    ] [gpio.digital            ] Setting up 'pin06' on GPIO06 as INPUT
2021-08-02 17:10:21,209 [DEBUG] [gpio    ] [core.gpio.pin.digital   ] Setting up pin GPIO06 using chardev
2021-08-02 17:10:21,210 [ERROR] [gpio    ] [core.gpio.pin.digital   ] Failed to setup GPIO06 using cdev, pin is in use
2021-08-02 17:10:21,211 [WARN ] [gpio    ] [core.gpio.pin.digital   ] Unable to set resistor on GPIO06 as sysfs does not support this
2021-08-02 17:10:21,211 [TRACE] [mqtt    ] [mqtt.client             ] Sending CONNECT (u1, p1, wr1, wq0, wf1, c0, k15) client_id=b'openHABianRPi4'
2021-08-02 17:10:21,212 [DEBUG] [gpio    ] [core.gpio.pin.digital   ] Setting up pin GPIO06 using sysfs
2021-08-02 17:10:21,213 [TRACE] [mqtt    ] [mqtt.client             ] Received CONNACK (1, 0)
2021-08-02 17:10:21,214 [ERROR] [gpio    ] [core.gpio.pin.digital   ] Failed to setup GPIO06 using sysfs, pin is in use
2021-08-02 17:10:21,215 [INFO ] [gpio    ] [gpio.digital            ] Setting up 'pin13' on GPIO13 as OUTPUT
2021-08-02 17:10:21,215 [INFO ] [mqtt    ] [mqtt                    ] Connected to broker 'openHABianRPi4:1883'
2021-08-02 17:10:21,216 [DEBUG] [gpio    ] [core.gpio.pin.digital   ] Setting up pin GPIO13 using chardev
2021-08-02 17:10:21,216 [DEBUG] [mqtt    ] [mqtt                    ] Resuming previous session
2021-08-02 17:10:21,217 [TRACE] [mqtt    ] [mqtt.client             ] Sending SUBSCRIBE (d0, m1) [(b'openHABianRPi4/+/+/+/#', 0)]
2021-08-02 17:10:21,217 [ERROR] [gpio    ] [core.gpio.pin.digital   ] Failed to setup GPIO13 using cdev, pin is in use
2021-08-02 17:10:21,217 [WARN ] [gpio    ] [core.gpio.pin.digital   ] Unable to set resistor on GPIO13 as sysfs does not support this
2021-08-02 17:10:21,217 [DEBUG] [mqtt    ] [mqtt                    ] Heartbeat
2021-08-02 17:10:21,218 [DEBUG] [gpio    ] [core.gpio.pin.digital   ] Setting up pin GPIO13 using sysfs
2021-08-02 17:10:21,218 [TRACE] [mqtt    ] [mqtt.client             ] Sending PUBLISH (d0, q0, r1, m2), 'b'openHABianRPi4/lwt'', ... (6 bytes)
2021-08-02 17:10:21,219 [ERROR] [gpio    ] [core.gpio.pin.digital   ] Failed to setup GPIO13 using sysfs, pin is in use
2021-08-02 17:10:21,219 [TRACE] [mqtt    ] [mqtt.client             ] Sending PUBLISH (d0, q0, r0, m3), 'b'openHABianRPi4/version'', ... (6 bytes)
2021-08-02 17:10:21,220 [INFO ] [gpio    ] [gpio.digital            ] Setting up 'pin19' on GPIO19 as OUTPUT
2021-08-02 17:10:21,221 [DEBUG] [gpio    ] [core.gpio.pin.digital   ] Setting up pin GPIO19 using chardev
2021-08-02 17:10:21,222 [ERROR] [gpio    ] [core.gpio.pin.digital   ] Failed to setup GPIO19 using cdev, pin is in use
2021-08-02 17:10:21,222 [TRACE] [mqtt    ] [mqtt.client             ] Received SUBACK
2021-08-02 17:10:21,224 [WARN ] [gpio    ] [core.gpio.pin.digital   ] Unable to set resistor on GPIO19 as sysfs does not support this
2021-08-02 17:10:21,226 [DEBUG] [gpio    ] [core.gpio.pin.digital   ] Setting up pin GPIO19 using sysfs
2021-08-02 17:10:21,227 [ERROR] [gpio    ] [core.gpio.pin.digital   ] Failed to setup GPIO19 using sysfs, pin is in use
2021-08-02 17:10:21,228 [INFO ] [gpio    ] [gpio.digital            ] Setting up 'pin26' on GPIO26 as OUTPUT
2021-08-02 17:10:21,229 [DEBUG] [gpio    ] [core.gpio.pin.digital   ] Setting up pin GPIO26 using chardev
2021-08-02 17:10:21,229 [ERROR] [gpio    ] [core.gpio.pin.digital   ] Failed to setup GPIO26 using cdev, pin is in use
2021-08-02 17:10:21,230 [WARN ] [gpio    ] [core.gpio.pin.digital   ] Unable to set resistor on GPIO26 as sysfs does not support this
2021-08-02 17:10:21,230 [DEBUG] [gpio    ] [core.gpio.pin.digital   ] Setting up pin GPIO26 using sysfs
2021-08-02 17:10:21,231 [ERROR] [gpio    ] [core.gpio.pin.digital   ] Failed to setup GPIO26 using sysfs, pin is in use
2021-08-02 17:10:21,232 [INFO ] [gpio    ] [gpio.digital            ] Setting up 'pin16' on GPIO16 as OUTPUT
2021-08-02 17:10:21,232 [DEBUG] [gpio    ] [core.gpio.pin.digital   ] Setting up pin GPIO16 using chardev
2021-08-02 17:10:21,233 [ERROR] [gpio    ] [core.gpio.pin.digital   ] Failed to setup GPIO16 using cdev, pin is in use
2021-08-02 17:10:21,234 [WARN ] [gpio    ] [core.gpio.pin.digital   ] Unable to set resistor on GPIO16 as sysfs does not support this
2021-08-02 17:10:21,234 [DEBUG] [gpio    ] [core.gpio.pin.digital   ] Setting up pin GPIO16 using sysfs
2021-08-02 17:10:21,235 [ERROR] [gpio    ] [core.gpio.pin.digital   ] Failed to setup GPIO16 using sysfs, pin is in use
2021-08-02 17:10:21,236 [DEBUG] [gpio    ] [gpio                    ] Starting polling timer with interval of 60s
2021-08-02 17:10:21,238 [DEBUG] [gpio    ] [gpio                    ] Polling all pins
2021-08-02 17:10:21,239 [TRACE] [core    ] [bus.transmit            ] Message received on publish queue: PublishMessage('gpio/polling-interval', '60')
2021-08-02 17:10:21,254 [TRACE] [mqtt    ] [mqtt                    ] Message received to transmit: PublishMessage('gpio/polling-interval', '60')
2021-08-02 17:10:21,256 [TRACE] [mqtt    ] [mqtt.client             ] Sending PUBLISH (d0, q0, r1, m4), 'b'openHABianRPi4/gpio/polling-interval'', ... (2 bytes)
2021-08-02 17:10:23,217 [TRACE] [mqtt    ] [mqtt.client             ] Sending CONNECT (u1, p1, wr1, wq0, wf1, c0, k15) client_id=b'openHABianRPi4'
2021-08-02 17:10:23,219 [TRACE] [mqtt    ] [mqtt.client             ] Received CONNACK (1, 0)
2021-08-02 17:10:23,220 [INFO ] [mqtt    ] [mqtt                    ] Connected to broker 'openHABianRPi4:1883'
2021-08-02 17:10:23,221 [DEBUG] [mqtt    ] [mqtt                    ] Resuming previous session
2021-08-02 17:10:23,222 [TRACE] [mqtt    ] [mqtt.client             ] Sending SUBSCRIBE (d0, m5) [(b'openHABianRPi4/+/+/+/#', 0)]
2021-08-02 17:10:23,223 [DEBUG] [mqtt    ] [mqtt                    ] Heartbeat
2021-08-02 17:10:23,224 [TRACE] [mqtt    ] [mqtt.client             ] Sending PUBLISH (d0, q0, r1, m6), 'b'openHABianRPi4/lwt'', ... (6 bytes)
2021-08-02 17:10:23,226 [TRACE] [mqtt    ] [mqtt.client             ] Sending PUBLISH (d0, q0, r0, m7), 'b'openHABianRPi4/version'', ... (6 bytes)
2021-08-02 17:10:23,227 [TRACE] [mqtt    ] [mqtt.client             ] Received SUBACK
2021-08-02 17:10:25,224 [TRACE] [mqtt    ] [mqtt.client             ] Sending CONNECT (u1, p1, wr1, wq0, wf1, c0, k15) client_id=b'openHABianRPi4'
2021-08-02 17:10:25,226 [TRACE] [mqtt    ] [mqtt.client             ] Received CONNACK (1, 0)
2021-08-02 17:10:25,228 [INFO ] [mqtt    ] [mqtt                    ] Connected to broker 'openHABianRPi4:1883'
2021-08-02 17:10:25,230 [DEBUG] [mqtt    ] [mqtt                    ] Resuming previous session
2021-08-02 17:10:25,231 [TRACE] [mqtt    ] [mqtt.client             ] Sending SUBSCRIBE (d0, m8) [(b'openHABianRPi4/+/+/+/#', 0)]
2021-08-02 17:10:25,232 [DEBUG] [mqtt    ] [mqtt                    ] Heartbeat
2021-08-02 17:10:25,233 [TRACE] [mqtt    ] [mqtt.client             ] Sending PUBLISH (d0, q0, r1, m9), 'b'openHABianRPi4/lwt'', ... (6 bytes)
2021-08-02 17:10:25,234 [TRACE] [mqtt    ] [mqtt.client             ] Sending PUBLISH (d0, q0, r0, m10), 'b'openHABianRPi4/version'', ... (6 bytes)
2021-08-02 17:10:25,238 [TRACE] [mqtt    ] [mqtt.client             ] Received SUBACK
Config
######## Configuration for MQTTany ########

# All optional values are commented out and default values are shown



### Config file version
version: '1.0'


######## MQTT Module ########
mqtt:

  ### Broker Host
  # can be either IPv4 address or hostname
  host: 'openHABianRPi4'

  ### Broker Port
  # port to connect to on the host
  port: 1883

  ### Client ID
  # Substitutions:
  # - {hostname} = the computer's hostname
  #client id: '{hostname}'

  ### Login
  #username:
  #password:

  ### Session Options
  #qos: 0
  #retain: false

  ### Topics
  # Substitutions:
  # - {hostname} = the computer's hostname
  # - {client_id} = the mqtt 'client id'
  # topics are composed as `{root topic}/{node id}/{property id}`
  #root topic: '{client_id}' # Root topic
  #root topic 'openhabian'
# last will topic becomes `{root topic}/{lwt topic}`
  #lwt topic: 'lwt' # Last Will topic

  ### Heartbeat
  # Interval in seconds to publish status messages
  heartbeat interval: 300


######## 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
  #pin-id:
  #pin05:

    ### 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: 'input' # can be 'input' or 'output'
    #pin mode: input

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

    ### Pin Type Specifc Options
    # Each pin type will have some options specific to it,
    # consult the documentation for details.

   #digital:
   #  interrupt: both
   #   invert: true

  pin05:
    pin: 5
   # name: '{pin_id}'
    pin mode: input
    resistor: pullup
    digital:
      interrupt: both
      invert: true

  pin06:
    pin: 6
   # name: '{pin_id}'
    pin mode: input
    resistor: pulldown
    digital:
      interrupt: both
      invert: false

  pin13:
    pin: 13
   # name: '{pin_id}'
    pin mode: output
    resistor: pullup
    digital:
      invert: true
      initial state: 'ON'

  pin19:
    pin: 19
   # name: '{pin_id}'
    pin mode: output
    resistor: pullup
    digital:
      invert: true
      initial state: 'ON'

  pin26:
    pin: 26
   # name: '{pin_id}'
    pin mode: output
    resistor: pullup
    digital:
      invert: true
      initial state: 'ON'

  pin16:
    pin: 16
   # name: '{pin_id}'
    pin mode: output
    resistor: pullup
    digital:
      invert: true
      initial state: 'ON'


  ### 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 ########
#i2c:

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

  ### Device Configuration
  # !! this id is used as the node so it must not match any other node or module name !!
  #device-id:

    ### Device Friendly Name
    # Friendly name used in logging etc
    # Substitutions:
    # - {device_id} = name of device's section in config file
    # - {address:02x} = device address in hex (ex. '20')
    # - {device} = device identifier
    #name: '{device_id}'

    ### Device Type
    # Device identifier, see the wiki for a list of supported devices
    #device: ''

    ### I2C Bus ID
    # ID of the I2C bus to use on your SBC
    # ex. Raspberry Pi 3 this will probably be 1
    # Can also specify full path ex. '/dev/i2c-1'
    #bus:

    ### Device Address
    # 7-bit hex address of the device (ex. 0x20)
    # this can also be a base-10 integer
    #address: 0x

    ### Device Specific Options
    # Each device type will have some options specific to it
    # consult the wiki page for the device for details.



######## OneWire Module ########
onewire:

  ### Bus Interface
  bus: 'w1'

  ### Polling Interval
  polling interval: 10 # interval in seconds to poll all devices

  ### Bus Scan
  # Scan bus for any unconfigured devices and add them
  bus scan: true

  ### Device Configuration
  device-id:

    ### Device Name
    # Substitutions:
    # - {device_id} = will be replaced with the device definition section name
    # - {device_type} = will be replaced with the device type (ex. `DS18B20`)
    # - {address} = will be replaced with the device's **FULL 8 BYTE ADDRESS**
    ds18b20:
      unit: 'C'
    address: '28-03209779ee7e'
    #name: '{device_id}'
    name: '{address}'

    ### Device Address
    # The device's address, can be 7 or 8 bytes, can use w1 style `xx-xxxxxxxxxxxx`
    # address: '28-030b97942442' # **MUST BE IN SINGLE QUOTES `''`**

    ### Device Specific Options
    # Each device type will have some options specific to it
    # consult the wiki page for the device for details.

  ### Multiple Device Configuration
  #batch-id:

    ### Device 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}'
    # Substitutions:
    # - {device_id} = will be replaced with the device definition section name
    # - {device_type} = will be replaced with the device type (ex. `DS18B20`)
    # - {address} = will be replaced with the device's **FULL 8 BYTE ADDRESS**
    # - {index} = will be replaced with the device's index in the list of addresses
    #name: '{device_id}'

    ### Device Address
    # List of device addresses, can be 7 or 8 bytes, can use w1 style `xx-xxxxxxxxxxxx`
    #address: ['', ''] # **MUST BE IN SINGLE QUOTES `''`**

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



######## LED Module ########
#led:

  ### Animation Directory
  # A directory or list of directories to look for additional animations in
  #anim dir: []

  ### Startup Animation
  # Animation to play when MQTTany loads
  #anim startup: 'test.array'

  ### Array Configuration
  #array-id:

    ### Array Name
    # Substitutions:
    # - {array_id} = will be replaced with the array definition section name
    #name: '{array_id}'

    ### Output
    # The interface to use for outputting data
    # Available options are 'rpi' or 'sacn'
    #output: ''

    ### Pixel Count
    # The number of pixels in your array (not necessarily LEDs, see next option)
    #count:

    ### LEDs per Pixel
    # Allows you to have more than one LED handled as a single pixel.
    # Ex. A bulb with 3 LEDs in it can be treated as a single pixel in the array.
    # Total number of LEDs in the array should be 'count' times 'leds per pixel'
    #leds per pixel: 1

    ### Initial Brightness
    # The initial brightness of the array, can be 0-255
    #brightness: 255

    ### Color Order
    # The byte order for the color data sent to the LEDs.
    # See the 'test.order' animation for how to determine this
    #color order: '{default}'

    ### Animation Frame Rate
    # Frame rate for animations, you may need to decrease this for
    # longer arrays or certain interface types.
    #anim fps: 60

    ### Interface Specific Options
    # Each interface may have some options specific to it
    # consult the wiki page for the interface for details.



######## XSET Module ########
#xset:

  ### Default Display
  # Display option to use when commands do not specify a display.
  # Omitting this option will omit the '-display' option from the call to xset
  #default display: None

  ### Startup Commands
  # A list of commands to run when the module loads.
  # See the documentation on sending commands for formatting.
  # If none are desired, use an empty list as shown below.
  #startup commands: []

@CrazyIvan359
Copy link
Owner

CrazyIvan359 commented Aug 3, 2021

I edited your comment to use collapsible sections because I'm on my phone.

So the udev rules file is here which if you followed the instructions to the letter should be in /opt/mqttany/udev.

There is definitely a bug in the One Wire module though, your config is fine. I will look into that later this week when I have time.

As for getting One Wire configured and also your GPIO working, because the log is telling me it isn't, let's switch to discussion #121

@CrazyIvan359
Copy link
Owner

@EKNYESE sorry it took so long to get back to this, I have not had much time to work on MQTTany this year.

I came to work on this issue but looking through everything here again I found that the problem is actually with your config. This key in the onewire section is wrong:

  ### Bus Interface
  bus: 'w1'

It should be 'bus interface' and not 'bus'

  ### Bus Interface
  bus interface: 'w1'

@CrazyIvan359 CrazyIvan359 changed the title Bug Report OneWire Bug Dec 26, 2021
@CrazyIvan359 CrazyIvan359 removed the bug Something isn't working label Dec 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OneWire OneWire Module
Projects
None yet
Development

No branches or pull requests

2 participants