Arduino EEPROM

jeanmarc
Posts: 1564
Joined: Thu Aug 29, 2013 7:16 am

Arduino EEPROM

Post by jeanmarc » Thu Aug 29, 2013 6:07 pm

Hi,

The next release of meterN won't support a "reset to null value" for counter.
If there is a reset (surge..), the counters will start from 0 and the datas will mess up. Sadly, the arduino EEPROM have a reduce cyle of write :roll:
So, i am looking for a trick for the 'poometers com app', i believe a solution could come from i2C using a AT24C external EEPROM. Anyone have any experience with that ?

Thanks
Last edited by jeanmarc on Thu Aug 29, 2013 8:52 pm, edited 5 times in total.

escix
Posts: 19
Joined: Sun Sep 01, 2013 6:22 am

Re: Arduino EEPROM

Post by escix » Sun Sep 01, 2013 6:27 am

Hi Jeanmarc,

Is there a particular reason for not having a reset to 0 in the new version.

How about writing poolmeters' output to a file and another script to read the file and increment the value and post it to meterN

jeanmarc
Posts: 1564
Joined: Thu Aug 29, 2013 7:16 am

Re: Arduino EEPROM

Post by jeanmarc » Sun Sep 01, 2013 6:54 am

Hi escix,

Yes, the reason is: if meterN or your logger is stop for a reason, you can still meter later on without any count lost.
Also, when you have a real smart counter, it is nicer to have a log of the reals values.

I haven't thought about a script :oops: it is indeed a temporary solution. I say temporary because of the same reason as above, if your logger/script is down, you'll loose counting. I'd prefer seeing the arduino as a standalone counter, don't you think ? :)
Last edited by jeanmarc on Sun Sep 01, 2013 5:51 pm, edited 2 times in total.

escix
Posts: 19
Joined: Sun Sep 01, 2013 6:22 am

Re: Arduino EEPROM

Post by escix » Sun Sep 01, 2013 12:10 pm

Just to put into perspective;

My understanding is even if the script stopped working (not sure about arduino stopped, because you won't register any usage anyway in that case) you still like the arduino to register the usage.

I believe as it is now, without any modifications to the firmware, the arduino still register and increase the count regardless of the script's (poolmeters) operation. So when the script runs back it gives the usage (at least the total, ie not timed).

If you are looking at the possibility of arduino stopped working, then I can't see the point how this will register the usage.

If you are looking at the possibility for the scenario where the script stopped working and a couple of hour later the arduino stopped, then you still want to get the data for that couple of hours, then I would really like to think of the possibility of occurring.

Did you had any real life issues in regards to this?

I really love your works and didn't want you to stress too much on covering every possible scenarios. ;)

jeanmarc
Posts: 1564
Joined: Thu Aug 29, 2013 7:16 am

Re: Arduino EEPROM

Post by jeanmarc » Sun Sep 01, 2013 2:15 pm

Thanks for your thought, it is really appreciated :)
What changed my mind, is that a smart meter owner told me he prefer to keep log of his real counter values. I surely understand that, i would too.
But, we (poor) pulse-meters owners have now to find a solution :lol:

Your senario are correct, if meterN or the logger stop but if you reset your Arduino when meterN is running, the counters will goes to zero. And, meterN will then thought they have pass-over :?

Maybe another solution would be that the Arduino return a signal if it is reset ? It'll will add another option in meterN i am not sure it is a good idea..
On the other hand AT24C EEPROM are cheap, I had to find some times to look at that. Or find another trick :mrgreen:

jeanmarc
Posts: 1564
Joined: Thu Aug 29, 2013 7:16 am

Re: Arduino EEPROM

Post by jeanmarc » Mon Sep 02, 2013 8:23 am

Hi,
I have sleep on it. You've got reason, this could be done by software :P

Well, i simply need to make a script that :
- read the last values in the daily csv
- pool the arduino each 5 min and increase the value counter of the corresponding meter
- then -put to zero- the arduino counter
and so on..

escix
Posts: 19
Joined: Sun Sep 01, 2013 6:22 am

Re: Arduino EEPROM

Post by escix » Mon Sep 02, 2013 11:05 pm

Hi Jeanmarc,

Why not implement a 'watchdog' system for the arduino so if the monitoring arduino crashed it can restart again.

jeanmarc
Posts: 1564
Joined: Thu Aug 29, 2013 7:16 am

Re: Arduino EEPROM

Post by jeanmarc » Tue Sep 03, 2013 7:19 am

Hi,
It could also be an option, the Arduino would then have to make a request to the logger to know where the counters have been stopped.
I really don't know how to do that ;)

escix
Posts: 19
Joined: Sun Sep 01, 2013 6:22 am

Re: Arduino EEPROM

Post by escix » Tue Sep 03, 2013 8:37 am

Hi Jeanmarc,

My proposal is as follows:

1. Revert the meterN's operation back to previous (no issues even if arduino resets)
2. set up a watch dog system to monitor the monitoring arduino (say for every 5 minutes) and if the monitoring arduino stops the watchdog system will reset the arduino.

this is based on the assumption that:
The issue is when the arduiono stops and failed to restart, we will lose the usage data until the arduino get restarted.


By employing a watchdog timer the arduino will be automatically restarted if stops working.

jeanmarc
Posts: 1564
Joined: Thu Aug 29, 2013 7:16 am

Re: Arduino EEPROM

Post by jeanmarc » Tue Sep 03, 2013 1:59 pm

Hi escix,

Well, no i won't revert back to his previous behavior (incremental). For the following reasons: Smart-meters owners prefer real values in there logs, real-counters always increase, if the logger is off/restarted you'd lost counting information.

Now, with the new method, you'd never loose a pulse as long as your arduino is powered ! I have an external USB powered battery that will surely fit for that need.
I have to find a bit of time but the solution is close for us :ugeek:

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest