Page 1 of 2

Pizigate / Zigate not working

Posted: Sunday 07 April 2019 8:57
by pgielen
Version: Domoticz 4.10602
Platform: Raspbian Stretch
Plugin/Hardware: Raspberry Pi 3B+ with RFXCOM XL on /dev/ttyUSB0, Aeotec Z-Stick Gen 5 gateway on /dev/ttyACM0 and Pizigate internal, using Zigate plugin
Description:

I received the PiZigate recently and have installed it on my RPi 3B+. As is said in the instructions, I have disabled bluetooth on the RPi.

I have set the Pizigate in production mode using:

Code: Select all

gpio mode 0 out
gpio mode 2 out
gpio write 2 1 
gpio write 0 0
gpio write 0 1
I have deleted the console=... in /boot/cmdline

I have installed the Zigate plugin from https://github.com/sasu-drooz/Domoticz-Zigate.

I set 'erase persistent data' to 'true'

I added Zigate in the hardware section of Domoticz. However, this still does not work. This is my log:

Code: Select all

2019-04-06 14:06:16.988 (ZIGATE) Debug: 0
2019-04-06 14:06:16.672 Status: (ZIGATE) Started.
2019-04-06 14:06:16.985 Status: (ZIGATE) Entering work loop.
2019-04-06 14:06:16.986 Status: (ZIGATE) Initialized version 4.1.3, author 'zaraki673 pipiche38'
2019-04-06 14:06:16.988 Status: (ZIGATE) Zigate plugin 4.1.3 started
2019-04-06 14:06:16.988 Status: (ZIGATE) Python Version - 3.5.3 (default, Sep 27 2018, 17:25:39)
2019-04-06 14:06:16.988 [GCC 6.3.0 20170516]
2019-04-06 14:06:16.988 Status: (ZIGATE) Switching Hearbeat to 5 s interval
2019-04-06 14:06:16.988 Status: (ZIGATE) DomoticzVersion: 4.10602
2019-04-06 14:06:16.988 Status: (ZIGATE) DomoticzHash: ce68fa52
2019-04-06 14:06:16.988 Status: (ZIGATE) DomoticzBuildTime: 2019-04-04 20:51:02
2019-04-06 14:06:16.995 Status: (ZIGATE) Opening DomoticzDB in raw
2019-04-06 14:06:16.995 Status: (ZIGATE) load PluginConf
2019-04-06 14:06:16.995 Status: (ZIGATE) PluginConf: /home/pi/domoticz/plugins/Domoticz-Zigate/Conf/PluginConf.txt
2019-04-06 14:06:16.996 Status: (ZIGATE) -vibrationAqarasensitivity: medium
2019-04-06 14:06:16.996 Status: (ZIGATE) -enablegroupmanagement: 0
2019-04-06 14:06:16.996 Status: (ZIGATE) -resetMotiondelay: 30
2019-04-06 14:06:16.996 Status: (ZIGATE) -logFORMAT: 0
2019-04-06 14:06:16.996 Status: (ZIGATE) -logLQI: 0
2019-04-06 14:06:16.996 Status: (ZIGATE) -channel: ['11', '15', '19', '20', '25', '26']
2019-04-06 14:06:17.041 (ZIGATE) Configure Permit To Join
2019-04-06 14:06:17.041 (ZIGATE) Request discovery mode for 254 seconds
2019-04-06 14:06:17.000 Status: (ZIGATE) Plugin Database: DeviceList-8.txt
2019-04-06 14:06:17.012 Status: (ZIGATE) DeviceConf loaded
2019-04-06 14:06:17.012 Status: (ZIGATE) load ListOfDevice
2019-04-06 14:06:17.013 Status: (ZIGATE) Entries loaded from /home/pi/domoticz/plugins/Domoticz-Zigate/Data/DeviceList-8.txt : 0
2019-04-06 14:06:17.013 Status: (ZIGATE) Connection Name: Zigate, Transport: Serial, Address: /dev/ttyUSB0
2019-04-06 14:06:17.040 Status: (ZIGATE) Erase Zigate PDM
2019-04-06 14:06:17.040 Status: (ZIGATE) Set Zigate as a Coordinator
2019-04-06 14:06:17.040 Status: (ZIGATE) ZigateConf setting Channel(s) to: ['11', '15', '19', '20', '25', '26']
2019-04-06 14:06:17.040 Status: (ZIGATE) setChannel - Channel set to : 06188800
2019-04-06 14:06:17.041 Status: (ZIGATE) ZigateConf - Setting UTC Time to : 607874777
2019-04-06 14:06:17.041 Status: (ZIGATE) Start network
2019-04-06 14:06:27.011 (ZIGATE) FirmwareVersion not ready
2019-04-06 14:06:32.020 (ZIGATE) FirmwareVersion not ready
2019-04-06 14:06:37.029 (ZIGATE) FirmwareVersion not ready
2019-04-06 14:06:42.038 (ZIGATE) FirmwareVersion not ready
2019-04-06 14:06:42.038 (ZIGATE) Try to get Firmware version once more 4
2019-04-06 14:06:46.997 Status: (ZIGATE) Set Zigate as a Coordinator
2019-04-06 14:06:46.997 Status: (ZIGATE) ZigateConf setting Channel(s) to: ['11', '15', '19', '20', '25', '26']
2019-04-06 14:06:46.998 Status: (ZIGATE) setChannel - Channel set to : 06188800
2019-04-06 14:06:46.998 Status: (ZIGATE) ZigateConf - Setting UTC Time to : 607874806
2019-04-06 14:06:46.998 Status: (ZIGATE) Start network
2019-04-06 14:06:52.007 (ZIGATE) FirmwareVersion not ready
2019-04-06 14:06:57.015 (ZIGATE) FirmwareVersion not ready
2019-04-06 14:07:02.035 (ZIGATE) FirmwareVersion not ready
2019-04-06 14:07:02.035 (ZIGATE) Try to get Firmware version once more 8
2019-04-06 14:07:06.994 (ZIGATE) FirmwareVersion not ready
2019-04-06 14:07:12.003 (ZIGATE) FirmwareVersion not ready
2019-04-06 14:07:17.011 (ZIGATE) FirmwareVersion not ready
2019-04-06 14:07:17.012 Error: (ZIGATE) Plugin is not started ...
2019-04-06 14:07:17.012 Error: (ZIGATE) - Communication issue with the Zigate
2019-04-06 14:07:17.012 Error: (ZIGATE) - restart once the plugin, and if this remain the same
2019-04-06 14:07:17.012 Error: (ZIGATE) - unplug/plug the zigate
(...the last 4 lines are repeated every 5 seconds)

What could be the problem?

Pierre

Re: Pizigate / Zigate not working

Posted: Sunday 07 April 2019 12:16
by alanlsmith
I had a similar experience with a Pi 2 I found that disabling then renabling the plugin got rid of the ‘firmware version not ready message’ and both the plugin and the PiZiGate hardware appeared to be working but no matter what setting I used relating to pairing time. I couldn’t pair any device.

The led on the PiZiGate changed to bright when put in production mode and dim when in flash (as in firmware update) mode, so I assume the it was functioning and the plugin appeared to be communicating with it. One thing was the led did not flash to indicate that it was in pairing mode. i assume that it should in the same way as it does for the USB ZiGate, although the documentation is a bit sparse and doesn’t mention whether that’s the case.

I have gone back to using the Zigbee2MQTT plugin but will try the PiZiGate on another Pi that so I can play around with it without messing up my production set up.

Re: Pizigate / Zigate not working

Posted: Sunday 07 April 2019 20:51
by ronaldbro
I was also strugling with it for a moment. I needed to enable the serial port in raspi-config and connected it in domoticz to /dev/serial0. Then it worked.

Re: Pizigate / Zigate not working

Posted: Sunday 07 April 2019 21:14
by pgielen
ronaldbro wrote: Sunday 07 April 2019 20:51 I needed to enable the serial port in raspi-config and connected it in domoticz to /dev/serial0. Then it worked.
I tried this, had to re-enter the gpio instructions to enter production mode, and it got rid of the continuous 'Firmware' errors. But now, there is another problem:

Code: Select all

019-04-07 21:01:25.065 Error: (ZIGATE) 'onHeartbeat' failed 'KeyError'.
2019-04-07 21:01:25.065 Error: (ZIGATE) ----> Line 618 in '/home/pi/domoticz/plugins/Domoticz-Zigate/plugin.py', function onHeartbeat
2019-04-07 21:01:25.065 Error: (ZIGATE) ----> Line 498 in '/home/pi/domoticz/plugins/Domoticz-Zigate/plugin.py', function onHeartbeat
2019-04-07 21:01:25.065 Error: (ZIGATE) ----> Line 418 in '/home/pi/domoticz/plugins/Domoticz-Zigate/Modules/heartbeat.py', function processListOfDevices
2019-04-07 21:01:25.065 Error: (ZIGATE) ----> Line 759 in '/home/pi/domoticz/plugins/Domoticz-Zigate/Modules/output.py', function processConfigureReporting
Again, every 5 seconds.... What this hardware needs is good documentation...

Re: Pizigate / Zigate not working

Posted: Sunday 07 April 2019 21:28
by ronaldbro
At least it looks like you got a connection with the PiZigate ;)
When you update the zigate plugin it will restart. Can you send the complete logging after that?

There are some zigate plugin experts on the forum who probably can help you. (I just reached the level noob+ ;) )

Re: Pizigate / Zigate not working

Posted: Sunday 07 April 2019 22:03
by pgielen
Sure:

Code: Select all

2019-04-07 21:46:19.707 (ZIGATE) Debug: 0
2019-04-07 21:46:19.734 (ZIGATE) Configure Permit To Join
2019-04-07 21:46:19.734 (ZIGATE) Request discovery mode for 254 seconds
2019-04-07 21:46:19.415 Status: (ZIGATE) Started.
2019-04-07 21:46:19.703 Status: (ZIGATE) Entering work loop.
2019-04-07 21:46:19.704 Status: (ZIGATE) Initialized version 4.1.4, author 'zaraki673 pipiche38'
2019-04-07 21:46:19.706 Status: (ZIGATE) Zigate plugin 4.1.4 started
2019-04-07 21:46:19.707 Status: (ZIGATE) Python Version - 3.5.3 (default, Sep 27 2018, 17:25:39)
2019-04-07 21:46:19.707 [GCC 6.3.0 20170516]
2019-04-07 21:46:19.707 Status: (ZIGATE) Switching Hearbeat to 5 s interval
2019-04-07 21:46:19.707 Status: (ZIGATE) DomoticzVersion: 4.10602
2019-04-07 21:46:19.707 Status: (ZIGATE) DomoticzHash: ce68fa52
2019-04-07 21:46:19.707 Status: (ZIGATE) DomoticzBuildTime: 2019-04-04 20:51:02
2019-04-07 21:46:19.714 Status: (ZIGATE) Opening DomoticzDB in raw
2019-04-07 21:46:19.715 Status: (ZIGATE) load PluginConf
2019-04-07 21:46:19.715 Status: (ZIGATE) PluginConf: /home/pi/domoticz/plugins/Domoticz-Zigate/Conf/PluginConf.txt
2019-04-07 21:46:19.716 Status: (ZIGATE) -vibrationAqarasensitivity: medium
2019-04-07 21:46:19.716 Status: (ZIGATE) -enablegroupmanagement: 0
2019-04-07 21:46:19.716 Status: (ZIGATE) -resetMotiondelay: 30
2019-04-07 21:46:19.716 Status: (ZIGATE) -logFORMAT: 0
2019-04-07 21:46:19.716 Status: (ZIGATE) -logLQI: 0
2019-04-07 21:46:19.716 Status: (ZIGATE) -channel: ['11', '15', '19', '20', '25', '26']
2019-04-07 21:46:19.718 Status: (ZIGATE) Plugin Database: DeviceList-9.txt
2019-04-07 21:46:19.731 Status: (ZIGATE) DeviceConf loaded
2019-04-07 21:46:19.731 Status: (ZIGATE) load ListOfDevice
2019-04-07 21:46:19.733 Status: (ZIGATE) Entries loaded from /home/pi/domoticz/plugins/Domoticz-Zigate/Data/DeviceList-9.txt : 0
2019-04-07 21:46:19.835 Status: (ZIGATE) Major Version Num: 0003
2019-04-07 21:46:19.836 Status: (ZIGATE) Installer Version Number: 030f
2019-04-07 21:46:20.038 Status: (ZIGATE) Permit Join: Off
2019-04-07 21:46:20.143 Status: (ZIGATE) Zigate addresses ieee: 00158d0001ede6ef , short addr: ffff
2019-04-07 21:46:20.143 Status: (ZIGATE) Network state UP, PANID: 7380 extPANID: 0x0000000000000000 Channel: 11
2019-04-07 21:46:20.246 Status: (ZIGATE) Number of devices recently active in Zigate = 0
2019-04-07 21:46:29.712 Status: (ZIGATE) Plugin with Zigate firmware 030f correctly initialized
2019-04-07 21:47:24.739 Error: (ZIGATE) 'onHeartbeat' failed 'KeyError'.
2019-04-07 21:47:24.739 Error: (ZIGATE) ----> Line 618 in '/home/pi/domoticz/plugins/Domoticz-Zigate/plugin.py', function onHeartbeat
2019-04-07 21:47:24.739 Error: (ZIGATE) ----> Line 498 in '/home/pi/domoticz/plugins/Domoticz-Zigate/plugin.py', function onHeartbeat
2019-04-07 21:47:24.739 Error: (ZIGATE) ----> Line 418 in '/home/pi/domoticz/plugins/Domoticz-Zigate/Modules/heartbeat.py', function processListOfDevices
2019-04-07 21:47:24.739 Error: (ZIGATE) ----> Line 759 in '/home/pi/domoticz/plugins/Domoticz-Zigate/Modules/output.py', function processConfigureReporting

Re: Pizigate / Zigate not working

Posted: Sunday 07 April 2019 22:18
by ronaldbro
Looks like the zigate is initialized. Maybe the error occurs because you don't have any joined devices yet.

Can you add a device?
Permit join is now set to off according to your log. At first I would set the permit join time to 255 which means always on. This is more convenient when adding devices. Just don't forget to change the value after you finished adding devices.
(After you change the permit join time and update the plugin you have to wait until the plugin is ready. This can take about one minute. Just look at the zigate status device)

Re: Pizigate / Zigate not working

Posted: Monday 08 April 2019 0:07
by pgielen
I tried adding a Trädfri lightbulb. Which did not work...

Re: Pizigate / Zigate not working

Posted: Monday 08 April 2019 8:38
by LouiS22
pgielen wrote: Monday 08 April 2019 0:07 I tried adding a Trädfri lightbulb. Which did not work...
Tradfri is a PITA to add as it is factory set to connect to tradfri gateway. You first need to get rid of that. Have you done that?

Re: Pizigate / Zigate not working

Posted: Monday 08 April 2019 9:12
by pipiche
They are 2 issues which might happen:

- Not getting Firmware version looks as a communication issue between the PiZigate and the Plugin. Try the tetsing tool at : https://github.com/fairecasoimeme/ZiGat ... s/PiZiGate

- The first thing you need to do is to initialize the Zigate, so when the Communication is ok and you get the firmware version, please start the plugin with Erase Permanent Data Memory

Re: Pizigate / Zigate not working

Posted: Monday 08 April 2019 9:13
by pipiche
Last make sure that you have the latest version of the plugin, so do a git pull, as I think the error mentioned above is addressed.

Re: Pizigate / Zigate not working

Posted: Monday 08 April 2019 10:00
by pgielen
The hardware and plugin seem to work together now, at least there are no more errors:

Code: Select all

2019-04-08 09:49:24.863 Status: (ZIGATE) Started.
2019-04-08 09:49:25.081 (ZIGATE) Debug: 0
2019-04-08 09:49:25.110 (ZIGATE) Configure Permit To Join
2019-04-08 09:49:25.111 (ZIGATE) Request discovery mode for 255 seconds
2019-04-08 09:49:25.078 Status: (ZIGATE) Entering work loop.
2019-04-08 09:49:25.079 Status: (ZIGATE) Initialized version 4.1.4, author 'zaraki673 pipiche38'
2019-04-08 09:49:25.081 Status: (ZIGATE) Zigate plugin 4.1.4 started
2019-04-08 09:49:25.081 Status: (ZIGATE) Python Version - 3.5.3 (default, Sep 27 2018, 17:25:39)
2019-04-08 09:49:25.081 [GCC 6.3.0 20170516]
2019-04-08 09:49:25.081 Status: (ZIGATE) Switching Hearbeat to 5 s interval
2019-04-08 09:49:25.081 Status: (ZIGATE) DomoticzVersion: 4.10602
2019-04-08 09:49:25.081 Status: (ZIGATE) DomoticzHash: ce68fa52
2019-04-08 09:49:25.081 Status: (ZIGATE) DomoticzBuildTime: 2019-04-04 20:51:02
2019-04-08 09:49:25.088 Status: (ZIGATE) Opening DomoticzDB in raw
2019-04-08 09:49:25.089 Status: (ZIGATE) load PluginConf
2019-04-08 09:49:25.089 Status: (ZIGATE) PluginConf: /home/pi/domoticz/plugins/Domoticz-Zigate/Conf/PluginConf.txt
2019-04-08 09:49:25.090 Status: (ZIGATE) -vibrationAqarasensitivity: medium
2019-04-08 09:49:25.090 Status: (ZIGATE) -enablegroupmanagement: 0
2019-04-08 09:49:25.090 Status: (ZIGATE) -resetMotiondelay: 30
2019-04-08 09:49:25.090 Status: (ZIGATE) -logFORMAT: 0
2019-04-08 09:49:25.090 Status: (ZIGATE) -logLQI: 0
2019-04-08 09:49:25.090 Status: (ZIGATE) -channel: ['11', '15', '19', '20', '25', '26']
2019-04-08 09:49:25.095 Status: (ZIGATE) Plugin Database: DeviceList-9.txt
2019-04-08 09:49:25.108 Status: (ZIGATE) DeviceConf loaded
2019-04-08 09:49:25.108 Status: (ZIGATE) load ListOfDevice
2019-04-08 09:49:25.109 Status: (ZIGATE) Entries loaded from /home/pi/domoticz/plugins/Domoticz-Zigate/Data/DeviceList-9.txt : 0
2019-04-08 09:49:25.212 Status: (ZIGATE) Major Version Num: 0003
2019-04-08 09:49:25.212 Status: (ZIGATE) Installer Version Number: 030f
2019-04-08 09:49:25.414 Status: (ZIGATE) Zigate in Permit Join: On
2019-04-08 09:49:25.540 Status: (ZIGATE) Zigate addresses ieee: 00158d0001ede6ef , short addr: 0000
2019-04-08 09:49:25.540 Status: (ZIGATE) Network state UP, PANID: 8fe7 extPANID: 0x511ceaaa56bb7e5a Channel: 11
2019-04-08 09:49:25.644 Status: (ZIGATE) Number of devices recently active in Zigate = 0
2019-04-08 09:49:35.109 Status: (ZIGATE) Plugin with Zigate firmware 030f correctly initialized
Pairing it with a Trädfri bulb (which is the only Zigbee device I have right now) however still does not work (after switching on/off several times), but I understand that they are problematic everywhere, so maybe I'll get a Philips Hue or another device for further testing.

Re: Pizigate / Zigate not working

Posted: Monday 08 April 2019 10:13
by pipiche
Did you do an Erase PDM ?
To reset the Ikea Tradrfi, you need to do 6 times from Power Off Power On/off and stay at On

Re: Pizigate / Zigate not working

Posted: Monday 08 April 2019 18:53
by alanlsmith
Enabling the serial port fixed it for me. All working very well. Devices pair first time.

Only problem is I have the PiZiGate on a slave Domoticz as my master Domoticz is on a Ubuntu machine and therefore even though the devices are shared they don't appear on the master, I believe this is due to the limitations of the Python plugin framework.

I have had to use json calls to update dummy devices on the master which introduces a bit of a lag but it's not too bad.

Re: Pizigate / Zigate not working

Posted: Monday 08 April 2019 20:08
by pgielen
pipiche wrote: Monday 08 April 2019 10:13 Did you do an Erase PDM ?
Yes, I did. Several times. Nothing changes. Switching on and off the Tradfri bulb for 5, 6 or 7 times also makes no difference. I even followed the weird instructions for linking the Tradfri to and Athome device in this forum: https://github.com/athombv/com.ikea.tradfri/issues/4 but it still doesn't work. So I conclude that buying this cheap and buggy IKEA junk is just throwing away money. I ordered an Osram Zigbee smart plug today to check if that works and can be used as a mesh repeater as well.

BTW the blue Pizigate LED keeps blinking all of the time. Is it supposed to do that? A result of setting the permit join to 255?

Re: Pizigate / Zigate not working

Posted: Monday 08 April 2019 21:37
by domogijs
I have the same problems as Pgielen.

If i configure the plugin an choose PI for model this is not saved/updated. It is saved as usb.

Anybody ideas?

Greets Gijs

Re: Pizigate / Zigate not working

Posted: Monday 08 April 2019 22:25
by ronaldbro
This is solved in the latest version (4.1.4). Although in the previous version I did not experience any problem with it when it displayed USB and serial0

Re: Pizigate / Zigate not working

Posted: Monday 08 April 2019 22:30
by ronaldbro
pgielen wrote: Monday 08 April 2019 20:08
pipiche wrote: Monday 08 April 2019 10:13 Did you do an Erase PDM ?
Yes, I did. Several times. Nothing changes. Switching on and off the Tradfri bulb for 5, 6 or 7 times also makes no difference. I even followed the weird instructions for linking the Tradfri to and Athome device in this forum: https://github.com/athombv/com.ikea.tradfri/issues/4 but it still doesn't work. So I conclude that buying this cheap and buggy IKEA junk is just throwing away money. I ordered an Osram Zigbee smart plug today to check if that works and can be used as a mesh repeater as well.

BTW the blue Pizigate LED keeps blinking all of the time. Is it supposed to do that? A result of setting the permit join to 255?
It’s a hassle to bind the Tradfri, tried many times and eventually it worked. (Don’t know for sure but I think you have to start the on/off from off state and leave it on on the sixth on. And all of this in 5 seconds.) No problems after.
Maybe it’s best to bind another device first to make sure your ZigBee network works.

Re: Pizigate / Zigate not working

Posted: Tuesday 09 April 2019 12:22
by pgielen
I received the Osram Smart Plug just now and it works right out of the box (just hold the button on the plug until it clicks)! :D

Re: Pizigate / Zigate not working

Posted: Tuesday 09 April 2019 12:24
by pgielen
By the way, I entered the gpio sequence to set production mode in /etc/rc.local so that if the pi reboots, Pizigate will still work.