rooi/homebridge-lightwaverf

Plugin broken with latest update

Cardo1 opened this issue · 14 comments

Hello,
I updated the plugin today and unfortunately it seems to have broken.

The devices still show up as normal, but when I try to turn a device on or off, homebridge locks up for about a minute. The command shows in the homebridge log, but the device doesn't turn on or off. Homebridge remains completely unresponsive for about a minute, then returns to normal.
This is only occurring with lightwaverf devices. Other devices running through homebridge work as normal.
Homebridge does not throw up any errors.

rooi commented

Hi @Cardo1, what version were you using before? I just check what could cause this behaviour, but couldn't find anything in the latest commit. Perhaps you can paste your log in here as well and provide some information on which platform and nodejs version you're using.

Thanks!

So, it looks like things have sorted themselves out. I'm wondering whether there was a Lightwave Link firmware update that broke things. It seemed that the Link after being on for a few minutes would stop accepting commands from the Homebridge device. Restarting the Link would fix it for a few minutes, but then it would become unresponsive again. I tried updating everything and reinstalling Node and all that, nothing. Then I restarted the Link and it showed it had been updated a few minutes ago. Since then, fingers crossed, things have been fine.

So everything worked fine for a few days, and today the Lightwave Link stopped playing ball, again. The commands don't work and both Homebridge and the Link hang for about a minute. After that I can run commands using the LightwaveRF app, however if I try using Homekit it all hangs for another minute. Restarting the Link seems to fix things for a while.

Don't know whether the issue is on the Homebridge or Link side.

I have Homebridge running on macOS Sierra with all the latest updates. The Link has firmware N2.93Q.

I seem to have a similar issue running HomeBridge on a fresh Raspberry PI server. Other accessories seem to work fine.

I notice that the command appears to be sent twice after looking in the logs

rooi commented

@Cardo1, @leonbarrett sorry, for the late reply... It's been extremely busy lately. Did you get any further with to homebridge link connection. It's very difficult for me to test/help with this problem since I have a different device.

Perhaps you can try if paul's lightwaverf code works. https://github.com/pauly/lightwaverf
This way we can find out if the problem is with the udp link, node-lightwaverf, homebridge and/or this plugin. Thanks

I am also having the above issue.... wifi link is not responding to any of my UDP packets.

I have registered my device using the register command but subsequent packets do nothing.

Anybody got any further on this?

OK... got there in the end, seems my device and room IDs are not what the manage.lightwaverf.com site suggests. R1D1 worked ok.

However seems this plugin is including a trailing | at the end of the UDP packet which is stopping the command working... any ideas anyone?

Sending message: 001,!R1D1FdP32|
Sending message: 002,!R1D1FdP32|

001,!R1D1FdP32 works but 001,!R1D1FdP32| doesn't!

I’m also having trouble getting homebridge connected to my LightwaveRF Link.

I've managed to get my lights (dimmer switches) to show up in Apple’s Home app, but haven't been able to connect the LightwaveRF Link to homebridge.

I’ve never done this before, so can anyone confirm these steps are correct?

Type the following in Terminal:

echo -ne '100,!F*p' | nc -u 110.0.1.179 9760

Hit Return. It doesn’t go back to the usual prompt in Terminal, presumably it’s doing something? Should I stop this before using PacketSender, or leave it running? (What's it actually doing?)

Here’s a screenshot of PacketSender. Does this look as expected?
packet sender - lightwaverf link

When I click send in PacketSender should the LightwaveRF Link start flashing so I can pair it, or should I press the pair button on the Link, then click send in PacketSender?
How do I know if PacketSender was successful in linking homebridge with the Link? (Other than keep trying Apple’s Home app)

Try changing the name in Packetsender to register and put '100,!F*p' in to ASCII box. Click into the HEX box to update the contents and click send.

Your Link should then ask if you want to register your device. Note that the device you are registering will be presumably your Mac - so if you are running Homebridge elsewhere that device won't be registered (I think).

The above negates the need to issue the echo -ne '100,!F*p' | nc -u 110.0.1.179 9760 command from terminal - which should give you the same registration message on your link? Then Ctrl-C to exit.

Hope this helps. I've managed to get past that stage - now just seems the plugin is appending the command with a | which stops the commands working.

Thanks, but that still doesn't appear to do anything. I have the newer LightwaveRF Link BTW, the one without a screen.

And yes, I'm using my Mac to run homebridge (same Mac that I'm trying to use PacketSender with)

Ah - I've got the old one. I think you should get the green light flashing, press it to pair.

But if you're not getting the green light... not sure sorry. Is the IP definitely correct?

Yeah, the IP address of the LightwaveRF Link is shown in the iOS app, I used that.

Ok, I've finally managed to test when the plugin has stopped working. I can't work out what causes the LW Link to do this, but every now and then, and it could be after a few minutes or after a few days the Link stops responding to commands from the machine running Homebridge. When the command doesn't work, Homebridge hangs for about 30s and then goes back to normal. Trying the command again will cause Homebridge to hang again. The LW Link also seems to hang for a few seconds when this happens, stopping control from the LWRF app itself on my phone. I can now confirm that when the Link is playing up, trying to send a command from the terminal, ie.
echo -ne "001,!R4D1F1\r" | nc -u -w1 192.168.2.189 9760
also doesn't work. Nothing happens. Restarting the Link causes it to start working fine again, but no idea for how long.
Sending commands from the LWRF app on my phone works fine when the Link is misbehaving.

I note from this thread http://lightwaverfcommunity.org.uk/forums/topic/talking-to-a-lightwave-link-2-91z/ there have been a lot of changes to the LW Link firmware. I wonder if there is a change in the structure of the UDP commands that needs changing in the plugin?

Touch wood but it appears this issue may have been resolved via an update to either node or the Link firmware. I've not had this issue manifest itself for a number of weeks now, so hopefully it's gone for good.