Output Node - No Function at all

25 replies [Last post]
wpmax
Offline
Freilassing, Austria
Joined: 4 Jul 2011

Hi,

i have 5 jeenodes as Roomnodes perfectly up and running.

Now i wanted to change one of these to an Outputnode.

When i change the state of a digital point (e.g. p1) i can see the output state changing from off to on in the xfx Viewer as it schould be,

but on the node, nothing happens.

There is also no Serial.Comms Class where I would see a Serial.Sent command or something like this in the xfx Viewer.

It seems to me as if the command would be ignored by the HAH and doesn`t come to the hahcentral node to be sent to the peripheral node.

What did i do wrong? Where can i debug für things going wrong?

brett
Offline
Providence, United States
Joined: 9 Jan 2010
Although I don't have the

Although I don't have the Output node hardware to hand I was able to verify that the software is working as it should according to the setup instructions; http://www.dbzoo.com/livebox/hah_hahnode/outputnode

I've amended a typo in the setup sample and added some more detail about what you should expect to see being sent to xap-serial.

wpmax
Offline
Freilassing, Austria
Joined: 4 Jul 2011
no function on outputnodes

Hi brett,

i can verify the serial output you specified in the thread.

But though my node is working well as a roomnode (= hardware is OK), as an outputnode, nothing happens at all, when putting one port on or off.

Is there any extra debugging possibilities or something like that to find out what's wrong with the outgoing serial commands and why they do not work?

thanks,

Markus

brett
Offline
Providence, United States
Joined: 9 Jan 2010
How to debug
Markus,  

I'm not sure if you compiling your own code or how you are flashing the OutputNode.
By default the outputNo is hardcoded to be Node 8.

#define NODEID 8 // MY NODE ID *** ADJUST PLEASE **

The Output will report the state of the outputs on node hardware bootup and then every 5min.
If you are not even getting that you need to debug with a serial port connected.

You can enable debug output to the serial port.

#define SERIAL 1 // set to 1 to also report readings on the serial port
#define DEBUG 0 // set to 1 to display each loop() run

The source is available to read and compile.

http://code.google.com/p/livebox-hah/source/browse/trunk/userapps/arduin...

Brett
wpmax
Offline
Freilassing, Austria
Joined: 4 Jul 2011
I already did all the steps

I already did all the steps above, set my Outputnode-Sketch to id 5 and changed the filtering, so it tells me every traffic from all my rf12 devices (roomnodes) via it's serial Interface. I can see all the traffic from the roomnodes coming into the outputnode, which means, the Node is ok and working. But even if i can see your above specified serial.send command for the Outputnode on the xFx Viewer, nothing is coming to the node itself. It seems to me as if the hahcentral would not send the command out via rf12 otherwise i should see anything on my outputnode. I keep on trying to find the bug.

Thanks, 

Markus

brett
Offline
Providence, United States
Joined: 9 Jan 2010
I would connect directly to

I would connect directly to your HAHCentral and issue the command manually to make the Output node toggle.   Isolating xap-serial from the equation if you suspect a problem here, however in my testing this did look ok.

From memory when I was writing the code I simply plugged two NODES into my computer and used serial comms to each to make sure the command was being sent and received on both sides.

I'd break it down to this level as a starter.   Do note that the Output node runs in a busy loop waiting for RF commands so its not a candidate for running on Batteries like the RoomNodes do as it would quickly drain them.

The Output node should not receive packets from other roomNodes, I'm pretty sure its not running in promiscous mode by default.

Let me setup a couple of spare nodes that I have and flash them down to see what I can make of this - its been a while since I used this code.

UPDATE:  http://www.dbzoo.com/livebox/hah_hahnode/outputnode?&#debugging

I did not test integration with the HAH LUA code I'm assuming xap-serial is sending to the HAHCentral ok.

Brett

brett
Offline
Providence, United States
Joined: 9 Jan 2010
I did find an issue the

I did find an issue the "OUTPUT" statement that it the report back to HAH Central was not correctly picking up the values of the ports.  So even thou a relay would toggle ON the output node would always report it as OFF.   The port would be set ON/OFF thou.

Code updated and committed.

Brett

wpmax
Offline
Freilassing, Austria
Joined: 4 Jul 2011
success !

Hi brett,

thank you very much for your support!

I did all your suggested debuggging, took your new outputnode-sketch and found out, the problem can only be on the hahcentral node. So i took the latest hahcentral arduino sketch (this is the nocfg version, isn't it?), compiled it, flashed the atmega and voila, it works perfectly!

Maybe i had an old version of the hahcentral_nocfg.cpp.hex (downloaded within the HAH) that didn't work with outputnodes?

I am very happy since i try to get it working since many weeks, thank you again,

Markus

brett
Offline
Providence, United States
Joined: 9 Jan 2010
I will update the hahcentral

I will update the hahcentral HEX file that is posted as a download based on a new compile of the SOURCE.  I'm not sure what this HEX is based on either.   Glad we got to the bottom of the problem thou.  .... and I did find a problem that needed correcting that I would not have noticed had I not retested.  So its a gone well all round.

Brett

BodgeIT
Offline
London, United Kingdom
Joined: 10 Jun 2010
Hi Brett,Do you recommend

Hi Brett,

Do you recommend flashing new HAHCentral code as a result of this?

brett
Offline
Providence, United States
Joined: 9 Jan 2010
If it aint broke don't touch

If it aint broke don't touch it.  Unless something is broken for you i would not bother.

Brett

BodgeIT
Offline
London, United Kingdom
Joined: 10 Jun 2010
Fair enough, was just

Fair enough, was just responding to this:

"I did find a problem that needed correcting that I would not have noticed had I not retested"

garrydwilms
Offline
United Kingdom
Joined: 31 Mar 2011
This fix was for accurate

This fix was for accurate reporting of output states on output nodes. Unless you use output nodes no need to update

 

Garry

wpmax
Offline
Freilassing, Austria
Joined: 4 Jul 2011
Outputnode and Roomnode in one

Hi Brett,

could you define a new node on the HAH called something like "controller node",

that can measure for instance temperature on 1 or 2 DIOs and work like an Outputnode on the other 2 DIOs.

This would be very helpful for me, because i would like to measure my pool temperature (i do that already) and with the given value i would want to put the heating on or off.

All this process should be done in my cellar at one place. So by now i would have to take 2 nodes on one place with the danger of interferance of RF12 actions.

Possible to manage?

Thank you very much für your suggestion / help!

Markus

garrydwilms
Offline
United Kingdom
Joined: 31 Mar 2011
HI, I already have this, let

HI,

 

I already have this, let me dig out the files!

 

EDIT: Heres the lua file, just need to find the HAHNode PDE script?? I have it somewhere :)

EDIT2: Found it. Temps on ports 1 and 2 digital. Relays on Ports 3 and 4 digital. LED indicators for relays can be connected to Ports 3 and 4 analogue.

For or interest I use this for measuring top and bottom of water tank and then heating and water control via the relays.

My relays are logic reversed so you may need to alter script if your are not.

Garry

AttachmentSize
relaynode2.lua 1.52 KB
relay2Node.zip 2.6 KB
wpmax
Offline
Freilassing, Austria
Joined: 4 Jul 2011
How to get the relaynode2.lua into /lua/5.1/xap directory

Hi Garry,

it took some time for me to continue on my task,

but now that i studied your attachments i got stopped at the point how to bring the relaynode2.lua into the right directory on the hah,

so that the system can find an use it correctly.

Sorry, i am not that good in system structures so i have to ask that question.

I tried to copy the file via ftp to the directory, where i found the in system lua scripts, i.e. usr/share/lua/5.1/xap but i failed obviously because of right problems.

Can you help me, please?

Thanks,

Markus

garrydwilms
Offline
United Kingdom
Joined: 31 Mar 2011
Hi, this confused me too at

Hi, 

this confused me too at first. Put your lua file in the plugboard folder the add the following to your jeenode applet file

 

RelayNode2 = require("relaynode2").RelayNode2

 

I hade a power outage last light tha t corrupted my Rasp Pi SD card. Didn't make a backup.. Gutted :(

well that's my weekend sorted !

 

let me know it you need more info.

Garry


wpmax
Offline
Freilassing, Austria
Joined: 4 Jul 2011
seems to work, thank you

Hi Garry,

sorry to hear from your accident. Hope you can restore soon!

Thanks for your support, the code seems to work, i just have to test the node physically.

 

Markus

kema01
Offline
MAIDSTONE, United Kingdom
Joined: 8 Jul 2013
Inverting the output of an unmodified HAH output node.

Hi

Reading this post inspired me to have a go at converting one of my room nodes to an output node.

I have just got the output node working connected to a relay board, but have found  that if I send an off command the relay turns on. I am pretty sure that you can invert the output, but for the life of me I cannot find where to make the changes in the outputNode.ino code.

I would be very grateful if someone could help me out, with a solution to the above problem. If I can get this sorted I will purchase a few more Jeenodes from Derek, as I have a number of other application.

garrydwilms
Offline
United Kingdom
Joined: 31 Mar 2011
Hi,glad to see you using your

Hi,

glad to see you using your nodes for more than just reading inputs. They are very flexible.

i also had to reverse inputs. 

Try something like this

  digitalWrite(relay1Pin, !targetstate); //logic is reversed for relay board

 

garry

kema01
Offline
MAIDSTONE, United Kingdom
Joined: 8 Jul 2013
Not sure if this will work

Garry

Many thanks again for your help and support with my HAH

I am using the original 4 port outputnode code , so am unsure if your suggestion will work. I thought I would just have to alter all outputs from a low to a high, which seems to be the train of thought on the arduino forums. But I cannot find any reference in the outputnode code for this.

Apologise for my lack of knowledge in coding, but my way of learning is by experimentation. And when the code drastically changes I struggle.

Many thanks

 

kema

garrydwilms
Offline
United Kingdom
Joined: 31 Mar 2011
Ok, how about changing the

Ok, how about changing the following line to:

 

out[port].digiWrite(!on);
 

 

garry

kema01
Offline
MAIDSTONE, United Kingdom
Joined: 8 Jul 2013
Yes it works.Thank you

Garry once again you have come to my aid with a solution to my HAH problem. I have no understanding as to how this inverts the output, will read up later.

I plan to use this node (4 relays) to control our ponds Pump, UV, oxegen and fish feeder.

I will now order a couple more nodes.

many thanks again.

kema

garrydwilms
Offline
United Kingdom
Joined: 31 Mar 2011
Hi Kema,glad it worked. If

Hi Kema,

glad it worked. If you look at the function where the line in question resides you'll see that 'on' is a variable containing the state required for the relay in question.

using the c code NOT operator, !, just reverses any 1s to 0s and vice versa. 

Garry

brett
Offline
Providence, United States
Joined: 9 Jan 2010
Kema,Some explaination of why

Kema,

Some explaination of why you had to do that pin inversion.
The AVR pins are a path to ground they to not supply current they are a current sink.

What does this mean?  Let me draw it.

AVR --pin-|  <--- Relay ---> +5v

Naturally the pin on the AVR will float HIGH (1) +5v on both sides won't make a relay work.
To complete the circuit you need to pull the pin LOW (0) pull it to 0v.
When you pull it LOW and complete the path to ground the Relay is now ON.
pin LOW - Relay ON.
pin HIGH - Relay OFF.

Brett

kema01
Offline
MAIDSTONE, United Kingdom
Joined: 8 Jul 2013
Thanks for the explantion's

Garry and Brett many thanks for your explanation’s, I am sure this will help others who read the HAH forum as well.

Eagerly awaiting my delivery of new nodes from Derek.

 

kema...

Hardware Info