Victrid / splatplost

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

Bluetooth error when using flashable image #32

Open Ceiyne opened 2 years ago

Ceiyne commented 2 years ago

I have an old laptop with bluetooth that I am trying to use with the flashable image. I followed all of the instructions and was able to successfully generate a plotting plan, but got an error related to bluetooth when I tried to start the printer. Here is the output I received:

splatplost@arch-splatplost-iso ~/Documents/splat % sudo splatplot --order octotilt
Traceback (most recent call last):
  File "/usr/lib/python3.10/site-packages/dbus/bus.py", line 177, in activate_name_owner
    return self.get_name_owner(bus_name)
  File "/usr/lib/python3.10/site-packages/dbus/bus.py", line 361, in get_name_owner
    return self.call_blocking(BUS_DAEMON_NAME, BUS_DAEMON_PATH,
  File "/usr/lib/python3.10/site-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/bin/splatplot", line 24, in <module>
    plot(order_list=f.readlines(),
  File "/usr/lib/python3.10/site-packages/splatplost/plot.py", line 21, in plot
    connection = backend(press_duration_ms=press_duration_ms, delay_ms=delay_ms)
  File "/usr/lib/python3.10/site-packages/libnxctrl/nxbt_wrapper.py", line 64, in __init__
    adapters = self.nx.get_available_adapters()
  File "/usr/lib/python3.10/site-packages/libnxctrl/nxbt/nxbt/nxbt.py", line 645, in get_available_adapters
    adapters = find_objects(bus, SERVICE_NAME, ADAPTER_INTERFACE)
  File "/usr/lib/python3.10/site-packages/libnxctrl/nxbt/nxbt/bluez.py", line 78, in find_objects
    bus.get_object(service_name, "/"),
  File "/usr/lib/python3.10/site-packages/dbus/bus.py", line 241, in get_object
    return self.ProxyObjectClass(self, bus_name, object_path,
  File "/usr/lib/python3.10/site-packages/dbus/proxies.py", line 250, in __init__
    self._named_service = conn.activate_name_owner(bus_name)
  File "/usr/lib/python3.10/site-packages/dbus/bus.py", line 182, in activate_name_owner
    self.start_service_by_name(bus_name)
  File "/usr/lib/python3.10/site-packages/dbus/bus.py", line 277, in start_service_by_name
    return (True, self.call_blocking(BUS_DAEMON_NAME, BUS_DAEMON_PATH,
  File "/usr/lib/python3.10/site-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.NoReply: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.

In case it is helpful, here is the output of the install_splatplost command:

splatplost@arch-splatplost-iso ~ % install_splatplost
You choose to not modify the mirror.
Installing splatplost...
Collecting splatplost
  Downloading splatplost-0.1.4-py3-none-any.whl (20 kB)
Collecting numpy~=1.23.2
  Downloading numpy-1.23.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (17.1 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 17.1/17.1 MB 5.9 MB/s eta 0:00:00
Collecting scikit-image~=0.19.3
  Downloading scikit_image-0.19.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (13.9 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 13.9/13.9 MB 5.5 MB/s eta 0:00:00
Collecting libnxctrl~=0.1.7
  Downloading libnxctrl-0.1.7-py3-none-any.whl (145 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 145.6/145.6 kB 5.9 MB/s eta 0:00:00
Collecting Pillow~=9.2.0
  Downloading Pillow-9.2.0-cp310-cp310-manylinux_2_28_x86_64.whl (3.2 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.2/3.2 MB 5.0 MB/s eta 0:00:00
Collecting setuptools~=65.3.0
  Downloading setuptools-65.3.0-py3-none-any.whl (1.2 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.2/1.2 MB 5.9 MB/s eta 0:00:00
Collecting tsp-solver2~=0.4.1
  Downloading tsp_solver2-0.4.1-py3-none-any.whl (13 kB)
Collecting tqdm~=4.64.0
  Downloading tqdm-4.64.1-py2.py3-none-any.whl (78 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 78.5/78.5 kB 6.1 MB/s eta 0:00:00
Collecting scipy~=1.9.1
  Downloading scipy-1.9.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (43.9 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 43.9/43.9 MB 4.9 MB/s eta 0:00:00
Requirement already satisfied: cryptography<37.1.0,>=3.3.2 in /usr/lib/python3.10/site-packages (from libnxctrl~=0.1.7->splatplost) (37.0.4)
Collecting blessed<1.20.0,>=1.17.10
  Downloading blessed-1.19.1-py2.py3-none-any.whl (58 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 58.0/58.0 kB 9.0 MB/s eta 0:00:00
Collecting Flask-SocketIO<5.4.0,>=5.0.1
  Downloading Flask_SocketIO-5.3.0-py3-none-any.whl (17 kB)
Collecting aioconsole~=0.5.1
  Downloading aioconsole-0.5.1-py3-none-any.whl (30 kB)
Collecting Flask<2.3.0,>=1.1.2
  Downloading Flask-2.2.2-py3-none-any.whl (101 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 101.5/101.5 kB 6.8 MB/s eta 0:00:00
Collecting pynput~=1.7.1
  Downloading pynput-1.7.6-py2.py3-none-any.whl (89 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 89.2/89.2 kB 7.7 MB/s eta 0:00:00
Collecting hid~=1.0.5
  Downloading hid-1.0.5.tar.gz (3.9 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Collecting dbus-python~=1.2.16
  Downloading dbus-python-1.2.18.tar.gz (578 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 578.2/578.2 kB 5.5 MB/s eta 0:00:00
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Collecting eventlet<0.34,>=0.31
  Downloading eventlet-0.33.1-py2.py3-none-any.whl (226 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 226.8/226.8 kB 4.8 MB/s eta 0:00:00
Collecting psutil<5.10.0,>=5.6.6
  Downloading psutil-5.9.2-cp310-cp310-manylinux_2_12_x86_64.manylinux2010_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (282 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 282.8/282.8 kB 5.2 MB/s eta 0:00:00
Collecting packaging>=20.0
  Downloading packaging-21.3-py3-none-any.whl (40 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 40.8/40.8 kB 7.0 MB/s eta 0:00:00
Collecting imageio>=2.4.1
  Downloading imageio-2.21.2-py3-none-any.whl (3.4 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.4/3.4 MB 5.5 MB/s eta 0:00:00
Collecting networkx>=2.2
  Downloading networkx-2.8.6-py3-none-any.whl (2.0 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.0/2.0 MB 5.4 MB/s eta 0:00:00
Collecting tifffile>=2019.7.26
  Downloading tifffile-2022.8.12-py3-none-any.whl (208 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 208.5/208.5 kB 5.5 MB/s eta 0:00:00
Collecting PyWavelets>=1.1.1
  Downloading PyWavelets-1.3.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (6.9 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 6.9/6.9 MB 5.4 MB/s eta 0:00:00
Requirement already satisfied: six>=1.9.0 in /usr/lib/python3.10/site-packages (from blessed<1.20.0,>=1.17.10->libnxctrl~=0.1.7->splatplost) (1.16.0)
Collecting wcwidth>=0.1.4
  Downloading wcwidth-0.2.5-py2.py3-none-any.whl (30 kB)
Requirement already satisfied: cffi>=1.12 in /usr/lib/python3.10/site-packages (from cryptography<37.1.0,>=3.3.2->libnxctrl~=0.1.7->splatplost) (1.15.1)
Collecting greenlet>=0.3
  Downloading greenlet-1.1.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (155 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 155.9/155.9 kB 5.3 MB/s eta 0:00:00
Collecting dnspython>=1.15.0
  Downloading dnspython-2.2.1-py3-none-any.whl (269 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 269.1/269.1 kB 5.0 MB/s eta 0:00:00
Collecting Werkzeug>=2.2.2
  Downloading Werkzeug-2.2.2-py3-none-any.whl (232 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 232.7/232.7 kB 5.0 MB/s eta 0:00:00
Requirement already satisfied: Jinja2>=3.0 in /usr/lib/python3.10/site-packages (from Flask<2.3.0,>=1.1.2->libnxctrl~=0.1.7->splatplost) (3.1.2)
Collecting click>=8.0
  Downloading click-8.1.3-py3-none-any.whl (96 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 96.6/96.6 kB 4.4 MB/s eta 0:00:00
Collecting itsdangerous>=2.0
  Downloading itsdangerous-2.1.2-py3-none-any.whl (15 kB)
Collecting python-socketio>=5.0.2
  Downloading python_socketio-5.7.1-py3-none-any.whl (56 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 56.6/56.6 kB 6.7 MB/s eta 0:00:00
Collecting pyparsing!=3.0.5,>=2.0.2
  Downloading pyparsing-3.0.9-py3-none-any.whl (98 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 98.3/98.3 kB 4.9 MB/s eta 0:00:00
Collecting python-xlib>=0.17
  Downloading python_xlib-0.31-py2.py3-none-any.whl (179 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 179.0/179.0 kB 5.3 MB/s eta 0:00:00
Collecting evdev>=1.3
  Downloading evdev-1.6.0.tar.gz (26 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Requirement already satisfied: pycparser in /usr/lib/python3.10/site-packages (from cffi>=1.12->cryptography<37.1.0,>=3.3.2->libnxctrl~=0.1.7->splatplost) (2.21)
Requirement already satisfied: MarkupSafe>=2.0 in /usr/lib/python3.10/site-packages (from Jinja2>=3.0->Flask<2.3.0,>=1.1.2->libnxctrl~=0.1.7->splatplost) (2.1.1)
Collecting bidict>=0.21.0
  Downloading bidict-0.22.0-py3-none-any.whl (36 kB)
Collecting python-engineio>=4.3.0
  Downloading python_engineio-4.3.4-py3-none-any.whl (52 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 52.9/52.9 kB 5.8 MB/s eta 0:00:00
Building wheels for collected packages: dbus-python, hid, evdev
  Building wheel for dbus-python (pyproject.toml) ... done
  Created wheel for dbus-python: filename=dbus_python-1.2.18-cp310-cp310-linux_x86_64.whl size=398147 sha256=a574af03d1cd55fbbb18db2d406f906562a7596126c21e79f5f6121a7a93b232
  Stored in directory: /root/.cache/pip/wheels/41/2f/5d/8139d22ab509d595750109cb8f37acefa23c1773d43bf24d1f
  Building wheel for hid (pyproject.toml) ... done
  Created wheel for hid: filename=hid-1.0.5-py3-none-any.whl size=3730 sha256=b21215279327c340e5a0d2be557c4633df07be15c061092657e1d1c614731606
  Stored in directory: /root/.cache/pip/wheels/56/33/0f/353ed5f5a0813974aa1ca84e5dca348c9dcbc8240e9ec9987c
  Building wheel for evdev (pyproject.toml) ... done
  Created wheel for evdev: filename=evdev-1.6.0-cp310-cp310-linux_x86_64.whl size=85088 sha256=df5ca65cffc7bd2ffd8a88c668c695c3136982a6f0e0391b1938136f0198a608
  Stored in directory: /root/.cache/pip/wheels/65/35/6b/e8b578526dbdf79fd0b22088500306f42bbbcfe0996a4a343f
Successfully built dbus-python hid evdev
Installing collected packages: wcwidth, tsp-solver2, hid, evdev, dbus-python, Werkzeug, tqdm, setuptools, python-xlib, python-engineio, pyparsing, psutil, Pillow, numpy, networkx, itsdangerous, greenlet, dnspython, click, blessed, bidict, aioconsole, tifffile, scipy, PyWavelets, python-socketio, pynput, packaging, imageio, Flask, eventlet, scikit-image, Flask-SocketIO, libnxctrl, splatplost
Successfully installed Flask-2.2.2 Flask-SocketIO-5.3.0 Pillow-9.2.0 PyWavelets-1.3.0 Werkzeug-2.2.2 aioconsole-0.5.1 bidict-0.22.0 blessed-1.19.1 click-8.1.3 dbus-python-1.2.18 dnspython-2.2.1 evdev-1.6.0 eventlet-0.33.1 greenlet-1.1.3 hid-1.0.5 imageio-2.21.2 itsdangerous-2.1.2 libnxctrl-0.1.7 networkx-2.8.6 numpy-1.23.3 packaging-21.3 psutil-5.9.2 pynput-1.7.6 pyparsing-3.0.9 python-engineio-4.3.4 python-socketio-5.7.1 python-xlib-0.31 scikit-image-0.19.3 scipy-1.9.1 setuptools-65.3.0 splatplost-0.1.4 tifffile-2022.8.12 tqdm-4.64.1 tsp-solver2-0.4.1 wcwidth-0.2.5
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
install_splatplost  42.85s user 13.98s system 71% cpu 1:19.76 total
Victrid commented 2 years ago

Maybe you need to check the bluetooth status before starting the program, like when you reboot into the flashable image. Try this in your console:

sudo systemctl status bluetooth

It should say active and running like this:

image

If your page is different to this, please attach the full output of the command (screenshot, or just take a picture of the screen are OK) so we can dig into it.

Ceiyne commented 2 years ago

This turned out to be user error, sorry. I realized that my laptop has a hardware key to turn on bluetooth and after pressing that, the error went away.

However, now I'm stuck at the next part. I am trying to do the sudo splatplot --order command and I get the "Open the pairing menu on switch." message. I went into the pairing menu but nothing happened. The laptop is still sitting at the "Open the pairing menu on switch." message, and no new controllers appeared on the Switch.

Just to make sure I'm not making another stupid mistake, I'm going into the "Change Grip and Order" screen on the Switch that looks like this (this isn't my Switch; it's just a pic of the screen I found online):

image

Ceiyne commented 2 years ago

I tried again to get this to work. I borrowed a USB bluetooth dongle from a friend and used that instead of the one built into my laptop (which I turned off). I rebooted the computer and restarted from scratch with the flashable image, and installed splatplost. I checked the status of the bluetooth with the command you gave me earlier and everything looked good.

However, the same thing happened: the laptop stayed at "open pairing menu on switch" but the Switch didn't see any new controllers.

After that I tried installing & using the new dev version (0.2.0) and the results were basically the same. I clicked the button to start pairing from the GUI but nothing ever happened on the laptop and no new controllers appeared on the switch side.

I tried 5-10 times, doing different things like moving the switch closer or farther away from the bluetooth dongle but it didn't help. I also tried waiting for a long time (up to 5 minutes) to see if anything ever happened, but nothing did.

StuffOfSonny commented 2 years ago

I am also having an issue with using the printer from a flashable image. At first it took a while for it to spit this error at me, but now it's almost instant when I run sudo splatplot --order [my output here] below is a paste of the error


Exception in thread Thread-1 (connection_reset_watchdog):
Traceback (most recent call last):
  File "/usr/lib/python3.10/threading.py", line 1016, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.10/threading.py", line 953, in run
    self._target(self._args, **self._kwargs)
  File "/usr/lib/python3.10/site-packages/libnxctrl/nxbt/nxbt/controller/server.py", line 308, in connection_reset_watchdog
    paths = self.bt.find_connected_devices(alias_filter="Nintendo Switch")
  File "/usr/lib/python3.10/site-packages/libnxctrl/nxbt/nxbt/bluez.py", line 906, in find_connected_devices
    device_conn_status = device_props.Get(
  File "/usr/lib/python3.10/site-packages/dbus/proxies.py", line 72, in call
    return self._proxy_method(args, **keywords)
  File "/usr/lib/python3.10/site-packages/dbus/proxies.py", line 141, in call
    return self._connection.call_blocking(self._named_service,
  File "/usr/lib/python3.10/site-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.UnknownObject: Method "Get" with signature "ss" on interface "org.freedesktop.DBus.Properties" doesn't exist