fablabnbg / inkscape-silhouette

An extension to drive Silhouette vinyl cutters (e.g. Cameo, Portrait, Curio series) from within inkscape.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Fresh install of Linux Mint 21.2 x86_64 cannot get a Silhouette Cameo 4 running

mofosyne opened this issue · comments

commented

Today just did a fresh install of Linux Mint 21.2 x86_64 but cannot get a Silhouette Cameo 4 running

My process was to follow the readme under "Ubuntu 20.10 or newer (features Inkscape 1.0+ natively)"
I then draw a line then attempted to use "Send to Silhouette" but got a mathplotlib error.

I then installed pip and the matplotlib (This should really be included in the readme)

sudo apt-get install python3-pip
python -m pip install -U pip
python -m pip install -U matplotlib

I then tried again and finally got a vector preview of the cut... I then ran it again and got this error.

<frozen importlib._bootstrap>:671: ImportWarning: DynamicImporter.exec_module() not found; falling back to load_module()
<frozen importlib._bootstrap>:671: ImportWarning: DynamicImporter.exec_module() not found; falling back to load_module()
/home/mofosyne/.local/lib/python3.10/site-packages/matplotlib/backends/_backend_gtk.py:146: DeprecationWarning: Gtk.Window.set_wmclass is deprecated
  self.window.set_wmclass("matplotlib", "Matplotlib")

If you are not running as root, this might be a udev issue.
Try a file /etc/udev/rules.d/99-graphtec-silhouette.rules
with the following example syntax:
SUBSYSTEM=="usb", ATTR{idVendor}=="0b4d", ATTR{idProduct}=="1137", MODE="666"

Then run 'sudo udevadm trigger' to load this file.

Alternatively, you can add yourself to group 'lp' and logout/login.

I then attempted to follow the suggestion, but that did not solve the problem

> cat /etc/udev/rules.d/99-graphtec-silhouette.rules
SUBSYSTEM=="usb", ATTR{idVendor}=="0b4d", ATTR{idProduct}=="1137", MODE="666"

So I'm unsure what's the main issue here, hope you can fix the readme to make setting this up easier on at least a fresh Linux install.

commented

Okay I figured out that while I added 99-graphtec-silhouette.rules I forgot to run sudo udevadm trigger.

Would it make sense for this extension to have already included all the udev rules for all the printers at least?

Also don't forget to include in readme that matplotlib needs to be added.

commented

Ah it carked up

image

but at least the machine is moving... sorta


edit: It's because it ran out of media... the error reporting should at least note that if "please load media ..." is present.

<frozen importlib._bootstrap>:671: ImportWarning: DynamicImporter.exec_module() not found; falling back to load_module()
<frozen importlib._bootstrap>:671: ImportWarning: DynamicImporter.exec_module() not found; falling back to load_module()
/home/mofosyne/.local/lib/python3.10/site-packages/matplotlib/backends/_backend_gtk.py:146: DeprecationWarning: Gtk.Window.set_wmclass is deprecated
  self.window.set_wmclass("matplotlib", "Matplotlib")
 28/2400: please load media ...
 29/2400: please load media ...
... etc ...
 405/2400: please load media ...
 406/2400: please load media ...
Traceback (most recent call last):
  File "/usr/share/inkscape/extensions/sendto_silhouette.py", line 753, in <module>
    e.run()
  File "/usr/share/inkscape/extensions/inkex/base.py", line 131, in run
    self.save_raw(self.effect())
  File "/usr/share/inkscape/extensions/sendto_silhouette.py", line 690, in effect
    bbox = dev.plot(pathlist=cut,
  File "/usr/share/inkscape/extensions/silhouette/Graphtec.py", line 1394, in plot
    self.safe_send_command(cmd_list)
  File "/usr/share/inkscape/extensions/silhouette/Graphtec.py", line 633, in safe_send_command
    self.safe_write(data)
  File "/usr/share/inkscape/extensions/silhouette/Graphtec.py", line 623, in safe_write
    self.wait_for_ready(timeout=120, poll_interval=0.05)
  File "/usr/share/inkscape/extensions/silhouette/Graphtec.py", line 740, in wait_for_ready
    state = self.status()
  File "/usr/share/inkscape/extensions/silhouette/Graphtec.py", line 694, in status
    self.send_escape(CMD_ENQ, is_query=True)
  File "/usr/share/inkscape/extensions/silhouette/Graphtec.py", line 637, in send_escape
    self.write(CMD_ESC + esc, is_query=is_query) # Concatenation will typecheck
  File "/usr/share/inkscape/extensions/silhouette/Graphtec.py", line 597, in write
    raise ValueError('write %d bytes failed: r=%d' % (len(chunk), r))
ValueError: write 2 bytes failed: r=0
Error in sys.excepthook:
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 153, in apport_excepthook
    with os.fdopen(os.open(pr_filename,
FileNotFoundError: [Errno 2] No such file or directory: '/var/crash/_usr_share_inkscape_extensions_sendto_silhouette.py.1000.crash'

Original exception was:
Traceback (most recent call last):
  File "/usr/share/inkscape/extensions/sendto_silhouette.py", line 753, in <module>
    e.run()
  File "/usr/share/inkscape/extensions/inkex/base.py", line 131, in run
    self.save_raw(self.effect())
  File "/usr/share/inkscape/extensions/sendto_silhouette.py", line 690, in effect
    bbox = dev.plot(pathlist=cut,
  File "/usr/share/inkscape/extensions/silhouette/Graphtec.py", line 1394, in plot
    self.safe_send_command(cmd_list)
  File "/usr/share/inkscape/extensions/silhouette/Graphtec.py", line 633, in safe_send_command
    self.safe_write(data)
  File "/usr/share/inkscape/extensions/silhouette/Graphtec.py", line 623, in safe_write
    self.wait_for_ready(timeout=120, poll_interval=0.05)
  File "/usr/share/inkscape/extensions/silhouette/Graphtec.py", line 740, in wait_for_ready
    state = self.status()
  File "/usr/share/inkscape/extensions/silhouette/Graphtec.py", line 694, in status
    self.send_escape(CMD_ENQ, is_query=True)
  File "/usr/share/inkscape/extensions/silhouette/Graphtec.py", line 637, in send_escape
    self.write(CMD_ESC + esc, is_query=is_query) # Concatenation will typecheck
  File "/usr/share/inkscape/extensions/silhouette/Graphtec.py", line 597, in write
    raise ValueError('write %d bytes failed: r=%d' % (len(chunk), r))
ValueError: write 2 bytes failed: r=0
commented

Okay making sure enough paper media is present it was able to draw the test square.

It then showed a success and noted these logs

<frozen importlib._bootstrap>:671: ImportWarning: DynamicImporter.exec_module() not found; falling back to load_module()
<frozen importlib._bootstrap>:671: ImportWarning: DynamicImporter.exec_module() not found; falling back to load_module()
/home/mofosyne/.local/lib/python3.10/site-packages/matplotlib/backends/_backend_gtk.py:146: DeprecationWarning: Gtk.Window.set_wmclass is deprecated
  self.window.set_wmclass("matplotlib", "Matplotlib")

And then has extra message box saying "The output from the extension could not be parsed."

While it looks like it workable enough for me at this stage... I'm leaving this ticket open at least as a UX experience review... so the readme can be improved and the extension error message can be less confusing (Instead of throwing an exception when paper is out).

commented

Further observation when trying to do "Silhouette Multiple Actions". These two seems to be missing.

sudo apt install python3-wxgtk4.0
python3 -m pip install -U xmltodict

Also tried to use the autoblade settings but did not see the cameo 4 using the autoblade switching pits, if there is a way to output a debug log let me know so we can figure out why.

commented

Other UX issue encountered. When printing directly from inkscape, the scale of 10mm of the reg mark spacing is correct. But when i save the pdf then attempted to print it again at 100% scaling... i got 15mm spacing... not sure what happened there.

commented

Other UX issue encountered. When printing directly from inkscape, the scale of 10mm of the reg mark spacing is correct. But when i save the pdf then attempted to print it again at 100% scaling... i got 15mm spacing... not sure what happened there.

This particular observation might be an issue of either Inkscape or your PDF Viewer...

commented

Also tried to use the autoblade settings but did not see the cameo 4 using the autoblade switching pits, if there is a way to output a debug log let me know so we can figure out why.

You may look at the log file path you choose in the settings dialog or inspect autoblade handling in silhouette/Graphtec.py. Feel free to open a dedicated issue with your observations.

commented

It then showed a success and noted these logs

<frozen importlib._bootstrap>:671: ImportWarning: DynamicImporter.exec_module() not found; falling back to load_module()
<frozen importlib._bootstrap>:671: ImportWarning: DynamicImporter.exec_module() not found; falling back to load_module()
/home/mofosyne/.local/lib/python3.10/site-packages/matplotlib/backends/_backend_gtk.py:146: DeprecationWarning: Gtk.Window.set_wmclass is deprecated
  self.window.set_wmclass("matplotlib", "Matplotlib")

This looks like a matplotlib / Gtk3 compat error related to your system. Currently unable to reproduce here.
Feel free to provide a repro case or investigate upstream

And then has extra message box saying "The output from the extension could not be parsed."

This is inkscapes reaction related to the output being an warning or error msg - instead of on awaited SVG.

While it looks like it workable enough for me at this stage... I'm leaving this ticket open at least as a UX experience review... so the readme can be improved and the extension error message can be less confusing (Instead of throwing an exception when paper is out).

Improve install experience: absolutely
Improve Error Message for media load: would need to include a GUI / msgbox in the Graphtec.py logic as Inscape doesn't provide a way to give feedback with GUI.
Food note: inkscape-silhouette also works as a standalone cmdline application.

commented

If you are not running as root, this might be a udev issue.
Try a file /etc/udev/rules.d/99-graphtec-silhouette.rules
with the following example syntax:
SUBSYSTEM=="usb", ATTR{idVendor}=="0b4d", ATTR{idProduct}=="1137", MODE="666"

Then run 'sudo udevadm trigger' to load this file.

Alternatively, you can add yourself to group 'lp' and logout/login.


I then attempted to follow the suggestion, but that did not solve the problem

```shell
> cat /etc/udev/rules.d/99-graphtec-silhouette.rules
SUBSYSTEM=="usb", ATTR{idVendor}=="0b4d", ATTR{idProduct}=="1137", MODE="666"

Indeed the Cameo4* models were missing from the provided udev rules. Can you remove your workaround and try if 02abb6b fixes your issue?

nb: in order to trigger udev rules without reboot you may sudo udevadm trigger

commented

Okay ran sudo make install and deleted the old udev rule and ran sudo udevadm trigger. It still works, so looks like your change fixed the issue with udev.

Also updated the readme in #246 so hopefully it's ready for you to use.