renaud11232 / octoprint-marlin-flasher Goto Github PK
View Code? Open in Web Editor NEWArduino/Marlin firmware flasher for OctoPrint
License: MIT License
Arduino/Marlin firmware flasher for OctoPrint
License: MIT License
OP has changed to flask v 0.12.5 and this plugin downgrades flask to 0.10, causing op to fail dependencies during startup.
Since newer versions of arduino-cli provide a way to add board manifest without editing the config files, it would be nice to configure this directly in the settings
I have the sanguino board (core) loaded. I got the installed message. I put up a hex file. Now I'm getting "board option fetch failed". Any idea what could cause this?
It would be great to get feedback on what is going on when flashing (compiling, flashing, reading, writing, etc.). Not sure if this is possible.
Running Octoprint on x86 CPU. Here's the full error.
Error during Upload: cannot execute upload tool: fork/exec /root/.arduino15/packages/arduino/tools/avrdude/6.3.0-arduino14/bin/avrdude: no such file or directory
I have verified avrdude
is present and executable. I also replaced that executable with one I installed manually from the OS repo, that did not work either. Same error no such file or directory
~/.octoprint # ls -la /root/.arduino15/packages/arduino/tools/avrdude/6.3.0-arduino14/bin/avrdude
-rwxr-xr-x 1 root root 537192 Mar 1 23:01 /root/.arduino15/packages/arduino/tools/avrdude/6.3.0-arduino14/bin/avrdude
~/.octoprint # ls
arduino-cli config.yaml logs scripts supervisord.log translations watched
avrdude data plugins slicingProfiles supervisord.pid uploads
config.backup generated printerProfiles socat.sh timelapse virtualSd
~/.octoprint # rm /root/.arduino15/packages/arduino/tools/avrdude/6.3.0-arduino14/bin/avrdude
~/.octoprint # mv avrdude /root/.arduino15/packages/arduino/tools/avrdude/6.3.0-arduino14/bin/
Just for the sake of clarification, is this the same as the firmware updater but without the added step of compiling a hex file in arduino ide first?
Is it possible to just have it uncompressed in a directory so people can just text edit whatever files they may need to?
Recreated from #5
I have Tronxy X3A, running 1.0 marlin on a Melzi 2.0 board.
I would like to update the firmware but I'm new to this and having a hard time figuring out how to get this going.
Is there a walk through with examples somewhere? I looked at the wiki but did not add much beyond the readme and seems targeted at folks who already own this process... I have installed the other packages but I'm left with a big now what?
Thanks
Add a step by step how to use/configure. Maybe create a wiki ?
Related to #8
Compilation can be very long and the way it seems to be implemented, the server only answers 1 request at a time, so it block everything.
It would be nice to make all requests async and get the return statuses using plugin_messages
A new version for arduino-cli is out.
When searching through cores, glitches appear when some cores/libs have manually been installed
Sometimes, an error occurs during octoprint startup.
2020-03-28 14:52:47,438 - octoprint.server.views - ERROR - Error while retrieving template data for plugin marlin_flasher, ignoring it
Traceback (most recent call last):
File "/home/renaud/OctoPrint/venv/local/lib/python2.7/site-packages/octoprint/server/views.py", line 686, in fetch_template_data
wizard_required = implementation.is_wizard_required()
File "/home/renaud/OctoPrint/venv/local/lib/python2.7/site-packages/octoprint_marlin_flasher/__init__.py", line 87, in is_wizard_required
if self.__flasher.check_setup_errors():
AttributeError: 'MarlinFlasherPlugin' object has no attribute '_MarlinFlasherPlugin__flasher
While waiting for a fix, just restart Octoprint once more and the plugin should now be enabled
Since new versions aren't compatible with older arduino-cli versions, adding a screen telling people is needed
pyduinocli will be updated soon.
When released, use the new version, no functionnal change, but it's way prettier
TLDR: Do you accept donations / where can I tip you?
Long story: I'm rebuilding my first self-built 3d printer into a ultra-low-duty CNC, which requires a lot of firmware tweaking right now. Not having to replug the board all the time is really a godsend. For the amount of time you save me I'd love to give you a small tip and probably others feel the same way, too.
So I have used this and it is really cool. The ONLY thing I would love is the ability to edit the sketch (configuration.h in my case) ON the Pi, somehow. Still a PITA to load the sketch on my Windows box make an edit, save it, zip it, upload it, flash it...
Nonetheless, this is a cool plugin for a cool package. Thank you!
BIG changes are coming, this is issue is here for me to remember to update the docs
It is actually more work to: (having installed Arduino CLI)
-zip the sketch directory,
-upload it
than:
(I am very much likely to have Marlin sketch already open for editing)
-hit Ctrl-R (build it, on much more powerful computer)
-upload /tmp/arduino/marlin.ino.hex
Currently, only Arduino compatible boards are supported.
32bit boards may not work as they need platform.io.
New update for arduino-cli is out.
It may need some patches
I am not a linux user but should we us "which" instead of "where" in linux?
Current Instructions:
Once it is installed, you will need to know where it got installed. To do this you can do (Linux and Windows' cmd) :
where platformio
Proposed:
Once it is installed, you will need to know where it got installed. To do this you can do (Linux) :
which platformio
Check compatibility with the newly released 0.5.0
it would be great timing to have access to the 'files' to make changes to dial the printer in with the new controller hardware.
Recreated from #5
Hi, I have my octoprint main page stuck on Marlin Flasher wizard page, the note on it says that I should be able to continue by clicking finish but I have tried nothing I still on the wizard page thus can't use octoprint at the moment.
How I can disable or uninstall Marlin Flash maybe through command line so I can at least access my octoprint? I have attached a picture so you can see where I'm stuck. Any help will be appreciated.
Add a way to install a specific version of a lib/core instead of only the latest one
The plugin UI on my octoprint doesn't seem to match anything shown in the readme for this repo. This is what I see ...
Marlin Flasher Settings
Path to arduino-cli
Sketch .ino
Maximum sketch size 20 MB *requires restart
till now, it has been "arduino-cli-latest-linuxarm.tar.bz2"
now there are LinuxARM v6 , v7, and 64
It would be great to know which one is for RPi / (OctoPi) - probably the most used hardware.
There is a way for the plugin to automatically select the correct environment for a PlatformIO build and not require users to edit their platformio.ini
file and change the default environment.
If you read the MOTHERBOARD
value in Marlin/Configuration.h
and then search for the corresponding MB(...)
line in pins/pins.h
, the end of the following #include
line contains one or more env:
designations. When there's only one, that can be stuck into the -e
parameter. When there's more than one then the plugin can display a selector.
The basis of this has already been implemented as part of the auto_build.py
script that comes with Marlin. I'm in the process of porting over the behavior handled by that Python script directly into the "Auto Build Marlin" extension for VSCode, so then there will be a working Javascript implementation and UI possibly more transportable to an OctoPrint plugin.
After installing the plugin and setting up arduino-cli, I'm unable to search for cores.
The search button remains greyed out showing "Searching" indefinitely. The following exception shows up in the OctoPrint log:
octoprint - ERROR - Exception on /plugin/marlin_flasher/cores/search [GET]
Traceback (most recent call last):
File "/home/pi/oprint/local/lib/python2.7/site-packages/flask/app.py", line 1817, in wsgi_app
response = self.full_dispatch_request()
File "/home/pi/oprint/local/lib/python2.7/site-packages/flask/app.py", line 1477, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/home/pi/oprint/local/lib/python2.7/site-packages/flask/app.py", line 1381, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/home/pi/oprint/local/lib/python2.7/site-packages/flask/app.py", line 1475, in full_dispatch_request
rv = self.dispatch_request()
File "/home/pi/oprint/local/lib/python2.7/site-packages/flask/app.py", line 1461, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "/home/pi/oprint/local/lib/python2.7/site-packages/octoprint/server/util/flask.py", line 1149, in decorated_view
return no_firstrun_access(flask_login.login_required(func))(*args, **kwargs)
File "/home/pi/oprint/local/lib/python2.7/site-packages/octoprint/server/util/flask.py", line 1168, in decorated_view
return func(*args, **kwargs)
File "/home/pi/oprint/local/lib/python2.7/site-packages/flask_login.py", line 758, in decorated_view
return func(*args, **kwargs)
File "/home/pi/oprint/local/lib/python2.7/site-packages/flask_principal/__init__.py", line 198, in _decorated
rv = f(*args, **kw)
File "/home/pi/oprint/local/lib/python2.7/site-packages/octoprint_marlin_flasher/__init__.py", line 112, in search_cores
return flask.make_response(flask.jsonify(result), 200)
File "/home/pi/oprint/local/lib/python2.7/site-packages/flask/json.py", line 237, in jsonify
return current_app.response_class(dumps(dict(*args, **kwargs),
ValueError: dictionary update sequence element #0 has length 7; 2 is required
2019-11-02 21:13:25,382 - tornado.access - ERROR - 500 GET /plugin/marlin_flasher/cores/search?query=arduino (::ffff:192.168.1.17) 18776.28ms
Running OctoPrint 1.3.10, tested on a Raspberry Pi 3B and RPi Zero W.
The next version of OctoPrint will add compatibility for python3.
The plugin might need to be updated to support both versions.
This is recreated from #30
I suspect 0.3.0 does not support the newest pyduinocli.
arduino-cli 0.11.0 and 0.12 are out but introduce breaking changes for the .hex files and will be skipped
0.15 will be supported.
This will drop support for previous versions
There might be an issue with arduino-cli
I've opened an issue.
While waiting for official help on their part, I've found a workaround :
On Linux: open the /etc/init.d/octoprint
with your favorite editor. Find the following lines :
start-stop-daemon --start --background --quiet --pidfile $PIDFILE --make-pidfile \
--exec $DAEMON --chuid $OCTOPRINT_USER --user $OCTOPRINT_USER --umask $UMASK --nicelevel=$NICELEVEL \
-- serve $COMMAND_ARGS $DAEMON_ARGS
and change it for
start-stop-daemon --start --background --quiet --pidfile $PIDFILE --make-pidfile \
--exec /usr/bin/env USER=$OCTOPRINT_USER $DAEMON --chuid $OCTOPRINT_USER --user $OCTOPRINT_USER --umask $UMASK --nicelevel=$NICELEVEL \
-- serve $COMMAND_ARGS $DAEMON_ARGS
Then try to restart octoprint.
The issue does not appear on windows afaik
I have followed the instructions and installed the Marlin Flasher as well as the platformio components. When I drop the zip file into the Marlin Flasher in Octoprint, it takes a moment to compile. It says Uploading and gets about half way through the progress bar and then says - /dev/ttyACM0/firmware.bin: Not a directory - Failed. I have tried looking around but am drawing a blank.
In order to ease the maintainability, the code should be split in more than 1 single file
Some error messages needs to be more clear
ie : The printer is not ready
Big changed happened under the hood
Document those
"Board option fetch failed"
There might be other cases of unclear messages.
This is due to the fact that arduino-cli does not (yet) have an sound error output. (Sometimes on stdout, sometimes stderr, sometimes both, or even none).
The error output of the plugin needs to have all these cases in mind, which it currently doesn't.
This is linked to #37
Placing all translatable strings in a seperate file will help translate the plugin (if someone wants to)
avrdude tried to upload to an unexisting serial port when the serial port selected is auto
The new versions of arduino-cli don't work with the plugin
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x34 pc=0x37c600]
goroutine 1 [running]:
github.com/arduino/arduino-cli/arduino/cores.(*PlatformRelease).GetLibrariesDir(0x0, 0x3)
/__w/arduino-cli/arduino-cli/arduino/cores/cores.go:210 +0x2c
github.com/arduino/arduino-cli/arduino/libraries/librariesmanager.(*LibrariesManager).AddPlatformReleaseLibrariesDir(0x2913d60, 0x0, 0x2)
/__w/arduino-cli/arduino-cli/arduino/libraries/librariesmanager/librariesmanager.go:143 +0x20
github.com/arduino/arduino-cli/legacy/builder.(*LibrariesLoader).Run(0xcd429c, 0x1040960, 0xcd429c, 0x0)
/__w/arduino-cli/arduino-cli/legacy/builder/libraries_loader.go:62 +0x444
github.com/arduino/arduino-cli/legacy/builder.(*ContainerSetupHardwareToolsLibsSketchAndProps).Run(0xcd429c, 0x1040960, 0xcd429c, 0x10)
/__w/arduino-cli/arduino-cli/legacy/builder/container_setup.go:60 +0x1f0
github.com/arduino/arduino-cli/legacy/builder.runCommands(0x1040960, 0x130f960, 0x20, 0x20, 0xda201, 0x72f2b0, 0x130f8bc)
/__w/arduino-cli/arduino-cli/legacy/builder/builder.go:210 +0xb8
github.com/arduino/arduino-cli/legacy/builder.(*Builder).Run(0x130fa88, 0x1040960, 0x801c70, 0x26f26d0)
/__w/arduino-cli/arduino-cli/legacy/builder/builder.go:117 +0xa98
github.com/arduino/arduino-cli/legacy/builder.RunBuilder(...)
/__w/arduino-cli/arduino-cli/legacy/builder/builder.go:226
github.com/arduino/arduino-cli/commands/compile.Compile(0x7ff7b0, 0x1030040, 0x130fe74, 0x7f8f48, 0x10100d0, 0x7f8f48, 0x10100d8, 0x1027810, 0x55bc00, 0x1, ...)
/__w/arduino-cli/arduino-cli/commands/compile/compile.go:172 +0x10e4
github.com/arduino/arduino-cli/cli/compile.run(0x10cbcc0, 0x112d340, 0x1, 0x7)
/__w/arduino-cli/arduino-cli/cli/compile/compile.go:96 +0x208
github.com/spf13/cobra.(*Command).execute(0x10cbcc0, 0x112d2c0, 0x7, 0x8, 0x10cbcc0, 0x112d2c0)
/github/home/go/pkg/mod/github.com/spf13/[email protected]/command.go:830 +0x204
github.com/spf13/cobra.(*Command).ExecuteC(0xcbdfa8, 0x407b8, 0x5dc5ec, 0x10000e0)
/github/home/go/pkg/mod/github.com/spf13/[email protected]/command.go:914 +0x234
github.com/spf13/cobra.(*Command).Execute(...)
/github/home/go/pkg/mod/github.com/spf13/[email protected]/command.go:864
main.main()
/__w/arduino-cli/arduino-cli/main.go:28 +0x24
=> In cores, search for avr
and install the arduino:avr
core.
This problem has already been reported on the arduino-cli
GitHub.
All code is in the plugin class.
It might be a good idea to split it.
Some people had an issue where the EEPROM size was not right after reflashing.
Add a checkbox to reset after flashing or not.
There is a non breaking bug when a user is not logged in as an administrator.
The server answers with an Unothorized status and the JS does not expect this
It would be quite nice to simply see the timestamp of when the sketch was uploaded before flashing, just for being able to double-check the upload worked. Especially when repeatedly flashing firmare I had situations where I was not sure if I did already (successfully) upload the new sketch and had no way to validate that.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.