I have had discussions with Jon, Andy, Sam and others in the past
about AVR watchdog timers... and how you handle the possibility of
crashing the AVR when you've got an embedded device deployed out in
the field doing environmental sensing or power measurement or
something like that using the Aiko platform, and you can't get to the
hardware easily.
I think this is potentially a good solution for this:
If the aiko-gateway doesn't hear any data coming in from the aiko-node
devices (which are presumably connected via ZigBee) within a certain
amount of time, the gateway then sends a reset command out via the
Zigbee.
The ZigBee on the remote end then receives this and pulses low one of
its GPIO pins which resets the Arduino; it's wired into the AVR's
reset pin circuit.
Alternatively, perhaps the ZigBee in the node itself has got enough
smarts to be able to tell that the AVR is talking, and if not, to
reset the AVR.
This requires a little bit of programming of the ZigBee devices so
that they implement this, but it seems like a fairly nice solution,
and one that takes advantage of the fact that the ZigBees are really
fully fledged microcontrollers themselves. This seems pretty flexible
and powerful and doesn't require any additional electronics.
Your thoughts?
> The ZigBee on the remote end then receives this and pulses low one of
> its GPIO pins which resets the Arduino; it's wired into the AVR's
> reset pin circuit.
Nice. Could be worth thinking about ways this could be used for a DOS
attack though.
Also, this looks a lot like a first step towards another very nice
potential mod, which is being able to push new firmware to a node via
ZigBee. If the XBee module can reset the AVR and it's also connected to
the RX pin, it should be enough to assert reset and then a few hundred
milliseconds later start squirting a new hex file at it.
Cheers :-)
--
Jonathan Oxer
Ph +61 4 3851 6600
* Internet Vision Technologies (www.ivt.com.au)
* Practical Arduino (www.practicalarduino.com)
* SuperHouse Automation (www.superhouse.tv)
* Geek My Ride! (www.geekmyride.org)
>
> Also, this looks a lot like a first step towards another very nice
> potential mod, which is being able to push new firmware to a node via
> ZigBee. If the XBee module can reset the AVR and it's also connected to
> the RX pin, it should be enough to assert reset and then a few hundred
> milliseconds later start squirting a new hex file at it.
Like this? :-)
> Like this? :-)
>
> http://ladyada.net/make/xbee/arduino.html
Pretty much. I think it would be better to assert one of the XBee's
GPIOs manually though, to prevent the remote node from resetting every
time RTS is asserted at the transmitter end. The way it's documented
above is extremely convenient if you're using XBee purely for pushing
across new firmware, but if you also want to use it for general comms it
may reset the Arduino unnecessarily.