Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add octoprint support #2

Closed
jonferreira opened this issue Apr 12, 2020 · 26 comments
Closed

Add octoprint support #2

jonferreira opened this issue Apr 12, 2020 · 26 comments
Assignees
Labels
enhancement New feature or request

Comments

@jonferreira
Copy link

First of all let me start by saying I love your plugin!

Only thing I'd love to see implement is octoprint support. I barely every export .gcode nowadays and print straight to octoprint. It's a shame we can't have the custom name + octoprint support :(

@rgomezjnr
Copy link
Owner

Hi jon thanks for using the plugin! Just to confirm, you are referring to the Cura Octoprint plugin, correct? I will have to try using that plugin. I also use octoprint but I do export .gcode and manually upload it to octoprint. It's an extra step but it can be useful if the .gcode needs to be modified before printing.

@jonferreira
Copy link
Author

Yes that's what I'm talking about :)

I've never export the .gcode since I don't really see the need to edit anything? Anyways it would be incredible helpful if this was possible although I understand it may be impossible to do it depending on how the plugin system is coded.

To be honest this is one thing that should be built in really, it's just so "easy" and brilliant!

@rgomezjnr
Copy link
Owner

Just tried out the octoprint plugin and I see what you mean. Both plugins aren't usable simultaneously since they use separate buttons.

Do you use the "Store G-code on the printer SD card" setting?

I think it should be possible to make Gcode Filename Format work with the octoprint plugin by sending the customized filename to the gcode writer or printer. That's how I've seen another plugin behave, Custom Printjob Prefix. It doesn't have a separate save button.

I'll have to do some more digging.

@jonferreira
Copy link
Author

Hey,

I don't currently have that option enabled but can probably use it if it means having a properly formatted filename :)

Thanks for the effort and let us know in case you make progress

@joshlarsen48
Copy link

I second Jon. It would be awesome to see the filenames loaded to OctoPrint using the OctoPrint Connected to use the names from this plugin. I just came from using Slic3r and so far getting better prints from Cura but miss the custom file names that Slic3r was able to upload directly to OctoPrint.

Thanks for your work on this plugin.

Josh

@rgomezjnr
Copy link
Owner

Thanks for the feedback Josh and Jon. I've been reviewing some of the Cura source code and started to make some changes to add support for Octoprint. I think it is possible. I will get back to you shortly.

@jonferreira
Copy link
Author

that's great, thanks for letting us know!

@rgomezjnr
Copy link
Owner

Hey @jonferreira and @joshlarsen48,

I've been able to rewrite the code so that the plugin is compatible with Octoprint Connection. This has been changed in 2.0.0-rc2.

The following format:
[brand] [material] lw [line_width]mm lh [layer_height]mm if [infill_sparse_density]% ext1 [material_print_temperature]C bed [material_bed_temperature]C [printer_name] [print_time] [print_time_days]d [print_time_hours]h [print_time_minutes]min [print_time_seconds]s [material_weight]g [material_length]m $[material_cost]

resulted in the following job name in Octoprint:

Annotation 2020-05-02 192215

20200502192313

There are a few issues I haven't solved yet:

  1. Modifying the format after the object has been sliced won't work
  2. The [base_name] and [job_name] options don't work, although I've hard-coded this in to the output
  3. The [material_weight], [material_length], [material_cost] options don't work

Can you please test the plugin and provide any feedback? You will need to download it and place it in your Cura plugins folder.

@jonferreira
Copy link
Author

This is absolutely perfect!

image

@rgomezjnr
Copy link
Owner

Glad it's working for you jon i'll see if I can fix those issues. I do like that as a result of these changes the plugin is more seamless and integrated, so you don't have to select a different button when saving gcode.

@DotNetRob
Copy link

Looks good to me too, running 2.0.0-rc2 on cura 4.6.1. File name looks great in octoprint now. Thanks for adding this functionality.

@rgomezjnr
Copy link
Owner

Thanks for testing this guys. I will work on the issues I mentioned and get this released.

@jonferreira
Copy link
Author

Only thing I've noticed so far is that if you manually rename the "file" in cura, your naming rules don't take effect. For example

image

Say you add 10 different objects to cura. Cura will automatically call it something like C3PRO_first_object_name so you rename it to something meaningful like C3PRO_proper_name.

When I've hit print the file wasn't renamed properly?

@rgomezjnr
Copy link
Owner

I think I see what you are seeing @jonferreira. When are you changing the name of the object?

What I'm seeing is if the object name is changed after the slice, the filename format is not followed. However, if the object name is changed before the slice, the filename format is followed.

Can you verify this?

image

image

@joshlarsen48
Copy link

Thanks for the updates. As you mentioned if you change the object name after slicing it but before clicking "Print with OctoPrint" it ignores the name format.

Is there anyway to drop the machine prefix from the name? Even when I have it unchecked in Cura settings it gets added to the file format.

I use a custom profile most of the time. When I include the profile_name in the file name it shows it as None instead of the actual profiles name.

Thanks

@rgomezjnr
Copy link
Owner

Thanks for the feedback @joshlarsen48.

I'm still working on this branch of the code to see if I can iron out this behavior. This change significantly changes the plugin structure so I want to make sure it's ready before releasing it to the Cura Marketplace.

Is there anyway to drop the machine prefix from the name? Even when I have it unchecked in Cura settings it gets added to the file format.

I just checked this in 1.4.1-rc2 and the machine prefix is dropped for me. I had to uncheck the setting in Cura, clear the build plate, then re-slice. Can you confirm?

I use a custom profile most of the time. When I include the profile_name in the file name it shows it as None instead of the actual profiles name.

Are you using 2.0.0-rc2 or 1.3.1? 1.3.1 added the profile_name option but doesn't include Octoprint support.

The custom profile names from Prusa work correctly. Maybe you can share you profile source?

@joshlarsen48
Copy link

@rgomezjnr
I installed 1.4.1-rc2 and the machine prefex indeed got removed. The Custom Profile name also showed.
I was using 2.0.0-rc2 before when the machine prefix was always added and the custom profile name showed as None.

@StumbleNOLA
Copy link

Just a note on installation. I was having some issues with getting the plug in working, and finally figured it out. Removing the old GFF from the Cura program failed, I have to remove the old plug in via the web Marketplace. Once I did that it installed correctly.

I am curious if I may have an old build however. If I use ""[base_name] [brand] [material] [material_weight]g"" everything comes out correctly except I get ""Nonegrams"" for the weight. I downloaded the source for GcodeFilenameFormat-2.0.0-rc2

@erdemozor
Copy link

erdemozor commented Jan 12, 2021

Hey, I just discovered this plugin and immediately tried to use it with Octoprint.
The 2.0.0-rc2 is working for me but as mentioned above the machine prefix is hard-coded into the first part of the file name.
Perhaps checking the Cura "Add machine prefix to job name" setting and deciding to add the machine prefix based on that could be an improvement?
So if I didn't have that setting checked the [base_name] still wouldn't work but the hard-coded name wouldn't include the machine prefix.
I hope you can solve those issues and add this feature to the release version because I love the temp settings this plugin can add to the end of the gcode. Thanks.

Edit: Also, This comment should be helpful for people trying to install.

@rgomezjnr
Copy link
Owner

Hello @erdemozor

I've come up with a solution for this in 2.0.0-rc3. I added the [abbr_machine] option for the machine prefix. Unfortunately, this makes the "Add machine prefix to job name" Cura option no longer effective, but this should address your issues for now. I also merged in the new changes from branch 1.5.1 that include new options and multi-extruder support. Please try it and let me know what you think.

@erdemozor
Copy link

Thanks for getting back so fast @rgomezjnr
The rc3 works wonderfully without the machine prefix like I wanted. Also, thanks to the merge, [profile_name] is working again. Couldn't really ask for anything else. Keep up the great work :).

@rgomezjnr rgomezjnr self-assigned this Feb 13, 2021
@rgomezjnr rgomezjnr added the enhancement New feature or request label Feb 13, 2021
@soostdijck
Copy link

I came here looking for exactly this feature, but it looks like it didn't make it into the released version yet. Are there still pending issues, or just a matter of patience?

@rgomezjnr
Copy link
Owner

Hi @soostdijck I'm going to publish a separate plugin (eg GcodeFilenameFormat+) to the Cura Marketplace soon that supports Octoprint and does away with the separate Save Gcode button. Does that sound good?

@soostdijck
Copy link

Sounds good! What I wanted is a just box to rename the uploaded gcode before uploading to my octoprint. I'll give it a go when I see if pop up

@rgomezjnr
Copy link
Owner

Hello GFF users,

GFF+ is now available in the Cura Marketplace. This separate version includes Octoprint support as well as a few other improvements. Let me know if you have any questions or feedback, thanks.

Release notes

  • Added multi-extruder support
  • Added OctoPrint plugin support
  • Added more format options
  • Added rounding of all floating point numbers
  • Removed Save Gcode button from GFF

@rgomezjnr
Copy link
Owner

If anyone has feedback specific to GFF+, please create a separate issue in GFF+ Issues, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

7 participants