Git Product home page Git Product logo

splatplost's Introduction

Splatplost

中文

Splatplost is a software-based Splatpost plotter based on libnxctrl. Unlike the former commonly used USB printer which requires a Teensy, or AVR based microcontrollers, You only need a device with bluetooth connection, which is easy to use. With an optimized printing algorithm, this can save you up to 1/3 time printing it.

Basic Usage

Installation

It's recommended to use a physical linux machine. If you don't have one, you may check the flashable image. Windows or macOS is not supported, as libnxctrl is based on bluez, the linux bluetooth stack.

You need to use sudo, or root, as altering bluetooth is a privileged operation.

sudo pip install splatplost

This will automatically install the required dependencies.

If you need to update the library, you can use pip install --upgrade splatplost.

Use

Generate a plotting plan with:

sudo splatplan -i <your image> -o <output filename>

Start the printer:

sudo splatplot --order <output filename>

You may check the printer's option (for example, stable mode, customizing delay and press time, etc.) with:

sudo splatplot --help

When "Open the pairing menu on switch." shows on the screen, go to the pairing menu, and the switch will be paired.

Then you may enter the game and enter splatpost interface using your own controller. Remember to set the brush to minimum one.

When everything is prepaired, disconnect your own controller, (for example, press the tiny pairing button on the top of the controller), and you'll enter the "connect to controller" menu.

Press enter or "A" button on your computer as instructed, the plotting will begin. You may see the progress and ETA time while printing.

Help needed / I found a bug / Feature request

Click the "Issues" link above to open an issue on the repository.

If you find bugs on connection, please open issues to libnxctrl.

Contributing

License

This project is based on libnxctrl, so it is released under GPLv3.

splatplost's People

Contributors

dependabot[bot] avatar logic530 avatar victrid avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

splatplost's Issues

using the splatplost .iso as a persistent installation on a removable drive?

I don't feel like a ticket is the right way to ask this but I'm not sure what other route to go.

Is there any way to use the .iso for splatplost as a persistent installation on a usb drive? I used Rufus on windows to create the drive and I made sure to maximize my persistent partition but when I switch back to windows and then load up arch from the USB, it's back to a blank slate of entering wifi, installing splatplost and other items, losing my display settings, etc. I did some further research and it looks like other steps need to be done that I'm not able to do to the .iso file, but it might be my lack of advanced linux knowledge leading me to falsely believe that to be true.

Any help is appreciated. Thank you.

SyntaxError on f-string

Error occured when running python ./insgen.py IMAGE.png IMAGE.order:

File "./insgen.py", line 131
    f"Complete. Original difficulty: {original_num}, Optimized difficulty:{optimized_num}\n")
                                                                                           ^
SyntaxError: invalid syntax

Mode to draw in zig-zag pattern

Hi, I've noticed that Splatplost seems to draw in a random pattern that I assume is meant to speed up the drawing process. However my image needs a lot of accuracy in order for it to work properly, and I've gotten a lot of misalignment with the current pattern. Can there be a drawing mode that draws a line of pixels across the screen, then moves down one pixel and draws the next line in the opposite direction?

can not draw accurately

WeChat Image_20210325205725

WeChat Image_20210326033617
-----------------------------------------update------------------------------
I updated the software and used sudo python ./print.py IMAGE.order 0.1. But the problem are getting worse.
WeChat Image_20210327191942

frequently reconnection problem

While use the splatplost in splatoon3,meets the above obstacle, print every 4pit will eject the reconnection page= =
after 6 mins the splatplost stop and never connect to the NS. How should I do to deal with this problem?
PS this happened in the tv mode,because the oled screen....I am really worry about it's life....

Add redrawing functions

As bluetooth connection stability is highly dependent on the Wireless NIC, we need to add the redrawing function.

  • Allow user to redraw by blocks
  • Read a screenshot and check which part is broken, and generate patches to it.

This is working on version 0.2.0.

Error running splatplan

(venv) root@logic-VirtualBox /h/l/splatplost# 
splatplan -i post.png -o post.order
Traceback (most recent call last):
  File "/home/logic/splatplost/venv/bin/splatplan", line 9, in <module>
    from splatplost.generate_route import ResetPosition, divide_image, generate_block_visit, generate_order_file, find_nearest_reset_position, \
  File "/home/logic/splatplost/venv/lib/python3.8/site-packages/splatplost/generate_route.py", line 98, in <module>
    def get_label(image: np.ndarray) -> tuple[np.ndarray, int]:
TypeError: 'type' object is not subscriptable

Windows version in v0.2.0 not recognizing switch

Hello!
I don't use Github but I made an account because I can't figure out how to use the Windows version of Splatplost. I tried both using the USB-C and remote connections, but neither will recognize my Switch. If it matters, I'm on Windows 10 and trying to connect to Splatoon 3.
USB-C connection:
image My computer recognizes my Switch via Bluetooth, but the program itself doesn't. I've tried reconnecting it and closing the program, but nothing seems to work.
For the remote connection, I'm unsure of what to put in the remote server box. I went to the Switch pairing menu, but no new controllers appeared.
image
I don't have Linux, or any knowledge of Python, so any help is appreciated! This is a great tool and I've seen so many printed pictures in the plaza.

Bluetooth to switch connection failing on dev4

Describe the bug

When attempting to connect to my switch using the Remote option, I get a OSError: unsupported XML-RPC protocol. This may be due to a blank Remote Server box, but I'm not sure what to put in that box.

Running Environment Information

Splatplost version: 0.2.0.dev3

Python version: 3.10.6 (main, Aug 10 2022, 11:40:04) [GCC 11.3.0]

OS Information: Linux-5.15.0-48-generic-x86_64-with-glibc2.35

Systemd Version:

systemd 249 (249.11-0ubuntu3.4)
+PAM +AUDIT +SELINUX +APPARMOR +IMA +SMACK +SECCOMP +GCRYPT +GNUTLS +OPENSSL +ACL +BLKID +CURL +ELFUTILS +FIDO2 +IDN2 -IDN +IPTC +KMOD +LIBCRYPTSETUP -LIBFDISK +PCRE2 -PWQUALITY -P11KIT -QRENCODE +BZIP2 +LZ4 +XZ +ZLIB +ZSTD -XKBCOMMON +UTMP +SYSVINIT default-hierarchy=unified

Python Traceback

Traceback (most recent call last):
  File "/usr/local/lib/python3.10/dist-packages/splatplost/gui/plotter.py", line 44, in run
    self.working_function()
  File "/usr/local/lib/python3.10/dist-packages/splatplost/gui/plotter.py", line 118, in pairing
    raise e
  File "/usr/local/lib/python3.10/dist-packages/splatplost/gui/plotter.py", line 113, in pairing
    connection = backend(**parameters)
  File "/usr/local/lib/python3.10/dist-packages/libnxctrl/rpc.py", line 61, in __init__
    self.control = ServerProxy(self.host)
  File "/usr/lib/python3.10/xmlrpc/client.py", line 1432, in __init__
    raise OSError("unsupported XML-RPC protocol")
OSError: unsupported XML-RPC protocol

Bluetooth status

● bluetooth.service - Bluetooth service
     Loaded: loaded (/lib/systemd/system/bluetooth.service; enabled; vendor preset: enabled)
     Active: active (running) since Sun 2022-10-09 14:52:25 EDT; 1h 5min ago
       Docs: man:bluetoothd(8)
   Main PID: 656 (bluetoothd)
     Status: "Running"
      Tasks: 1 (limit: 9312)
     Memory: 2.0M
        CPU: 4.848s
     CGroup: /system.slice/bluetooth.service
             └─656 /usr/lib/bluetooth/bluetoothd

Oct 09 15:34:11 Ichaival-r02-prime bluetoothd[656]: Endpoint unregistered: sender=:1.37 path=/MediaEndpoint/A2DPSink/sbc_xq_552
Oct 09 15:34:11 Ichaival-r02-prime bluetoothd[656]: Endpoint unregistered: sender=:1.37 path=/MediaEndpoint/A2DPSource/sbc_xq_552
Oct 09 15:34:17 Ichaival-r02-prime bluetoothd[656]: Endpoint registered: sender=:1.37 path=/MediaEndpoint/A2DPSink/sbc
Oct 09 15:34:17 Ichaival-r02-prime bluetoothd[656]: Endpoint registered: sender=:1.37 path=/MediaEndpoint/A2DPSource/sbc
Oct 09 15:34:17 Ichaival-r02-prime bluetoothd[656]: Endpoint registered: sender=:1.37 path=/MediaEndpoint/A2DPSink/sbc_xq_453
Oct 09 15:34:17 Ichaival-r02-prime bluetoothd[656]: Endpoint registered: sender=:1.37 path=/MediaEndpoint/A2DPSource/sbc_xq_453
Oct 09 15:34:17 Ichaival-r02-prime bluetoothd[656]: Endpoint registered: sender=:1.37 path=/MediaEndpoint/A2DPSink/sbc_xq_512
Oct 09 15:34:17 Ichaival-r02-prime bluetoothd[656]: Endpoint registered: sender=:1.37 path=/MediaEndpoint/A2DPSource/sbc_xq_512
Oct 09 15:34:17 Ichaival-r02-prime bluetoothd[656]: Endpoint registered: sender=:1.37 path=/MediaEndpoint/A2DPSink/sbc_xq_552
Oct 09 15:34:17 Ichaival-r02-prime bluetoothd[656]: Endpoint registered: sender=:1.37 path=/MediaEndpoint/A2DPSource/sbc_xq_552

--order not working

Traceback (most recent call last):
File "/usr/local/bin/splatplot", line 24, in
plot(order_list=f.readlines(),
File "/usr/local/lib/python3.10/dist-packages/splatplost/plot.py", line 23, in plot
connection.connect()
File "/usr/local/lib/python3.10/dist-packages/libnxctrl/nxbt_wrapper.py", line 82, in connect
self.nx.wait_for_connection(self.controller_idx)
File "/usr/local/lib/python3.10/dist-packages/libnxctrl/nxbt/nxbt/nxbt.py", line 632, in wait_for_connection
raise OSError("The watched controller has crashe with error",
OSError: [Errno The watched controller has crashe with error] Traceback (most recent call last):
File "/usr/local/lib/python3.10/dist-packages/libnxctrl/nxbt/nxbt/controller/server.py", line 88, in run
self.controller.setup()
File "/usr/local/lib/python3.10/dist-packages/libnxctrl/nxbt/nxbt/controller/controller.py", line 43, in setup
self.bt.set_powered(True)
File "/usr/local/lib/python3.10/dist-packages/libnxctrl/nxbt/nxbt/bluez.py", line 646, in set_powered
self.device.Set(ADAPTER_INTERFACE, "Powered", dbus_value)
File "/usr/lib/python3/dist-packages/dbus/proxies.py", line 141, in call
return self._connection.call_blocking(self._named_service,
File "/usr/lib/python3/dist-packages/dbus/connection.py", line 652, in call_blocking
reply_message = self.send_message_with_reply_and_block(
dbus.exceptions.DBusException: org.bluez.Error.Blocked: Blocked through rfkill

GUI not working without root privilege

Using the 0.2.0.dev0 version, I get the GUI to launch (looks very nice by the way) and can interact with it, however when I click "Connect to Switch" and then "Start Pairing," nothing happens and the GUI does not progress to step 2. The Switch console, in the pairing menu, has no response either.
I'm not sure what I'm doing wrong-- I know my hardware is compatible with spoofing the controller because I have used NXBT before successfully on this setup.

I am using Python 3.10 on PopOS 22.04 LTS on bare metal, not in a VM.

Originally posted by @SuperOkazaki in #13 (comment)

AttributeError: 'Namespace' object has no attribute 'input'

might just be an idiot. But trying to get it working on Ubuntu
But no matter what I input I get the error.

Traceback (most recent call last):

File "/usr/local/bin/splatplan", line 37, in

main(args.input, args.output)

AttributeError: 'Namespace' object has no attribute 'input'

Windows version of v0.2.0 only displays COM1 for Splatplost USB

I am unable to use the Splatplost USB option as the only available "device" is COM1, a serial port. Windows can recognize my Switch when plugged in through USB, so I am at a complete loss of what to do here. I do not have such a serial port on my PC and even if I did, that would not resolve the issue.
image

ModuleNotFoundError: No module named 'tqdm'

我已经安装了tqdm, 可是还是No module named 'tqdm',这是为什么?

Laptop:~/Desktop/splatplost-master$ sudo python3 ./print.py IMAGE.order

Traceback (most recent call last):
File "./print.py", line 6, in
import tqdm
ModuleNotFoundError: No module named 'tqdm'

Laptop:~/Desktop/splatplost-master$ pip3 install tqdm

Requirement already satisfied: tqdm in /home/.local/lib/python3.8/site-packages (4.59.0)

Laptop:~/Desktop/splatplost-master$ sudo python3 ./print.py IMAGE.order

Traceback (most recent call last):
File "./print.py", line 6, in
import tqdm
ModuleNotFoundError: No module named 'tqdm'

Bluetooth error when using flashable image

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

cant launch gui

When i try to launch the GUI i get this error

sudo: splatplost: command not found

im not really sure what to do from here. any advice?

Non-GUI Options

We're planning to add an option supporting devices without GUI, considering that

  • devices supporting linux and bluetooth may have difficulties access the GUI
  • without GUI some actions would be difficult to perform on terminal

The plotter would be like:



                                  ''''''' '''''''
                           '''''''  Linux        '''
     '''''               ''  ┌──────────────────┐   ''
''''''   ''''            '   │Orig. Backend on  │    '
'  Platform '' ┌───────┐''┌─►│supported devices │    '
' Independent' │       │' │  └──────────────────┘   ''
'            ' │       │' │               '''' '''''
''   ┌─────┐ ' │ Back  │''│     ''''''''''' '''''
 '   │ GUI ├──►│ -end  ├─'│ ''''''┌──────────────''
  '  └─────┘ ' │       │  ''   '' │   Dev like   │ ''
   ''        ' │ Proxy │   HTTP'  │  Raspi, non  │  ''
    '''''''''' │       ├───...┼'─►│  GUI daemon  │   '
               │       │       '  │ For plotting │   '
               └───────┘       '  └──────────────┘    '
                               ''    Embedded        ''
                                ''   Devices..   '''''
                                 '''            ''
                                   '''' '''''''''
                                       ''

Support for Splatoon 3

We found out that Splatoon 3 testfire already provide an interface for splatpost submissions.

We can improve this script further so that it can be used to paint in Splatoon 3.


To all:

If you are trying to install the latest beta version, please check https://pypi.org/project/splatplost/#history for the latest pre-release.

The package is now splitted into nxbt and usb part. If you are seeing this post, you could install all (on linux) for complete backends.

For example, if you see that the latest version from pypi is something called 0.2.0.dev4, you may use

sudo pip install "splatplost[nxbt,usb]==0.2.0.dev4"

If you are updating, you may use

sudo pip install -U "splatplost[nxbt,usb]==0.2.0.dev4"

windows和虚拟机都试过了,都有相同的报错

root@t-virtual-machine:/home/t/下载/splatplost-master# python ./print.py IMAGE.order
Traceback (most recent call last):
File "./print.py", line 11, in
from joycontrol.controller_state import ControllerState, button_push, button_press, button_release
File "/home/t/下载/splatplost-master/joycontrol/controller_state.py", line 3, in
from joycontrol import utils
File "/home/t/下载/splatplost-master/joycontrol/utils.py", line 5, in
import hid
File "/usr/local/lib/python3.6/dist-packages/hid/init.py", line 30, in
raise ImportError(error)
ImportError: Unable to load any of the following libraries:libhidapi-hidraw.so libhidapi-hidraw.so.0 libhidapi-libusb.so libhidapi-libusb.so.0 libhidapi-iohidmanager.so libhidapi-iohidmanager.so.0 libhidapi.dylib hidapi.dll libhidapi-0.dll

https://bbs.nga.cn/read.php?&tid=25779071&pid=632631776&to=1

Cannot generate plotting plan

loki@loki-virtual-machine:~/Desktop$ sudo splatplan -i inkling.png -o test
[sudo] loki's password:
Blocks to be visited: 0%| | 0/24 [00:00<?, ?it/s]

The execution progress of the program stopped at 0%. After I waited for a few minutes, the terminal interface closed automatically.
I tried several times and all failed

Using Ubuntu 22.04.1 LTS

``WI_AW RQH}$39F9S5NITN

自动关闭画板 Automatic closing of the drawing board

问题如下:程序连接完毕,设置完最小笔尖。坐标点会自动移到左上角,然后自动按-退出画板并重新进入,此时画笔重置为中等笔尖,并且坐标位于中间,开始作画

The problem: Program is connected .The coordinate point will automatically move to the upper left corner, then automatically press - to exit the board and re-enter, then the brush is reset to medium tip and the coordinates are in the middle, start painting

Issues connecting to switch.

Hello.
I'm running the dev0 build of Splatplost, using the flashable image, and whenever I attempt to connect to my switch, it seems to fail. Looking in the bluetooth menu down in the taskbar reveals that it connects for a second, then disconnects, and repeats.
I'm not quite sure if this project is still active, however, any help from anybody would be greatly appreciated.

Check if we can use USB for connection

Now that there are compatibility issues with drawing with Bluetooth, we may need to fall back to the USB joystick emulation. This would also be quicker to draw and would solve the problems mentioned in #4.

list index out of range

Ive followed the limited provided instructions and even tried using the provided flashable image but no matter what i try i keep getting the following message when doing the sudo splatplot --order command. I am not sure what could be causing this issue and am not sure what i am doing wrong.

outofbounds

Drawing will offset itself

Hello, an issue I have encountered is that when it keeps drawing it will randomly offset itself for some areas, some images it will be the same spot while for others at random. I have tried using stable mode and have gotten the same results.
test image

Wasted my time

Running on Raspberry pi zero 2 w. Raspbian 32bit is installed.

After overcoming the hardships associated with dependencies, the program stuck at "Open the pairing menu on switch."
And my switch haven't recognized it.

Fix pairing issues with switch version 12+

The plotter cannot be connected with switch for version 12+.

Behaviour
When program is running to "Open the pairing menu on switch.", after the pairing menu is opened, the program cannot connect correctly.

Problem
This is caused due to broken dependency joycontrol.

This issue is posted in order to replace:

No new issues on pairing will be handled if it's the same behaviour until this issue is solved.

Post closes before drawing

The program works fine until it's about to start drawing, the controller presses the minus button causing it to save and exit.

Can't download Pre-Configured image

In the page Use Pre-Configured Image, it's suggested to download said image from 3 services.

I can't download from any of them.

First is Mega, which will only download 1 GB or so and then demands money. The second requires a login. The third asks for a program to install, and since it's Baidu, I don't trust it.

Could I suggest alternatives? I've seen quite a lot of people using dummy Google Drive accounts to share big files. They don't require login and will let you download the entire thing. The only error they throw is that they can't virus scan such a big file but otherwise you can download fine.

A dummy Dropbox account could work too but if the file is too popular they'll cut access at some point.

Another suggestion that could work is using BitTorrent. As long as one person has the file served in a bittorrent client like "qBittorrent", everyone else should be able to grab it.

ModuleNotFoundError: No module named 'libnxctrl.nxbt.nxbt'

Don't know if this should be here or on the libnxctrl page, but I get this error when trying to start a plot.

sudo splatplot --order testsample.order

Traceback (most recent call last):

File "/usr/local/bin/splatplot", line 19, in

back = get_backend(args.backend)

File "/usr/local/lib/python3.10/dist-packages/libnxctrl/bluetooth.py", line 8, in get_backend

from .nxbt_wrapper import NXBTControl

File "/usr/local/lib/python3.10/dist-packages/libnxctrl/nxbt_wrapper.py", line 1, in

from .nxbt.nxbt import Buttons as NXBT_Buttons, Nxbt, PRO_CONTROLLER, find_devices_by_alias

ModuleNotFoundError: No module named 'libnxctrl.nxbt.nxbt'

Chromebook support

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.

Failed to press A button.

First for all, I'm so impressed by this brilliant project after researching on lots of hardware based solutions.
However, there might be an issue where the A button doesn't getting pressed at the beginning. Instead the +/- button was somehow pressed and the controller help menu from Switch shows up. The plot is also likely offsetted.
(See my recording below)

I'm using the Pre-configured Image.

Screenshot.2023-01-07.at.21.02.39-converted.mp4

Another "Open the pairing menu on switch" but nothing happened

20220901_234051

After long waiting, it shows an exception.

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

NS version: 14.1.2
Ubuntu version: 22.04.1 LTS
Does this have something to do with me not having NXBT installed separately?
But when I try to install NXBT, it just failed to build the wheel for dbus-python
I have no idea about what to do next

Showing Error when press Draw

Describe the bug

Using the latest version GUI to draw on Splatoon 3.
Already paired with Switch and can press L/R button.
Loaded PIC and try to select some area and draw.

It show error after press "Draw selected" button.

Running Environment Information

Splatplost version: 0.2.0.dev4

Python version: 3.10.6 (main, Aug 3 2022, 17:39:45) [GCC 12.1.1 20220730]

OS Information: Linux-5.19.6-arch1-1-x86_64-with-glibc2.36

Systemd Version:

systemd 251 (251.4-1-arch)
+PAM +AUDIT -SELINUX -APPARMOR -IMA +SMACK +SECCOMP +GCRYPT +GNUTLS +OPENSSL +ACL +BLKID +CURL +ELFUTILS +FIDO2 +IDN2 -IDN +IPTC +KMOD +LIBCRYPTSETUP +LIBFDISK +PCRE2 -PWQUALITY +P11KIT -QRENCODE +TPM2 +BZIP2 +LZ4 +XZ +ZLIB +ZSTD -BPF_FRAMEWORK +XKBCOMMON +UTMP -SYSVINIT default-hierarchy=unified

Python Traceback

Traceback (most recent call last):
  File "/usr/lib/python3.10/site-packages/splatplost/gui/plotter.py", line 46, in run
    self.working_function()
  File "/usr/lib/python3.10/site-packages/splatplost/gui/plotter.py", line 265, in draw_func
    partial_plot_with_conn(self.connection, self.RouteFile.blocks.items(), key_binding=self.current_key_binding,
  File "/usr/lib/python3.10/site-packages/splatplost/plot.py", line 317, in partial_plot_with_conn
    execute_command_list(command_list, connection, stable_mode=stable_mode)
  File "/usr/lib/python3.10/site-packages/splatplost/plot.py", line 99, in execute_command_list
    connection.button_hold(command[0], command[1])
  File "/usr/lib/python3.10/site-packages/libnxctrl/rpc.py", line 72, in button_hold
    self.control.button_hold(
  File "/usr/lib/python3.10/xmlrpc/client.py", line 1122, in __call__
    return self.__send(self.__name, args)
  File "/usr/lib/python3.10/xmlrpc/client.py", line 1464, in __request
    response = self.__transport.request(
  File "/usr/lib/python3.10/xmlrpc/client.py", line 1166, in request
    return self.single_request(host, handler, request_body, verbose)
  File "/usr/lib/python3.10/xmlrpc/client.py", line 1182, in single_request
    return self.parse_response(resp)
  File "/usr/lib/python3.10/xmlrpc/client.py", line 1354, in parse_response
    return u.close()
  File "/usr/lib/python3.10/xmlrpc/client.py", line 668, in close
    raise Fault(**self._stack[0])
xmlrpc.client.Fault: <Fault 1: "<class 'TypeError'>:NXBTControl.button_hold() got an unexpected keyword argument 'button_name'">

Bluetooth status

● bluetooth.service - Bluetooth service
     Loaded: loaded (/usr/lib/systemd/system/bluetooth.service; enabled; preset: disabled)
    Drop-In: /run/systemd/system/bluetooth.service.d
             └─nxbt.conf
     Active: active (running) since Thu 2022-11-10 10:07:59 UTC; 33min ago
       Docs: man:bluetoothd(8)
   Main PID: 3525967 (bluetoothd)
     Status: "Running"
      Tasks: 1 (limit: 38079)
     Memory: 1.0M
        CPU: 609ms
     CGroup: /system.slice/bluetooth.service
             └─3525967 /usr/lib/bluetooth/bluetoothd --compat "--noplugin=*"

Nov 10 10:07:59 arch-splatplost-iso bluetoothd[3525967]: Excluding (cli) avrcp
Nov 10 10:07:59 arch-splatplost-iso bluetoothd[3525967]: Excluding (cli) network
Nov 10 10:07:59 arch-splatplost-iso bluetoothd[3525967]: Excluding (cli) input
Nov 10 10:07:59 arch-splatplost-iso bluetoothd[3525967]: Excluding (cli) hog
Nov 10 10:07:59 arch-splatplost-iso bluetoothd[3525967]: Excluding (cli) gap
Nov 10 10:07:59 arch-splatplost-iso bluetoothd[3525967]: Excluding (cli) scanparam
Nov 10 10:07:59 arch-splatplost-iso bluetoothd[3525967]: Excluding (cli) deviceinfo
Nov 10 10:07:59 arch-splatplost-iso bluetoothd[3525967]: Excluding (cli) midi
Nov 10 10:07:59 arch-splatplost-iso bluetoothd[3525967]: Excluding (cli) battery
Nov 10 10:07:59 arch-splatplost-iso bluetoothd[3525967]: Bluetooth management interface 1.22 initialized

TypeError: 'type' object is not subscriptable

i use this command "sudo splatplan -i 1.jpeg -o 111"
then

Traceback (most recent call last):
File "/usr/local/bin/splatplan", line 9, in
from splatplost.generate_route import ResetPosition, divide_image, generate_block_visit, generate_order_file, find_nearest_reset_position,
File "/usr/local/lib/python3.8/dist-packages/splatplost/generate_route.py", line 98, in
def get_label(image: np.ndarray) -> tuple[np.ndarray, int]:
TypeError: 'type' object is not subscriptable

splatplost[nxbt]==0.2.0.dev4 does not install.

Running sudo pip3 install splatplost[nxbt]==0.2.0.dev4 leads to the following error:

ERROR: Could not find a version that satisfies the requirement sys-platform=='linux'; extra == "nxbt" (from splatplost[nxbt]) (from versions: none)
ERROR: No matching distribution found for sys-platform=='linux'; extra == "nxbt"

Running Ubuntu 22.04 on x86_64

splatplost[nxbt]==0.2.0.dev3 installs fine (although i'm struggling to get it to run with root permissions, I'm getting the following error when running it with sudo:

qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
 
Available platform plugins are: linuxfb, offscreen, xcb, minimal, wayland-egl, minimalegl, vnc, wayland, eglfs, vkkhrdisplay.
 
Aborted

this issue was resolved by using KDE plasma instead of gnome)

Not returning to the corners properly and pixel shifting problem

Like andyubird said :
The plotter isn't returning to the corners properly when it's plotting the first square on the third row, maybe holding down the buttons longer may fix it? Also, some of the blocks is shifted by 1px the left or right, with the contents of it complete.

I have also had this issue trying to splatplot a whole image. Please help.

Enhance documentation

The documentation in README.md is rather misleading, as bluetooth over virtual machine or windows is rather badly supported.

The program is only tested on linux on bare metal machine, and we need documentation to address that.

Furthermore, it's possible that we provide a Linux image, to be burnt onto some USB drive, and user can plot this out of box.

This issue is posted in order to replace:

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.