Code Monkey home page Code Monkey logo

marlin-console-configurator's Introduction

Release Buy me a beer

Marlin Console Configurator

The life is too short to configure Marlin

If you want to modify and share easily your Marlin configuration, Marlin Console Configurator is for YOU.

This tool will help you to disable, enable and changes values into your Marlin firmware (currently Configuration.h & Configuration_adv.h) with just only a minimalistic wanted config.

Cool things:

  • No need to fork Marlin repository, and have a git pull-rebase-conflicts-f**k. Just download/clone last Marlin sources and run marlin-console-configuration onto wanted profile.
  • No more Ctrl+F to find the constant to change
  • Same Marlin version/code, when you can apply the wanted profile of targeted printer
  • Share profile with friends, or on a tutorial.
  • It is not doing anything else than modifying C/C++ header files (.h), so it don't care about Marlin version !
  • It will not add/remove/reorder constants, but just modifying only what you wanted into your profile :)

Bad things:

  • This tool is so quick that you have no time to take a coffee while it is running :D
  • Complex guys that loves complex things won't love it... Too simple !

Go quickly with docker

Just run the following command.

cd /path/to/Marlin
docker run --rm -it -v ${PWD}:/app/files chuckame/marlin-console-configurator help

Since docker need to access to your Marlin configuration folder/files AND your profile, this is why there is ${PWD}:/app/files volume. But, because of this volume, you cannot go trought the current folder's parents using ../ from marlin-console-configurator parameters.

Example for apply command with the following folder architecture:

3d-printing/
├── profiles/
│   ├── ender-3-pro-base.yaml
│   ├── ender-3-pro-mbl.yaml
│   ├── ender-3-pro-runout-sensor.yaml
│   └── ender-3-pro-abl.yaml
└── MarlinFirmware/
    └── Marlin/
        ├── Configuration.h
        └── Configuration_adv.h

Execute the command:

cd 3d-printing/
docker run --rm -it -v ${PWD}:/app/files chuckame/marlin-console-configurator apply ./MarlinFirmware/Marlin -p ./profiles/ender-3-pro.yaml

Actually only compatible with amd64 architectures. If you want to execute on other arch, like armv7 for raspberry pi, you can directly use binaries, while you can create an issue if you really want marlin-console-configurator on your arch.

Docker alternative: Downloading binaries

Download marlin-console-configurator.zip from Releases and extract it.

The unzipped folder will contain those files:

marlin-console-configurator/
├── bin/
│   ├── marlin-console-configurator      # Entrypoint script for unix-like OS
│   └── marlin-console-configurator.bat  # Entrypoint script for windows OS
└── lib/
    └── marlin-console-configurator.jar  # The marlin-console-configurator

How to use it:

Linux, MacOS, unix-like

cd ./marlin-console-configurator/bin
./marlin-console-configurator help

Windows

cd ./marlin-console-configurator/bin
marlin-console-configurator.bat help

Execute from sources

./gradlew bootRun help

How to use it

Concrete example: show all changes without saving (just output to console)

marlin-console-configurator apply ./Marlin -p ./ender-3-base.yml ./ender-3-abl.yml

You will see something like this: apply-without-saving

Concrete example: show all changes and save modifications to Marlin firmware files

marlin-console-configurator apply ./Marlin -p ./ender-3-abl.yml --save

Only needed modifications will be saved.

Concrete example: Create a profile from your current config

marlin-console-configurator generate-profile ./Marlin -o ./my-new-profile.yml

Usage

Usage: marlin-console-configurator [command] [command options]
  Commands:
    apply      Apply the given profile to marlin constants files, that will enable, change value or disable constants into marlin 
            configuration files
      Usage: apply [options] /path1 /path2 ...	File or directory path(s) where all changes will be applied
        Options:
        * --profiles, -p
            Profile's path(s) (space separated) containing changes to apply. Format: yaml
          --save, -s
            When is present, will save changes to files. Else, just display changes without saving
            Default: false
          --verbose, -v
            when present, all non-changed line are printed
            Default: false
          --yes, -y
            when present, the changes will be saved without prompting the user
            Default: false

    diff      Display differences between marlin configuration files
      Usage: diff [options]
        Options:
        * --left
            marlin configuration folder or files paths for the base of diff
        * --right
            marlin configuration folder or files paths to know what was changed since --source paths

    generate-profile      Generate a profile from given marlin constants files
      Usage: generate-profile [options] /path1 /path2 ...	The marlin constants folder or files paths
        Options:
          --diff-from
            The marlin constants folder or files paths from where you want to make a diff. If gathered, the generated profile will contains 
            only the diff between those files and the command files
        * --output, -o
            The output profile path, will be overwritten if already existing file. If 'console' is specified, the profile will just be 
            printed to the console

    help      Display this help message
      Usage: help

A problem?

Please go to Issues, find a similar issue, or create a new one with your problem.

Credits

Made with ❤️ by Chuckame

marlin-console-configurator's People

Contributors

chuckame avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

marlin-console-configurator's Issues

Add warning when marlin source not found properly

Hello!

First, great idea for a project really dig it! When I went to create a config from the default marlin for my printer at first I kept getting an empty set of settings in the yml file. I realized I was being thick and when specifying the marlin folder i was specifying the root folder of the cloned marlin repo NOT the Marlin subfolder that contains the actual firmware. Once I added that subfolder it created the config fine.

So I would just suggest to add a feature that gives a warning if it does not find the firmware rather than spitting out an empty config. Might help some people, particularly if they are unfamiliar with Docker and its volume mounts and don't end up mounting the volumes correctly.

Great job, looking forward to see how this project progresses!

Not parsing lines ending by backslash

Want to parse this to profile:

    #define MMU2_LOAD_TO_NOZZLE_SEQUENCE \
      {  7.2,  562 }, \
      { 14.4,  871 }, \
      { 36.0, 1393 }, \
      { 14.4,  871 }, \
      { 50.0,  198 }

Expected something like that:

enabled:
  MMU2_LOAD_TO_NOZZLE_SEQUENCE: "\
      {  7.2,  562 }, \
      { 14.4,  871 }, \
      { 36.0, 1393 }, \
      { 14.4,  871 }, \
      { 50.0,  198 }"

Actual:

enabled:
  MMU2_LOAD_TO_NOZZLE_SEQUENCE: \

Feature Request: generate-profile builds diff

As a user
I want to be able to take an existingly modified version of Marlin, plus the original unmodified Marlin source that it was derived from, and generate a profile yaml file which only contains the changes that were made to the unmodified source to get to the modified version.
So that I can take my existing modified marlin and create as minimal a profile.yaml as possible

TLDR, I think that while the generate-profile command is nice, it creates a lot of noise - you end up with every single constant and the current value (Be it the original value or your new one), when all you really are interested in is what you changed

Given an unaltered Marlin folder Marlin
And a modified Marlin folder Modified
When I execute a command similar to marlin-console-configurator generate-profile ./Marlin ./Modified -d ./diff.yaml
Then diff.yaml is created with ONLY the differences between Marlin and Modified

ie:
Original Marlin source (Marlin\Configuration.h):

//#define CUSTOM_MACHINE_NAME "3D Printer"
#define SOME_CONSTANT "Foo"

Modified Marlin source (Modified\Configuration.h)

#define CUSTOM_MACHINE_NAME "MyPrinterName"
#define SOME_CONSTANT "Foo"

Output (diff.yaml):

enabled:
   CUSTOM_MACHINE_NAME: '"MyPrinterName"'

Hide files and settings that have no changes unless verbose on apply

This is a feature request to make the default output of apply operation to hide files and settings that will not be changed to show only the differences unless verbose output is requested.

This is needed particularly when dealing with Marlin 1.X due to the sheer number of files it lists. It is a huge list of "nothing to do" to sift through to see the actual changes.

Thanks again!

com.fasterxml.jackson.databind.exc.MismatchedInputException

Hi, I cannot get this software to work - any ideas what I am doing wrong?

marlin-console-configurator apply ./Marlin -p ./profile.yaml
com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot construct instance of `java.util.LinkedHashMap` (although at least one Creator exists): no String-argument constructor/factory method to deserialize from String value ('CUSTOM_MACHINE_NAME "foo"')
 at [Source: (byte[])"enabled:
  CUSTOM_MACHINE_NAME "foo"
"; line: 2, column: 3] (through reference chain: fr.chuckame.marlinfw.configurator.profile.ProfileProperties["enabled"])

profile.yaml:

enabled:
  CUSTOM_MACHINE_NAME: '"foo"'

Am on windows, also tried marlin-console-configurator apply .\Marlin -p .\profile.yaml but same error

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.