I have an interesting problem that my sketch behaves quite randomly. There is no repeatable errors. It writes random values to EEPROM at random times while it should not.
What I suspect, is that there is not enough RAM, as before I added NTP function, there was no random writings into EEPROM. After compiling a sketch it says that there is still 591 bytes available for local variables.
I have seen similar behavior with my other sketches.
Is there any real possibilities to see if there is truly not enough RAM? And how much RAM there is actually available?
A few years ago I tried to make a "High Water Mark" for the sketch, to actually measure how much memory is not used at all while the Arduino is running: HighWaterMark.ino.
You can add it to your sketch and let it run a few days and then check if there is still some unused memory. I have it running in a Arduino Uno and Arduino Mega 2560. It is informative to see the difference of what the compiler says and the actual value during runtime.
The value that it shows does not have to be the actual unused ram, because the heap might have large chunks that are not used and maybe the method that I use can find a wrong piece of "unused" memory.
When you say that your use NTP and have 591 bytes left, then I think that is not enough for a Uno or Mega 2560.
We know many ways to reduce memory usage, but then you have to show your sketch.
Maybe in some post-modernist delusion but there is no magic except to people who don't know any better.
I see a LOT of code on this forum that shows little real thought at all. In time they learn to think in logic and their code gets better and better -- I don't expect beginners to know the ropes.
This Arduino code is what you give the IDE to make a set of instructions for the chip to run, PERIOD.
If you do it right your project may run right (may, because the wiring could be less than right) otherwise keep trying or give up.
I'm not winging that, I started writing computer code for money in 1980.
Smartest thing a beginner can do is to NOT take on a big project until they have gotten comfortable with small projects and at least gotten past arrays and loops and hopefully learned that do-many-things-at-once lesson well.
"no code"
is what OP has posted for his code (in tags ...etc), so far.
"So, no code = no thinking. Correct?"
is a comment just to show to OP, not to expect an answer (in other words, "thinking" by forum members) without posting a code.
I'm not winging that, I started writing computer code for money in 1980.
Company gave me interpreter Basic and in 82 or 83 DR's CB80. That's when I got an assembler but very little time to play, my shop duties took half my time or more. They could have hired a programmer but it would take longer to teach what I knew than for me to learn coding so I got another hat and a small raise.
Back in those days I learned Forth at home on a VIC-20 and that's the language that liberated my view.
Thanks groundFungus, this makes sense. I will try to measure the amount of free memory.
Others, thank you for bothering yourself! I really did not expect so many replies and I did not ask to analyze my code, I asked for methods to measure free RAM.