Victrid / splatplost

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

Support for Splatoon 3 #13

Open Victrid opened 2 years ago

Victrid commented 2 years ago

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"
chenchenfang commented 2 years ago

good job!

Joshua7896 commented 1 year ago

Nice! Looking forward to it!

Victrid commented 1 year ago

Hello, I've updated a beta version which supports splatoon 3 and have a GUI. Check https://github.com/Victrid/splatplost/tree/dev-v0.2 for readme file for more information.

If you want to try this version, you need to install with special pip command, which allows you to install a pre-release version:

sudo pip install splatplost==0.2.0.dev0
grantbacon commented 1 year ago

Which version of python is this dev version targeting? I'm getting a syntactical error regarding the union operator when using python 3.9.2:

  File "/home/none/splatplost/splatplost/common.py", line 5, in <module>
    Command = tuple[Button, int] | Button
TypeError: unsupported operand type(s) for |: 'types.GenericAlias' and 'EnumMeta'

I thought union operator was added in 3.9.x... I've also tried both installing with pip and also building manually with the setuptools script to no avail.

Victrid commented 1 year ago

Which version of python is this dev version targeting? I'm getting a syntactical error regarding the union operator when using python 3.9.2:

  File "/home/none/splatplost/splatplost/common.py", line 5, in <module>
    Command = tuple[Button, int] | Button
TypeError: unsupported operand type(s) for |: 'types.GenericAlias' and 'EnumMeta'

I thought union operator was added in 3.9.x... I've also tried both installing with pip and also building manually with the setuptools script to no avail.

I thought this is PEP 604 and supported in python 3.10?

Victrid commented 1 year ago

@grantbacon Let me see if I can separate type hints to stub files...

grantbacon commented 1 year ago

Ah, I see from the PEP you shared it was introduced 3.10, my apologies. I can just use 3.10 in a virtual env instead of using python3.9 which is current in the Debian buster repo.

Thanks for the timely response and useful info!

El sáb, 10 de sept de 2022, 17:33, Jiang Weihao @.***> escribió:

@grantbacon https://github.com/grantbacon Let me see if I can separate type hints to stub files...

— Reply to this email directly, view it on GitHub https://github.com/Victrid/splatplost/issues/13#issuecomment-1242826802, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAG4GYIWKX6ACT67CCLKQRLV5USF5ANCNFSM57VFW4RA . You are receiving this because you were mentioned.Message ID: @.***>

SuperOkazaki commented 1 year ago

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.

Victrid commented 1 year ago

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.

Did you launch the GUI with root privileges? If you don't the Start Pairing will just have a flash and return to Start Pairing. I'll add a notification to this.

SuperOkazaki commented 1 year ago

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.

Did you launch the GUI with root privileges? If you don't the Start Pairing will just have a flash and return to Start Pairing. I'll add a notification to this.

That fixed it, thank you. One more problem. I got the PC to sync with the console, and all works well when I am in the Change Order menu, but when I try to connect the software to the prompt that comes up when making a post in-game, I am unable to progress. Splatplost GUI does not allow me to press A.

https://imgur.com/PxeN5Kc.jpeg

DetectiveNaoya commented 1 year ago

Do you know what could cause the program to frequently disconnect with a Switch? For extra details I'm using the pre flashed image provided. When running the program I'm able to connect for the first time but it'd send me to the reconnection screen every time I tried to do anything with it, especially when it comes to the drawing process.

Victrid commented 1 year ago

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.

Did you launch the GUI with root privileges? If you don't the Start Pairing will just have a flash and return to Start Pairing. I'll add a notification to this.

That fixed it, thank you. One more problem. I got the PC to sync with the console, and all works well when I am in the Change Order menu, but when I try to connect the software to the prompt that comes up when making a post in-game, I am unable to progress. Splatplost GUI does not allow me to press A.

https://imgur.com/PxeN5Kc.jpeg

I think this means that the GUI have not detected that you've connected to it. Maybe restart the GUI and do a reconnect while switch is at plot screen might help.

SuperOkazaki commented 1 year ago

I think this means that the GUI have not detected that you've connected to it. Maybe restart the GUI and do a reconnect while switch is at plot screen might help.

I ended up having to disconnect my bluetooth adapter and re-connecting it. Maybe it was loose! I got the printer to work :) it is just becoming misaligned during longer prints, so I am playing around with higher ms delays to get a stable print

very happy that I got it working for splatoon 3! thank you for all your hard work

Victrid commented 1 year ago

Hello, I've uploaded with a newer version 0.2.0.dev2, which fixes:

Check https://github.com/Victrid/splatplost/tree/dev-v0.2 for readme file for more information.

If you want to try this version, you need to install with special pip command, which allows you to install a pre-release version:

sudo pip install splatplost==0.2.0.dev2

If this version does not have much problem, I'll merge it into master branch and put out for stable release.

kodxana commented 1 year ago

Any plan for Python3.9 support is still latest one on debian :/

AuthorX commented 1 year ago

Hi,

I'm trying to use the dev2 build with Splatoon 3 but on two systems it hasn't worked for me so far.

Raspberry Pi Zero W (on Raspberry Pi OS, aka Debian Bullseye): Installed pyenv Used it to build Python 3.10.7 Switched the "local" version (in home directory) to 3.10.7 Ran the above sudo pip install splatplost==0.2.0.dev2

When it gets to trying to install PyQt6~=6.3.1 it fails with the following:

× Preparing metadata (pyproject.toml) did not run successfully. │ exit code: 1 ╰─> [29 lines of output] Traceback (most recent call last): File "/home/pi/.pyenv/versions/3.10.7/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 156, in prepare_metadata_for_build_wheel hook = backend.prepare_metadata_for_build_wheel AttributeError: module 'sipbuild.api' has no attribute 'prepare_metadata_for_build_wheel'

Lubuntu (light Ubuntu) running from a bootable USB drive: Successfully installed the dev2 build Ran using sudo splatplost Loaded image On my switch, went to the post drawing screen Hit Home to open the home menu then change order/pair controllers screen In Splatplost, hit "Connect to Switch" then "Start Pairing"

After that, it just waited at the pairing screen. It didn't fail or boot me back but it never paired, either.

I checked that Lubuntu could access my bluetooth module by scanning for bluetooth devices in the system menu, and tried closing splatplost then running sudo service Bluetooth restart to restart the service and retrying, but to no avail (the bluetooth module is built into my desktop, so I couldn't unplug it and replug it as someone else suggested before).

I'm not sure if it's possible to get it working on the Rapsberry Pi Zero but I'm surprised Lubuntu didn't seem to work. If there's any other info I can provide that would be helpful, let me know.

I'll also note that I was going to try using the regular commands to see if they would give an error message or anything, but running sudo splatplost ---help just launched the GUI again. I hope the update with the GUI won't disable commands entirely, if it is possible to get it working on the raspberry pi zero I would need to run it through ssh, as it doesn't have a desktop environment installed at all.

grantbacon commented 1 year ago

Just wanted to say got it running swimmingly using Debian bookworm/sid (testing repo) which packages python3.10, qt6 and other necessities for your latest realease. Currently plotting away now! :smile_cat:

I tried using pyenv on stable debian install but realized I wouldn't have a lot of the needed headers for other dependencies like qt6 unless I also built them manually, which would frankly be more of a hassle (especially maintenance wise).

I would also echo a desire to have the ability to run without GUI as before, if such beahavior can be preserved. Anyway,thanks so much for the awesome project!

andyubird commented 1 year ago

Thank you for making such an convenient tool. I've installed the dev2 version and just encountered an issue. 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.

DetectiveNaoya commented 1 year ago

Just wanted to say got it running swimmingly using Debian bookworm/sid (testing repo) which packages python3.10, qt6 and other necessities for your latest realease. Currently plotting away now! 😸

I tried using pyenv on stable debian install but realized I wouldn't have a lot of the needed headers for other dependencies like qt6 unless I also built them manually, which would frankly be more of a hassle (especially maintenance wise).

I would also echo a desire to have the ability to run without GUI as before, if such beahavior can be preserved. Anyway,thanks so much for the awesome project!

how did you do this?

zong1203 commented 1 year ago

Thank you for making such an convenient tool. I've installed the dev2 version and just encountered an issue. 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'm too. it's annoying

funkyFangs commented 1 year ago

Is there an option for Splatoon 3 support via CLI instead of GUI? I'm trying to use version 0.2.0.dev0 on an Ubuntu server, but it seems like the only option is for the GUI.

Victrid commented 1 year ago

Is there an option for Splatoon 3 support via CLI instead of GUI? I'm trying to use version 0.2.0.dev0 on an Ubuntu server, but it seems like the only option is for the GUI.

@funkyFangs The 0.2.x version introduces a selective draw and clean method, and I'm still working on how to translate them into CLI options.

CrocodileCroco commented 1 year ago

Thank you for making such an convenient tool. I've installed the dev2 version and just encountered an issue. 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'm too. it's annoying

Same problem :/

JTiger24 commented 1 year ago

Has anyone been able to get this version working an a Raspberry Pi? I don't think PyQt6 works on them.

starbitterling commented 1 year ago

ah hello, im not sure if this is the best place to contact you or if i should have opened up a new issue, but i think i might need your help step by step with this ? whenever i open splatplan it logs me out immediately. i think i must be lost or something ?

funkyFangs commented 1 year ago

Is the Erase selected option currently functional in the GUI? Every time I use it, it acts identically to Draw selected.

Additionally, is there any intention to add support for cancelling a currently-running task? I'm getting a lot of desynchronization/pixel shift issues, and it would be nice to cancel/pause it so that I can fix them.

Victrid commented 1 year ago

@funkyFangs

Is the Erase selected option currently functional in the GUI? Every time I use it, it acts identically to Draw selected.

Yes. The terminal part is not done yet.

Additionally, is there any intention to add support for cancelling a currently-running task? I'm getting a lot of desynchronization/pixel shift issues, and it would be nice to cancel/pause it so that I can fix them.

For now, you can just close the window / press Ctrl+C to terminate. I'll add this part in the future.

Victrid commented 1 year ago

@starbitterling

ah hello, im not sure if this is the best place to contact you or if i should have opened up a new issue, but i think i might need your help step by step with this ? whenever i open splatplan it logs me out immediately. i think i must be lost or something ?

That is strange. Which linux distribution are you using?

LOKI696 commented 1 year ago

目前使用DEV2版本,使用预配置镜像

繪圖功能都OK 有個問題就是好幾次左邊兩格都偵測不到 繪畫不上去 使用穩定模式 80/80毫秒

請問這怎麼解決呢

建議把DEV2版本增加到主頁

https://imgur.com/a/HUoXvRO

JTiger24 commented 1 year ago

I set up an old laptop for dual boot with Debian bookworm. Install went well, and the program connected to the device correctly, but I'm also getting the pixel shifts multiple people have reported.

Pongormah commented 1 year ago

Is the Erase selected option currently functional in the GUI? Every time I use it, it acts identically to Draw selected.

Additionally, is there any intention to add support for cancelling a currently-running task? I'm getting a lot of desynchronization/pixel shift issues, and it would be nice to cancel/pause it so that I can fix them.

Just commenting to add that I, like many others, am having pixel shifts occurring semi-frequently. Implementation of mentioned feature would be incredibly welcomed.

JTiger24 commented 1 year ago

On both the second and third rows, the tool started by drawing the selection from the first column in the third column. It also disconnected after about 4 hours before completing the last row. Unfortunately I wasn't watching when it disconnected, so the Switch went to sleep and I lost the whole drawing. I'll probably give it another try tonight and see what it's output tomorrow morning.

LOKI696 commented 1 year ago

I set up an old laptop for dual boot with Debian bookworm. Install went well, and the program connected to the device correctly, but I'm also getting the pixel shifts multiple people have reported.

yes i getting the pixel shifts too , multiple people have reported.

https://imgur.com/a/HUoXvRO

like i say , i try few time ,also in the left , also is no painting

Frostiikin commented 1 year ago

Hello, I've updated a beta version which supports splatoon 3 and have a GUI. Check https://github.com/Victrid/splatplost/tree/dev-v0.2 for readme file for more information.

If you want to try this version, you need to install with special pip command, which allows you to install a pre-release version:

sudo pip install splatplost==0.2.0.dev0

Hey, complete linux noob here who straight up installed debian on a crappy old laptop for the sole purpose of using this, attempting to do that command simply left me with this error. image

I was able to get the splatoon 2 version working just fine, but that obviously doesn't quite work for splatoon 3's purposes given the different button layout and all. Any idea what i'm doing wrong here...?

Victrid commented 1 year ago

@Frostiikin

Hello, I've updated a beta version which supports splatoon 3 and have a GUI. Check https://github.com/Victrid/splatplost/tree/dev-v0.2 for readme file for more information. If you want to try this version, you need to install with special pip command, which allows you to install a pre-release version:

sudo pip install splatplost==0.2.0.dev0

Hey, complete linux noob here who straight up installed debian on a crappy old laptop for the sole purpose of using this, attempting to do that command simply left me with this error. image

I was able to get the splatoon 2 version working just fine, but that obviously doesn't quite work for splatoon 3's purposes given the different button layout and all. Any idea what i'm doing wrong here...?

Use these commands to check your default python version:

python -V
pip -V

Some distro uses python 2 as python, then you need to change pip to pip3.

Use this command to check whether you are using a pip mirror (which could be outdated):

pip config list

If you see something like

# pip config list
global.index-url='https://pypi.douban.com/simple/'

It means you are behind a mirror. Add -i https://pypi.org/simple to the pip commands.

Frostiikin commented 1 year ago

When I do config list, absolutely nothing shows up. Everything else was as to be expected (have python3 and latest PIP, though I had to use "python3" instead of just "python"). image

In other news though, I did manage to get the new version installed, though attempting to use it just gives errors. It was dev2 that wasn't working for me, so I checked the PyPI page and saw that dev4 exists and used that instead, which actually DID install. Basically, when I do the "splatplost" command to open up the GUI, this happens. I'm assuming the command versions of everything were removed given how attempting to use the old commands just results in nothing being recognized. image

JTiger24 commented 1 year ago

When I do config list, absolutely nothing shows up. Everything else was as to be expected (have python3 and latest PIP, though I had to use "python3" instead of just "python"). image

In other news though, I did manage to get the new version installed, though attempting to use it just gives errors. It was dev2 that wasn't working for me, so I checked the PyPI page and saw that dev4 exists and used that instead, which actually DID install. Basically, when I do the "splatplost" command to open up the GUI, this happens. I'm assuming the command versions of everything were removed given how attempting to use the old commands just results in nothing being recognized. image

It's mentioned above that you need python 3.10 for this release.

Frostiikin commented 1 year ago

When I do config list, absolutely nothing shows up. Everything else was as to be expected (have python3 and latest PIP, though I had to use "python3" instead of just "python"). image In other news though, I did manage to get the new version installed, though attempting to use it just gives errors. It was dev2 that wasn't working for me, so I checked the PyPI page and saw that dev4 exists and used that instead, which actually DID install. Basically, when I do the "splatplost" command to open up the GUI, this happens. I'm assuming the command versions of everything were removed given how attempting to use the old commands just results in nothing being recognized. image

It's mentioned above that you need python 3.10 for this release.

after fighting with it for way too long, I managed to get 3.10 installed... still getting similar errors, though. i'm seeing it's mentioning 3.9, which is... odd? image I even tried doing the update alternatives thing, and it's just... not using the correct python I guess?? image

Victrid commented 1 year ago

@Frostiikin after you get another version of python, you need to install the package again. Python packages are bounded to python version.

Frostiikin commented 1 year ago

Finally managed to get it to actually boot up, now when I hit the pair button, this error happens:

Describe the bug

Running Environment Information

Splatplost version: 0.2.0.dev4

Python version: 3.10.0 (default, Oct 8 2022, 22:09:19) [GCC 10.2.1 20210110]

OS Information: Linux-5.10.0-18-amd64-x86_64-with-glibc2.31

Systemd Version:

systemd 247 (247.3-7+deb11u1)
+PAM +AUDIT +SELINUX +IMA +APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +ZSTD +SECCOMP +BLKID +ELFUTILS +KMOD +IDN2 -IDN +PCRE2 default-hierarchy=unified

Python Traceback

Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/serial/serialposix.py", line 322, in open
    self.fd = os.open(self.portstr, os.O_RDWR | os.O_NOCTTY | os.O_NONBLOCK)
FileNotFoundError: [Errno 2] No such file or directory: ''

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/splatplost/gui/plotter.py", line 46, in run
    self.working_function()
  File "/usr/local/lib/python3.10/site-packages/splatplost/gui/plotter.py", line 121, in pairing
    raise e
  File "/usr/local/lib/python3.10/site-packages/splatplost/gui/plotter.py", line 117, in pairing
    connection.connect()
  File "/usr/local/lib/python3.10/site-packages/libnxctrl/splatplost_USB.py", line 84, in connect
    self.serial = serial.Serial(self.serial_port, 115200)
  File "/usr/local/lib/python3.10/site-packages/serial/serialutil.py", line 244, in __init__
    self.open()
  File "/usr/local/lib/python3.10/site-packages/serial/serialposix.py", line 325, in open
    raise SerialException(msg.errno, "could not open port {}: {}".format(self._port, msg))
serial.serialutil.SerialException: [Errno 2] could not open port : [Errno 2] No such file or directory: ''

Bluetooth status

● bluetooth.service - Bluetooth service
     Loaded: loaded (/lib/systemd/system/bluetooth.service; enabled; vendor preset: enabled)
     Active: active (running) since Sat 2022-10-08 23:06:59 EDT; 43min ago
       Docs: man:bluetoothd(8)
   Main PID: 490 (bluetoothd)
     Status: "Running"
      Tasks: 1 (limit: 6927)
     Memory: 6.9M
        CPU: 71ms
     CGroup: /system.slice/bluetooth.service
             └─490 /usr/libexec/bluetooth/bluetoothd

Oct 08 23:06:59 frostiidebian bluetoothd[490]: Bluetooth daemon 5.55
Oct 08 23:06:59 frostiidebian systemd[1]: Started Bluetooth service.
Oct 08 23:06:59 frostiidebian bluetoothd[490]: Starting SDP server
Oct 08 23:07:00 frostiidebian bluetoothd[490]: Bluetooth management interface 1.18 initialized
Oct 08 23:07:01 frostiidebian bluetoothd[490]: profiles/sap/server.c:sap_server_register() Sap driver initialization failed.
Oct 08 23:07:01 frostiidebian bluetoothd[490]: sap-server: Operation not permitted (1)
Oct 08 23:49:56 frostiidebian bluetoothd[490]: profiles/sap/server.c:sap_server_register() Sap driver initialization failed.
Oct 08 23:49:56 frostiidebian bluetoothd[490]: sap-server: Operation not permitted (1)
Oct 08 23:50:14 frostiidebian bluetoothd[490]: src/service.c:btd_service_connect() a2dp-source profile connect failed for 58:2F:40:29:60:20: Protocol not available
Oct 08 23:50:24 frostiidebian bluetoothd[490]: src/service.c:btd_service_connect() a2dp-source profile connect failed for 58:2F:40:29:60:20: Protocol not available

I had the old splatoon 2 version (aka the stable release) running just fine before, and even managed to get it to print a full image of a couple undertale sprites as a test, so i'm not sure what's different here... image Thanks for being so nice about this by the way, sorry if some of my issues i've run in to have been a bit... dumb, LOL

baconsaur commented 1 year ago

An option to automatically save and exit after completing the image would be an amazing addition. I just waited 4 hours for my drawing to finish, then my switch fell asleep. Splatoon 3 very helpfully kicks you out of the drawing interface without saving when that happens 🥲

raqu73 commented 1 year ago

How do the newest versions work? I'm not sure what to input for the address in the Remote option nor what to do for the Splatplost USB option.

funkyFangs commented 1 year ago

Would it be possible to add a step-by-step procedure in the documentation for using this application (e.g. installation -> running the application -> pairing the switch -> using the printer)? I'm able to install and run the application (version 0.2.0.dev4 on Ubuntu 22), but I am unable to pair via USB, and I don't know if it's because I used the application incorrectly or because I encountered a bug.

guighub commented 1 year ago

I get this error updating from the main branch to dev4 (put it in a txt as to not flood the comments) error.txt