Zwave razberry2 rpi2 error

Hello i had i working ha 0.41 installed with allinone, with razberry 2 card on rpi2.
i did an upgrade to 0.47 and zwave crashed. on ozwcp i could initialize razberry ans see all devices.
i did a fresh install with allinone but again zwave is not working and also there is no ozwcp

error log

2017-06-30 17:26:59 WARNING (Thread-1) [homeassistant.components.zwave] ZWave entity_ids will soon be changing. To opt in to new entity_ids now, set new_entity_ids: true under zwave in your configuration.yaml. See the following blog post for details: https://home-assistant.io/blog/2017/06/15/zwave-entity-ids/
2017-06-30 17:26:59 ERROR (MainThread) [homeassistant.setup] Error during setup of component zwave
Traceback (most recent call last):
File “/home/homeassistant/.homeassistant/deps/openzwave/option.py”, line 75, in init
raise ZWaveException(u"Can’t write to device %s : %s" % (device, traceback.format_exception(*sys.exc_info())))
File “/usr/lib/python3.4/traceback.py”, line 181, in format_exception
return list(_format_exception_iter(etype, value, tb, limit, chain))
File “/usr/lib/python3.4/traceback.py”, line 146, in _format_exception_iter
for value, tb in values:
File “/usr/lib/python3.4/traceback.py”, line 125, in _iter_chain
context = exc.context
AttributeError: ‘NoneType’ object has no attribute ‘context

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/setup.py”, line 190, in _async_setup_component
component.setup, hass, processed_config)
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/homeassistant_venv/lib/python3.4/site-packages/homeassistant/components/zwave/init.py”, line 268, in setup
config_path=config[DOMAIN].get(CONF_CONFIG_PATH))
File “/home/homeassistant/.homeassistant/deps/openzwave/option.py”, line 81, in init
raise ZWaveException(u"Error when retrieving device %s : %s" % (device, traceback.format_exception(*sys.exc_info())))
openzwave.object.ZWaveException: ‘Zwave Generic Exception : Error when retrieving device /dev/ttyAMA0 : [‘Traceback (most recent call last):\n’, ’ File “/home/homeassistant/.homeassistant/deps/openzwave/option.py”, line 75, in init\n raise ZWaveException(u"Can\‘t write to device %s : %s" % (device, traceback.format_exception(*sys.exc_info())))\n’, ’ File “/usr/lib/python3.4/traceback.py”, line 181, in format_exception\n return list(_format_exception_iter(etype, value, tb, limit, chain))\n’, ’ File “/usr/lib/python3.4/traceback.py”, line 146, in _format_exception_iter\n for value, tb in values:\n’, ’ File “/usr/lib/python3.4/traceback.py”, line 125, in _iter_chain\n context = exc.context\n’, “AttributeError: ‘NoneType’ object has no attribute ‘context’\n”]’

can anyone help please?

Did you read the release notes for 047.1 specifically the breaking changes related to Zwave?

Yes i read it. But i cannot find anything helpful.
I though with a fresh install everything should work ok

That hints that the problem is that your controller either isn’t on /dev/ttyAMA0, or that HA can’t access it. What does the following command return:

ls -l /dev/ttyAMA0

crw–w---- 1 root tty 204, 64 Jun 30 17:17 /dev/ttyAMA0

in previous installation is was working with /dev/ttyAMA0

Well, only root has read and write access, you’re missing rw access for the group (it’s only showing write access).

Check that the user running HA is in group tty, then run:

sudo chmod g+r /dev/ttyAMA0

That should work, but you’ll want to reboot to see if the permissions get mangled on boot, and so you need a udev rule to fix it.

Oh it works. but after reboot same problem. how can i fix it?
what is a udev rule?

udev is the system that handles devices, and you use rules to tell it what to do when it detects things.

Here’s a relevant Stack Exchange article. However, before we take you down that path, what’s in /boot/cmdline.txt? The odds are good you’ve got something that’s setting those permissions “wrong” for HA.

dwc_otg.lpm_enable=0 console=serial0,115200 console=tty1 root=PARTUUID=59219cf2-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait

Remove console=serial0,115200 from that, reboot, then post the output of ls -l /dev/ttyAMA0 please.

crw-rw---- 1 root dialout 204, 64 Jun 30 18:43 /dev/ttyAMA0

Right, as long as your HA user is in the dialout group, you’ll be fine.

Thank you very much

@Tinkerer : How can you device or figure our which user is running your home assistant. I just installed a new Home Assistant and came from the AIO installation on my PI. Now I struggle a little bit with setting up my RAZBERRY zwave on my PI 3.

Folks,
I run into the same Problem with my Rapsberry PI 3 when I added the Razberry for zwave.

pi@NEW-HomeAssistant:~ $ ls -l /dev/ttyAMA0
crw-rw---- 1 root dialout 204, 64 Dec 13 19:07 /dev/ttyAMA0

The first question I do have as I run the Home Assistant in a python Virtualenv how to I find the user which runs HomeAssistant?

Well, it does depend on how you installed HA - which you forgot to mention. If it’s some form of Linux install, not Hass.io, then ps axu|egrep "homeassist|hass" will give a hint.

You should. You can chose not to, but if you’re installing any other Python based programs you run the risk of clashing versions and something breaking.

So I did a LINUX Install an Rapsberry PI 3 without any HASSIO.

pi@NEW-HomeAssistant:~ $ ps axu|egrep “homeassist|hass”
homeass+ 528 3.1 5.5 376016 52632 ? Ssl Dec13 44:34 /srv/homeassistant/bin/python3 /srv/homeassistant/bin/hass -c /home/homeassistant/.homeassistant
pi 26294 0.0 0.0 4372 536 pts/0 S+ 18:53 0:00 grep -E --color=auto homeassist|hass

I imagine that the user is homeassistant as I also do need it to stop and start the HA service
sudo systemctl start home-assistant@homeassistant
sudo systemctl stop home-assistant@homeassistant

Correct?

Yes, the user is homeassistant

If you installed Hassbian it mentions the user (and other details) in the install documentation.

I am still getting error when I try to get on my Rapsberry PI 3 the “Razzberry 2” zwave running:

2017-12-14 14:06:18 ERROR (MainThread) [homeassistant.setup] Error during setup of component zwave
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.5/site-packages/openzwave/option.py", line 75, in __init__
    raise ZWaveException(u"Can't write to device %s : %s" % (device, traceback.format_exception(*sys.exc_info())))
openzwave.object.ZWaveException: "Zwave Generic Exception : Can't write to device /dev/ttyAMA0 : ['NoneType: None\\n']"

When I do a lookup of the device it is there, right?

pi@NEW-HomeAssistant:~ $ ls -l /dev/ttyAMA0
crw-rw---- 1 root dialout 204, 64 Dec 13 19:07 /dev/ttyAMA0

and the user homeassistant is part of the group dialout

pi@NEW-HomeAssistant:~ $ grep 'dialout' /etc/group
dialout:x:20:pi,homeassistant

I am hopefully fine with that user homeassistant?

pi@NEW-HomeAssistant:~ $ ps axu | egrep "homeassist|hass"
homeass+ 528 3.1 5.5 376016 52632 ? Ssl Dec13 44:34 /srv/homeassistant/bin/python3 /srv/homeassistant/bin/hass -c /home/homeassistant/.homeassistant
pi 26294 0.0 0.0 4372 536 pts/0 S+ 18:53 0:00 grep -E --color=auto homeassist|hass

pi@NEW-HomeAssistant:~ $ cat /etc/passwd

only gave me homeassistant, no hass user

homeassistant:x:999:996::/home/homeassistant:

I am not aware that during the installation of my HomeAssistant form: Installation in Python virtual environment I have installed openzwave. Anyway the path is there:

pi@NEW-HomeAssistant:~ $ ls /srv/homeassistant/lib/python3.5/site-packages/openzwave/
command.py  controller.py  group.py  __init__.py  network.py  node.py  object.py  option.py  __pycache__  scene.py  singleton.py  value.py
pi@NEW-HomeAssistant:~ $

That looks good, and you shouldn’t need to manually install OZW, since Home Assistant will handle that when it needs it.

Now, you’re sure that the device is /dev/ttyAMA0 and not /dev/ttyACM0 or /dev/ttyUSB0 or anything else?