RoomNode2 data format

12 replies [Last post]
cdswift
Offline
Joined: 20 Nov 2011

I have connected a light sensor to 1 room node and am seeing readings appear on my HAH in the form Node ID followed by an integer similar to 168 and then some zeros.  I have set up my jeenodeApplet.lua file to include light=1 and restarted the serial scheam and plugboard service but I am getting "?" in the value field from the light endnode.

Looking at the source for roomnode2.pde, the payload format specifies that light should come first, followed by moved etc.. My question is should the specification of the endnodes in jeenodeApplet.lua be in the same order as that in the source code of the roomnode?

Thanks for any help


Chris

brett
Offline
Providence, United States
Joined: 9 Jan 2010
You are confusing enabling

You are confusing enabling the functionality with decoding structures these things are not related.  As long as you specify light=1 somewhere in the configuration it will be enabled correctly.  The payload you are seeing in the the RoomNode.PDE does match how the data is decoded in backend LUA decoder (I don't have the source to hand but I know its right) - I'm using both of these.

Do check the light sensor is between ANALOGUE and GND for the correct PORT, in anycase if you are getting a ? - it would imply your BASE Node unit is not receiving data as if it was you would see a '0' for your sensor even if it was incorrectly pinned.   You have a comms problem between your nodes at this point that needs resolving first.

You do have 2 of these setup right- some people think they can just configure the base unit with a sketch and away they go.   The unit in the HAH must be running HAH Central and be configured correctly and the other running roomNode2.pde.   Verify you are getting comms before even setting up all the HAH LUA backend applets.

Brett

derek
Offline
Glasgow, United Kingdom
Joined: 26 Oct 2009
LDR/PIR/Temp should be fine

Like Brett, I'm running with roomNode2 and the HAHcentral. The temp/lobat/moved/light are good for me. Batteries have been in place for 6 months and still no 'lobat'.

>am seeing readings appear on my HAH in the form Node ID followed by an integer similar to 168 and then some zeros.

Are you seeing this via microcom? If so, 168 is your LDR value. If you cover this over, the number should drop.

If this value is being reported at a rate greater than your 'ttl' setting, I'm confused as to why you might see a '?' on the endpoint.

cdswift
Offline
Joined: 20 Nov 2011
LDR/PIR/Temp should be fine

Yes,

 

I am seeing this value being reported by minicom (OK node id LDR value and then zeros) and the value does change (albeit very slowly) if I cover the LDR.  I end minicom session and hearbeats are showing but no values reported other than "?".  I just thought that there might be a mapping problem between the lua script and the roomnode2 source.

 

Maybe signal quality is poor because of distance and some metalwork in between.  This would account for low frequency of readings with minicom and possibly exceeding ttl value ?(currently 300)

 

Chris

derek
Offline
Glasgow, United Kingdom
Joined: 26 Oct 2009
ttl / signal might be the issue

The low frequency of readings that you see via microcom is intentional. I recall that (in order to save precious battery power) the light/lowbat/temp readings are only pumped out every 150secs or so. Only the PIR is interrupt driven, immediately reported and acknowledged by the HAHCentral - the thinking here is that the other values generally change quite slowly.

Do try moving the roomNode a lot closer to the HAH and upping the ttl until you get something working.

brett
Offline
Providence, United States
Joined: 9 Jan 2010
Debugging

Brett

cdswift
Offline
Joined: 20 Nov 2011
Almost there

Hi guys,

 

Thanks for the help so far.  When I moved the jeenode closer to the HAH, I started getting sensible light readings.  However, I have noticed that the plugboard engine seems to stop after a while as the nodes dissappear from the xfx viewer and there is no sign of a lua process in the process list.  If I stop & start the plugboard service from the web interface, things start working again, but then eventually stop.  Any ideas how I should start tarcing the problem here?

 

Chris

BoxingOrange
Offline
United Kingdom
Joined: 11 Jun 2010
Other Scripts?

Do you have any other scripts in the plugboard directory, if so remove them and restart the service as you have previously.

You could also try running the plugboard manually and see if you get any errors output to the console.  To do this stop the scripting engine, through the web interface or by killing the process, and then login to the HAH and run xap-plugboard, read here for more info.  This will hopefully show you any errors generated by the script.  Post the errors back here so that we can try and resolve it.

Karl

brett
Offline
Providence, United States
Joined: 9 Jan 2010
Log files

Don't forget all the log files in /var/log which might contain hints of what went wrong.  Note: a reboot will loose all of these so examine then BEFORE you reboot !

cdswift
Offline
Joined: 20 Nov 2011
Log Files

 

I stopped plugboard from the web interface and then started it manually.  xfx reported events correctly and the process showed up in the process list.  The log file generated was:-

 

# cat xap-plugboard.log

lua: /usr/share/lua/5.1/xap/jeenode.lua:198: RoomNode[3]: has no 'humid' configurable endpoint stack traceback:

        [C]: in function 'assert'

        /usr/share/lua/5.1/xap/jeenode.lua:198: in function 'expire'

        /usr/share/lua/5.1/xap/jeenode.lua:162: in function 'callback'

        /usr/share/lua/5.1/xap/init.lua:172: in function 'dispatch'

        /usr/share/lua/5.1/xap/init.lua:124: in function 'fun'

        /usr/share/lua/5.1/pl/list.lua:360: in function 'foreach'

        /usr/share/lua/5.1/xap/init.lua:122: in function 'process'

        /etc_ro_fs/plugboard/plugboard.lua:73: in main chunk

        [C]: ?

Loading /etc/plugboard/jeenodeApplet.lua        [ JeeNode ]

Running...

 

There were no errors generated to the console.

I restarted plugboard from the web interface and all was OK for a while.  Then the lua process dissappeared and the log file generated was as above.

 

Any suggestions?

 

Chris

 

BoxingOrange
Offline
United Kingdom
Joined: 11 Jun 2010
Possible Wrong Endpoint

It looks like you might have defined a wrong endpoint name :-

lua: /usr/share/lua/5.1/xap/jeenode.lua:198: RoomNode[3]: has no 'humid' configurable endpoint stack traceback:

Check your jeenodeApplet file and change it to humi instead, read http://www.dbzoo.com/livebox/hah_hahnode#room_node for more info.

 

Karl


cdswift
Offline
Joined: 20 Nov 2011
Success - I thnk

 

Karl,

Your suggestion seems to work.  Changing the spelling of the humidity endpoint from humid to humi in the lua file seems to have fixed it.  The lua process has been happily working all day.

 

By the way, I got the suggestion for the humidity endnode entry from the "Integration with Jeenodes" wiki where an example is listed as:

 

 

[ID] = RoomNode
    { base = "dbzoo.livebox.jeenode:bedroom1",
      endpoints = {temp=1,lobat=1,light=1,humid=0,moved=0} }
    }

 

Hope this helps others avoid the same problem.

Cheers

Chris

BoxingOrange
Offline
United Kingdom
Joined: 11 Jun 2010
Fixed

Glad it worked, I've corrected the Wiki.

Hardware Info