JeeNode - No XAP Messages...?

12 replies [Last post]
Pentala
Offline
Joined: 22 Oct 2011

Hi,

I've been running a Livebox for a number of months now, all has been working until a couple of weeks ago when I noticed that the XAP messages from my JeeNode seemed to have stopped. I have checked the JeeNode and it is transmitting data - I can see a XAP-Serial message with the details -

 

xap-header
{
v=12
hop=1
uid=FF00D500
class=Serial.Comms
source=dbzoo.livebox.Serial
}
Serial.Received
{
port=/dev/ttyUSB1
data=OK 2 0 0 213 0
}

Running Plugboard from the cli with debug enabled shows the messages being received and processed, but no XAP messages are seen in XFX - 
  data = "OK 2 0 0 212 0",
  port = "/dev/ttyUSB1",
}
process RoomNode[2]
        moved=0
        humi=0
        temp=21.2
        lobat=0
        light=0
Reaping RoomNode[2] alive=true ttl=900 timeout=1
The jeenodeApplet.lua hasn't been changed -
# cat jeenodeApplet.lua
--[[
    JeeNode to xAP Endpoint mapping
--]]

_DEBUG=1
module(...,package.seeall)

monitor = require("xap.jeenode").monitor
RoomNode = require("xap.roomnode").RoomNode
OutputNode = require("xap.outputnode").OutputNode

info={
   version="2.0", description="JeeNode"
}

       local jeemon={
       port="/dev/ttyUSB1",
       baud=57600,
       stop=1,
       databits=8,
       parity="none",
       flow="none"
}

-- Keyed by NODE ID
local nodes = {
   [2] = RoomNode{base="dbzoo.livebox.jeenode:conservatory", endpoints={temp=1,lobat=1}, ttl=900},
}

function init()
   monitor(jeemon, nodes)
end
Any help/suggestions will be gratefully received.
My HAH is currently running -
Build 306/3.4
Many thanks,
Andy

 

brett
Offline
Providence, United States
Joined: 9 Jan 2010
I'm confused everything you

I'm confused everything you have show demonstrated that its working.   Try using xap-snoop locally instead of xFxViewer you can setup filters using this if you wish.

# xap-snoop -s "dbzoo.livebox.jeenode:conservatory"

Brett

Pentala
Offline
Joined: 22 Oct 2011
Hi Brett,I've run a xap-snoop

Hi Brett,

I've run a xap-snoop but nothing is shown for that node. I tested with another node just to check that the snoop was working -

 

# xap-snoop -s "dbzoo.livebox.serial"

xAP Snoop - for xAP v1.2
Copyright (C) DBzoo 2009-2010

xap-header
{
v=12
hop=1
uid=FF00D500
class=Serial.Comms
source=dbzoo.livebox.Serial
}
Serial.Received
{
port=/dev/ttyUSB1
data=OK 2 1 0 152 0
}

 

 

 

# xap-snoop -s "dbzoo.livebox.jeenode:conservatory"

xAP Snoop - for xAP v1.2
Copyright (C) DBzoo 2009-2010

 

Puzzling....

 

Andy

brett
Offline
Providence, United States
Joined: 9 Jan 2010
That is freaking weird - I

That is freaking weird - I mean it says "process RoomNode[2]" its running where it should be!

Staring at the code I can only see a couple of reasons why a message would not be sent.

  • The value has not change from the last value - but you would still get INFO messages.
  • You've copied one of the std modules into /etc/plugboard and modified it and its using that first.
  • Its being reaped

Everybody (even me) uses this code so I'm scratching as to why its breaking for you only.

Very odd indeed.

Pentala
Offline
Joined: 22 Oct 2011
Reaping RoomNode[2] alive=true ttl=900 timeout=2 ???

Brett,

Just looking at your last post - "It's being reaped' - this is the debug output

Does this throw any light on it..?

"Reaping RoomNode[2] alive=true ttl=900 timeout=2"

 

# lua /etc_ro_fs/plugboard/plugboard.lua
Loading /etc/plugboard/RebootApplet.lua         [ Auto reboot after set time ]
Loading /etc/plugboard/clockApplet.lua          [ HAH LCD Clock ]
Loading /etc/plugboard/jeenodeApplet.lua        [ JeeNode ]
build RoomNode[2]
Loading /etc/plugboard/xapCacheWebserverApplet.lua[ xAP Caching web servlet ]
Running...
{
  data = "OK 2 1 0 132 0",
  port = "/dev/ttyUSB1",
}
process RoomNode[2]
        moved=0
        humi=0
        temp=13.2
        lobat=0
        light=1
{
  data = "OK 2 1 0 132 0",
  port = "/dev/ttyUSB1",
}
process RoomNode[2]
        moved=0
        humi=0
        temp=13.2
        lobat=0
        light=1
{
  data = "OK 2 1 0 132 0",
  port = "/dev/ttyUSB1",
}
process RoomNode[2]
        moved=0
        humi=0
        temp=13.2
        lobat=0
        light=1
Reaping RoomNode[2] alive=true ttl=900 timeout=2
{
  data = "OK 2 1 0 132 0",
  port = "/dev/ttyUSB1",
}
process RoomNode[2]
        moved=0
        humi=0
        temp=13.2
        lobat=0
        light=1
{
  data = "OK 2 1 0 132 0",
  port = "/dev/ttyUSB1",
}
process RoomNode[2]
        moved=0
        humi=0
        temp=13.2
        lobat=0
        light=1
{
  data = "OK 2 1 0 132 0",
  port = "/dev/ttyUSB1",
}
process RoomNode[2]
        moved=0
        humi=0
        temp=13.2
        lobat=0
        light=1
Reaping RoomNode[2] alive=true ttl=900 timeout=1
{
  data = "OK 2 1 0 132 0",
  port = "/dev/ttyUSB1",
}
process RoomNode[2]
        moved=0
        humi=0
        temp=13.2
        lobat=0
        light=1
{
  data = "OK 2 1 0 132 0",
  port = "/dev/ttyUSB1",
}
process RoomNode[2]
        moved=0
        humi=0
        temp=13.2
        lobat=0
        light=1
Reaping RoomNode[2] alive=true ttl=900 timeout=3
{
  data = "OK 2 1 0 132 0",
  port = "/dev/ttyUSB1",
}
process RoomNode[2]
        moved=0
        humi=0
        temp=13.2
        lobat=0
        light=1
{
  data = "OK 2 1 0 132 0",
  port = "/dev/ttyUSB1",
}

 

brett
Offline
Providence, United States
Joined: 9 Jan 2010
Why is this node generating

Why is this node generating data every second?  Did you tweak the firmware on the RoomNode itself?

Here is a run on my system - its not a livebox box its running directly on my joggler but you can see the initial INFO packet go out annoucing the blank node.  And then some data coming in, as the nodes only transmit every 2min the timeout counter ticks up until it either we get data that resets it back to 1, or the ttl limit is reached. and then its reaped.

# lua /etc/plugboard/plugboard.lua
Loading /etc/plugboard/01jeeNodeApplet.lua      [ JeeNode ]
build RoomNode[2]
build RoomNode[3]
Loading /etc/plugboard/hepburnTempApplet.lua    [ Hepburn temp web servlet ]
Loading /etc/plugboard/xapCacheWebserverApplet.lua[ xAP Caching web servlet ]
Running...
xap-header
{
uid=FF00D802
source=dbzoo.joggler.jeenode:hepburn.temp
hop=1
class=xAPBSC.info
v=12
}
input.state
{
state=?
text=?
}

Reaping RoomNode[2] alive=true ttl=900 timeout=10
Reaping RoomNode[3] alive=true ttl=900 timeout=10
Reaping RoomNode[2] alive=true ttl=900 timeout=20
Reaping RoomNode[3] alive=true ttl=900 timeout=20
Reaping RoomNode[2] alive=true ttl=900 timeout=30
Reaping RoomNode[3] alive=true ttl=900 timeout=30
Reaping RoomNode[2] alive=true ttl=900 timeout=40
Reaping RoomNode[3] alive=true ttl=900 timeout=40
{
  data = "OK 3 0 0 145 0 0",
  port = "/dev/ttyUSB0",
}
process RoomNode[3]
        temp2=0
        moved=0
        humi=0
        temp=14.5
        lobat=0
        light=0
{
  data = "OK 2 140 0 174 0",
  port = "/dev/ttyUSB0",
}
process RoomNode[2]
        moved=0
        humi=0
        temp=17.4
        lobat=0
        light=140
xap-header
{
uid=FF00D802
source=dbzoo.joggler.jeenode:hepburn.temp
hop=1
class=xAPBSC.event
v=12
}
input.state
{
state=on
text=17.4
}

Reaping RoomNode[2] alive=true ttl=900 timeout=4
Reaping RoomNode[3] alive=true ttl=900 timeout=7
Reaping RoomNode[2] alive=true ttl=900 timeout=14
Reaping RoomNode[3] alive=true ttl=900 timeout=17
Reaping RoomNode[2] alive=true ttl=900 timeout=24
Reaping RoomNode[3] alive=true ttl=900 timeout=27
lua: /usr/share/lua/5.1/xap/init.lua:114: interrupted!
stack traceback:
        [C]: in function 'select'
        /usr/share/lua/5.1/xap/init.lua:114: in function 'process'
        /etc/plugboard/plugboard.lua:73: in main chunk
        [C]: ?
#

Pentala
Offline
Joined: 22 Oct 2011
Hi,Yes - the FW is tweaked to

Hi,

Yes - the FW is tweaked to increase the TX rate. During original setup last year I reduced the TX delay to make the original setup easier. Its been running like this for about 6 months...

Pentala
Offline
Joined: 22 Oct 2011
This gets even stranger -

This gets even stranger - I've got this configured to upload data to Pachube. Pachube is receiving data from the Livebox without issue - it's just the XAP messages that are not being created....???

Does anyone have any ideas on this?

Andy.

brett
Offline
Providence, United States
Joined: 9 Jan 2010
huh?  The only way pachube

huh?  The only way pachube can get data is from an xAP message via xap-hub and if its getting it from the hub then it should be broadcast on the wire as well as distributed to every other internal component (such as pachube in this case).  However earlier you said xap-snoop wasn't seeing anything either.  This makes no sense.

Unless there is a bug in the hub?  But that would break lots of things as its a CORE component and central to the complete distribution of every xap message that can be received on the wire.  That and I've found no bug in there since I released it - its been one of the most solid bits of the system.  It has to be.

Here is how things work:

Components can send (broadcast) an xAP packet by themselves.  Only one process may listen on the correct PORT (3639) for incoming xap message, that is the job of the xap-HUB.  Other components plug into the hub and it takes care of making sure an incoming message gets sent (multiplexed) to everybody that registers with it.

Brett

Pentala
Offline
Joined: 22 Oct 2011
I've done some more testing

I've done some more testing with this tonight. I left 'xap-snoop' running with no filter. After several minutes (10-15) I spotted the following...

 

xap-header
{
v=12
hop=1
uid=FF00D500
class=Serial.Comms
source=dbzoo.livebox.Serial
}
Serial.Received
{
port=/dev/ttyUSB1
data=OK 2 1 0 162 0
}

xap-header
{
v=12
hop=1
uid=FF00D801
class=xAPBSC.event
source=dbzoo.livebox.jeenode:conservatory.temp
}
input.state
{
state=on
text=16.2
}

so it now looks like the XAP messages are available internally. However, running XFX I am still not seeing the messages on the PC, in addition, I am also running WireShark and no seeing a broadcast packet with the 'jeenode' message in it...

 

brett
Offline
Providence, United States
Joined: 9 Jan 2010
Wow that is crazy.xap-snoop

Wow that is crazy.

xap-snoop can only get it because the xap-hub got it - but that would mean that xap-hub isn't broadcasting it externally - or is having an issue doing this.  I'm assuming you are seeing every other xap packet that you would expect to see in xFxViewer?   Have you got 2x livebox on your network?  What changed recently then.

Also what version of xFx are you running btw?   I tend to use the older V3 version as it does not require my PC to be running a hub as well.  But as you say wireshark get no data either which is pretty definitive.

UPDATE: Wait that isn't right.  Packets Transmitted go directly onto the wire as a broadcast packet.  The xap-hub just happens to see these and picks them up to forward back INTO the system.  I built this thing and even I get confused.

Brett

Pentala
Offline
Joined: 22 Oct 2011
Brett,I'm going to stick a

Brett,

I'm going to stick a cross-over cable between my Livebox and Laptop and check again - from your explaination this just isn't making sense :-) 

Thanks for all your help so far, i'll let you know how I get on with the 'local' capture.

Andy

p.s. It looks like the Livebox doesn't support 'snoop' - is that the case?

Pentala
Offline
Joined: 22 Oct 2011
Solved!!!

Brett,

This turned out to be a FW issue! Despite there being rules in the FW to allow UDP 3639 In/Out, for some reason it was blocking some of the XAP messages but not all of them...unforetunately the logs on the FW aren't detailled enough to explain why it was dropping some packets and not others. However, when I disabled the FW it started working...

Out of interest I'm running AVG 2012.0.2169 if anyone else sees this strange behavior.

Thanks for your help with this.

Andy

Hardware Info