Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backup config directly on the board #20081

Closed

Conversation

rhapsodyv
Copy link
Member

Description

This is one idea that @sjasonsmith came to me somedays ago.

It generate a cpp file containing an array with all user configs. Then it add M360 do dump that configs.

It uses from 5k to 10k of flash size to hold all user options.

It might be useful for vendors, users with multiple printers or even users with low technical knowledge, to be easy to reconfigure a new printer based in the old configs.

The actual code works fine. But it needs discussion. M360 is the right place for that? Maybe should be M360 C? Do we need some formatting on the dump? Do we need to embed the config in a place to offline extraction too? SAVE_CONFIG_INSIDE_FIRMWARE is a good name?!

I just pushed it today because the topic came again in the discord.

One of the main advantages is that our python script will be able to parse and load configs... and it can open other possibilities...

Sample of the generated file:

const char user_config_options[] = "CONFIGURATION_H_VERSION=020008\n\
STRING_CONFIG_H_AUTHOR=\"(none, default config)\"\n\
SHOW_BOOTSCREEN\n\
SERIAL_PORT=3\n\
BAUDRATE=250000\n\
MOTHERBOARD=BOARD_MKS_ROBIN_NANO_V2\n\
EXTRUDERS=1\n\
DEFAULT_NOMINAL_FILAMENT_DIA=1.75\n\
PSU_NAME=\"Generic\"\n\
TEMP_SENSOR_0=1\n\
......
.....
.....
PROPORTIONAL_FONT_RATIO=1.0\n\
FASTER_GCODE_PARSER\n\
SAVE_CONFIG_INSIDE_FIRMWARE\n\
";

Benefits

User will not lost their configs.

Configurations

SAVE_CONFIG_INSIDE_FIRMWARE

Related Issues

@rhapsodyv
Copy link
Member Author

Now from the correct branch!

@sjasonsmith
Copy link
Contributor

We get the question all the time, "Is there any way to extract settings from my firmware binary". With this change, the answer will be YES!

It is too large for anybody to practically enable on a 128k board, but I expect that most 256k users and every 512k+ user will be able to enable it. Since this is currently using uncompressed text, it would be pretty trivial to locate and extract from a raw binary image as well.

Copy link
Contributor

@sjasonsmith sjasonsmith left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we move forward with this you should probably add it to at least one of the test files.

@@ -3236,6 +3236,8 @@

//#define REPETIER_GCODE_M360 // Add commands originally from Repetier FW

//#define SAVE_CONFIG_INSIDE_FIRMWARE // This will save all user configuration options and enable M360 to dump it
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here comes the controversy...

I think there is little value to this if it is not enabled by default.
The entire point is to make setting retrievable for users who do not track their changes in git, or back them up in any other way. Ideally vendors would leave it enabled as well.

If we decide to include this, I think it should be opt-out rather than opt-in. Perhaps something could be done to default-disable it on boards with very small flash memories.

We might be able to gauge the impact of this by enabling it on every example in the Config repo and testing how many now run out of space.

@sjasonsmith
Copy link
Contributor

@rhapsodyv I found you a related feature request!
#7650

@thinkyhead
Copy link
Member

thinkyhead commented Nov 10, 2020

What about making a ZIP file of the configuration, boot screen, status screen, and version files and storing that instead? These files should compress extremely well. (Under 80kb in my testing.)

@thinkyhead thinkyhead changed the title Save user configs _Inside_ the firmware, M360 to dump it later Store config directly on the board Nov 11, 2020
@thinkyhead thinkyhead changed the title Store config directly on the board Backup config directly on the board Nov 11, 2020
@thinkyhead thinkyhead closed this Nov 11, 2020
@sjasonsmith
Copy link
Contributor

@thinkyhead did you mean to close this without any discussion at all?

@rhapsodyv
Copy link
Member Author

What about making a ZIP file of the configuration, boot screen, status screen, and version files and storing that instead? These files should compress extremely well. (Under 80kb in my testing.)

All marlin configs fit in less than 50kb uncompressed, less than 10kb compressed....

Just the marlin boot screen that is embed in the flash in the Color UI have 76kb.....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants