Since it will be powered by the 220v line, when the power grid fails it would lose the counter number.
To keep the solution at a software level I'm planning on saving the counter number to the flash memory (file.write()) and reading from it when the Node boots up.
That rewrite cycle would occur 5.000 times a day, how many cycles should I expect before the Flash memory starts to wear out/fail ?
Daniel.