16-06-09 18:20:19 homeassistant.components.sensor: Error while setting up platform dht
Traceback (most recent call last):
File "/srv/hass/hass_venv/lib/python3.4/site-packages/homeassistant/helpers/entity_component.py", line 109, in _setup_platform
discovery_info)
File "/srv/hass/hass_venv/lib/python3.4/site-packages/homeassistant/components/sensor/dht.py", line 61, in setup_platform
dev.append(DHTSensor(data, variable, unit, name))
File "/srv/hass/hass_venv/lib/python3.4/site-packages/homeassistant/components/sensor/dht.py", line 81, in __init__
self.update()
File "/srv/hass/hass_venv/lib/python3.4/site-packages/homeassistant/components/sensor/dht.py", line 100, in update
self.dht_client.update()
File "/srv/hass/hass_venv/lib/python3.4/site-packages/homeassistant/util/__init__.py", line 289, in wrapper
result = method(*args, **kwargs)
File "/srv/hass/hass_venv/lib/python3.4/site-packages/homeassistant/components/sensor/dht.py", line 125, in update
self.pin)
File "/home/hass/deps/Adafruit_DHT/common.py", line 90, in read_retry
humidity, temperature = read(sensor, pin, platform)
File "/home/hass/deps/Adafruit_DHT/common.py", line 77, in read
return platform.read(sensor, pin)
File "/home/hass/deps/Adafruit_DHT/Raspberry_Pi_2.py", line 34, in read
raise RuntimeError('Error accessing GPIO. Make sure program is run as root with sudo!')
RuntimeError: Error accessing GPIO. Make sure program is run as root with sudo!
I added hass user to gpio,root,sudo groups and still the same error
Okay, first things first.
Did you run the AiO installer as sudo?
Assuming you did, I can’t quite get my head around some design choices for the installer…
The all in one installer makes an entry in systemd, which is a service that autostarts programs, amongst other things. My question to the creators of the installer is: why not make sure that entry gets root rights right away?
Next problem.
If you manually edit the systemd entry, to run hass as root, the directory with configuration files will change too, to /root/.homeassistant/
Actually, now that I’ve typed that…
The AiO installer is supposed to be ran on the lastest Raspbian version.
On that version, root should not be required to acces the GPIO.
Hmm, only thing I can think of is at this point that the Adafruit DHT library is not yet optimised for using GPIO as non-root.
Only fixes to this would be to run hass as root (see problems above) or open a bug report on the DHT sensor component.
I’ve manually installed HASS, and I run it as root. I can access my DHT no problem
currently im pushing data to HA via USB. yeah ESP8266 are really cheap, but i need to wait more than 3 weeks to receive them. in my situation, i like to keep thing wired up so ill appreciate if u can find me a tutorial for MQTT over serial communication. cause i cant find nothing :S