Using Zigbee radio in the Wink Relay

I was able to get the Zigbee radio in the Wink Relay to work in homeassistant using socat.

The inspiration came from this post I found about the z-wave radio in the wink hub…
https://github.com/wink-hub-root/demystified/wiki/External-Z-Wave-Radio-Usage

The Wink Relay uses an EZSP radio located at

/dev/ttymxc1

I used the static socat build from this repo.
https://github.com/therealsaumil/static-arm-bins

shell@edison_dvt:/ $ su
root@edison_dvt:/ # mount -o rw,remount /system
root@edison_dvt:/ # cp /sdcard/socat /system/bin/socat
root@edison_dvt:/ # chmod 755 /system/bin/socat

I have jimpastos/wink-relay-manager installed already so my relay is rooted previously. I had to remove the apks for the edison service because it was taking control of the uart of the zigbee radio. I decided to just copy the apks to the sdcard in case I had issues later.

root@edison_dvt:/ # cd /system/app
root@edison_dvt:/system/app # cp Edison* /sdcard/
root@edison_dvt:/system/app # rm Edison*
root@edison_dvt:/system/app # reboot

After reboot I ran this socat command from and adb shell.

adb shell
shell@edison_dvt:/ $ su
root@edison_dvt:/ # /system/bin/socat -d -d -ls tcp-l:54321,reuseaddr,fork file:/dev/ttymxc1,nonblock,raw,echo=0,b57600,icanon=0,parenb=0,cstopb=0,cs8,waitlock=/cache/ttymxc1 </dev/null &

Then from my server running HA in docker I run

root@nova:/home/michael# socat -d -d pty,link=/dev/zig,waitslave,ignoreeof tcp:192.168.20.58:54321

After this I was able to use something like zigpy/zigpy-cli to talk to the radio on /dev/zig.
I tried passing /dev/zig through to my docker container but I believe since it is a system link it doesn’t play well with HA. I ended up passing /dev/pts/3 through as /dev/zig inside my docker container.
I had to do all of this after the socat connection was setup obviously. Once my server came up I was able to add the zigbee radio manually.

2022-12-24 20_10_33-Settings – Home Assistant
2022-12-24 20_11_30-Settings – Home Assistant

This isn’t complete I still need to work on creating a service file for the Wink Relay and figure out how to make the socat connection persistent and resilient. Right now if the socat connection drops my docker container has to be restarted after the connection is fixed.

Will be busy with the holidays the next week so I wanted to put this info out here so others could try and test for themselves.

I will make a repo once I get back to work.

2 Likes

Great work! Any new progress?