COMPLETE BigBox Firmware Plugin

Discussion in 'Guides, Mods, and Upgrades' started by tohara, Aug 5, 2016.

  1. tohara

    tohara Well-Known Member

    Joined:
    Sep 5, 2015
    Messages:
    128
    Likes Received:
    59
    I have been experimenting with compiling marlin with makefile to be able to compile and flash from the OctoPi and think I have a setup that should work, although I do not have access to my printer at the moment and can only debug on my laptop.

    Anyway I just want to share this plugin now if anyone is curious to experiment with it.

    What it does is to allow you to set up several firmware profiles by entering any #define variables in a list in the plugins settings page and save it. You can then hit the Flash Firmware button for the profile you want and the configuration files Configuration.h and Configuration_adv.h will be updated with the selected profile, compiled into a .hex file and flashed to the Rumba with avrdude.

    This plugin contains the RC6 marlin source code from https://github.com/BigBox3D/Marlin.

    I also have a RC7 version almost ready, but I want test it with RC6 first.

    Link to plugin: https://github.com/tohara/OctoPrint-BigBoxFirmware

    PluginMainPage.png ProfileSetup.png
     
    #1 tohara, Aug 5, 2016
    Last edited: Aug 5, 2016
  2. Alex9779

    Alex9779 Moderator
    Staff Member

    Joined:
    Sep 4, 2015
    Messages:
    2,405
    Likes Received:
    731
    I like the idea... Can you tell me how long it does take to compile Marlin on the RPi? Do you use an RPi2 or RPi3?
     
  3. tohara

    tohara Well-Known Member

    Joined:
    Sep 5, 2015
    Messages:
    128
    Likes Received:
    59
    @Alex9779

    I have not had access to my BB to try a compile on the RPI yet, but based on the debugging I have done using my laptop and a google cloud micro server, I think it should take 10-15 seconds.

    I have the original RPi 2 on my BB, and I will be able to do some testing on it by end of next week.

    If you want to verify this, you could install the plugin and just disconnect the USB from RPi to rumba if you don't want to flash it. The plugin would then compile and all stdout is PIPE'ed to a dialog so you can follow the process. It would just fail and issue a "make clean" and abort when it comes to the avrdude part.

    Or it is also set up so it is possible to SSH into the 'octoprint_bigboxfirmware/marlin/Marlin' folder and issue a 'make' command.

    All you should need to install on the RPi is avrdude, make and avr-libc. You will be asked to confirm install of this when you open the plugin, if it is not already installed.
     
    #3 tohara, Aug 6, 2016
    Last edited: Aug 6, 2016
  4. Alex9779

    Alex9779 Moderator
    Staff Member

    Joined:
    Sep 4, 2015
    Messages:
    2,405
    Likes Received:
    731
    Really? My MacMini is not that fast and my build server, I think I gave him all four cores running on a Xeon E3-1220 3.1GHz with 8GB RAM needs ~15 seconds...
    But if it is not too long this might be ok for me...
    Initially I thought about modifying the upload plugin to list firmwares on my buildserver...
    Your solution is even cooler, I was thinking about changing the config with scripts too but still wanted to build on a server...

    I will do a live test and see how it works. Especially if I create new profiles for the Dual Titan setup with inductive probe I am running...

    But a first suggestion, what if you make it selectable wich firmware repo to use as base? That way you could just base on original Malrin for the official config and I would be able to use it with my geek firmware where I also added new commands and changed other files than the config. Basically not delivering the source code with the plugin but selecting a Github repository and a branch in there to use?
     
  5. tohara

    tohara Well-Known Member

    Joined:
    Sep 5, 2015
    Messages:
    128
    Likes Received:
    59
    @Alex9779

    Actuall i just started looking into moving the marlin source out of the plugin package.

    I was planning to set a fixed url to a marlin git repo, but i like your idea and will make it configuarble.
     
    Alex9779 likes this.
  6. Alex9779

    Alex9779 Moderator
    Staff Member

    Joined:
    Sep 4, 2015
    Messages:
    2,405
    Likes Received:
    731
    Great! Looking forward to test it. Just have to finish a 3DHubs order...
     
  7. Stian Indal Haugseth

    Stian Indal Haugseth Well-Known Member

    Joined:
    Sep 11, 2015
    Messages:
    573
    Likes Received:
    95
    @tohara, you actually compiling the fw in RPI? I gave up and only using my mac now.
     
  8. tohara

    tohara Well-Known Member

    Joined:
    Sep 5, 2015
    Messages:
    128
    Likes Received:
    59
    Yes, using make with a customized makefile.
     
    Stian Indal Haugseth likes this.
  9. Stian Indal Haugseth

    Stian Indal Haugseth Well-Known Member

    Joined:
    Sep 11, 2015
    Messages:
    573
    Likes Received:
    95
    Will you include the makefile with the plugin?
     
  10. tohara

    tohara Well-Known Member

    Joined:
    Sep 5, 2015
    Messages:
    128
    Likes Received:
    59
    I just realized that I had put a RPi 2 in my suitcase before i left home :)

    Guess i was a bit optimistic about the compile time, it only took 6 seconds on my laptop, but on the RPi i have use 66 seconds. Anyway I don't see this as a big issue.

    Code:
    AVR Memory Usage
    ----------------
    Device: atmega2560
    
    Program:  145618 bytes (55.5% Full)
    (.text + .data + .bootloader)
    
    Data:       5368 bytes (65.5% Full)
    (.data + .bss + .noinit)
    
    
       text       data        bss        dec        hex    filename
    144836        782       4586     150204      24abc    /home/pi/.octoprint/data/bigboxfirmware/tmp/Marlin.elf
    
    Make time: 66.1563270092
     
  11. tohara

    tohara Well-Known Member

    Joined:
    Sep 5, 2015
    Messages:
    128
    Likes Received:
    59
    Stian Indal Haugseth likes this.
  12. tohara

    tohara Well-Known Member

    Joined:
    Sep 5, 2015
    Messages:
    128
    Likes Received:
    59
    @Alex9779

    I have a version using github repos tested and working until the avrdude part.
    You can now select configured github repository and branch from a drop down list in the profile editor.

    This version https://github.com/tohara/OctoPrint-BigBoxFirmware/tree/dev is based on RC7.
    (It does not contain any firmware source, but the makefile is different from RC6 and RC7, not sure if it is possible to write one that works for both)

    GithubSource.png ProfileEditorwGithub.png
     
    Alex9779 and PsyVision like this.
  13. Alex9779

    Alex9779 Moderator
    Staff Member

    Joined:
    Sep 4, 2015
    Messages:
    2,405
    Likes Received:
    731
    I tried it yesterday I think the RC6 branch but my OctoPrint didn't come up again. Had to remove it. Will try again with your newest build...
     
  14. PsyVision

    PsyVision Moderator
    Staff Member

    Joined:
    Sep 4, 2015
    Messages:
    798
    Likes Received:
    248
    I'm giving this a go now... I've just got the RC7 plugin installed and git is cloning your RC7 Marlin repository...
     
  15. PsyVision

    PsyVision Moderator
    Staff Member

    Joined:
    Sep 4, 2015
    Messages:
    798
    Likes Received:
    248
    Which branch should I select when adding a profile?
     
  16. Alex9779

    Alex9779 Moderator
    Staff Member

    Joined:
    Sep 4, 2015
    Messages:
    2,405
    Likes Received:
    731
    Tried it, was not able to get it working initially again. Created a PR on Github with a fix... And I opened a first "issue"...

    But so far it works great, the compile time is ok, flashing works, I created an own branch in my Marlin repo, loaded the Arduino file in it and your Makefile, rest is stock, then I created my own profile for the Dual Titan, and two more branches, one with the Geek changes and one with additional changes for my LED setup... It works, well compiling and flashing works, didn't test yet if I transferred every setting correct but will try that tomorrow.

    All good! Great work!
     
  17. mike01hu

    mike01hu Well-Known Member

    Joined:
    Apr 22, 2014
    Messages:
    957
    Likes Received:
    166
    @tohara , @PsyVision and @Alex9779 , will you members of the "Super Set" provide us lower class guys with an easy insight on what you have achieved and how to implement it? I got lost after the words "I tried . . ." :eek::D
     
  18. PsyVision

    PsyVision Moderator
    Staff Member

    Joined:
    Sep 4, 2015
    Messages:
    798
    Likes Received:
    248
    @Alex9779 is that BBFF branch set, BBFF/RC7 ?
     
  19. Alex9779

    Alex9779 Moderator
    Staff Member

    Joined:
    Sep 4, 2015
    Messages:
    2,405
    Likes Received:
    731
    In my repo yes... Though I am not pleased with what RC7 introduced at least for dual prints...
    I created that this night as @toharas branch is not the real tagged RC7. So I moved his Makefile and added the Arduino to the "real" RC7, that is what is in this branch.
    The RC7_Geek has the additional "Move Z to 295" entry and Z moves for 10mm. It has not additional features activated because this is not done in the repo anymore with @toharas genius plugin...

    It is very fresh and I have no idea how to commit to it, in my RC7_Alex9779 I just switched the logic they implemented for tool changes... No idea if I should do it in the Geek or even the Default too... That automatic moving head on tool changes sucks IMHO and defaulting to not doing it would be the way I would have solved it...
     
    PsyVision likes this.
  20. Alex9779

    Alex9779 Moderator
    Staff Member

    Joined:
    Sep 4, 2015
    Messages:
    2,405
    Likes Received:
    731
    Pretty simple Mike... You install a OctoPrint plugin, you tell it to use a generic Marlin repo which has no special config set, can be the default config. Unfortunately you can't use the original Marlin repo because for this to work there has to be an updated Makefile in it and for now the Arduino software.
    Then you can create profiles, @tohara included profiles for the standard builds of the BigBox so far but they are untested...
    Then you click to flash a specific profile and the plugin sets the configuration you defined in the profile, compiles Marlin with that settings and flashed it to the box.
    The whole process of compiling and flashing takes about one minute. You can have multiple profiles and switch firmwares with just a click and a minute wait...
     

Share This Page