problem

34 replies [Last post]
g7pkf
Offline
United Kingdom
Joined: 11 Jan 2011

I had a major power spike a few weeks ago and my cc lead got fried (along with livebox)

basenode as also not working. so i replaced it.

output below does this look right? as i am not seeing any "interpretaed" packets on my joggler.

 

how do i debug this problem?

 

login as: root
root@192.168.0.124's password:
# microcom -s 57600 /dev/ttyUSB0

[RF12nocfg.1] A i1 g212 @ 868 MHz

Current basenode configuration:
 A i1 g212 @ 868 MHz
OK 5 180 6 178 241 0
OK 2 0 0 50 2
OK 5 182 6 178 241 0
OK 5 182 6 178 241 0
 ? 187 113 222 104 156 39 194 245 30 103 21 68 69 76 225 206 239 98 103 209 137
OK 5 183 6 178 241 0
OK 5 183 6 178 241 0
 ? 190 243 225 204 197 108 98 156 13 223 70 81 235 137 126 212 129 100 153 120 66
OK 5 183 6 178 242 0



derek
Offline
Glasgow, United Kingdom
Joined: 26 Oct 2009
Applet to decode is running?

Do check that the necessary applet is running on your HAH

http://www.dbzoo.com/livebox/hah_hahnode#configuring_the_jeenodeappletlua

I'm probably teaching you how to suck eggs here, but best to make sure. Also, there is a version of the node firmware that doesn't report lines starting with a '?'. Such reports are just noise on the link. Suppressing these gives the HAH applet less to do because it only works on reports that start with 'OK'.

Derek.

 

g7pkf
Offline
United Kingdom
Joined: 11 Jan 2011
jeenodeApplett.luabeen so

jeenodeApplett.lua

been so long since i had to build one of these :)

 

contents below:-

 

--[[
    JeeNode to xAP Endpoint mapping
--]]

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

monitor = require("xap.jeenode").monitor
RoomNode = require("xap.roomnode").RoomNode
BoilerNode = require("boilernode").BoilerNode


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

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

-- Keyed by NODE ID
local nodes = {
   [2] = BoilerNode{base="dbzoo.livebox.jeenode:pond", endpoints={temp=1,light=1,lobat=1}, ttl=1800},
}

function init()
   monitor(jeemon, nodes)
end

brett
Offline
Providence, United States
Joined: 9 Jan 2010
I take it jeenodeApplett.lua

I take it jeenodeApplett.lua was a typo, if not then it won't we loaded.
Files should be called <Something>Applet.lua

One t in applet.

Brett

g7pkf
Offline
United Kingdom
Joined: 11 Jan 2011
yes

Typo sorry

garrydwilms
Offline
United Kingdom
Joined: 31 Mar 2011
Hi,I may be wide of the Mark

Hi,

I may be wide of the Mark here but have you got a boilernode applet in the plugboard folder or are you hoping to use the one shipped with the firmware. Reason is, I think you need to change the boilernode to xap.boilernode in the crequire section to use the firmware version.

Garry

g7pkf
Offline
United Kingdom
Joined: 11 Jan 2011
boilernode

this is my boilernode lua, i do not really understand last messgae?

 

--[[  boilernode.lua

   Use in conjuction with the RoomNode JeeNode sketch.
   Copyright (c) Brett England, 2011

   No commercial use.
   No redistribution at profit.
   All derivative work must retain this message and
   acknowledge the work of the original author.
--]]
module("boilernode", package.seeall)

require("xap.bsc")
jeenode = require("xap.jeenode")
Nodule = jeenode.Nodule
class = require("pl.class").class

class.BoilerNode(Nodule)

-- create BSC endpoints
function BoilerNode:build(...)
   Nodule.build(self, ...)

   -- Creates the endpoints: self[key] as in self.light, self.moved etc..
   -- If the user has configured that they want them that is.
   self:add {key="light", direction=bsc.INPUT, type=bsc.STREAM}
   self:add {key="moved", direction=bsc.INPUT, type=bsc.BINARY}
   self:add {key="humi", direction=bsc.INPUT, type=bsc.STREAM}
   self:add {key="temp",  direction=bsc.INPUT, type=bsc.STREAM}
   self:add {key="lobat", direction=bsc.INPUT, type=bsc.BINARY}
end

function BoilerNode:process(data)
--[[
-- From the RoomNode.pde Sketch
struct {
    byte light;     // light sensor: 0..255
    byte moved :1;  // motion detector: 0..1
    byte humi  :7;  // humidity: 0..100
    int temp   :10; // temperature: -500..+500 (tenths)
    byte lobat :1;  // supply voltage dropped under 3.1V: 0..1
} payload;
--]]
   local li, mo, hu, te, lo = jeenode.bitslicer(data,8,1,7,10,1)
   te = te  / 10
   -- The keys here must match the key values from the self:add{key=x}
   Nodule.process(self,{light=li,moved=mo,humi=hu,temp=te,lobat=lo})
end

brett
Offline
Providence, United States
Joined: 9 Jan 2010
Definitions for nodes{} is a old school supplying base=

That definitions for the nodes{} is a old school, with supplying base=.

When the "Portable" distribution came around the leading parts of the triple are not specified (dbzoo.livebox.jeenode) and will be supplied for you. To make setting up nodes, and their corresponding source, host portable its now more like this:

local nodes = {
   [2] = BoilerNode{instance="jeenode:pond", endpoints={temp=1,light=1,lobat=1}, ttl=1800},
}

I did update samples/jeenodeApplet.lua and the documentation to reflect this.
Brett

g7pkf
Offline
United Kingdom
Joined: 11 Jan 2011
Thanks Brett

That explains why, now gotta figure it all out (not a script guy-hardware).

This is going to take some time :)

g7pkf
Offline
United Kingdom
Joined: 11 Jan 2011
Spent 8 hours on this

And getting no where spent 8 hours on it, anyone willing to help?

 

will open up ports etc so direct access is allowed?

 

or rather full public access (for a short time) (i have several public ip's avalible)

 

OK its on full public access email me if you are willing to help?

 

dean usual symbol packetradio then usual co uk

 

Dean

g7pkf
Offline
United Kingdom
Joined: 11 Jan 2011
And i do not expect this for free

An assorted goody bag of related bits will be in the post once this gets sorted :)

Dean

P.S too busy sorting out probate in 2 countries to be honest, and wife driving me nuts as it is!! hence help required and appreciated.

brett
Offline
Providence, United States
Joined: 9 Jan 2010
Things to check.You have

Things to check.

  1. You have already validated that the base node it getting data with microcom so that's good.
  2. Make sure xap-serial is running.  You this need up so that data at step1 can be put on the wire as xAP for the plugboard to see and interpret.
  3. Setup the jeeNodeApplet.lua this tells xap-serial to listen for data it also creates BSC endpoints and updates those based on incoming xAP serial packets from step 2.

You need to ensure xap-serial is up and running.  If not then start it.  Then restart the plugboard.  This sequence is necessary as plugboard sends a configuration xAP packet to xap-serial.

Do you see data coming in from xap-serial?
What do you see?

Brett

g7pkf
Offline
United Kingdom
Joined: 11 Jan 2011
Thank's

um ref below? how

 

You need to ensure xap-serial is up and running.  If not then start it.  Then restart the plugboard.  This sequence is necessary as plugboard sends a configuration xAP packet to xap-serial.

 

Also is it possible to downgrade firmware? winter is upon us and i really need oil level monitoring and this may be fastest way forward :)

 

Dean

brett
Offline
Providence, United States
Joined: 9 Jan 2010
Downgrading is possible but I

Downgrading is possible but I would have to check out the code from a point in time and rebuild it for you.
The latest should work thou - it contains many bug fixes.

xap-serial can be access on the gui;  Automations TAB - > Assist TAB -> Serial SCHEMA service (radio button)

For screenshot see: http://www.dbzoo.com/livebox/xap_serial

On the same TAB you will also see this is where you enable the plugboard engine too.
Enable both then reboot.

Brett

g7pkf
Offline
United Kingdom
Joined: 11 Jan 2011
yep all running

Well they were both enabled :( sure its in my scripts but dammed if i can figure it out.)

 

scripts below, sure i could have attatched them but no idea how :)

 

--[[ boilernode.lua

 

Use in conjuction with the RoomNode JeeNode sketch.

Copyright (c) Brett England, 2011

 

No commercial use.

No redistribution at profit.

All derivative work must retain this message and

acknowledge the work of the original author.

--]]

module("boilernode", package.seeall)

 

require("xap.bsc")

jeenode = require("xap.jeenode")

Nodule = jeenode.Nodule

class = require("pl.class").class

 

class.BoilerNode(Nodule)

 

-- create BSC endpoints

function BoilerNode:build(...)

Nodule.build(self, ...)

 

-- Creates the endpoints: self[key] as in self.light, self.moved etc..

-- If the user has configured that they want them that is.

self:add {key="light", direction=bsc.INPUT, type=bsc.STREAM}

self:add {key="moved", direction=bsc.INPUT, type=bsc.BINARY}

self:add {key="humi", direction=bsc.INPUT, type=bsc.STREAM}

self:add {key="temp", direction=bsc.INPUT, type=bsc.STREAM}

self:add {key="lobat", direction=bsc.INPUT, type=bsc.BINARY}

end

 

function BoilerNode:process(data)

--[[

-- From the RoomNode.pde Sketch

struct {

byte light; // light sensor: 0..255

byte moved :1; // motion detector: 0..1

byte humi :7; // humidity: 0..100

int temp :10; // temperature: -500..+500 (tenths)

byte lobat :1; // supply voltage dropped under 3.1V: 0..1

} payload;

--]]

local li, mo, hu, te, lo = jeenode.bitslicer(data,8,1,7,10,1)

te = te / 10

-- The keys here must match the key values from the self:add{key=x}

Nodule.process(self,{light=li,moved=mo,humi=hu,temp=te,lobat=lo})

end

 


--[[
    JeeNode to xAP Endpoint mapping
--]]

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

monitor = require("xap.jeenode").monitor
RoomNode = require("xap.roomnode").RoomNode
BoilerNode = require("boilernode").BoilerNode


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

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

-- Keyed by NODE ID

local nodes = {
   [2] = BoilerNode{instance="jeenode:pond", endpoints={temp=1,light=1,lobat=1}, ttl=1800},
}




--local nodes = {
--   [2] = BoilerNode{base="dbzoo.livebox.jeenode:pond", endpoints={temp=1,light=1,lobat=1}, ttl=1800},
--}

function init()
   monitor(jeemon, nodes)
end

 

module("oilnode", package.seeall)

require("xap.bsc")
jeenode = require("xap.jeenode")
Nodule = jeenode.Nodule
class = require("pl.class").class

class.OilNode(Nodule)

-- create BSC endpoints
function OilNode:build(...)
   Nodule.build(self, ...)

   -- Creates the endpoints: self[key] as in self.light, self.moved etc..
   -- If the user has configured that they want them that is.
   self:add {key="oil", direction=bsc.INPUT, type=bsc.STREAM}
   self:add {key="moved", direction=bsc.INPUT, type=bsc.BINARY}
   self:add {key="humi", direction=bsc.INPUT, type=bsc.STREAM}
   self:add {key="temp",  direction=bsc.INPUT, type=bsc.STREAM}
   self:add {key="lobat", direction=bsc.INPUT, type=bsc.BINARY}
end

function OilNode:process(data)

  -- local li, mo, hu, te, lo = jeenode.bitslicer(data,8,1,7,-10,1)
   local oi, mo, hu, te, lo = jeenode.bitslicer(data,16,1,7,-10, 1)
   te = te  / 10
   -- The keys here must match the key values from the self:add{key=x}
   Nodule.process(self,{oil=oi,moved=mo,humi=hu,temp=te,lobat=lo})
end

 

--[[
    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
OilNode = require("oilnode").OilNode
IRNode = require("xap.irnode").IRNode

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

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

-- Keyed by NODE ID
local nodes = {
   [2] = RoomNode{base="dbzoo.livebox.jeenode:livingroom", endpoints={temp=1,light=1,moved=1}, ttl=360},
   [5] = OilNode{base="dbzoo.livebox.jeenode:outside", endpoints={temp=1,oil=1,humi=1,lobat=1}, ttl=360}

}

function init()
   monitor(jeemon, nodes)
end

garrydwilms
Offline
United Kingdom
Joined: 31 Mar 2011
Dean,this suggests you have

Dean,

this suggests you have two jeenode applets? Is that correct? You should only have one with all your nodes in. 

Can you confirm your list of scripts in plugboard folder?

Also as Brett mentioned earlier you need to modify the jeenode applet slightly where it states base= to the newer instance= format

Garry

g7pkf
Offline
United Kingdom
Joined: 11 Jan 2011
 Like this?--[[     JeeNode

 

Like this?

--[[
    JeeNode to xAP Endpoint mapping
--]]

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

monitor = require("xap.jeenode").monitor
RoomNode = require("xap.roomnode").RoomNode
BoilerNode = require("boilernode").BoilerNode


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

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

-- Keyed by NODE ID

local nodes = {
   [2] = BoilerNode{instance="jeenode:pond", endpoints={temp=1,light=1,lobat=1}, ttl=1800},
}




--local nodes = {
--   [2] = BoilerNode{instance="dbzoo.livebox.jeenode:pond", endpoints={temp=1,light=1,lobat=1}, ttl=1800},
--}

function init()
   monitor(jeemon, nodes)
end

magill
Offline
Joined: 27 Apr 2012
oil tank

Hi Dean

I've just come upon this. Your jeenodeApplet has no reference to the oilnode stuff I sent you:

http://www.homeautomationhub.com/content/oil-tank-depth-gauge

your jeenodeApplet needs to look something like:

-------------------------------------------------

--[[ 
    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
OilNode = require("oilnode").OilNode
IRNode = require("xap.irnode").IRNode

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

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

-- Keyed by NODE ID
local nodes = { 
   [2] = RoomNode{instance="jeenode:livingroom",  endpoints={temp=1,light=1,moved=1}, ttl=360}, 
   [4] = RoomNode{instance="jeenode:kitchen", endpoints={temp=1,light=1,moved=1}, ttl=360}, 
   [5] = OilNode{instance="jeenode:outside", endpoints={temp=1,oil=1,humi=1,battery=1}, ttl=3600}

}

function init()
   monitor(jeemon, nodes)
end

---------------------


and oilnode.lua:
----------------------------

module("oilnode", package.seeall) require("xap.bsc") jeenode = require("xap.jeenode") Nodule = jeenode.Nodule class = require("pl.class") class.OilNode(Nodule) -- create BSC endpoints function OilNode:build(...) Nodule.build(self, ...) -- Creates the endpoints: self[key] as in self.light, self.moved etc.. -- If the user has configured that they want them that is. self:add {key="oil", direction=bsc.INPUT, type=bsc.STREAM} self:add {key="moved", direction=bsc.INPUT, type=bsc.BINARY} self:add {key="humi", direction=bsc.INPUT, type=bsc.STREAM} self:add {key="temp", direction=bsc.INPUT, type=bsc.STREAM} self:add {key="battery", direction=bsc.INPUT, type=bsc.STREAM} end function OilNode:process(data) -- local li, mo, hu, te, lo = jeenode.bitslicer(data,8,1,7,-10,1) local oi, mo, hu, te, ba = jeenode.bitslicer(data,16,1,7,-10,16) te = te / 10 ba = ba/100 oi=math.floor(oi/(1+(.0008*te)))-11 -- The keys here must match the key values from the self:add{key=x} Nodule.process(self,{oil=oi,moved=mo,humi=hu,temp=te,battery=ba}) end
-----------------------------------------
garrydwilms
Offline
United Kingdom
Joined: 31 Mar 2011
Dean, that looks better. Has

Dean, that looks better. Has this fixed your issue?

 

magill, you're using the outdated base ref still?

magill
Offline
Joined: 27 Apr 2012
GarrySorry I just cut and

Garry

Sorry I just cut and pasted some old code. I've corrected it.

John

g7pkf
Offline
United Kingdom
Joined: 11 Jan 2011
Nope still not working

have put all my plugboard scripts here if someone could have a look please?

 

http://www.packetradio.co.uk/HAH

allanayr
Offline
Ayr, United Kingdom
Joined: 25 Sep 2011
DeanI don't do jeenodes so I

Dean

I don't do jeenodes so I can't really help with the code for that but I notice that you still have a pvoutput Applet which I didn't think you needed because you update your pvoutput.org data by grabbing it from xively/cosm/pachube.

Just an observation.

 

Allan

magill
Offline
Joined: 27 Apr 2012
DeanRemove or move

Dean

Remove or move oilnodeApplet.lua as it is a replica (nearly) of jeenodeApplet.lua.

Then in jeenodeApplet.lua edit the line:

 [2] = OilNode{base="dbzoo.livebox.jeenode:pond", endpoints={temp=1,oil=1,humi=1,battery=1}, ttl=3600}

to be

  [2] = OilNode{instance="jeenode:outside", endpoints={temp=1,oil=1,humi=1,battery=1}, ttl=3600}

also why have you called the oil tank "pond"

John
g7pkf
Offline
United Kingdom
Joined: 11 Jan 2011
thanks for all help have a

thanks for all help have a slight problem/question

 

"Remove or move oilnodeApplet.lua as it is a replica (nearly) of jeenodeApplet.lua."

 

I have OilNodeApplet.lua   and   oilnode.lua  which one should i remove or both?

 

It's called pond as the tank is next to pond and temp sensor is in the pond :)

removet PV lua.

allanayr
Offline
Ayr, United Kingdom
Joined: 25 Sep 2011
Just move the

Just move the oilnodeApplet.lua from the plugboard directory and then restart the plugboard. The oilnode.lua won't run unless you specifically issue a "lua oilnode.lua" command.

g7pkf
Offline
United Kingdom
Joined: 11 Jan 2011
I hate power spikes!!

still no joy.

plugboard looks like this now

and modified scripts are in http://www.packetradio.co.uk/HAH

magill
Offline
Joined: 27 Apr 2012
where has the oilnode.lua

where has the oilnode.lua gone?

You need to have it in the plugboard directory.

John

Email me directly if you like.

allanayr
Offline
Ayr, United Kingdom
Joined: 25 Sep 2011
Oops

My bad I didn't realise that it was needed in addition to the jeenode applet. Sorry!

garrydwilms
Offline
United Kingdom
Joined: 31 Mar 2011
Hi Dean, looks like a lot of

Hi Dean,

 

looks like a lot of confusion on the jeenode structure and what files are needed.

in summary:

you need a jeenodeApplet.lua that sets up ALL your nodes. If you have a boiler node, oilnode, roomnode. Then all three should be declared in this one applet.

for non standard nodes (boilernode and oilnode) for example, you also need the lua script that contains the decoding information amongst other things. These are just .lua files and NOT Applet.lua's.

These lua files need to be "required" in you jeenodeApplet like so

 

BoilerNode = require("boilernode").BoilerNode
OilNode=require("oilnode").OilNode

 

This is the part of the script that tells it to look in the .lua files for the decode info, etc.

Hope this clears things up a little.

 

Garry

g7pkf
Offline
United Kingdom
Joined: 11 Jan 2011
Nearly back working LOL

Oil is sort of working, need to add roomnode to lua/plugboard.

Oil needs proper supply.

dropped back to ver 310, i knackered my latest live box hence going back to an old one and it is sort of start working. (on ver 310)

going to get it all back 100% then look at taking the leap of upgrade.

All your help has got me going again.

 

thanks

Dean

And my wife is sort of happy (as happy as they get)

g7pkf
Offline
United Kingdom
Joined: 11 Jan 2011
OK need advice

got an OLD livebox on 310 working 100%

"if" i upgrade what changes to my scripts do i need to do?

scripts here:- http://www.packetradio.co.uk/hah.tar.gz

been a long couple of month's

If i break it again wife will go MAD!!!!

garrydwilms
Offline
United Kingdom
Joined: 31 Mar 2011
I'm surprised this is

I'm surprised this is working? You still have oilnodeApplet AND jeenodeApplet running? One declares node 2 as a roomnode the other declares node2 as a boilernode.

as for upgrading, the process will split your ini files up for you and you'll need to change base ref to instance as discussed earlier.

Garry.

g7pkf
Offline
United Kingdom
Joined: 11 Jan 2011
yes that explains double posts in XFX viewer

Tidying it up now. Thanks Garry

 

Really scared to upgrade as wife has been having proverbial "hissy fit" these last 2 months.

 

is there an easy way to downgrade to a previous firmware?

 

Dean

magill
Offline
Joined: 27 Apr 2012
DeanI have a spare Livebox

Dean

I have a spare Livebox running latest 316 and have loaded and edited your files. They now seem to run without error.

Put just these 5 files in your plugboard folder. You will probably have to edit the local nodes within jeenodeApplet.lua

John

AttachmentSize
AliasHandlerApplet.lua 2.59 KB
boilernode.lua 1.52 KB
jeenodeApplet.lua 712 bytes
xapCacheWebserverApplet.lua 4.33 KB
oilnode.lua 998 bytes
g7pkf
Offline
United Kingdom
Joined: 11 Jan 2011
Thank you John

Really appreciated.

when i am feeling brave i will have a go at updating :)

 

Dean

Hardware Info