Lightwave RF UDP Packets are not formatted correctly

Hi all,

I have the lightwaverf wifi link (the new one without the LCD) and I have noticed that when trying to sniff the packets on the wire whilst using my phone to control my lights, there appears to be an additional space inserted into the format of the message.

Instead of the message being formatted as documented on the wiki "nnnnnn,100,!R1D3F1" (where ‘nnnnnn’ is the unique identifier for my android phone app in the UDP packet), there is a space between the R and the Room identifier:

"nnnnnn,100,!R 1D3F1"

Try as I might, I am unable to replicate this in the configuration. If I place a space in the appropriate character slot, then the binding simply ignores it and tries to dim a light on "“nnnnnn,100,!RD3F1”.

Is anyone able to shed light on why this might be and how to fix it?

Thanks in advance,

Matt

Hi,

Set it up in the binding with “room=1,device=3,type=SWITCH” (or DIMMER) and it should work. I suspect the space you are seeing might be wire shark breaking things into bytes and there isn’t really a space.

Also ensure you are using my latest build of the API: https://github.com/foxy82/openhab/releases/tag/1.8.0_alpha12

Neil

OK, thanks.

I’ll try with the latest alpha release later on tonight if I can.

I assumed 1.8.0_alpha12 was older than the 1.8.1 binding that gets supplied with the downloads, is this not the case?

Matt

Hi,

The powers that be decided not to merge my fixes/changes in until I support OH2. So the official version in the openhab releases is old and rubbish as far as I know.

Awesome, thanks. I’ll check it out.

Matt

Hey @neil_renaud,

I’ve just had a chance to download and install the alpha_12 release of the lightwave binding and this is what I’m seeing in the logs:

2016-03-03 14:16:23.323 [INFO ] [.l.internal.LightwaveRfBinding] - LightwaveRf Binding changed for: Dimmer1 2016-03-03 14:16:25.071 [INFO ] [.l.internal.LightwaveRfBinding] - Update from LightwaveRf ItemName[LW_WifiL_EnergyYesterday], State[0] 2016-03-03 14:16:25.072 [INFO ] [.l.internal.LightwaveRfBinding] - Update from LightwaveRf ItemName[LW_WifiL_EnergyToday], State[11890] 2016-03-03 14:16:25.073 [INFO ] [.l.internal.LightwaveRfBinding] - Update from LightwaveRf ItemName[LW_WifiL_EnergyCurrentUsage], State[234] 2016-03-03 14:16:32.291 [INFO ] [.b.l.i.LightwaveRfSenderThread] - Ok message not received for 200,!R1D1F0 , retrying again. Retry count 2 2016-03-03 14:16:35.293 [INFO ] [.b.l.i.LightwaveRfSenderThread] - Ok message not received for 200,!R1D1F0 , retrying again. Retry count 3 2016-03-03 14:16:38.298 [INFO ] [.b.l.i.LightwaveRfSenderThread] - Ok message not received for 200,!R1D1F0 , retrying again. Retry count 4 2016-03-03 14:16:40.170 [INFO ] [.l.internal.LightwaveRfBinding] - Update from LightwaveRf ItemName[LW_WifiL_EnergyYesterday], State[0] 2016-03-03 14:16:40.171 [INFO ] [.l.internal.LightwaveRfBinding] - Update from LightwaveRf ItemName[LW_WifiL_EnergyToday], State[11891] 2016-03-03 14:16:40.172 [INFO ] [.l.internal.LightwaveRfBinding] - Update from LightwaveRf ItemName[LW_WifiL_EnergyCurrentUsage], State[236] 2016-03-03 14:16:41.299 [INFO ] [.b.l.i.LightwaveRfSenderThread] - Ok message not received for 200,!R1D1F0 , retrying again. Retry count 5 2016-03-03 14:16:44.301 [ERROR] [.b.l.i.LightwaveRfSenderThread] - Unable to send message 200,!R1D1F0

On startup, I also see this:

2016-03-03 14:14:53.712 [INFO ] [l.internal.LightwaveRfWifiLink] - Starting LightwaveRfWifiLink Connection 2016-03-03 14:14:54.503 [INFO ] [.l.internal.LightwaveRfBinding] - Update from LightwaveRf ItemName[LW_WifiL_EnergyYesterday], State[0] 2016-03-03 14:14:54.505 [INFO ] [.l.internal.LightwaveRfBinding] - Update from LightwaveRf ItemName[LW_WifiL_EnergyToday], State[11885] 2016-03-03 14:14:54.506 [INFO ] [.l.internal.LightwaveRfBinding] - Update from LightwaveRf ItemName[LW_WifiL_EnergyCurrentUsage], State[230] 2016-03-03 14:14:54.732 [INFO ] [.b.l.i.LightwaveRfSenderThread] - Ok message not received for 100,!F*p , retrying again. Retry count 2 2016-03-03 14:14:57.734 [INFO ] [.b.l.i.LightwaveRfSenderThread] - Ok message not received for 100,!F*p , retrying again. Retry count 3 2016-03-03 14:15:00.736 [INFO ] [.b.l.i.LightwaveRfSenderThread] - Ok message not received for 100,!F*p , retrying again. Retry count 4 2016-03-03 14:15:03.738 [INFO ] [.b.l.i.LightwaveRfSenderThread] - Ok message not received for 100,!F*p , retrying again. Retry count 5 2016-03-03 14:15:06.740 [ERROR] [.b.l.i.LightwaveRfSenderThread] - Unable to send message 100,!F*p

I’m struggling to find a way to export the actual text from the wireshark UI, however there is definitely a space, it’s not a linewrap as far as I can tell, but I’m happy to provide more on this if you need it and can help me get it out of the UI! :slightly_smiling:

Thanks in advance,

Matt

Also, not sure if it helps at all, but http://www.vesternet.com/lightwaverf-link is the exact wifi link that I have (this is where I purchased it from) :slightly_smiling:

OK, I stand corrected, it is the UI.

I’ve learned to use Wireshark correctly and now I see this in the packet dumps:

:nnnnnn,101,!R1D1FdP32|Lounge|main lights 100%

(where ‘nnnnnn’ is my unique id from my phone)

So it’s not that… :frowning:

Can you make sure your ports are like this in the openhab.cfg

lightwaverf:receiveport=9761
lightwaverf:sendport=9760

Oh and nnnnn isn’t the unique number for your phone it is the unique ID of your lightwave wifi link.

Neil

Hey,

Thanks for all this help :slightly_smiling:

My configuration currently looks like this:

openhab.cfg:
lightwaverf:ip=225.225.225.225 lightwaverf:receiveport=9761 lightwaverf:sendport=9760 lightwaverf:registeronstartup=true lightwaverf:senddelay=2000 lightwaverf:okTimeout=1000

items:

`
Group gFirstFloor “First Floor”
Group gGroundFloor “Ground Floor”
Group GF_Lounge “Lounge” (gGroundFloor)
Group gEnergyStats “Energy Usage”

String    LW_WifiL_Ver     "Wifi Link Version [%s]"                   <network>      (gLWTEST)   {lightwaverf="serial=wifilink,type=VERSION"}
String    LW_WifiL_IP      "Wifi Link IP Address [%s]"                <network>      (gLWTEST)   {lightwaverf="serial=wifilink,type=WIFILINK_IP"}
DateTime  LW_WifiL_Dusk    "Wifi Link Dusk Time [%1$tT, %1$tF]"       <network>      (gLWTEST)   {lightwaverf="serial=wifilink,type=WIFILINK_DUSK_TIME"}
DateTime  LW_WifiL_Dawn    "Wifi Link Dawn Time [%1$tT, %1$tF]"       <network>      (gLWTEST)   {lightwaverf="serial=wifilink,type=WIFILINK_DAWN_TIME"}
Number    LW_WifiL_Uptime  "Wifi Link Uptime [%.2f]"                  <network>      (gLWTEST)   {lightwaverf="serial=wifilink,type=WIFILINK_UPTIME"}
String    LW_WifiL_Long    "Wifi Link Longitude [%s]"                 <network>      (gLWTEST)   {lightwaverf="serial=wifilink,type=WIFILINK_LONGITUDE"}
String    LW_WifiL_Lat     "Wifi Link Latitude [%s]"                  <network>      (gLWTEST)   {lightwaverf="serial=wifilink,type=WIFILINK_LATITUDE"}

Number    LW_WifiL_EnergyCurrentUsage  "Current Energy Usage: [%.2f]"    <energy>      (gEnergyStats)   {lightwaverf="serial=9D9FFE,type=ENERGY_CURRENT_USAGE"}
Number    LW_WifiL_EnergyToday  "Energy used so far today: [%.2f]"    <energy>      (gEnergyStats)   {lightwaverf="serial=9D9FFE,type=ENERGY_TODAY_USAGE"}
Number    LW_WifiL_EnergyYesterday  "Energy used yesterday: [%.2f]"    <energy>      (gEnergyStats)   {lightwaverf="serial=9D9FFE,type=ENERGY_YESTERDAY_USAGE"}

Dimmer  Dimmer1 "Dimmer1 [%d %%]" (GF_Lounge) { lightwaverf="room=1,device=1,type=DIMMER" }

`

The dimmer settings are based on the packet trace I posted above.

The entries I get in the log when trying to use the dimmer are as follows:

2016-03-04 11:22:55.361 [INFO ] [.b.l.i.LightwaveRfSenderThread] - Ok message not received for 200,!R1D1FdP25, retrying again. Retry count 2 2016-03-04 11:22:58.363 [INFO ] [.b.l.i.LightwaveRfSenderThread] - Ok message not received for 200,!R1D1FdP25, retrying again. Retry count 3 2016-03-04 11:23:01.365 [INFO ] [.b.l.i.LightwaveRfSenderThread] - Ok message not received for 200,!R1D1FdP25, retrying again. Retry count 4 2016-03-04 11:23:04.367 [INFO ] [.b.l.i.LightwaveRfSenderThread] - Ok message not received for 200,!R1D1FdP25, retrying again. Retry count 5 2016-03-04 11:23:07.972 [ERROR] [.b.l.i.LightwaveRfSenderThread] - Unable to send message 200,!R1D1FdP25 after 5 attemps giving up 2016-03-04 11:23:10.974 [INFO ] [.b.l.i.LightwaveRfSenderThread] - Ok message not received for 201,!R1D1FdP25, retrying again. Retry count 2 2016-03-04 11:23:13.975 [INFO ] [.b.l.i.LightwaveRfSenderThread] - Ok message not received for 201,!R1D1FdP25, retrying again. Retry count 3 2016-03-04 11:23:16.977 [INFO ] [.b.l.i.LightwaveRfSenderThread] - Ok message not received for 201,!R1D1FdP25, retrying again. Retry count 4 2016-03-04 11:23:19.981 [INFO ] [.b.l.i.LightwaveRfSenderThread] - Ok message not received for 201,!R1D1FdP25, retrying again. Retry count 5 2016-03-04 11:23:22.983 [ERROR] [.b.l.i.LightwaveRfSenderThread] - Unable to send message 201,!R1D1FdP25 after 5 attemps giving up

FWIW, it looks like I’m not the only one (which is a relief for me!)

Matt

Having the same issue myself.

2016-03-07 14:38:58.923 [INFO ] [.l.internal.LightwaveRfBinding] - Update from LightwaveRf ItemName[LW_Energy_Current], State[204]
2016-03-07 14:38:58.976 [ERROR] [.b.l.i.LightwaveRfSenderThread] - Unable to send message 369,!R3F*r
after 5 attemps giving up

Receiving information from the TRV’s and then energy monitor ok,

WIFI link is populating all the items with IP Address, etc.

Not sure if OH has registered with the WIFI , hence not able to send messages? Just a thought.

But any help appreciated…

Using OH 1.8.1
Lightwave binding Alpha 12.

EDIT: Success!

Turned out it was OH not registered with the Wifi Link. Once I did this its working great.

Now to sniff the network for all the serial numbers

@Andrew_Brown - how did you get OH to register with the link? I can’t even get mine to do that! :frowning:

(and yes, I do have “register” set to “true” in my openhab config file :frowning: )

OK, I still can’t get openHab to register with the link:

This is my configuration:

lightwaverf:ip=225.225.225.225 lightwaverf:receiveport=9761 lightwaverf:sendport=9760 lightwaverf:registeronstartup=true lightwaverf:senddelay=2000 lightwaverf:okTimeout=1000

And this is what I see in the logs (the energy meter information even appears in the UI!)

2016-03-09 20:59:30.211 [INFO ] [.l.internal.LightwaveRfBinding] - LightwaveBinding: IP[225.225.225.225] 2016-03-09 20:59:30.213 [INFO ] [.l.internal.LightwaveRfBinding] - LightwaveBinding: ReceivePort[9761] 2016-03-09 20:59:30.214 [INFO ] [.l.internal.LightwaveRfBinding] - LightwaveBinding: Send Port[9760] 2016-03-09 20:59:30.216 [INFO ] [.l.internal.LightwaveRfBinding] - LightwaveBinding: Register On Startup[true] 2016-03-09 20:59:30.218 [INFO ] [.l.internal.LightwaveRfBinding] - LightwaveBinding: Send Delay [2000] 2016-03-09 20:59:30.219 [INFO ] [.l.internal.LightwaveRfBinding] - LightwaveBinding: Timeout for Ok Messages [1000] 2016-03-09 20:59:30.239 [INFO ] [l.internal.LightwaveRfWifiLink] - Starting LightwaveRfWifiLink Connection 2016-03-09 20:59:30.689 [INFO ] [.l.internal.LightwaveRfBinding] - Update from LightwaveRf ItemName[LW_WifiL_EnergyYesterday], State[0] 2016-03-09 20:59:30.695 [INFO ] [.l.internal.LightwaveRfBinding] - Update from LightwaveRf ItemName[LW_WifiL_EnergyToday], State[10962] 2016-03-09 20:59:30.697 [INFO ] [.l.internal.LightwaveRfBinding] - Update from LightwaveRf ItemName[LW_WifiL_EnergyCurrentUsage], State[476] 2016-03-09 20:59:31.256 [INFO ] [.b.l.i.LightwaveRfSenderThread] - Ok message not received for 100,!F*p, retrying again. Retry count 2 2016-03-09 20:59:35.105 [INFO ] [.b.l.i.LightwaveRfSenderThread] - Ok message not received for 100,!F*p, retrying again. Retry count 3 2016-03-09 20:59:38.107 [INFO ] [.b.l.i.LightwaveRfSenderThread] - Ok message not received for 100,!F*p, retrying again. Retry count 4 2016-03-09 20:59:41.110 [INFO ] [.b.l.i.LightwaveRfSenderThread] - Ok message not received for 100,!F*p , retrying again. Retry count 5 2016-03-09 20:59:44.112 [ERROR] [.b.l.i.LightwaveRfSenderThread] - Unable to send message 100,!F*p after 5 attemps giving up 2016-03-09 20:59:45.754 [INFO ] [.l.internal.LightwaveRfBinding] - Update from LightwaveRf ItemName[LW_WifiL_EnergyYesterday], State[0] 2016-03-09 20:59:45.756 [INFO ] [.l.internal.LightwaveRfBinding] - Update from LightwaveRf ItemName[LW_WifiL_EnergyToday], State[10964] 2016-03-09 20:59:45.779 [INFO ] [.l.internal.LightwaveRfBinding] - Update from LightwaveRf ItemName[LW_WifiL_EnergyCurrentUsage], State[466]

Restart OH and at the same time hit the “link button” on the Lightwave Link box.

I had to stand there and keep pressing the link button a few times as it times out whilst OH is restarting, but this worked first time for me.

heh, that simple huh? :slight_smile:

Thanks, I’ll give it a go tonight.

WAHOOO!!! It works!!!

Thanks for all your help, it turns out that you can’t use the broadcast address to bind to the WiFiLink, so I had to scan my network and find the correct IP.

Now that I’ve got the IP in place, it works brilliantly.

The hint was when I saw this in the logs:

2016-03-17 20:08:37.369 [ERROR] [l.internal.LightwaveRfWifiLink] - Message not recognised: *!{"trans":39,"source_id":"20:37:19","source":"lwl","type":"log","payload":"EM LINK MODE"} 2016-03-17 20:08:37.381 [ERROR] [l.internal.LightwaveRfWifiLink] - Message not recognised: *!{"trans":39,"source_id":"20:37:19","source":"lwl","type":"log","payload":"EM LINK MODE"}

I’d not seen that before and it coincided with me pressing the “link” button, now everything is happy! :slight_smile: