Skip to main content
16 events
when toggle format what by license comment
Jan 4 at 20:09 comment added user3481644 @NickGammon My "morph" was explaining my project and how the OP might use my method for persisting data. Everyone else should have just left it at that - I was NEVER asking for help.
Jan 1 at 7:50 comment added Nick Gammon You make some good points, but you are morphing the question from what the OP wanted "I want Arduino to remember what was on and what was off in my room after a power failure" to your requirements which seem somewhat different. If you want to make a new question with these somewhat more complex requirements then we could validly discuss it further.
Jan 1 at 1:06 comment added user3481644 @NickGammon Not dwell on this, but in my house with the lights/devices, the router and server would be on a UPS (SPS) with about 12 hours of power, but the lights/devices are not.
Jan 1 at 1:05 comment added user3481644 @NickGammon ... And ... My question extends beyond the scope of my question. I have similar projects (need for data) for my motor home. One application will have records that could be about 50 bytes each and an unknown number of records. Another application will have records with around 120 bytes each and there could be hundreds of those and any of those could be updated.
Jan 1 at 1:01 comment added user3481644 @NickGammon The whole thing with banks in EEPROM is a lot of monkeying around. I have 75+ devices, many of them are variable, so I would need 7 bits (0-99/128) for those. I also need a table to map devices to a slot in the memory bank. Many devices will be "hot" and be updated far more often, so I could lose a whole bank because of one or two devices. And then there is testing of the bank management - which is alleviated by just moving the bank with each write instead of counting, etc. However, I don't what to have to buy a new Arduino when one fails.
Jan 1 at 0:53 comment added user3481644 @NickGammon I am using an Arduino with a very simplified implementation of HTTP, just so the client is familiar with the API. I've obtained a Rev 3 UNO with a off-brand SD/RTC board, using a simple HTTP service that I built for another project. The service is available in seconds. The router is a different issue, but I'm looking at simple devices, these will not be exposed to anything, so even a switch would be fine.
Dec 14, 2023 at 17:21 comment added Nick Gammon Your suggestion of using a web server, for this purpose, would cause a long delay (maybe 5 minutes) while the router and web server rebooted and became ready to answer queries. If the power went off, would you really want to wait minutes before the lights came back on? If you are trying to solve a different problem than I want Arduino to remember what was on and what was off in my room after a power failure then I suggest you make your own, new, question.
Dec 14, 2023 at 17:19 comment added Nick Gammon Re-reading your answer, it seems to me like a new question. You might want to make it one. The question asked about remembering light switch statuses after a power failure. Given that the Uno has 1024 bytes of EEPROM, and only one bit is needed to remember a on/off status, you could store 8096 statuses. Or, do some load balancing, so that after 100,000 writes to EEPROM, you switch to a new bank of bytes. I'm assuming they don't have 8096 lights in their house.
Dec 13, 2023 at 16:08 history edited user3481644 CC BY-SA 4.0
Explained my position for my answer in response to the downvotes.
Dec 13, 2023 at 16:04 comment added user3481644 All - the OP stated: "Is there any way to store the values of necessary variables somewhere" - emphasis on "somewhere" in my answer. "Somewhere" includes on a local network, which is what my answer provides.
Dec 13, 2023 at 16:03 comment added user3481644 @NickGammon - The EEPROM solution is not my best solution as I cannot predict how many updates to the persisted data, both in updates and new data, so I could eventually use all of the EEPROM data and/or perform too many writes to it, effectively destroying the UNO's capability for me.
Dec 13, 2023 at 16:01 comment added user3481644 @Juraj - Yes, that is my answer, and yes, it is complicated if your project does not use WiFi for anything else, but as I stated in my answer, WiFi is my best solution and I offered it as yet another possible answer for certain situations, see my response for Nick Gammon
Jun 24, 2023 at 8:46 comment added Nick Gammon Does EEPROM not work for you?
Jun 23, 2023 at 14:59 comment added Juraj so your answer is "add WiFi and store the values on a remote server"? isn't that a little complicated if the project doesn't use WiFi for anything else?
S Jun 23, 2023 at 14:30 review First answers
Jun 23, 2023 at 17:04
S Jun 23, 2023 at 14:30 history answered user3481644 CC BY-SA 4.0