Forgetfulino 2.0: 💾 Stop Losing Your Arduino Code! Meet Forgetfulino 2.0 (LIBRARY + EXTENSIONS ) Save Your Code in the Board - Retreave It Later

by IamTheVector in Circuits > Arduino

90 Views, 0 Favorites, 0 Comments

Forgetfulino 2.0: 💾 Stop Losing Your Arduino Code! Meet Forgetfulino 2.0 (LIBRARY + EXTENSIONS ) Save Your Code in the Board - Retreave It Later

Gemini_Generated_Image_lpmm4llpmm4llpmm.png

If you work with Arduino long enough, eventually this happens.

Your board is running perfectly.

The project works exactly as expected.

But the original .ino files are gone.

Maybe they were on another laptop.

Maybe the project folder was accidentally deleted.

Maybe someone modified the code, uploaded it, and closed the Arduino IDE without saving.

Now the board runs the correct code, but the source you have is outdated or missing.

Forgetfulino solves exactly this problem.

Forgetfulino is an Arduino library and Arduino IDE extension that embeds your sketch source code directly into the firmware so it can be recovered later via Serial.

So to retreave the code you have to upload the library first, Forgetfulino CANNOT RECOVER the code from machine code of old boards!


Once installed, every upload can become a self-contained backup of your sketch.

In this guide you will learn how to:

  1. embed your sketch source code inside firmware
  2. upload it to the board
  3. recover the original code later





Supplies

Hardware

  1. Arduino board (Uno, Nano, Mega, ESP32 or compatible)
  2. USB cable for the board

Software

  1. Arduino IDE 2.x
  2. Forgetfulino Arduino library
  3. Forgetfulino Arduino IDE extension

Optional

  1. A sketch already uploaded to the board (to demonstrate recovery)

Install the Forgetfulino Library

Download the library from GitHub:

https://github.com/IamTheVector/Forgetfulino

Extract the repository.

Copy the Forgetfulino folder into your Arduino libraries directory.

Typical locations:

Windows

Documents/Arduino/libraries/

macOS

~/Documents/Arduino/libraries/

Linux

~/Arduino/libraries/

After copying the folder, restart the Arduino IDE.

The library should now appear in:

Sketch → Include Library


Install the Arduino IDE Extension

Forgetfulino includes an Arduino IDE extension that automates the workflow.

The extension source project is hosted in the same repository on a subfolder.


https://github.com/IamTheVector/Forgetfulino/tree/main/extensions

Download the compiled .vsix extension package and install it in Arduino IDE 2.x.

Steps:

  1. Close Arduino IDE
  2. Locate the .arduinoIDE configuration folder



Windows

C:\Users\<you>\.arduinoIDE\

macOS

/Users/<you>/.arduinoIDE/

Linux

/home/<you>/.arduinoIDE/

  1. Create the folder
.arduinoIDE/extensions

  1. Copy the .vsix file into that folder

Restart Arduino IDE.

The extension will now be active and will allow you to generate headers and decode dumps automatically.

Check deployedPlugins folder to verify if the plugin has been installed (Remember only IDE 2.x)


(If you want to explore the extension build please follow this other git that is not useful for

Prepare Your Sketch

forget2.gif

Create or open your Arduino sketch.

Normally at this point a tutorial would say something like:

“Add the library manually to your sketch.”

Something like this:


#include <Forgetfulino.h>

But… come on. Manually? Really?

No way.

Forgetfulino includes an Arduino IDE extension that can inject everything automatically.

Follow the gif!

Upload and Recover the Source Code

forget3.gif

Upload the sketch to your Arduino board as usual.

The firmware now contains a copy of the source code inside flash memory.


If you open the serial you will find a string like this


XY/NasMwEITveoqBXhxo9ONiQ9S6l4Zcc0ihx+JY21hUlowsp4SSdy+2c2lOy+y3zMwKgcM3pabVGOb52dVRlUcmBLZ1Io1c5uVaPq1ViVzqYqOLYoI762jQUGwSVVXNizsTbn2YGHuwvnGjIbzsQjxR+hqd9YG3r4ydgzUYKI19tsIvAw4Ube34kU7WZ0oVuZSrZwYYcvUlU3KWDPjntFwvQAi877d7jUsYI5pgCC1F4pwv8KMlPzH81D4hBURqwpkiUku3/o9oauf0fYoZu/4tdH2kYSAzxV1vD7gQlv5Xxv4A


Open the Serial Monitor. Copy the compressed string, right click on the string and click decompress. Follow the gif, follow your code!

Why This Is Useful

Forgetfulino is useful in situations like:

• the original project folder is lost

• a different version of the sketch was saved.

• the sketch was modified and uploaded without saving

• the board still works but the source is missing

In those cases the firmware itself becomes the source of truth.

Other Features You Can Explore

In this guide we only covered the basic workflow:

embed the sketch → upload → recover it.

Forgetfulino includes several additional features that make it more flexible in real projects.

Here is a quick overview.

On-demand dump

Instead of printing the sketch every time the board starts, Forgetfulino can wait for a trigger word sent through the Serial Monitor.

When the word is received, the library dumps the source code.

Example trigger:

forgetfulino

Useful when you want a clean Serial output but still keep recovery available.

Password-protected trigger

You can define your own trigger string.

Example:

Forgetfulino.dumpCompressed_OnDemand("MySecretKey");

Now the dump will only happen when that exact word is received on Serial.

Useful for deployed devices or controlled access.

Compressed source storage

The sketch can be stored using deflate compression + Base64 encoding.

This significantly reduces flash usage and allows the entire sketch to be printed as a compact single line.


Include or remove comments in the dump

The IDE extension lets you enable or disable comments in the stored source.

• With comments enabled → the recovered code is easier to read.

• With comments disabled → the stored source becomes smaller and more compact.

This can be useful on boards with limited flash memory.


Plain text dump

Forgetfulino can also print the source code as readable text.

Useful when you simply want to copy the code directly from the Serial Monitor.

Arduino IDE extension

The IDE extension automates the workflow.

It can:

  1. generate embedded headers
  2. decode compressed dumps
  3. inject Forgetfulino templates into sketches
  4. regenerate headers automatically when the sketch changes

Auto-inject template

For brand-new sketches, the extension can automatically insert the Forgetfulino setup code.

This ensures the library is always initialized correctly without manual setup.

Library version annotation

When recovering a sketch, the extension can automatically add comments showing the version of each included library.

Example:

#include <EEPROM.h> // version 1.0.0

This helps reconstruct the exact original build environment.

If you want to see all these features demonstrated step by step, you can watch the full video here:

https://www.youtube.com/watch?v=jdCU2SBPLEA

Important Note

Forgetfulino does not replace version control systems like Git.

You should still use proper versioning for your projects.

Forgetfulino is meant as a last-resort recovery mechanism when the board is the only reliable artifact left.