Is this possible?
Due to hardware limitations I have attempted to combine the HAHcentral node for jeenode data collection and the URFrX sketch.
this has worked fine and I know get xap-serial messages from jeenodes and 433mhz rf devices.
jeenodes are still functioning fine so i'm no worse off than I was.
however, I know need to squirt the data from xap-serial into the xap-urfRx. Looking through the code it doesn't appear that I can direct a xap message towards it so i was wondering if there is any other way.
Brett, I noticed you have sucked in data from a file using a command like: $ ./xap-urfrx -i eth0 -s urf.in.
Is it possible to do something similar, save the xap-serial data to a file then call the above command, although I suppose this means starting and stopping the daemon regularly. It all sounds messy.
any other thoughts?
thanks
Garry
Gary,
I've done it but it turned out to be non-trivial and I changed a number of things along the way.
Needless to say when I send this (below) the xap-urfrx processor will now pick this up correctly match it against my definitions.
xap-header
{
v=12
hop=1
uid=FF00D500
class=Serial.Comms
source=dbzoo.livebox.Serial
}
Serial.Received
{
port=/dev/ttyUSB0
data=RFRX -10000,378,-1079,1120,-352,378,-1079,378,-1079,378,-1079,378,-1079,378,-1079,378,-1079,378,-1079,378,-1079,378,-1079,1120,-352,378,-1079,378,-1079,378,-1079,378,-1079,378,-1079,378,-1079,378,-1079,1120,-352,378,-1079,1120,-352,378,-1079,378,-1079,-10000
}
You will need to make sure you prefix the data string like this in your HAHCentral changes.
data=RFRX<space><data......>
The reason for this is to make it easier to pick up the DATA for the right processor. The HAHNodes pickup data from the HAH Central when it begins with 'OK'. So this will differentiate it and make it easy to spot.
I've not tried this for real in a URFRX/HAHCentral combo but I figure you are already there so I'll let you be the first. :) I'll work on some architecture changes to the URFRX stuff to make it a class so you can just include to make it more modular. I've also make a web GUI change to handle this stuff to - go look.
I've pushed Beta 309.3
@Karl this beta contains your graph changes too.
Brett
xap-serial buffer has been increased. Next beta drop is ready. I will see if I can test this scenario out myself here might one more wart that I can think of.
Brett
Gary,
I fixed a bug in the state machine processor for which I had a hack in the serial backend to workaround. With the introduction of virtual serial I either had to put in yet another workround or fix the root problem. I also noticed that I was not sending out a serial.setup message which I should also be doing. You got away with it as the lua hahnode process had already done this, but techinical it should be sent again it won't hurt.
Anyway's I pushed 309.5 with a few tweaks. I looked at your "mash up" we need to make the RFRX code into a class so it can be included as easily as this and all the goodness is encapsulating into he RFRX class.
#define RECV_PIN 4
RFrecv rfrecv(RECV_PIN);
RFResults results;
setup() {
rfrecv.enableRFIn();
}
loop() {
if(rfrecv.match(&results)) {
dumpRaw(&results);
rfrecv.resume();
}
}
Then bolting into the HAHCentral is very minimally invasive. On my list - getting there.
Brett
I've overhauled the UniversalRFRx sketch and the HAHCentral sketch.
The RFRX reciever code has been turned into a library and it now used by each of the above sketchs. This improves the separation of these two pieces. It does however make your work redundant Gary (sorry) but you'll probably agree this is much prettier when you grab it.
I've also incorporated the changes necessary to make the HAH Central not use the EEPROM so its NODE ID will never change once set, currently hardcoded to NODEID 1.
Many other minor updates to the Arduino code base so if you are using Tortoise (svn update) please.
Brett
I just flashed the latest HAHCentral and enabled the RFRX module, attached a 433Mhz RF receiver "bugger me" if it all just didn't work first time. I press my handy Byron RS1 remote and the signal gets all the way over to xap-urfrx and it toggles the BSC endpoint.
Hey Gary this is neat and I see why you where keen to get it working this way.
Pin 4 is labeled PORT 1 on the HAHNode in case anybody was wondering why I chose PIN 4.
How my setup looks (see pic) a little ugly but it works.
With a RF RX with the 3 pins instead of using the PCB it should just plug straight into the PORT without the need for kludgy wiring like I have in this picture and look must better.
Brett
It would be possible and I had considered this architecture this when I was building it but I decide to keep it separated, whilst still in development mode.
You would need to modifyt xap-urfrx to have a hook to pick up the xap-serial packet instead of directly communicating with the serial port itself.
Let me add some code to allow this combination - its trivial (well for me).
Brett