Nanode gateway

4 replies [Last post]
brett
Offline
Providence, United States
Joined: 9 Jan 2010

I got me one of these to play with (Nanode Gateway) - its basically a JeeNode/Arduino with an ethernet port.

http://shop.nanode.eu/shop/nanodes/nanode-gateway/

As proof of concept I turned this into a xap-serial gateway.  What this does is it accept an RF packet and dump the same format xap message onto the ethernet as the xap-serial program would do.  This one embedded device can  replace the base jeenode + xap-serial running on the livebox.  Which is kind of neat.

Rough code for your amusment attached:  This depends on EtherCard and JeeLib from jeelabs.  The xAP class libraries that I wrote are slighly modified from those in the SVN repo - once I finish hacking and I'm happy with these I'll check this and all my bit in.

I think what I might try next is to also have a web server front end and allow you to assign a node type (aka RoomNode) to this RF packet and it have it decode and put those on the wire too as a native xap packets.  This would allow it to assume the job of the plugboard jeenode decoder.

Brett

 

AttachmentSize
RFgateway.zip7.7 KB
brett
Offline
Providence, United States
Joined: 9 Jan 2010
This works very well - I'm

This works very well - I'm now using it full time and it bolts nicely into the jeenode applet on the Livebox too.  All I needed to do to the applet was add this extra monitor section.  Now I have a 915Mhz basenode directly connected and a 868Mhz Nanode gateway pushing out xap-serial conformant packets that are also picked up.  Rock on.

jeenodeApplet.lua

--snip--

function init()
   monitor(jeemon, nodes)
   monitor({ target="dbzoo.nanode.gateway", port="/dev/ttyUSB0" },
           { [2] = RoomNode{base="dbzoo.nanode.jeenode:2", endpoints={lobat=1,temp=1,light=1},ttl=900},
             [3] = RoomNode{base="dbzoo.nanode.jeenode:3", endpoints={lobat=1,temp=1,light=1},ttl=900},
             [4] = RoomNode{base="dbzoo.nanode.jeenode:4", endpoints={lobat=1,temp=1,light=1},ttl=900}
           })
end

magill
Offline
Joined: 27 Apr 2012
Gateway

Hi Brett

I've managed to get your sketch running on a nanode (older V5 with attached RFM12) and I can see activity from various nodes on the serial port. I have disconnected the base node in the hope of seeing activity on XFX viewer . I have modified the jeenode applet:

function init()
   monitor(jeemon, nodes)
   monitor({ target="dbzoo.nanode.gateway", port="/dev/ttyUSB0" },
           { [2] = RoomNode{base="dbzoo.nanode.jeenode:2", endpoints={temp=1,light=1,moved=1},ttl=360},
             [4] = RoomNode{base="dbzoo.nanode.jeenode:4", endpoints={temp=1,temp2=1},ttl=360},
             [5] = RoomNode{base="dbzoo.nanode.jeenode:5", endpoints={temp=1,oil=1,humi=1,battery=1},ttl=3600}
           })
end

Bit confused.

why is there a reference to USB0? Is the NODE ID of the nanode important?

I'm not seeing any traffic.

thanks

John

brett
Offline
Providence, United States
Joined: 9 Jan 2010
The /dev/ttyUSB0 is important

The /dev/ttyUSB0 is important because its a hack.

The nanode sketch is hacked to always say its receiving data from /dev/ttyUSB0 when reality its getting it from RF.   The monitor() function requires that the target is a xap-serial device but we don't have one as we are using a NANODE so its a fudge.

It is required thou.

The node ID of the nanode isn't important as long as its does not clash with any node ID you already have setup.

You should see on XfxViewer at lest the target "dbzoo.nanode.gateway" and it emitting a heart-beat.  Make sure you have setup the EEPROM with the right RF, Group, Node too.

Attached a screen shot of what sort of data you should see..

Nanode gateway xFxViewer

Brett

brett
Offline
Providence, United States
Joined: 9 Jan 2010
Nanode Gateway wiki page

John I've started a wiki page on the Nanode Gateway so I can capture some of the knowledge in my head and perhaps give you a bigger picture.


http://www.dbzoo.com/livebox/hah_hahnode/nanode_gateway

Hardware Info