plugboard trouble

6 replies [Last post]
vincent
Offline
Joined: 31 Aug 2014

hello 

this simple script 

module(...,package.seeall)

require("xap")

require("xap.bsc")

 

info = {version="0.04", description="HAH LCD Clock"}

 

function init()

xap.Timer(doclock, 5):start()

end

 

function doclock()

  bsc.sendText("dbzoo.dockstar.Controller:lcd", os.date("%H:%M:%S"))

end

 

output this bad xap message !!

 

why ?

thanks for your help

 

 

xap-header

{

  uid=FF00D800

  source=dbzoo.dockstar.Plugboard

  hop=1

  class=xAPBSC.cmd

  target=dbzoo.dockstar.Controller:lcd

  v=12

}

output.state.1

{

  id=*

  text=21:04:17

  state=on

}

brett
Offline
Providence, United States
Joined: 9 Jan 2010
Vincent,I ran your script and

Vincent,

I ran your script and I saw no bad packet.  Why do you say its bad?
This script is a modified version of /etc_ro_fs/plugboard/samples/clockApplet.lua
My xFxViewer v3 saw the packet and did not flag it in anyway as being bad.

Please explain your error in more detail.

Brett

vincent
Offline
Joined: 31 Aug 2014
brett  I am using HomeSeer

brett 

 

I am using HomeSeer and more hah "Livebox" the HomeSeer parser requires a strict order in the package xap 

example: 

xap-header 

{

   v = 13 

   hop = 1 

   uid = FF.00AA: 0001 

   class = tsc.Info 

   source = teleinfo.xap.compteur: edf 

 

the order is important v = hop =, uid =, class = ..... 

 

plugboard talks like this: 

 

xap-header 

{

   uid = FF00D800 

   source = dbzoo.dockstar.Plugboard 

   hop = 1 

   class = xAPBSC.cmd 

   target = dbzoo.dockstar.Controller: lcd 

   v = 12 

 

HomeSeer and rejects the message! 

 

mcsXap ProcessMessage xap-header{uid=FF00D800source=dbzoo.dockstar.Plugboardhop=1class=xAPBSC.cmdtarget=dbzoo.dockstar.Controller:lcdv=12}output.state.1{id=*text=17:56:58state=on} Line 230 Conversion from string "d = FF00D800 'to' Integer 'type is not valid. 

 

you understand? 

 

there is there a way to order the packet data xap? 

 

thank you again for this great project 

 

vincent

brett
Offline
Providence, United States
Joined: 9 Jan 2010
Vincent,The bug in the

Vincent,

The bug is in the HomeSeer xAP parser.  I quote from the xAP specification

http://www.xapautomation.org/index.php?title=Protocol_definition#Message...

"The order of name, value pairs in the message block is not significant. Name-Value Pair Definition"

I object to having to put code in place to workaround somebody else's BAD implementation of the specification, contact the HomeSeer forums and tell them their xAP parser sucks or point me at the code and I'll rewrite it.

LUA produces a non-deterministic payload for the xAP message, it does not define any order for its block elements, which is allowed by the specification.

xAP interoperability works when everybody adheres to the specification.

Brett

brett
Offline
Providence, United States
Joined: 9 Jan 2010
I have made a commit to the

I have made a commit to the portable distribution so that you can workaround HomeSeers xAP bug.  It is not enabled by default and requires a minor edit to put in place.   The code change is in the Frame class for the tostring() function implementation.

Details of the change can be seen here:  http://code.google.com/p/livebox-hah/source/detail?r=615

I would however ask that you follow up with HomeSeer as its their bug.

Brett

vincent
Offline
Joined: 31 Aug 2014
dbzoo ready with homeseer :)

now "livebox" project talk the "same" xap 

 

many thanks 

 

you great 

brett
Offline
Providence, United States
Joined: 9 Jan 2010
Glad that workaround got you moving

Vincent,  Glad that workaround got you moving whilst you wait for the HomeSeer boys to fix their code.  Did you raise the problem with them?   If not then I will.  They need to know about it.

Brett

Hardware Info