Store config file at compiling?

I’m sure this would probably take up a ton of memory, but what if we stored the contents of the CONFIG_FILE as a string literal that could be retrieved later in serial monitor with show_config?

Maybe just the BladeConfig?

Maybe check for an SD card before uploading and copy the config file there ?

All far fetched I’m sure, but worth pondering?
Just trying to help alleviate another poor user who wasn’t provided their config file at time of purchase.

1 Like

My suggestion is to not help them, just send them back to the seller.

That said, I’ve been pondering adding some simple serial monitor commands for reading and writing files. I was planning to use them in the ProffieOS workbench. However, if we have those commands, we may also be able to write some scripts that connects to the serial port and uploads the config file to the SD card after programming.

Another idea we’ve tossing around is to upload the config to a central repository. That central repository could be indexed by the proffieboard serial number and/or the a hash of the flash memory.

Of course, none of these ideas help if the installer modified the OS directly…

One day, we’ll have linux running on our sabers, and compilation will happen on the saber itself. Updating to a new OS will be a button press and adding fonts will be done by an in-saber store… :slight_smile: (but not today)

1 Like

What about printing info just from the BladeConfig at least, like retrieving bladePin, PowerPINS and maybe LED count per blade?
BladeBase objects?

Here’s what I think will happen:

  1. We add code to print out the blade configuration.
  2. We add a define to disable it to save memory.
  3. Everybody uses the define, and it helps noone.
1 Like

Maybe we should enable the code with a define, then name it something confusing like:


Then anybody who don’t read the documentation will think it’s good and use it, right?

1 Like

(any bets on how long it will take before someone asks what the PROFFIEOS_EXTRA_TURBO define does?)

1 Like

damn cargo culters.

Is it possible to write the config as a plain text file on the SD while compiling/flashing?

Not easily.

But if you wanted it idiot proof…

That’s what I mentioned.
If the whole world moved to Arduino CLI instead, yes.

How does that help?

I glanced over this post?

So, ProffieOS has a makefile in it, and I recently updated it to use arduino-cli.
It doesn’t have targets for uploading, but those could easily be added.
I primarily use the makefile to run “make test” which sets up multiple builds with multiple config files and runs them all to make sure they all compile. Because it’s a makefile it integrates nicely with emacs, and any other editor that has a “compile mode”.

In the words of a great, wise person once said:

“IF you make it Idiot Proof, the universe will invent a better idiot.”

Only makes it stronger!

It would be cool if the Upload process automatically copied the config.h as “MYCONFIG.h” onto the SD card root directory.

Agreed, but I don’t think it can be set up to where average installer Joe would unknowingly have that be part of his established upload routines, because Arduino IDE doesn’t seem to have a way to have an external script to run during compile.
Also, there’s no guarantee an SD card is inserted during upload. Any ideas?

This is great if you need to update the board but not so great if you need to replace it.

Good point.
Unfortunately, my next idea has a similar problem, but I still kind of like it…

ZIP files!

Zip files are made to be read from the end, and it doesn’t matter what is at the beginning of the file.

That means, that if there is sufficient space in board memory, you can zip up the config file, add it to the end of the flash memory and fill up the region in between with zeroes.

To recover the config file, all you have to do is to dump the flash memory (there is a web page that lets you do that) and then unzip the result.

Since the config file would be compressed, it would take less space and fit more often.


  • the only extra steps are to add some data to the file after linking
  • works with existing tools
  • works even if there no SD card in the board when programming


  • it doesn’t work if there isn’t enough space
  • not as easy as getting the file from the SD card
  • doesn’t work if the board is broken
  • makes uploads slower
1 Like