Auto-connection request for "cura-slicer"

Hi,

i’ve made a snap-package for the popular software “Cura” from Ultimaker. The software needs some connections to run:

  • netlink-connector
  • network-manager-observe
  • mount-observe (*)
  • removable-media (*)

(*) Optional

“netlink-connector” is needed so that the GUI can communicate with “CuraEngine” which is started by the GUI. Without this connection the GUI cannot slice any model.

“network-manager-observe” is needed for detection of network-connected 3D-printers.

“mount-observe” and “removable-media” are optional. Cura has the feature to store gcode-files directly on an external drive after slicing.

Link to Github:

2 Likes

finally a reason to dust off my printer again \o/

I would love a snap of cura. Is it in the store already? I can’t find it.

seems only in edge yet (and probably unlisted from search until it has the needed auto-connects (well done @glasen77 !!))

Thank you :wink:

There is also another connection missing. Yesterday i’ve tried to connect my Ender 3 to my Notebook and Cura couldn’t use the USB-connection. The interface " serial-port" is missing.

Currently i’m trying to fix the segfault when Cura is closed. There are problems with PyQt and the multithreading of Python.

i think the python issue was discussed here:

(snapcrft-preload should help with it according to the mentioned PR in the topic)

fo serial devices you should take a look at hotplug suport, similar to how the arduino snap from @galgalesh does it …

Great!
I just installed it and it seem to work great. Some observations:

  • I was able to open a stl file and slice it without any connection… I was under the impression that this was not possible without auto-connections?
  • For some reason the interface is slightly bigger than the appimage (fonts, widgets, etc). Not biggie, just curious.
  • As you said, it segfaults on exit.

Overall, great work! Thanks!

I’m getting a “Could not create AF_NETLINK socket (Permission denied)” error on startup. Maybe i misinterpreted this.

Here is the dmesg-output when no connection is allowed:

[  386.977995] audit: type=1400 audit(1590689657.521:130): apparmor="DENIED" operation="create" profile="snap.cura-slicer.cura" pid=16238 comm=517420626561726572207468726561 family="netlink" sock_type="dgram" protocol=0 requested_mask="create" denied_mask="create"
[  387.801222] audit: type=1400 audit(1590689658.345:131): apparmor="DENIED" operation="open" profile="snap.cura-slicer.cura" name="/media/" pid=16238 comm="python3" requested_mask="r" denied_mask="r" fsuid=1000 ouid=0
[  448.330305] audit: type=1400 audit(1590689718.870:176): apparmor="DENIED" operation="connect" profile="snap.cura-slicer.cura" name="/run/uuidd/request" pid=16238 comm="python3" requested_mask="w" denied_mask="w" fsuid=1000 ouid=0

Must be a thing with the Qt-Theme.

I’m currently working on a patch which hopefully should solve this problem.

I get the same Could not create AF_NETLINK socket (Permission denied) output in the terminal. But the app generates an apparently correct gcode.

@glasen77 so from this thread it appears you are requesting auto-connect of the following for cura-slicer:

netlink-connector
network-manager-observe
serial-port
mount-observe (*)
removable-media (*)

But it is unclear if these are all absolutely required and in what use-cases - can you please clarify since I am not familiar with cura-slicer. Thanks.

I will try it. At the moment “netlink-connector” seems the only interface really needed because without it the log gets spammed with “Could not create AF_NETLINK socket (Permission denied)” errors.

The rest of the interfaces are basically optional because they are not needed for Cura when the user is only slicing a STL-file and saving the generated G-Code in its home-directory.

“serial-port” and “network-manager-observe” are needed if you want control your printer over an USB-serial-connection or over the normal network-connection.

“mount-observe” and “removable-media” are only needed when you want to use hotplugging USB-disk-support in Cura. Cura can detect mounted disks and then asks the user if the gcode-file should be saved to this disk instead the normal home-directory.

I thik using the serial connection is a pretty normal/typical use-case for cura though … but you should perhaps take a look at hotlugging for it … IIRC the arduino IDE snap uses it nowadays, stealing the plugs from its snapcaft.yaml for cura might be helpful (and i bet @galgalesh wouldnt mind :wink: )

@ogra:

I can’t find anything special in the YAML-file of the Arduino IDE. It also uses “serial-port”. Can you please point me in the correct direction?

ah, sorry, i just checked and seems i completely mis-remembered. it was raw-usb that was special in the arduino snap, to allow updating the firmware (which you probably want too for cura since it allows this in the UI). hotplug is a feature of the snapd side that should already be there for serial-port …

@glasen77 - quite a bit of discussion and suggestions have happened since your request, but we’ve not heard back. Can you respond and clarify precisely what you want auto-connected after incorporating any suggestions?

@jdstrand:

I’m cancelling my request for now. I need more time to find all absolutely required and optional interfaces.

Thanks for getting back to us. Whenever you have a chance to respond, we can pick this back up then.

@jdstrand:

I’ve made a new request:

https://forum.snapcraft.io/t/auto-connection-request-for-cura-slicer-2/21141