1. Got a question or need help troubleshooting? Post to the troubleshooting forum or Search the forums!

Discussion: Marlin based web configuration tool

Discussion in 'Projects' started by Sean Carson, Jun 7, 2017.

  1. WheresWaldo

    WheresWaldo Volunteer ( ͠° ͟ʖ ͡°)
    Staff Member

    Joined:
    Feb 18, 2015
    Messages:
    5,905
    Likes Received:
    3,593
    @bamhm182 Good luck, even I am taking a break from all the mess that is now Marlin 1.1.3. The branch I use is always bugfix-1.1.x or whatever the current bugfix branch is. Right now it is too much to keep up with, so I have stopped or a month.
     
    bamhm182 and Geof like this.
  2. bamhm182

    bamhm182 Active Member

    Joined:
    Mar 17, 2014
    Messages:
    167
    Likes Received:
    87
    I was able to put in a pretty good amount of work this morning and got the Firmware/Version/Template selectors working. You can check it out at my Firmware Customizer. Next up, I have to populate the template files with variables and set up tables to read them and configure themselves. Should be pretty straight forward.

    @WheresWaldo, I added your firmwares. The way I'm planning on getting this to work is that I'll have the unmodified version of the firmware in firmwares/Marlin/Version, and then files in firmwares/Marlin/Version_templates will contain the variables needed to set up the firmware. With that, it would be helpful if you still had the original/unmodified version of the marlin firmware you pulled on 20170515 that I could use for the base. Do you still have that by chance? I understand I could go back through any of your firmwares and look for BH, which I am fully willing to do, but I just figured it would be a little easier if you still had it. Thank you in advance.
     
    mark tomlinson likes this.
  3. WheresWaldo

    WheresWaldo Volunteer ( ͠° ͟ʖ ͡°)
    Staff Member

    Joined:
    Feb 18, 2015
    Messages:
    5,905
    Likes Received:
    3,593
    @bamhm182 I would love to help make this easier for you but when I download the files from GITHUB, since I have no interest in adding these configurations back to the main Marlin GITHUB, nor are they interested, I just download the zip file. The problem is that the zip file has the same name no matter what day I download them, that is a function of GITHUB. I do not use GIT Desktop as I don't maintain a repository of these files nor my own fork.

    So basically I download the current files as a zip. Unzip and name the directory with the date I unzip them. Start modifying the files in that directory and then use a file compare utility to make sure I catch all the lines I need to change. Once a single version is complete I test compilation. If it compiles I zip them into the file sets you see here, then start with the next variation. When I am done, I have the self-created zip files and a modified version of the firmware on my PC. At that point there isn't a single unmodified version. There also are no previous version of the unmodified files.

    You cannot go by the date I used either, since I generally download the files the day before I upload them here. Typically files listed as May 4th may really be files from GITHUB on May 3rd and there may or may not be significant code changes on May 4th. Those of course won't be reflected in my file set.

    That is not the way a programmer would do it, but that was how I started in the very beginning and just kept doing it that way. It also is very different than the way I handle Marlin 1.0.2 that I have forked and use for the KLD-LCD1260 Resin Printer. I keep a repository of that fork and keep it updated as I would if I was the originator of the code.
     
    bamhm182 likes this.
  4. mark tomlinson

    mark tomlinson ༼ つ ◕_ ◕ ༽つ
    Staff Member

    Joined:
    Feb 21, 2013
    Messages:
    23,912
    Likes Received:
    7,338
    THERE IS A DESKTOP VERSION????

    :)

    I am stuck with the command line for mine. Old fart that I am...
     
    bamhm182 likes this.
  5. WheresWaldo

    WheresWaldo Volunteer ( ͠° ͟ʖ ͡°)
    Staff Member

    Joined:
    Feb 18, 2015
    Messages:
    5,905
    Likes Received:
    3,593
  6. bamhm182

    bamhm182 Active Member

    Joined:
    Mar 17, 2014
    Messages:
    167
    Likes Received:
    87
    @WheresWaldo, it is no problem at all. Would honestly only save me a couple minutes. One of those doesn't hurt to ask, but in no way a game-changer type deals. I didn't expect you to have anything serious set up for this, just thought if your download folder looks anything like mine, the original zip might be there. As for the dates, it's completely irrelevant if it's off by a day or so IMO. If I add a version, I'll probably try to keep it accurate to the day, but the day is really just for history tracking (this version came before this one which came before this one and so on). It sounds to me like there is no real tracking of anything with Marlin, so I seriously doubt a time will arise when someone goes "You said you pulled the firmware on this date, but there were significant pushes on that date that aren't part of your firmware!" and if there are, I'll just point them to the next date down or add a new version if there isn't a newer one already.
     
    mark tomlinson likes this.
  7. bamhm182

    bamhm182 Active Member

    Joined:
    Mar 17, 2014
    Messages:
    167
    Likes Received:
    87
    I'm thinking that I'd like to have the firmware pages be created dynamically, so I'm thinking that to do that I'm going to have two separate files. One will contain the list of all the fields and will look something like this:
    Code:
    #Category            | Friendly Name              | Variable Name                   | HTML Field Type
    #----------------------------------------------------------------------------------------------------
    Printer_Setup        | Motherboard_Type           | gctMotherboard                  | number
    Printer_Setup        | Printer_Name               | gctPrinterName                  | text
    Printer_Setup        | Printer_UUID               | gctPrinterUUID                  | text
    Printer_Setup        | Number_of_Extruders        | gctExtrduerCount                | number
    Printer_Setup        | Type_of_Power_Supply       | gctPowerSupply                  | number
    
    Temperature_Control  | Thermistor_0_Type          | gctTempSensor0                  | number
    Temperature_Control  | Thermistor_1_Type          | gctTempSensor1                  | number
    Temperature_Control  | Thermistor_2_Type          | gctTempSensor2                  | number
    Temperature_Control  | Bed_Thermistor_Type        | gctTempSensorBed                | number
    The other will contain a list of the variables that are set up for each template and have a few extra fields for information. It will look something like this:
    Code:
    #Creator: bamhm182
    #Description: This is an example template file to demonstrate an idea.
    #Variable Name                   | Value
    #----------------------------------------------------------------------------------------------------
    gctMotherboard                   | 33
    gctPrinterName                   | "ROBOR1PLUSV1"
    gctPrinterUUID                   | "00000000-0000-0000-0000-000000000000"
    gctExtrduerCount                 | 1
    gctPowerSupply                   | 1
    
    gctTempSensor0                   | 1
    gctTempSensor1                   | 0
    gctTempSensor2                   | 0
    gctTempSensorBed                 | 1
    Although the two files aren't yet implemented in my website, those two files would generate the screen you currently see when you select any firmware, version, and template combination on the Firmware Customizer.

    Thoughts?

    EDIT: I'm planning on using the pipe as the delimiter because I can't think of any other time I would need to use a pipe in these files.
     
    #27 bamhm182, Jun 17, 2017
    Last edited: Jun 17, 2017
    mark tomlinson likes this.
  8. bamhm182

    bamhm182 Active Member

    Joined:
    Mar 17, 2014
    Messages:
    167
    Likes Received:
    87
    Just posting an update to let everyone know that I haven't entirely forgotten about this project. I put in a good amount of effort tonight and made some good progress. You can now go to the Firmware Customizer and select Marlin > Robo3D (LEADSCREW V1) > Official and it'll load variables you can mess around with. You can press the Create button at the bottom and it will put the variables together into a file that's intended to be imported into the Configuration.h or wherever else it is needed and provide variables that are called throughout those files. It copies all the files into a folder that is specific to your build, then it zips them and provides you a link to download the zip.

    Right this second, the Configuration.h of that firmware hasn't been modified to let it interact with my file (GCTVariables.h), but that shouldn't be TOO time consuming to implement, so I'm going to try to finish that before calling it a night.

    EDIT: On second though, I was just reminded that the firmware I've been testing the templates with has issues that don't allow it to be build correctly on newer versions of the arduino IDE anyway, so fixing that would be a good next-step. I don't feel like doing that right this second though, so I'm headed to bed.
     
    #28 bamhm182, Jul 27, 2017
    Last edited: Jul 27, 2017
  9. WheresWaldo

    WheresWaldo Volunteer ( ͠° ͟ʖ ͡°)
    Staff Member

    Joined:
    Feb 18, 2015
    Messages:
    5,905
    Likes Received:
    3,593
    @bamhm182 The Robo provided firmware being based on Marlin version 1.0.0 uses an outdated construct in the code enabling SD card functionality. Robo has never fixed this and it is left to the end user to do a global search and replace for the handful of references to the old construct and replace it with the new construct. That is all that is required to compile on any version of the Arduino IDE 1.6.2 or newer. This should be done since we are well past that version of the Arduino compiler.
     
    bamhm182 likes this.
  10. bamhm182

    bamhm182 Active Member

    Joined:
    Mar 17, 2014
    Messages:
    167
    Likes Received:
    87
    I've fixed it before, I remember it wasn't too difficult. I just didn't feel like doing it last night.
     
    mark tomlinson likes this.
  11. mark tomlinson

    mark tomlinson ༼ つ ◕_ ◕ ༽つ
    Staff Member

    Joined:
    Feb 21, 2013
    Messages:
    23,912
    Likes Received:
    7,338
    Yea, it is like a two line fix. Annoying since they should have a setting in the compiler to adhere to older standards if you choose.
    I "get" that it is a simple GUI ... The alternative would be for Robo to maintain that older code ;)
     
    bamhm182 likes this.
  12. WheresWaldo

    WheresWaldo Volunteer ( ͠° ͟ʖ ͡°)
    Staff Member

    Joined:
    Feb 18, 2015
    Messages:
    5,905
    Likes Received:
    3,593
    All Robo would need to do is the simple search and replace then reupload. Problem solved. Why this hasn't been done yet amazes me.
     
    bamhm182 likes this.
  13. bamhm182

    bamhm182 Active Member

    Joined:
    Mar 17, 2014
    Messages:
    167
    Likes Received:
    87
    Yeah, I don't know how they've never done it either. I got all the errors resolved in less than 20 minutes. There was also a redefine issue with the pins.h file. Also a simple fix.

    Anyway, I have the fixed files for that firmware uploaded and started replacing the static variables with the ones I created and imported the GCTVariables.h file. Ran into a couple snags that I fixed regarding my variables file. I think the next one I'll have to fix is to translate a checked box to toggle a variable. I don't think that'll be too big of an issue though.

    I'd also like to add the ability for my website to try and build the code before it is provided to the user and if it fails, output the error and give them an option to email me with it. I feel like that MIGHT be a little overkill though. Haha.
     
  14. WheresWaldo

    WheresWaldo Volunteer ( ͠° ͟ʖ ͡°)
    Staff Member

    Joined:
    Feb 18, 2015
    Messages:
    5,905
    Likes Received:
    3,593
    Are you precompiling the source into a .HEX file?
     
  15. bamhm182

    bamhm182 Active Member

    Joined:
    Mar 17, 2014
    Messages:
    167
    Likes Received:
    87
    It's in the plans, just haven't done it yet. I downloaded the arduino ide on my server and figured out how to build the file manually. Now all I should have to do is figure out how to automate that.
     
  16. WheresWaldo

    WheresWaldo Volunteer ( ͠° ͟ʖ ͡°)
    Staff Member

    Joined:
    Feb 18, 2015
    Messages:
    5,905
    Likes Received:
    3,593
    Also I would focus on releases only, if someone needs a web configuration program likely they shouldn't be messing with buggy pre-releases.
     
    bamhm182 likes this.
  17. bamhm182

    bamhm182 Active Member

    Joined:
    Mar 17, 2014
    Messages:
    167
    Likes Received:
    87
    Alright. I got it to build the hex file and link to it. I set the build location to be inside of the arduino project file, so it's also in the zip file in a folder called build. I also cleaned up the page you enter the values on so that the categories collapse and are collapsed by default. I figured it would probably get a bit overwhelming if the page is incredibly long and that'll allow them to get an overview of everything you can change without actually seeing everything at the same time. I'm thinking I'd like to add a Google captcha to prevent my website from getting wrecked by a create-happy bot, and also create a job that'll go through and automatically delete older firmwares based on time & hdd space thresholds.

    EDIT: Alright, I've got the reCaptcha and script to delete old firmwares enabled. Unless anyone can think of anything else that needs to be added, I think that all there is left to do is to finish making the templates. I may have a go at making the dropdown links a bit more stylized at a later point in time.
     
    #37 bamhm182, Jul 29, 2017
    Last edited: Jul 29, 2017
    mark tomlinson likes this.
  18. bamhm182

    bamhm182 Active Member

    Joined:
    Mar 17, 2014
    Messages:
    167
    Likes Received:
    87
    Alright, so I believe that I have everything implemented. Everything I can think of has been added to the template for Marlin>Robo3D(LEADSCREW)>Official and should be working as expected. This template took the longest because I was figuring things out along the way and trying to decide on good ways to implement certain variable types. The rest should be a breeze to create.

    Can I please have you take a look at it, @WheresWaldo and tell me if you have any suggestions for things I could add? If anyone else wants to test it out as well, it would be greatly appreciated.

    EDIT: I think one thing I don't have added yet that may come in handy is an info link. I'm thinking of adding a info button that people can click on next to the title of specific fields and having it pop up a new window with information on stuff like motherboard numbers, thermistor numbers, etc.

    EDIT 2: Got the info button set up. Now all I have to do is add "(*i*)" to the friendly name of the variables. For example, "Motherboard Type" becomes "Motherboard Type (*i*)" and it will automatically have a linked info button taking you to the page for that variable name in a small pop-up window.
     
    #38 bamhm182, Jul 31, 2017
    Last edited: Jul 31, 2017
    mark tomlinson likes this.
  19. WheresWaldo

    WheresWaldo Volunteer ( ͠° ͟ʖ ͡°)
    Staff Member

    Joined:
    Feb 18, 2015
    Messages:
    5,905
    Likes Received:
    3,593
    So the only one complete is the Robo Official firmware? Since I only used the Official a few days I am not sure I can tell you what is needed to be added.
     
  20. bamhm182

    bamhm182 Active Member

    Joined:
    Mar 17, 2014
    Messages:
    167
    Likes Received:
    87
    That's right, for now. Fair enough. Anything you would change as far as usability goes? Anything aside from what variables are actually available to you?
     

Share This Page