OctoPrint-GcodeEditor icon indicating copy to clipboard operation
OctoPrint-GcodeEditor copied to clipboard

Nothing happens after save

Open Mesmer88 opened this issue 3 years ago • 14 comments

I notice that with OctoPrint 1.6.1 the plugin not longer works. After clicking save the popup window closes but the file is not edited.

In browser decveloper mode i see the POST message gets a 415 UNSUPPORTED MEDIA TYPE error.

Request header:

Content-Disposition: form-data; name="file"; filename="Calibration/CE5_5cm_Square.gcode"
Content-Type: text/plain

This is re response to the request:

{"error":"Can not upload file, wrong format?"}

Mesmer88 avatar Jun 02 '21 12:06 Mesmer88

Getting the same error

Loewe1000 avatar Jun 23 '21 17:06 Loewe1000

I've just updated to OctoPrint 1.6.1and have the same problem.

@ieatacid - any time scales on when this will be fixed? I run 2 printers and editing the gcode to suit has been a life saver til now.

anthonyonions avatar Aug 17 '21 08:08 anthonyonions

I've ran into similar issue. For me editing works in root folder but not in subfolders. To fix the issue you have to change line 33 in static/js/GcodeEditor.js from OctoPrint.files.upload("local", file, { filename: _selectedFilePath + fName }); to OctoPrint.files.upload("local", file, { filename: fName, path: _selectedFilePath });

Full path for the file should be something like: /home/octoprint/OctoPrint/venv/lib/python2.7/site-packages/octoprint_GcodeEditor/static/js/GcodeEditor.js

sergeysi779 avatar Sep 30 '21 15:09 sergeysi779

@sergeysi779

Thanks a lot, it fixed it for me as well! One mention though, on my setup the path was different:

/home/pi/oprint/lib/python3.7/site-packages/octoprint_GcodeEditor/static/js

Mesmer88 avatar Oct 02 '21 07:10 Mesmer88

I tried this yesterday but didn't seem to make a change on either of my installs. Does anything need doing other than a restart?

anthonyonions avatar Oct 02 '21 08:10 anthonyonions

I just edited the line and restarted Octoprint from the menu. Maybe double check the edit?

Mesmer88 avatar Oct 02 '21 08:10 Mesmer88

Thanks for confirming. Appears my js skills are lacking - I'd used the wrong comment format to comment out the original line of code. All sorted now, thanks @Mesmer88 and thanks @sergeysi779 for finding the fix originally.

anthonyonions avatar Oct 02 '21 08:10 anthonyonions

I have the same problem with OctoPrint 1.7.2: I've found the file GcodeEditor.js in /home/pi/oprint/lib/python3.7/site-packages/octoprint_GcodeEditor/static/js I have made the changes described and restarted OctoPrint. Now, when I click on "Save", the editor window does not even close. And it is not saved either.

FindusD avatar Dec 12 '21 12:12 FindusD

I can confirm this is working with Octoprint 1.7.2.

fleinze avatar Jan 02 '22 12:01 fleinze

This worked for me in 1.7.3!

vulgerrity avatar Apr 10 '22 21:04 vulgerrity

Still not working on Octoprint 1.8.0 Tried editing the line in the GcodeEditor.js that is located here ./oprint/lib/python3.7/site-packages/octoprint_GcodeEditor/static/js/

I rebooted the Octoprint server but it still doesn't work.

Build-0-Matic avatar May 18 '22 18:05 Build-0-Matic

In 1.8.1 the told Code is existing twice. Changing both as adviced Boy sergeysi779 does make the trick. Runs like a charme.

Fsie avatar Jun 03 '22 20:06 Fsie

This has got to be the strangest bug as it now works fine... I just don't get it but it seems OK. Slow but OK.

Build-0-Matic avatar Jun 03 '22 21:06 Build-0-Matic

If someone submits a pull request I'll merge it.

ieatacid avatar Jun 03 '22 22:06 ieatacid