One-time init only

I've hooked up a DCF77 receiver to an Arduino Nano that I would like to use as a 'time master' in my house.

I've looked into various ways of getting the time from this node to other nodes. Problem is that once a message fails (because of radio NACK), the whole sketch is re-run, including the startup of the DCF receiver.

I've put initialising and starting the DCF reception in preHwInit(), but it seems this one is called before every radio init.

Is there a function that is called only once? Is there a place I can patch the -master branch to get a function that is called only once? I would contribute back to -master, of course!

@gohan At the moment, I have a few 'weird' nodes that would like to talk to each other. I was pointed to this site because I wanted nodes that talked to each other 'over a certain distance', and MySensors seemed like the best fit, even without being attached to a controller...

One of the nodes is attached to my washing machine (to indicate if it's ready or not) and dryer (same reason). One node is in our daughter's bedside lamp, that turns purple at night and green at 0700 (so that she knows she can get out of bed), and I have a node attached to an LED screen with 4x 4"-high 7-segments leds. This last node can either run a specific 'show' for my choir (we needed a time machine...) or show data that sensors bring in.

Most of my nodes don't fit into a standard model really well, and I figured I didn't need to spend EUR100+ on a controller that I wasn't going to use...

Emergency mode on the night light is triggered by starting and stopping it three times within 10 seconds each time, so that if it can't find a time source, you can still get 12 hours of 'night light' followed by 'day light'.

In the night light, I commented out the request() call (and I took out the receive() implementation in the TimeMaster) because I ran into the DCF time receiver starting again every time.

Now it is on github also : https://github.com/mysensors/MySensors/issues/1403
lwaga created this issue in mysensors/MySensors
open
MySensors GatewayW5100 example sketch do not compile with ATmega128 board
#1403

@mfalkvidd said in idea: allow the present function to indicate if an echo will be sent:
To my knowledge, the MySensors library itself will send an echo when requested. There is no need to present if the node supports echo or not, echo is always enabled.
Very interesting!