Coder Social home page Coder Social logo

mmone / marlintool Goto Github PK

View Code? Open in Web Editor NEW
35.0 15.0 20.0 71 KB

A shell script for setting up a standalone Marlin build environment on Raspberry Pi and Linux in general.

License: GNU Lesser General Public License v3.0

Shell 100.00%
marlin raspberrypi linux tool 3d-printing arm shell

marlintool's Introduction

THIS SOLUTION IS NO LONGER MAINTAINED.

Follow the official building guide based on PlatformIO instead: /marlinfw.org/docs/basics/install_platformio_cli.html

marlintool

This script sets up the build environment, collects dependencies and provides commands for building and uploading Marlin from the commandline. It uses the official Arduino toolchain. Everything is standalone nothing is installed outside the marlintool directory.

Build configuration

Before first use: Rename the marlintool.params.example file to "marlintool.params"

In its default configuration the script is setup to build the official Marlin firmware but can be easily reconfigured to build any Marlin fork/variant.

Several additional parameters in the "marlintool.params" file allow to adapt the script to your needs.

parameter description
marlinRepositoryUrl The marlin git repository.
marlinRepositoryBranch The branch of the configured repo to use.
marlinDependencies A list of dependencies to download in the format:
[name],[repo url],[library directory](optional).
A library directory should only be specified if the library is not in the root of the repository.
hardwareDefinitionRepo If you build for the Anet board this downloads the necessary hardware definition for the Arduino build environment. If you dont need this set it to an empty string.
boardString The Anet board identifier.
arduinoToolchainVersion The Arduino toolchain version to use. The build platform and architecture are auto detected. At the moment Linux 32 Bit, 64 Bit, ARM and OS X are supported.
port The serialport to use for uploading.
arduinoDir Where to put the Arduino toolchain.
marlinDir Where to checkout Marlin sources.
buildDir The build directory.

Reminder: If you are running octopi on you Raspberry you need to disconnect it from your printer before uploading, otherwise the serial port is blocked.

Note: On OS X due to how the Arduino toolchain is packaged the Arduino splash screen will be displayed even when the toolchain is used from the commandline. This will cause the terminal window you launch marlintool from to lose focus. It also means that a build cannot be launched from a remote ssh session.

Building for Anet Hardware

If you are building the firmware for the Anet A6/A8 you can find suitable example configurations in the Marlin sources at: github.com/MarlinFirmware/Marlin/tree/1.1.x/Marlin/example_configurations/Anet. Just replace the "Configuration.h" and "Configuration_adv.h" in the marlin directory with the files your find there for a good starting point of your configuration.

Available commandline parameters

-s --setup

Download and configure the toolchain and the necessary libraries for building Marlin.
Also fetches the Anet board hardware definition from github if specified.

-m --marlin

Download Marlin sources.

-f --fetch

Update an existing Marlin clone.

-v --verify

Build without uploading.

-u --upload

Build and upload Marlin. If you are running octopi on you Raspberry
you need to disconnect it before uploading otherwise the serial port is blocked.

-b --backupConfig [name]

Backup the Marlin configuration to the named backup.

-r --restoreConfig [name]

Restore the given configuration into the Marlin directory.

-c --clean

Cleanup everything. Remove Marlin sources and Arduino toolchain.

-p --port [port]

Set the serialport for uploading the firmware. Overrides the default set in the script.

-h --help

Show help.

marlintool's People

Contributors

jhol avatar mmone avatar tssva avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

marlintool's Issues

Anet Optiboot support

For flashing an Anet Board with Optiboot bootloader change

boardString="anet:avr:anet"

to

boardString="anet:avr:aneto"

in marlintool.params

No command line params == nothing done

I think if you added the following right before your loop over the command line, marlintool would be even more awesome than it already is. :) Thanks for writing this.

if [ "$1" = "" ]; then printDocu; exit 1; fi

downloads from arduino broken

Tried to refetch arduino code today - checked everything else first, then discovered downloads-02.arduino.cc doesn't work.

Tried downloads.arduino.cc from a wget and that worked so I modified marlintool.sh and that worked - but refuses to overwrite existing folders..

Marlintool crashes when reading AVR after flash

I have an Anet A8and have been using marlintool for about a year. I upgraded to Marlin 1.1.9 and succesfully built and uploaded to the ANET main board.
I made a few minor changes to my Configuration.h, and tried to build and upload. Builds successfully, uploads successfully, however when it goes to read the flash after it is done writing, it will get between 1 and 3 # symbols, and the Anet mainboard reboots, and marlintool says An error occurred while uploading the sketch.
/home/pi/marlintool/arduino/hardware/tools/avr/bin/avrdude -C/home/pi/marlintool/arduino/hardware/tools/avr/etc/avrdude.conf -v -patmega1284p -carduino -P/dev/ttyUSB0 -b57600 -D -Uflash:w:/home/pi/marlintool/./build/Marlin.ino.hex:i

avrdude: Version 6.3, compiled on Dec 16 2016 at 12:14:49
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2014 Joerg Wunsch

     System wide configuration file is "/home/pi/marlintool/arduino/hardware/tools/avr/etc/avrdude.conf"
     User configuration file is "/home/pi/.avrduderc"
     User configuration file does not exist or is not a regular file, skipping

     Using Port                    : /dev/ttyUSB0
     Using Programmer              : arduino
     Overriding Baud Rate          : 57600
     AVR Part                      : ATmega1284P
     Chip Erase delay              : 55000 us
     PAGEL                         : PD7
     BS2                           : PA0
     RESET disposition             : dedicated
     RETRY pulse                   : SCK
     serial program mode           : yes
     parallel program mode         : yes
     Timeout                       : 200
     StabDelay                     : 100
     CmdexeDelay                   : 25
     SyncLoops                     : 32
     ByteDelay                     : 0
     PollIndex                     : 3
     PollValue                     : 0x53
     Memory Detail                 :

                              Block Poll               Page                       Polled
       Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
       ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
       eeprom        65    10   128    0 no       4096    8      0  9000  9000 0xff 0xff
       flash         65    10   256    0 yes    131072  256    512  4500  4500 0xff 0xff
       lock           0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
       lfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
       hfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
       efuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
       signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00
       calibration    0     0     0    0 no          1    0      0     0     0 0x00 0x00

     Programmer Type : Arduino
     Description     : Arduino
     Hardware Version: 2
     Firmware Version: 1.16
     Vtarget         : 0.0 V
     Varef           : 0.0 V
     Oscillator      : Off
     SCK period      : 0.1 us

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.00s

avrdude: Device signature = 0x1e9705 (probably m1284p)
avrdude: reading input file "/home/pi/marlintool/./build/Marlin.ino.hex"
avrdude: writing flash (122320 bytes):

Writing | ################################################## | 100% 30.13s

avrdude: 122320 bytes of flash written
avrdude: verifying flash memory against /home/pi/marlintool/./build/Marlin.ino.hex:
avrdude: load data flash data from input file /home/pi/marlintool/./build/Marlin.ino.hex:
avrdude: input file /home/pi/marlintool/./build/Marlin.ino.hex contains 122320 bytes
avrdude: reading on-chip flash data:

Reading | ##
An error occurred while uploading the sketch

Setup fails after upgrade

asince updating marlintool I can't get it to fetch the marlin sources or the dependancies

`./marlintool.sh -s

Setting up build environment in "./arduino" ...

Downloading Arduino environment ...

--2018-03-19 17:01:59-- http://downloads-02.arduino.cc/arduino--linuxarm.tar.xz
Resolving downloads-02.arduino.cc (downloads-02.arduino.cc)... 158.69.86.55
Connecting to downloads-02.arduino.cc (downloads-02.arduino.cc)|158.69.86.55|:80... connected.
HTTP request sent, awaiting response... 404 Not Found
2018-03-19 17:01:59 ERROR 404: Not Found.

Unpacking Arduino environment. This might take a while ...

tar: arduino--linuxarm.tar.xz: Cannot open: No such file or directory
tar: Error is not recoverable: exiting now
rm: cannot remove 'arduino--linuxarm.tar.xz': No such file or directory

Downloading libraries ...

Cloning into 'LiquidCrystal_I2C'...
remote: Counting objects: 7, done.
remote: Total 7 (delta 0), reused 0 (delta 0), pack-reused 7
Unpacking objects: 100% (7/7), done.
mv: cannot move 'LiquidCrystal_I2C/LiquidCrystal_I2C' to '/libraries/LiquidCrystal_I2C': No such file or directory
Cloning into 'LiquidTWI2'...
remote: Counting objects: 126, done.
remote: Total 126 (delta 0), reused 0 (delta 0), pack-reused 126
Receiving objects: 100% (126/126), 29.04 KiB | 0 bytes/s, done.
Resolving deltas: 100% (68/68), done.
mv: cannot move 'LiquidTWI2/' to '/libraries/LiquidTWI2': No such file or directory
Cloning into 'U8glib_Arduino'...
remote: Counting objects: 270, done.
remote: Total 270 (delta 0), reused 0 (delta 0), pack-reused 270
Receiving objects: 100% (270/270), 1.31 MiB | 1.10 MiB/s, done.
Resolving deltas: 100% (157/157), done.
mv: cannot move 'U8glib_Arduino/' to '/libraries/U8glib_Arduino': No such file or directory
Cloning into 'TMC2130Stepper'...
remote: Counting objects: 710, done.
remote: Compressing objects: 100% (28/28), done.
remote: Total 710 (delta 22), reused 34 (delta 18), pack-reused 663
Receiving objects: 100% (710/710), 237.98 KiB | 0 bytes/s, done.
Resolving deltas: 100% (429/429), done.
mv: cannot move 'TMC2130Stepper/' to '/libraries/TMC2130Stepper': No such file or directory
`

Looks Great -- Future Plans?

Hey @mmone --- this is really the only way I have to reach out to you. I hope you're well. We were discussing some different distribution methods for Klipper, I came to do another fork of your octoprint plugin, and noticed this marlintool project. Can you tell me a little about it? It looks like something I would have substantial interest in. I am attempting to utilize some kind of container system like docker that is architecture agnostic for different distributions of Klipper.... i'm curious, what is the primary purpose of this project?

does nothing but download stuff, doesn't matter witch command i use

➜ marlintool git:(master) ./marlintool.sh -s
./marlintool.sh: 41: ./marlintool.sh: function: not found
-e
Downloading Arduino environment ...

--2017-05-02 14:25:18-- http://downloads-02.arduino.cc/arduino-1.8.2-linuxarm.tar.xz
Resolving downloads-02.arduino.cc (downloads-02.arduino.cc)... 158.69.86.55
Connecting to downloads-02.arduino.cc (downloads-02.arduino.cc)|158.69.86.55|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 78667712 (75M) [application/octet-stream]
Saving to: ‘arduino-1.8.2-linuxarm.tar.xz’

arduino-1.8.2-linuxarm.tar. 100%[===========================================>] 75.02M 14.6MB/s in 6.1s

2017-05-02 14:25:25 (12.2 MB/s) - ‘arduino-1.8.2-linuxarm.tar.xz’ saved [78667712/78667712]

-e
Unpacking Arduino environment. This might take a while ...
./marlintool.sh: 53: ./marlintool.sh: function: not found
-e
Downloading libraries ...

Cloning into 'LiquidCrystal_I2C'...
remote: Counting objects: 7, done.
remote: Total 7 (delta 0), reused 0 (delta 0), pack-reused 7
Unpacking objects: 100% (7/7), done.
Checking connectivity... done.
Cloning into 'LiquidTWI2'...
remote: Counting objects: 126, done.
remote: Total 126 (delta 0), reused 0 (delta 0), pack-reused 126
Receiving objects: 100% (126/126), 29.04 KiB | 0 bytes/s, done.
Resolving deltas: 100% (68/68), done.
Checking connectivity... done.
Cloning into 'U8glib_Arduino'...
remote: Counting objects: 270, done.
remote: Total 270 (delta 0), reused 0 (delta 0), pack-reused 270
Receiving objects: 100% (270/270), 1.31 MiB | 1.34 MiB/s, done.
Resolving deltas: 100% (157/157), done.
Checking connectivity... done.
./marlintool.sh: 73: ./marlintool.sh: function: not found
-e
Cloning Marlin "https://github.com/SkyNet3D/Marlin"...

Cloning into 'Marlin'...
remote: Counting objects: 53894, done.
remote: Total 53894 (delta 0), reused 0 (delta 0), pack-reused 53894
Receiving objects: 100% (53894/53894), 39.94 MiB | 10.67 MiB/s, done.
Resolving deltas: 100% (35230/35230), done.
Checking connectivity... done.

➜ marlintool git:(master) ✗ ./marlintool.sh -u
./marlintool.sh: 41: ./marlintool.sh: function: not found
-e
Downloading Arduino environment ...

--2017-05-02 14:26:17-- http://downloads-02.arduino.cc/arduino-1.8.2-linuxarm.tar.xz
Resolving downloads-02.arduino.cc (downloads-02.arduino.cc)... 158.69.86.55
Connecting to downloads-02.arduino.cc (downloads-02.arduino.cc)|158.69.86.55|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 78667712 (75M) [application/octet-stream]
Saving to: ‘arduino-1.8.2-linuxarm.tar.xz’

arduino-1.8.2-linuxarm.tar.xz 100%[==========================================================================================================================================>] 75.02M 15.7MB/s in 5.4s

2017-05-02 14:26:23 (13.8 MB/s) - ‘arduino-1.8.2-linuxarm.tar.xz’ saved [78667712/78667712]

mkdir: cannot create directory ‘./arduino’: File exists
-e
Unpacking Arduino environment. This might take a while ...
./marlintool.sh: 53: ./marlintool.sh: function: not found
-e
Downloading libraries ...

Cloning into 'LiquidCrystal_I2C'...
remote: Counting objects: 7, done.
remote: Total 7 (delta 0), reused 0 (delta 0), pack-reused 7
Unpacking objects: 100% (7/7), done.
Checking connectivity... done.
Cloning into 'LiquidTWI2'...
remote: Counting objects: 126, done.
remote: Total 126 (delta 0), reused 0 (delta 0), pack-reused 126
Receiving objects: 100% (126/126), 29.04 KiB | 0 bytes/s, done.
Resolving deltas: 100% (68/68), done.
Checking connectivity... done.
Cloning into 'U8glib_Arduino'...
remote: Counting objects: 270, done.
remote: Total 270 (delta 0), reused 0 (delta 0), pack-reused 270
Receiving objects: 100% (270/270), 1.31 MiB | 2.24 MiB/s, done.
Resolving deltas: 100% (157/157), done.
Checking connectivity... done.
./marlintool.sh: 73: ./marlintool.sh: function: not found
-e
Cloning Marlin "https://github.com/SkyNet3D/Marlin"...

fatal: destination path 'Marlin' already exists and is not an empty directory.

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.