Skip to content
This repository has been archived by the owner on Oct 5, 2024. It is now read-only.

Unable to install packages #57

Open
Quentintin opened this issue Jul 11, 2019 · 42 comments
Open

Unable to install packages #57

Quentintin opened this issue Jul 11, 2019 · 42 comments

Comments

@Quentintin
Copy link

Quentintin commented Jul 11, 2019

Hello,

Firstly, i want to say I use Raspberry Pi 4 (4Go) with Raspbian buster + Pizigate freshly ordered

I'm not sure Pizigate works fine because test script is not developped yet for Rpi4, but control of blue led seems to work. (https://zigate.fr/documentation/parametrer-la-pizigate/)

I followed instruction about installation, but configuration.yaml doesn't accept this part :

homeassistant:
  packages: !include_dir_named packages

When I use configuration validator, here's the response :

Invalid config for [automation]: required key not provided @ data['action']. Got None
required key not provided @ data['trigger']. Got None. (See ?, line ?).
Please check the docs at https://home-assistant.io/components/automation/


Moreover I didn't succeed to use developer/services and call 'zigate.permit_join'.
I've got fail response too :

Échec d'appel du service "zigate/permit_join". 'NoneType' object has no attribute 'is_connected'

Do you have any idea to fix my problem ?
Thank you

@doudz
Copy link
Owner

doudz commented Jul 12, 2019

Are you using hass.io ?

@Quentintin
Copy link
Author

No, I did manual installation with python environnement : https://www.home-assistant.io/docs/installation/raspberry-pi/

Cause hass.io is not yet available for rpi4

@doudz
Copy link
Owner

doudz commented Jul 13, 2019

Good, could you provide log in debug mode ?

@Quentintin
Copy link
Author

I add debug mode in configuration.yaml, but I didn't find log file. The file home-assistant.log stay empty even after HA reboot, or Rpi Reboot (I gave full access to the file with chmod 777).

However, on admin dashboard (in /dev-info path), I had this following logs (I dont know where logs are stored) :

Error` doing job: Future exception was never retrieved
17:18 custom_components/zigate/init.py (ERROR)

ZiGate has not been found, please check configuration.
17:18 custom_components/zigate/init.py (ERROR)

ZiGate not found
17:18 custom_components/zigate/init.py (ERROR)


Moreover, following this step (https://zigate.fr/documentation/parametrer-la-pizigate/), I add procedure to enable GPIO in production mode. In the Zigate's forum, the user : zigate (owner) told to avoid this procedure if we use domotic assistant cause plugin (so like yours) may already enable the right GPIOs inputs.
Is it right ?
What should i do ?

Because actually, it seems to have a conflict. The blue led move to low light some times (I think after HA boot). Thank you doudz ;)

PS : Would you prefer to speak french ?

@Gesfenlir
Copy link

Hey, I have the same issue.
Runing homeassistant on a docker on a Synology NAS.

Configuration check and logs give me this:
ERROR (MainThread) [homeassistant.components.homeassistant] Invalid config for [automation]: required key not provided @ data['action']. Got None
required key not provided @ data['trigger']. Got None. (See ?, line ?). Please check the docs at https://home-assistant.io/components/automation/

@doudz
Copy link
Owner

doudz commented Jul 19, 2019

@Gesfenlir the error is about automation, not zigate

@doudz
Copy link
Owner

doudz commented Jul 19, 2019

@Quentintin Could you click on the error to have the full traceback ?
Because I need more info for the following

Error` doing job: Future exception was never retrieved
17:18 custom_components/zigate/init.py (ERROR)

The following means the zigate lib hasn't loaded

ZiGate has not been found, please check configuration.
17:18 custom_components/zigate/init.py (ERROR)

ZiGate not found
17:18 custom_components/zigate/init.py (ERROR)

@doudz
Copy link
Owner

doudz commented Jul 19, 2019

@Quentintin Did you follow the instructions ?
If you want to use PiZiGate, just add gpio: true. Other options are still available (channel, etc)

# Enable PiZiGate
zigate:
  gpio: true

If you're using Rpi3, you can have some trouble trying to use PiZiGate. If needed, add the following line into config.txt (If you're using Hass.io you have to access that on the SD card directly. Simply plug it into your PC and edit it there. The config.txt is not accessible from your Hass.io system, you may need to open the SD card on a Windows or Linux system.):

dtoverlay=pi3-miniuart-bt
enable_uart=1

@Quentintin
Copy link
Author

Hey @doudz ,
Sorry for late answer.

I did install new Hassio 0.96.5 for Rpi4 (32bits) with a fresh clean installation.

I follow instructions to install plugin, but it still doesn't work.
My problem is similar to #49 .
I even try to add dtoverlay=pi3-miniuart-bt at the end of config.txt (This is not necessary. cf : https://zigate.fr/documentation/compatibilite-raspberry-pi-4-b/)

Here's my files

configuration.yaml

  # Enable PiZiGate
zigate:
    gpio: true
    port: /dev/ttyAMA0

logger:
  default: error
  logs:
    zigate: debug
    custom_components.zigate: debug
    
panel_custom:
  - name: zigate
    sidebar_title: ZiGate
    sidebar_icon: mdi:zigbee

config.txt (at the end)

dtoverlay=pi3-miniuart-bt (I try without too)
enable_uart=1

The logs :

2019-08-01 18:53:21 INFO (MainThread) [homeassistant.setup] Setting up logger
2019-08-01 18:53:23 DEBUG (SyncWorker_10) [custom_components.zigate] Port : /dev/ttyAMA0
2019-08-01 18:53:23 DEBUG (SyncWorker_10) [custom_components.zigate] Host : None
2019-08-01 18:53:23 DEBUG (SyncWorker_10) [custom_components.zigate] GPIO : True
2019-08-01 18:53:23 DEBUG (SyncWorker_10) [custom_components.zigate] Led : True
2019-08-01 18:53:23 DEBUG (SyncWorker_10) [custom_components.zigate] Channel : None
2019-08-01 18:53:24 DEBUG (SyncWorker_10) [custom_components.zigate] ZiGate object created <zigate.core.ZiGateGPIO object at 0xb29e7b50>
2019-08-01 18:53:24 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 204, in _async_setup_platform
    self.hass, self.config, self.domain, platform_type)
  File "/usr/src/homeassistant/homeassistant/setup.py", line 214, in async_prepare_setup_platform
    integration = await loader.async_get_integration(hass, platform_name)
  File "/usr/src/homeassistant/homeassistant/loader.py", line 268, in async_get_integration
    Integration.resolve_from_root, hass, components, domain
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/loader.py", line 150, in resolve_from_root
    pathlib.Path(base) / domain / 'manifest.json'
  File "/usr/local/lib/python3.7/pathlib.py", line 908, in __truediv__
    return self._make_child((key,))
  File "/usr/local/lib/python3.7/pathlib.py", line 695, in _make_child
    drv, root, parts = self._parse_args(args)
  File "/usr/local/lib/python3.7/pathlib.py", line 649, in _parse_args
    a = os.fspath(a)
TypeError: expected str, bytes or os.PathLike object, not NoneType
2019-08-01 18:53:29 DEBUG (SyncWorker_9) [zigate] Try loading persistent file
2019-08-01 18:53:29 DEBUG (SyncWorker_9) [zigate] Trying to load /config/zigate.json
2019-08-01 18:53:29 DEBUG (SyncWorker_9) [zigate] Load success
2019-08-01 18:53:29 DEBUG (SyncWorker_9) [zigate] REQUEST : 0x0010
2019-08-01 18:53:29 DEBUG (SyncWorker_9) [zigate] Msg to send b'0010000010'
2019-08-01 18:53:29 DEBUG (SyncWorker_9) [zigate] Encoded Msg to send b'01021010021002101003'
2019-08-01 18:53:29 DEBUG (SyncWorker_9) [zigate] Waiting for status message for command 0x0010
2019-08-01 18:53:32 WARNING (SyncWorker_9) [zigate] No response after command 0x0010 (1)
2019-08-01 18:53:32 WARNING (SyncWorker_9) [zigate] Failed to retrieve zigate firmware version
2019-08-01 18:53:32 DEBUG (SyncWorker_9) [zigate] REQUEST : 0x0021 b'\x03\x18\xc8\x00'
2019-08-01 18:53:32 DEBUG (SyncWorker_9) [zigate] Msg to send b'00210004f60318c800'
2019-08-01 18:53:32 DEBUG (SyncWorker_9) [zigate] Encoded Msg to send b'0102102102100214f6021318c8021003'
2019-08-01 18:53:32 DEBUG (SyncWorker_9) [zigate] Waiting for status message for command 0x0021
2019-08-01 18:53:35 WARNING (SyncWorker_9) [zigate] No response after command 0x0021 (2)
2019-08-01 18:53:35 DEBUG (SyncWorker_9) [zigate] REQUEST : 0x0023 b'\x00'
2019-08-01 18:53:35 DEBUG (SyncWorker_9) [zigate] Msg to send b'002300012200'
2019-08-01 18:53:35 DEBUG (SyncWorker_9) [zigate] Encoded Msg to send b'010210230210021122021003'
2019-08-01 18:53:35 DEBUG (SyncWorker_9) [zigate] Waiting for status message for command 0x0023
2019-08-01 18:53:38 WARNING (SyncWorker_9) [zigate] No response after command 0x0023 (3)
2019-08-01 18:53:38 DEBUG (SyncWorker_9) [zigate] Check network state
2019-08-01 18:53:38 DEBUG (SyncWorker_9) [zigate] REQUEST : 0x0009
2019-08-01 18:53:38 DEBUG (SyncWorker_9) [zigate] Msg to send b'0009000009'
2019-08-01 18:53:38 DEBUG (SyncWorker_9) [zigate] Encoded Msg to send b'010210021902100210021903'
2019-08-01 18:53:38 DEBUG (SyncWorker_9) [zigate] Waiting for status message for command 0x0009
2019-08-01 18:53:41 WARNING (SyncWorker_9) [zigate] No response after command 0x0009 (4)
2019-08-01 18:53:41 ERROR (SyncWorker_9) [zigate] Failed to get network state
2019-08-01 18:53:41 DEBUG (SyncWorker_9) [zigate] Network is down, start it
2019-08-01 18:53:41 DEBUG (SyncWorker_9) [zigate] REQUEST : 0x0024
2019-08-01 18:53:41 DEBUG (SyncWorker_9) [zigate] Msg to send b'0024000024'
2019-08-01 18:53:41 DEBUG (SyncWorker_9) [zigate] Encoded Msg to send b'01021024021002102403'
2019-08-01 18:53:41 DEBUG (SyncWorker_9) [zigate] Waiting for status message for command 0x0024
2019-08-01 18:53:44 WARNING (SyncWorker_9) [zigate] No response after command 0x0024 (5)
2019-08-01 18:53:44 DEBUG (SyncWorker_9) [zigate] REQUEST : 0x0015
2019-08-01 18:53:44 DEBUG (SyncWorker_9) [zigate] Msg to send b'0015000015'
2019-08-01 18:53:44 DEBUG (SyncWorker_9) [zigate] Encoded Msg to send b'01021015021002101503'
2019-08-01 18:53:44 DEBUG (SyncWorker_9) [zigate] Waiting for status message for command 0x0015
2019-08-01 18:53:47 WARNING (SyncWorker_9) [zigate] No response after command 0x0015 (6)
2019-08-01 18:53:47 DEBUG (SyncWorker_9) [zigate] Auto saving /config/zigate.json
2019-08-01 18:53:47 DEBUG (SyncWorker_9) [zigate] Saving persistent file
2019-08-01 18:53:47 DEBUG (SyncWorker_9) [zigate] Acquire Lock to save persistent file
2019-08-01 18:53:47 DEBUG (SyncWorker_9) [zigate] File already existing, make a backup before
2019-08-01 18:53:47 DEBUG (SyncWorker_9) [zigate] Release Lock of persistent file
2019-08-01 18:53:47 DEBUG (SyncWorker_9) [zigate] REQUEST : 0x0018 b'\x01'
2019-08-01 18:53:47 DEBUG (SyncWorker_9) [zigate] Msg to send b'001800011801'
2019-08-01 18:53:47 DEBUG (SyncWorker_9) [zigate] Encoded Msg to send b'010210180210021118021103'
2019-08-01 18:53:47 DEBUG (SyncWorker_9) [zigate] Waiting for status message for command 0x0018
2019-08-01 18:53:50 WARNING (SyncWorker_9) [zigate] No response after command 0x0018 (7)
2019-08-01 18:53:50 DEBUG (SyncWorker_9) [zigate] REQUEST : 0x0010
2019-08-01 18:53:50 DEBUG (SyncWorker_9) [zigate] Msg to send b'0010000010'
2019-08-01 18:53:50 DEBUG (SyncWorker_9) [zigate] Encoded Msg to send b'01021010021002101003'
2019-08-01 18:53:50 DEBUG (SyncWorker_9) [zigate] Waiting for status message for command 0x0010
2019-08-01 18:53:53 WARNING (SyncWorker_9) [zigate] No response after command 0x0010 (8)
2019-08-01 18:53:53 WARNING (SyncWorker_9) [zigate] Failed to retrieve zigate firmware version
2019-08-01 18:53:53 ERROR (MainThread) [homeassistant.core] Error doing job: Future exception was never retrieved
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/zigate/__init__.py", line 364, in start_zigate
    version = myzigate.get_version_text()
  File "/usr/local/lib/python3.7/site-packages/zigate/core.py", line 808, in get_version_text
    v = self.get_version(refresh)['version']
TypeError: 'NoneType' object is not subscriptable

I noticed that when I plug out then plug in pizigate inside gpio, here's my logs :

2019-08-01 18:55:33 DEBUG (ZiGate-Listen) [zigate] Raw packet received, b'\x01\x80\x02\x17\x02\x10\x02\x12\x85\x02\x10\x02\x10\x03'
2019-08-01 18:55:33 DEBUG (ZiGate-Event Loop) [zigate] Dispatch ZIGATE_PACKET_RECEIVED
2019-08-01 18:55:33 DEBUG (ZiGate-Decode data) [zigate] Received response 0x8007: b'00'
2019-08-01 18:55:33 DEBUG (ZiGate-Decode data) [zigate] RESPONSE 0x8007 - “Factory New” Restart : status:0, lqi:0
2019-08-01 18:55:33 DEBUG (ZiGate-Decode data) [zigate] REQUEST : 0x0024 
2019-08-01 18:55:33 DEBUG (ZiGate-Decode data) [zigate] Msg to send b'0024000024'
2019-08-01 18:55:33 DEBUG (ZiGate-Decode data) [zigate] Encoded Msg to send b'01021024021002102403'
2019-08-01 18:55:33 DEBUG (ZiGate-Decode data) [zigate] Waiting for status message for command 0x0024
2019-08-01 18:55:36 WARNING (ZiGate-Decode data) [zigate] No response after command 0x0024 (10)
2019-08-01 18:55:36 DEBUG (ZiGate-Decode data) [zigate] Dispatch ZIGATE_RESPONSE_RECEIVED

It may help you to understand something.

I really want to make it work, so dont hesitate to ask me more informations.
Merci !

@doudz
Copy link
Owner

doudz commented Aug 1, 2019

I think about a baudrate issue or something like that.
Since you're on pi4 are you sure the workaround is pi3-miniuart-bt ? Maybe it's pi4, I have to check

@doudz
Copy link
Owner

doudz commented Aug 1, 2019

@Quentintin
Copy link
Author

So the solution is to double baudrate (in your source code) or firmware update (how should I do this on Hassos ?)

@doudz
Copy link
Owner

doudz commented Aug 2, 2019

Could you try dtoverlay=pi3-disable-bt ?

@doudz
Copy link
Owner

doudz commented Aug 2, 2019

You could also find some help on HA communauty since there's same problem for people who use razberry board (zwave gpio board)

@Quentintin
Copy link
Author

Ok i will try all this options this afternoon. Thk you.

@Quentintin
Copy link
Author

Nothing seems to work !
Here's what i tried :

  • dtoverlay=pi3-disable-bt

With Raspbian Buster Lite installed on other SD Card, I try :

All updates has done perfectly, but my problem is still here !

@doudz Did you try your plugin on Rpi 4 with Hass.io (HassOS)

@Quentintin
Copy link
Author

PS : The blue led (on PiZigate) stay solid state and LOW brightness

@doudz
Copy link
Owner

doudz commented Aug 3, 2019

No not tested on rpi 4 , only 2 and 3

@doudz
Copy link
Owner

doudz commented Aug 3, 2019

The problem can me related to GPIO ,I don't know ...

@doudz
Copy link
Owner

doudz commented Aug 3, 2019

Since I have no Rpi4, If you want, you can give me a ssh access to your raspbian to make test

@doudz
Copy link
Owner

doudz commented Aug 4, 2019

similar to doudz/zigate#139

@doudz
Copy link
Owner

doudz commented Aug 7, 2019

My Rpi 4 is on the way...
Edit: Pi 4 received. I'll make some tests tomorrow

@doudz
Copy link
Owner

doudz commented Aug 8, 2019

After test it works like a charm
What I did :

  • add user to groups : gpio, dialout and i2c
  • disable console from /boot/cmdline.txt by removing console=serial0,115200
  • enable uart by adding enable_uart=1 in /boot/config.txt
  • manually config the port in configuration.yaml like :
zigate:
  gpio: true
  port: /dev/serial0

That's all folks :)

@Quentintin
Copy link
Author

What's your environement ? Did you try on Hass.io ? or Alternative/manual install ?

I'm on Hassio 0.97 and I dont find how should i check this point :

add user to groups : gpio, dialout and i2c

But others 3 points are checked, and here's my log

2019-08-09 00:05:57 DEBUG (SyncWorker_5) [custom_components.zigate] Port : /dev/serial0
2019-08-09 00:05:57 DEBUG (SyncWorker_5) [custom_components.zigate] Host : None
2019-08-09 00:05:57 DEBUG (SyncWorker_5) [custom_components.zigate] GPIO : True
2019-08-09 00:05:57 DEBUG (SyncWorker_5) [custom_components.zigate] Led : True
2019-08-09 00:05:57 DEBUG (SyncWorker_5) [custom_components.zigate] Channel : None
2019-08-09 00:05:58 DEBUG (SyncWorker_5) [custom_components.zigate] ZiGate object created <zigate.core.ZiGateGPIO object at 0xb06ee4f0>
2019-08-09 00:06:00 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 223, in async_setup_platform
    self.hass, self.config, self.domain, platform_type
  File "/usr/src/homeassistant/homeassistant/setup.py", line 227, in async_prepare_setup_platform
    integration = await loader.async_get_integration(hass, platform_name)
  File "/usr/src/homeassistant/homeassistant/loader.py", line 283, in async_get_integration
    Integration.resolve_from_root, hass, components, domain
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/loader.py", line 154, in resolve_from_root
    manifest_path = pathlib.Path(base) / domain / "manifest.json"
  File "/usr/local/lib/python3.7/pathlib.py", line 908, in __truediv__
    return self._make_child((key,))
  File "/usr/local/lib/python3.7/pathlib.py", line 695, in _make_child
    drv, root, parts = self._parse_args(args)
  File "/usr/local/lib/python3.7/pathlib.py", line 649, in _parse_args
    a = os.fspath(a)
TypeError: expected str, bytes or os.PathLike object, not NoneType
2019-08-09 00:06:27 DEBUG (SyncWorker_6) [zigate] Try loading persistent file
2019-08-09 00:06:27 DEBUG (SyncWorker_6) [zigate] Trying to load /config/zigate.json
2019-08-09 00:06:27 WARNING (SyncWorker_6) [zigate] Persistent file /config/zigate.json doesn't exist
2019-08-09 00:06:27 DEBUG (SyncWorker_6) [zigate] Trying to load /config/zigate.json.0
2019-08-09 00:06:27 WARNING (SyncWorker_6) [zigate] Persistent file /config/zigate.json.0 doesn't exist
2019-08-09 00:06:27 DEBUG (SyncWorker_6) [zigate] No file to load
2019-08-09 00:06:27 ERROR (SyncWorker_6) [zigate] Cannot connect to ZiGate using port /dev/serial0
2019-08-09 00:06:27 ERROR (MainThread) [homeassistant.core] Error doing job: Future exception was never retrieved
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/serial/serialposix.py", line 244, in open
    self.fd = os.open(self.portstr, os.O_RDWR | os.O_NOCTTY | os.O_NONBLOCK)
FileNotFoundError: [Errno 2] No such file or directory: '/dev/serial0'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/zigate/transport.py", line 208, in reconnect
    self.serial = self.initSerial()
  File "/usr/local/lib/python3.7/site-packages/zigate/transport.py", line 200, in initSerial
    return serial.Serial(self._port, 115200)
  File "/usr/local/lib/python3.7/site-packages/serial/serialutil.py", line 182, in __init__
    self.open()
  File "/usr/local/lib/python3.7/site-packages/serial/serialposix.py", line 247, in open
    raise SerialException(msg.errno, "could not open port {}: {}".format(self._port, msg))
serial.serialutil.SerialException: [Errno 2] could not open port /dev/serial0: [Errno 2] No such file or directory: '/dev/serial0'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/zigate/__init__.py", line 361, in start_zigate
    myzigate.autoStart(channel)
  File "/usr/local/lib/python3.7/site-packages/zigate/core.py", line 339, in autoStart
    self.startup(channel)
  File "/usr/local/lib/python3.7/site-packages/zigate/core.py", line 356, in startup
    self.setup_connection()
  File "/usr/local/lib/python3.7/site-packages/zigate/core.py", line 2207, in setup_connection
    self.connection = ThreadSerialConnection(self, self._port, '3f201')
  File "/usr/local/lib/python3.7/site-packages/zigate/transport.py", line 192, in __init__
    self.reconnect(False)
  File "/usr/local/lib/python3.7/site-packages/zigate/transport.py", line 217, in reconnect
    raise ZIGATE_CANNOT_CONNECT('Cannot connect to ZiGate using port {}'.format(self._port))
zigate.transport.ZIGATE_CANNOT_CONNECT: Cannot connect to ZiGate using port /dev/serial0

Capture

@Quentintin
Copy link
Author

Following this tutorial : https://developers.home-assistant.io/docs/en/hassio_debugging.html#ssh-access-to-the-host

I'm over container now,
Now let see a sample of my dev folder :
Capture

@doudz
Copy link
Owner

doudz commented Aug 9, 2019

Sorry but I can't test HASSIO yet because HASSIO for pi4 doesn't have Wifi because of a driver problem
home-assistant/operating-system#435

I'm running a fresh raspbian buster on Pi4 2G and using venv
https://www.home-assistant.io/docs/installation/raspberry-pi/

pi@raspberrypi:~ $ ls -lh /dev/serial*
lrwxrwxrwx 1 root root 5 août   8 22:01 /dev/serial0 -> ttyS0
lrwxrwxrwx 1 root root 7 août   8 22:01 /dev/serial1 -> ttyAMA0

@doudz
Copy link
Owner

doudz commented Aug 9, 2019

@Quentintin you said you're using container, do you mean docker ?
If yes did you expose /dev/serial0 ?
https://www.home-assistant.io/docs/installation/docker/#exposing-devices

@Quentintin
Copy link
Author

Sorry but I can't test HASSIO yet because HASSIO for pi4 doesn't have Wifi because of a driver problem
home-assistant/operating-system#435

Hmmm I know, as you see I comment this issue. Just have to wait now ...

Now I start to understand complexity of HA, I really thing about a fresh installation of HA on Raspbian.
What is your advice ?

Is it possible to restore snapshot from HassIO on it ?

@Quentintin
Copy link
Author

Quentintin commented Aug 9, 2019

I dont use docker by myself. Talking about hassio running HA + Supervisor on ResinOS.

https://developers.home-assistant.io/docs/en/architecture_hassio.html

hassio

@doudz
Copy link
Owner

doudz commented Aug 9, 2019

By far I prefer a manual installation in raspbian rather than docker or HASSIO
Docker or HASSIO are made to be easy to use but if you're trying to make something unstandard it's a bit complex

Installing raspbian takes few seconds minutes
Installing HA using pip3 doesn't take more time and you have full access/control to the system

@Quentintin
Copy link
Author

I did new install on other SD card with Raspbian Buster + Python env, and ... IT WORKS FINE 🍾 !
My zigate is now connected and i success to add a first aqara temperature/hum device without problem.

Just one thing : "Your zigate firmware is outdated, Please upgrade to 3.1a or later !"
How should I update my PiZigate ?

@Narcotik
Copy link

For your information I had the same issue on a Pi 3. The problem was solved after I did this :
$ sudo nano /boot/cmdline.txt
Effacez l’inscription suivante : console=serial0,115200

Sauvegardez puis tapez les commandes suivantes :

$ sudo systemctl disable hciuart
$ sudo usermod -aG gpio pi
$ sudo reboot

@Clickb8
Copy link

Clickb8 commented Jan 3, 2020

Hi, i'm just passing by to say I had exactly the same problem and solved it.

My configuration is HassOS 3.7 on a Raspberry 4 Model B
The problem was that my serial port in my configuration file was not the good one.
Readme says it should be /dev/serial0 or /dev/ttyAMA0 (in forum post), but in my case it needed to be /dev/ttyS0

You can see that when you go in your "Hass.io "menu then "System" tab and "Hardware". Not sure why it changed for me.

Maybe the README should be updated to reflect that ?
Anyway, thanks doudz for the amazing work !
Have a good day

@hmargera
Copy link

hmargera commented Jan 6, 2020

Hi doudz,

I followed the way you installed HA on RPI4/PiZiGate :
#57 (comment)

I am facing the followin errors :
2020-01-06 17:53:17 WARNING (MainThread) [homeassistant.loader] You are using a custom integration for zigate which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you do experience issues with Home Assistant.
2020-01-06 17:53:22 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/helpers/entity_component.py", line 218, in async_setup_platform
self.hass, self.config, self.domain, platform_type
File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/setup.py", line 231, in async_prepare_setup_platform
integration = await loader.async_get_integration(hass, platform_name)
File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/loader.py", line 278, in async_get_integration
Integration.resolve_from_root, hass, components, domain
File "/usr/lib/python3.7/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/loader.py", line 154, in resolve_from_root
manifest_path = pathlib.Path(base) / domain / "manifest.json"
File "/usr/lib/python3.7/pathlib.py", line 901, in truediv
return self._make_child((key,))
File "/usr/lib/python3.7/pathlib.py", line 688, in _make_child
drv, root, parts = self._parse_args(args)
File "/usr/lib/python3.7/pathlib.py", line 642, in _parse_args
a = os.fspath(a)
TypeError: expected str, bytes or os.PathLike object, not NoneType
2020-01-06 17:53:26 WARNING (SyncWorker_14) [zigate] No response waiting command 0x8024
2020-01-06 17:53:30 ERROR (SyncWorker_14) [zigate] Failed to start network
2020-01-06 17:53:43 ERROR (ZiGate-Decode data) [zigate] Command 0x004e failed Failed (ZigBee event codes) 0x80 : b''
2020-01-06 17:53:46 WARNING (Thread-5) [zigate] No response waiting command 0x804e
2020-01-06 17:53:46 ERROR (Thread-5) [zigate] Failed to build neighbours table
2020-01-06 17:53:46 ERROR (ZiGate-Decode data) [zigate] Command 0x004e failed Failed (ZigBee event codes) 0x80 : b''
2020-01-06 17:53:49 WARNING (Thread-5) [zigate] No response waiting command 0x804e
2020-01-06 17:53:49 ERROR (Thread-5) [zigate] Failed to build neighbours table

Do you have any idea where this is coming from ?

Thanks for yout time.

@doudz
Copy link
Owner

doudz commented Jan 7, 2020

Did you copy manifest.json ?

@hmargera
Copy link

hmargera commented Jan 7, 2020

Yes, manifest.json is in custom_components/zigate diectory.
{
"domain": "zigate",
"name": "ZiGate",
"documentation": "https://github.com/doudz/homeassistant-zigate/blob/master/Readme.md",
"dependencies": ["persistent_notification"],
"codeowners": ["doudz"],
"requirements": ["zigate==0.37.4"]
}
2020-01-07_07-54-54-Home Assistant

@hmargera
Copy link

hmargera commented Jan 7, 2020

I also noticed this in the traces of hass :
2020-01-07 07:15:19 INFO (MainThread) [homeassistant.setup] Setting up zigate
/srv/homeassistant/lib/python3.7/site-packages/zigate/core.py:2315: RuntimeWarning: This channel is already in use, continuing anyway. Use GPIO.setwarnings(False) to disable warnings.
GPIO.setup(27, GPIO.OUT) # GPIO2

@doudz
Copy link
Owner

doudz commented Jan 7, 2020

@hmargera I think the ZiGate is working because you're able to see the firmware version in the admin Panel.
The problem is the zigbee network cannot start.
I suggest trying to erase ZiGate EEPRom

@hmargera
Copy link

hmargera commented Jan 7, 2020

Thank you for your feed back.

On my way to erase the PiZiGate EEPROM, il found that may be the Zigate python module is not correctly installed.
Can you say by seeing what is below ?

pi@raspberrypi:~ $ python3 -m zigate -h
/usr/bin/python3: No module named zigate

pi@raspberrypi:~ $ ls /usr/bin/python*
/usr/bin/python /usr/bin/python3 /usr/bin/python3.7m /usr/bin/python3m
/usr/bin/python2 /usr/bin/python3.7 /usr/bin/python3.7m-config /usr/bin/python3m-config
/usr/bin/python2.7 /usr/bin/python3.7-config /usr/bin/python3-config

pi@raspberrypi:~ $ ls /usr/bin/python3.7
/usr/bin/python3.7

pi@raspberrypi:~ $ ls /srv/homeassistant/lib/python3.7/site-packages/zigate
adminpanel clusters.py core.py flasher.py init.py mqtt_broker.py responses.py transport.py
broker.py const.py firmware.py ikea_ota_download.py main.py pycache templates version.py

@doudz
Copy link
Owner

doudz commented Jan 7, 2020

@hmargera no, don't try to use the zigate module outside of Home Assistant it wouldn't work because Home Assistant install the dependencies in it's own folder

If the admin Panel is working and the Firmware version is visible : the component is fine.

To erase the EEPROM, use the HA service zigate.raw_command and call the cmd: '0x0012'
Wait a little and restart HA

@hmargera
Copy link

hmargera commented Jan 7, 2020

Here is what happened after I use the zigate.raw_command :
2020-01-07 11:24:02 WARNING (SyncWorker_1) [zigate] No response after command 0x0012 (1)

Same issue present after restarting HA.
2020-01-07 07:15:15 WARNING (MainThread) [homeassistant.loader] You are using a custom integration for zigate which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you do experience issues with Home Assistant.
2020-01-07 07:15:20 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/helpers/entity_component.py", line 218, in async_setup_platform
self.hass, self.config, self.domain, platform_type
File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/setup.py", line 231, in async_prepare_setup_platform
integration = await loader.async_get_integration(hass, platform_name)
File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/loader.py", line 278, in async_get_integration
Integration.resolve_from_root, hass, components, domain
File "/usr/lib/python3.7/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/loader.py", line 154, in resolve_from_root
manifest_path = pathlib.Path(base) / domain / "manifest.json"
File "/usr/lib/python3.7/pathlib.py", line 901, in truediv
return self._make_child((key,))
File "/usr/lib/python3.7/pathlib.py", line 688, in _make_child
drv, root, parts = self._parse_args(args)
File "/usr/lib/python3.7/pathlib.py", line 642, in _parse_args
a = os.fspath(a)
TypeError: expected str, bytes or os.PathLike object, not NoneType
2020-01-07 07:15:24 WARNING (SyncWorker_17) [zigate] No response waiting command 0x8024
2020-01-07 07:15:27 ERROR (SyncWorker_17) [zigate] Failed to start network
2020-01-07 11:24:02 WARNING (SyncWorker_1) [zigate] No response after command 0x0012 (1)

@hmargera
Copy link

hmargera commented Jan 7, 2020

I noticed an abnormal situation for GPIO.0 -> should be output.
2020-01-07_13-41-57-homeassistant@raspberrypi_ ~_ homeassistant

After forcing GPIO.0 as an output, I was able to join to devices.

I guess I have to find who is playing with GPIO.0.
2020-01-07 11:27:12 INFO (MainThread) [homeassistant.setup] Setting up zigate
/srv/homeassistant/lib/python3.7/site-packages/zigate/core.py:2315: RuntimeWarning: This channel is already in use, continuing anyway. Use GPIO.setwarnings(False) to disable warnings.

Thank you for your help.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants