Output Node - No Function at all
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?
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
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
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
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
Hi Brett,
Do you recommend flashing new HAHCentral code as a result of this?
If it aint broke don't touch it. Unless something is broken for you i would not bother.
Brett
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"
This fix was for accurate reporting of output states on output nodes. Unless you use output nodes no need to update
Garry
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
Attachment | Size |
---|---|
relaynode2.lua | 1.52 KB |
relay2Node.zip | 2.6 KB |
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
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.
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
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
Ok, how about changing the following line to:
out[port].digiWrite(!on); |
garry
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
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
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
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...
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.