Error while setting up platform rpi_gpio

Anyone have any idea how to fix this problem.
I tried doing this on commandline

sudo usermod -a -G hass,gpio pi
sudo usermod -a -G hass,gpio hass
sudo usermod -a -G hass,gpio homeassistant

none of the 3 fix the issue still getting the same issue.

Im using homeassistant image on my raspberry pi 2 using USB flash drive… everything boots fine and I can connect my browser. only problem is i cannot make my GPIO work.

I edit my configuration using
sudo nano /home/homeassistant/.homeassistant/configuration.yaml
or on samba share. none work

Example configuration.yaml entry

switch:

  • platform: rpi_gpio
    ports:
    XX: GARDEN SPRINKLER
    XX: A/C UP STAIRS
    XX: Heater UP STAIRS
    XX: VENT FAN UP STAIRS
    XX: VENT FAN DOWN STAIRS
    XX: A/C DOWN STAIRS
    XX: Heater DOWN STAIRS

(XX is my gpio number)

16-11-18 21:32:10 homeassistant.components.switch: Error while setting up platform rpi_gpio

Traceback (most recent call last):
File “/srv/homeassistant/lib/python3.4/site-packages/homeassistant/helpers/entity_component.py”, line 148, in _async_setup_platform
entity_platform.add_entities, discovery_info
File “/usr/lib/python3.4/asyncio/futures.py”, line 388, in iter
yield self # This tells Task to wait for completion.
File “/usr/lib/python3.4/asyncio/tasks.py”, line 286, in _wakeup
value = future.result()
File “/usr/lib/python3.4/asyncio/futures.py”, line 277, in result
raise self._exception
File “/usr/lib/python3.4/concurrent/futures/thread.py”, line 54, in run
result = self.fn(*self.args, **self.kwargs)
File “/srv/homeassistant/lib/python3.4/site-packages/homeassistant/components/switch/rpi_gpio.py”, line 45, in setup_platform
switches.append(RPiGPIOSwitch(name, port, invert_logic))
File “/srv/homeassistant/lib/python3.4/site-packages/homeassistant/components/switch/rpi_gpio.py”, line 58, in init
rpi_gpio.setup_output(self._port)
File “/srv/homeassistant/lib/python3.4/site-packages/homeassistant/components/rpi_gpio.py”, line 41, in setup_output
GPIO.setup(port, GPIO.OUT)
RuntimeError: No access to /dev/mem. Try running as root!
16-11-18 21:34:49 netdisco.ssdp: Error fetching description at http://192.168.79.244:49686/
16-11-18 22:32:16 homeassistant.core: BusHandler:Exception doing job
Traceback (most recent call last):
File “/srv/homeassistant/lib/python3.4/site-packages/homeassistant/core.py”, line 1210, in job_handler
func(*args)
File “/srv/homeassistant/lib/python3.4/site-packages/homeassistant/components/updater.py”, line 74, in
hass, lambda _: check_newest_version(hass, huuid),
File “/srv/homeassistant/lib/python3.4/site-packages/homeassistant/components/updater.py”, line 82, in check_newest_version
newest, releasenotes = get_newest_version(huuid)
File “/srv/homeassistant/lib/python3.4/site-packages/homeassistant/components/updater.py”, line 128, in get_newest_version
return (res[‘version’], res[‘release-notes’])
TypeError: ‘NoneType’ object is not subscriptable
16-11-19 00:00:00 homeassistant.core: Error inside async loop: Exception in callback async_track_point_in_utc_time..point_in_time_listener() at /srv/homeassistant/lib/python3.4/site-packages/homeassistant/helpers/event.py:108
16-11-19 08:16:12 netdisco.ssdp: Error fetching description at http://192.168.79.244:49687/

Looks as if you need to give Hass root to the GPIO. Use the following command then reboot the pi and try again

sudo adduser hass gpio
sudo reboot

still getting same error after reboot

i get this in return
> The user hass’ is already a member of gpio'.

Is this any use ?

http://raspberrypi.stackexchange.com/questions/40105/access-gpio-pins-without-root-no-access-to-dev-mem-try-running-as-root

Thanks BertrumUK for trying to help it didn’t work… I did some experimenting. One of the reason why it’s not working it’s because I’m installing my hassbian image on a USB flash drive. I tried all the work around and none of them help. What works is installing the hassbian image only on micro SD card.

I wonder why it wouldn’t work on USB flash drive VS micro SD… does anyone know?

NEVER MIND PROBLEM SOLVED…

I been flashing the USB flash drive with hassbian image without changing my micro sd card set up… I updated my set up on my SD card from hassbian and changed only the cmdline.txt (after copying) so that it would boot on USB… now everything seem to work… sorry brain fart i been using my old microsd setup for so long since it work all time time and it boot without a problem. i never bother checking for it.