Victrid / splatplost

A software-based SplatPost plotter.
GNU General Public License v3.0
191 stars 17 forks source link

Chromebook support #29

Open Ceiyne opened 1 year ago

Ceiyne commented 1 year ago

Sorry, this is more of a question than an "issue". Do you happen to know if Splatpost works on the Linux environment that can be enabled on a Chromebook?

I don't have Linux set up on my Chromebook, and I'm not super familiar with Linux to begin with, so I figured I'd ask before I went through all of the configuration. If you don't know, I'll probably give it a try myself.

Victrid commented 1 year ago

I'm not familiar with Chromebook, but I've googled that chromebook supports booting from USB. You can try to flash the image to a USB drive and reboot into it, which is preconfigured with a working linux desktop environment.

Please let me know if this works.

Ceiyne commented 1 year ago

Thanks for getting back to me so fast. A Chromebook doesn't 'normally' support booting from USB; you have to basically wipe your system and disable all of the security features in order to do it. So, I would probably just go with the Linux environment available on Chromebooks and try to make that work.

Ceiyne commented 1 year ago

I have been trying to get it to work on my Chromebook and I've made some progress but I'm at a point where I'm unable to figure out what to do next. After getting into Linux, there were a few things I needed to do to get SplatPlost going. I'll list them below for anyone else who might try this on a Chromebook, and also in case I did something wrong! Most of this has been trial and error with Google and StackExchange posts for me.

  1. Needed to install pip sudo apt install python3-pip

  2. Needed to install pkg-config sudo apt install pkg-config

  3. Needed to install dbus stuff (info from https://stackoverflow.com/questions/61285415/no-package-dbus-1-found) sudo apt-get install libdbus-glib-1-dev libdbus-glib-1-2

  4. Needed to install bluez sudo apt-get install bluez

After doing the above I was able to get to the point where starting the printer gives me this error. It seems bluetooth related, but I don't know enough about Linux to do much more here. I tried a few things that I found via Google which I'll list below the error.

$ sudo splatplot --order octotilt
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/dist-packages/dbus/bus.py", line 177, in activate_name_owner
    return self.get_name_owner(bus_name)
  File "/usr/local/lib/python3.9/dist-packages/dbus/bus.py", line 361, in get_name_owner
    return self.call_blocking(BUS_DAEMON_NAME, BUS_DAEMON_PATH,
  File "/usr/local/lib/python3.9/dist-packages/dbus/connection.py", line 652, in call_blocking
    reply_message = self.send_message_with_reply_and_block(
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.NameHasNoOwner: Could not get owner of name 'org.bluez': no such name

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/bin/splatplot", line 24, in <module>
    plot(order_list=f.readlines(),
  File "/usr/local/lib/python3.9/dist-packages/splatplost/plot.py", line 21, in plot
    connection = backend(press_duration_ms=press_duration_ms, delay_ms=delay_ms)
  File "/usr/local/lib/python3.9/dist-packages/libnxctrl/nxbt_wrapper.py", line 64, in __init__
    adapters = self.nx.get_available_adapters()
  File "/usr/local/lib/python3.9/dist-packages/libnxctrl/nxbt/nxbt/nxbt.py", line 645, in get_available_adapters
    adapters = find_objects(bus, SERVICE_NAME, ADAPTER_INTERFACE)
  File "/usr/local/lib/python3.9/dist-packages/libnxctrl/nxbt/nxbt/bluez.py", line 78, in find_objects
    bus.get_object(service_name, "/"),
  File "/usr/local/lib/python3.9/dist-packages/dbus/bus.py", line 241, in get_object
    return self.ProxyObjectClass(self, bus_name, object_path,
  File "/usr/local/lib/python3.9/dist-packages/dbus/proxies.py", line 250, in __init__
    self._named_service = conn.activate_name_owner(bus_name)
  File "/usr/local/lib/python3.9/dist-packages/dbus/bus.py", line 182, in activate_name_owner
    self.start_service_by_name(bus_name)
  File "/usr/local/lib/python3.9/dist-packages/dbus/bus.py", line 277, in start_service_by_name
    return (True, self.call_blocking(BUS_DAEMON_NAME, BUS_DAEMON_PATH,
  File "/usr/local/lib/python3.9/dist-packages/dbus/connection.py", line 652, in call_blocking
    reply_message = self.send_message_with_reply_and_block(
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.TimedOut: Failed to activate service 'org.bluez': timed out (service_start_timeout=25000ms)

These are the additional commands I tried that didn't fix the error:

$ sudo systemctl enable bluetooth
Synchronizing state of bluetooth.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable bluetooth

$ sudo systemctl start bluetooth

sudo apt-get install bluetooth bluez bluez-tools rfkill -y
sudo service bluetooth start

I didn't get any errors from the above, but rfkill did not seem to be installed correctly as I would get things like this:

sudo rfkill list
rfkill: cannot open /dev/rfkill: No such file or directory
rfkill: cannot read /dev/rfkill: Bad file descriptor

sudo apt-get install blueman -y && blueman-manager The above command produced a lot of output and then hung on the last line "blueman-manager version 2.1.4 starting" for a while before popping up a window with an error saying that the connection to bluez failed.

By the way, if I've totally screwed something up with all the extra commands I ran, it's easy enough for me to delete the Linux environment and start over fresh.