IDE 2.3.7 Problem

Hello,

I'm still having the following problem: when I'm programming a sketch, all changes are lost if the laptop goes into power-saving mode and I wake it up again.

For example, if I add a line of code and the laptop goes into power-saving mode after a while, the new line of code is gone when I wake the laptop up again. And this affects every changes to the sketch if I haven't saved it before the laptop goes into power-saving mode

It looks like the IDE is refreshing and undoing all the changes.

Greetings
Michael

Hi @migru. As a workaround for this bug, enable Arduino IDE's "Auto save" preference:

  1. Select File > Preferences... (or Arduino IDE > Settings... for macOS users) from the Arduino IDE menus.
    The "Preferences" dialog will open.
  2. Check the box next to "Auto save" in the "Preferences" dialog.
  3. Click the "OK" button.
    The "Preferences" dialog will close.

Arduino IDE will now continuously save your work.


The Arduino IDE developers are tracking the bug here:

If you have a GitHub account, you can subscribe to that thread to get notifications of any new developments related to this subject:

Hi ptillisch,

thank you for the answer.
Using Auto Save isn't my usual workaround. But I'll give it a try.
Maybe I can work with it.

Greetings
Michael

You are welcome. I'm glad if I was able to be of assistance.

I also prefer to have control over when my sketch is saved. But many people find the auto-save behavior to be convenient (it is a common feature across other IDEs and programming editors).

The alternative would be to just be vigilant about manually triggering a save anytime you will be leaving your computer unattended. Just as I like control over saving, I also like control over when my PC sleeps. So I actually have the auto-sleep behavior disabled on my computer and thus it is a natural sequence for me to save files before putting the machine to sleep. However, I understand that when working from battery power the auto-sleep might be more important in order to ensure you don't drain your battery if you ended up going AFK without remembering to manually trigger a sleep.

If you are using a windows computer, sleep is anyway not a the best method to preserve the battery. Use Hibernate instead. All of the memory will be temporarily stored on the HD and the laptop will actually shut down and really stop using power. If on battery powered and your laptop goes into sleep, external devices connected to USB ports may not be shut down, and may drain your battery, while you may not even get an alert.