I need your help. Probably I’m looking at this problem from the wrong angle.
What am I trying to accomplish:
Building an energy monitor for electricity, water and gas with a Fez Panda I.
By counting the pulses I receive from 2 hall effect sensors and 1 open drain sensor.
[li]Store the real-time counters (as you see them on your utility meters) in the SRAM of a DS1306 (Done)[/li]
[li]Get real time instant consumption values (in Watt for electricity, in m3/hour for gas and water) (Done)[/li]
[li]Provide the data over serial on request(Done, but…)[/li]
[li]Display real-time data on a 3.6" SPI B/W Display (Done)[/li]
[li]Max resolution should be 1 hour. Meaning, I need the counter values every hour, though I will be polling them every 5 secs under normal circumstances to provide my other components (website) with real time data.[/li]
The problem is goal number 4. As soon as the Panda code is running as it should be, it will never be updated anymore (neither code or firmware).
The Fez Panda will be connected over serial to a Fez Cobra. The Fez Cobra will be handling allot of other things like XBee, RF433, IO’s, etc.
So the cobra will be updated regularly with new features and here arises the problem. The time the Cobra will be off-line will be minimal, but I foresee that off-line time could exceed 2-3 hours or more.
Thus, the Panda should have some sort of buffer that in case I don’t poll for data, will keep the data updated for every hour (should be able to cover a new day (I could update the Cobra at 23:59)). When the Cobra comes back to life, it polls the Panda again, and the Panda should provide all the data since the last time The Cobra asked for it.
Initially I was thinking of using a Queue on the Panda, but with only 38kb free memory I suspect that I will run out of memory in no time. Besides that, there’s no way to update items already added to the Queue.
I also considered using an SD Card but the problem here is that my Panda refuses to work with the SD Card.
So, how would you guys solve this?