Skarsnik / QUsb2snes

A Qt based webserver for usb2snes. Users: go check usb2snes.com
https://skarsnik.github.io/QUsb2snes/
GNU General Public License v3.0
52 stars 33 forks source link

[Arch] FXPak Pro not being detected #101

Closed SVaeth closed 2 years ago

SVaeth commented 2 years ago

Maybe I missed a step, the documentation is not clear, but any advice would be helpful

I have replaced the firmware files for usb2snes and verified the version on my FXPak Pro is 1.10.3_usb-v11.

I have built and compiled the qusb2snes-git package from AUR using pb -S and have the socket listening on port 8080

But when I plug my mciroUSB to my FXPak Pro, the device is not being detected by my machine, and thus is not found in QFile2Snes.

The logs don't show any error, but uploaded anyway log.txt

black-sliver commented 2 years ago

Does dmesg journalctl -k say anything?

Should be something like

New USB device found, idVendor=1209, idProduct=5a22, bcdDevice= 1.00
[...]
SerialNumber: DEMO00000000
[...]
cdc_acm [...]: ttyACM0: USB ACM device
SVaeth commented 2 years ago

I'm sorry, I wasn't expecting such a quick response, and thank you

I just tried it again, ran `journalctl -k --since "10 minutes ago" and it does look like it is detected, but QFile2Snes never finds it

Added log file and screenshot for reference. I have tried connecting the FXPak Pro to the laptop with it dislodged from the SuperNT and tried connecting with the SuperNT on and running the FXPak Pro, both after verifying QUsb2Snes is running on :8080 Neither worked

I also did not do the serial configuration step because I don't know what my device value would be to replace /dev/ttyACM0 if that would help? out.txt Screenshot from 2021-10-10 13-47-24

SVaeth commented 2 years ago

Also adding this from my phone: the picture of my system information

black-sliver commented 2 years ago

can you enable Systemtray -> Misc -> Enable debug logs, restart QUsb2Snes and then look in ~/.local/share/QUsb2Snes/log-debug.txt for the debug log?

(open the Systemtray -> Devices menu and/or start an app like QFile2Snes that scans for devices to get scan results into that log)

SVaeth commented 2 years ago

I'm not understanding. I do not see Systemtray -> Misc -> Enable debug logs. What am I trying to do? Am I trying to enable debug logs on the kernel or QUsb2Snes? In either case I interface with my terminal.

If it's enabling debugging on the kernel to see additional logs when connecting to the usb port, then there should be a command

If it's enabling debugging at the app level to see log messages in QUsb2Snes, then there should be a configuration property.

Skarsnik commented 2 years ago

QUsb2snes should show an icon on your system system tray where you can interact to activate option/devices. If you use qusb2snes without an Ui, you need to add debugLog = true in the config file.

SVaeth commented 2 years ago

I did not get an icon when I started QUsb2Snes. I only know it's running because when I try to open the app again it says 8080 is already in use and when I run lsof -i :8080 it says QUsb2Snes is listening. Might be something I have to fix with my DE. I run gnome

Here's the logs after setting the debugLog flag in .config/skarsnik.nyo.fr/QUsb2Snes.conf. It says it's connected, and lsof -i :8080 says the connection was established, but QFile2Snes still isn't showing any devices detected. Output of lsof -i :8080.

Screenshot from 2021-10-11 10-20-14

Here's the configuration files too, renamed so git allows them to be uploaded

debug.txt QFile2Snes.txt QUsb2Snes.txt

black-sliver commented 2 years ago

i think gnome3 got rid of the "tray area" and only supports notify thingies. you may have to install an extension to get that back.

do you have a line like cdc_acm [...]: ttyACM0: USB ACM device in your journalctl -k? because qt seems to not find any such usb-serial port (the FxPak USB firmware uses a generic modem-like USB driver to provide a serial port). can you maybe do ls -al /dev/ttyA* to see if it's actually there?

Skarsnik commented 2 years ago

The device is listed on the log, but the name/description does not match the excpected value it seems

Le lun. 11 oct. 2021 à 20:10, black-sliver @.***> a écrit :

i think gnome3 got rid of the "tray area" and only supports notify thingies. you may have to install an extension to get that back.

do you have a line like cdc_acm [...]: ttyACM0: USB ACM device in your journalctl -k? because qt seems to not find any such usb-serial port (the FxPak USB firmware uses a generic modem-like USB driver to provide a serial port). can you maybe do ls -al /dev/ttyA* to see if it's actually there?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Skarsnik/QUsb2snes/issues/101#issuecomment-940278305, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADDBK72RKDWCTIGAHR7O2BLUGMSBDANCNFSM5FUJAPCQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

black-sliver commented 2 years ago

I don't see any ttyAMA, ttyACM or ttyUSB in the debug.txt. the name ttyS4 points to being a PCI/e or on-board serial port. My log looks like this:

      SD2SNESFactory : "ttyACM0" "sd2snes" "DEMO00000000" Busy :  false
      SD2SNESFactory : "ttyS0" "" "" Busy :  false
            WSServer : DeviceFactory status done :  1 / 2

with ttyS0 being an on-board serial header

Skarsnik commented 2 years ago

You maybe have to add your user to the serial group (I think it's this one?) to be able to access the device.

Le lun. 11 oct. 2021 à 20:54, black-sliver @.***> a écrit :

I don't see any ttyAMA, ttyACM or ttyUSB in the debug.txt. the name ttyS4 points to being a PCI/e or on-board serial port. My log looks like this:

  SD2SNESFactory : "ttyACM0" "sd2snes" "DEMO00000000" Busy :  false
  SD2SNESFactory : "ttyS0" "" "" Busy :  false
        WSServer : DeviceFactory status done :  1 / 2

with ttyS0 being an on-board serial header

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Skarsnik/QUsb2snes/issues/101#issuecomment-940361702, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADDBK72YARXJUMBRHNHTFZLUGMXFNANCNFSM5FUJAPCQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

-- Sylvain "Skarsnik" Colinet

Victory was near but the power of the ring couldn't be undone

SVaeth commented 2 years ago

So I ran sudo ls -al /dev/ttyA* and '/dev/ttyA*': No such file or directory

So I do not appear to have a device named tty/ACM0 or anything similar, and I'm not sure what device to add to do the serial configuration

black-sliver commented 2 years ago

the kernel should automatically create that device, that's why i asked about the dmesg journalctl -k output

SVaeth commented 2 years ago

So I should have ACM0 already, or do I get ACM0 from plugging in the usb and running QUsb2Snes/QFile2Snes?

Should I be looking at why my device doesn't have ACM/AMA devices?

black-sliver commented 2 years ago

plugging in while powered up, or powering up while plugged in should make your OS kernel pick up the usb device, load the driver (it's a standard driver, nothing you installed with qusb) and create that node in /dev. qusb2snes is only a user space program, it needs a working device node to your actual hardware.

SVaeth commented 2 years ago

Okay I got an ACM0 to pop up this time. I was hoping to be able to run the microUSB to download content directly, save my FXPak Pro some more in not having to remove the cartridge from the system as often, but I guess that is not the case.

When running the FXPak Pro on the SuperNT with it plugged in I got some different logs with an error to look at. I can send them from my computer one second

I can also try the serial configuration step with ttyACM0 now

SVaeth commented 2 years ago

Note the error log at the bottom: Permission denied and bad file descriptor

debug.txt

SVaeth commented 2 years ago

Well, stty -F /dev/ttyACM0 0:0:cbd:0:3:1c:7f:15:4:5:40:0:11:13:1a:0:12:f:17:16:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0 got rid of the error, but it still isn't connecting..

Updated logs and output from journalctl -k --since "9 minutes ago"

Also managed to get the system tray plugin installed and see the qusdb2snes menu now

debug.txt log.txt out.txt

Skarsnik commented 2 years ago

You need to give yourself (your user) the right to access the device. You should have a serial group ou you can just chmod 777 on the device file (but you will have to do it every time you power/plug the fxpax)

Le mer. 13 oct. 2021 à 01:24, SVaeth @.***> a écrit :

Well, stty -F /dev/ttyACM0 0:0:cbd:0:3:1c:7f:15:4:5:40:0:11:13:1a:0:12:f:17:16:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0 got rid of the error, but it still isn't connecting..

Updated logs and output from `journalctl -k --since "9 minutes ago"

debug.txt https://github.com/Skarsnik/QUsb2snes/files/7333632/debug.txt log.txt https://github.com/Skarsnik/QUsb2snes/files/7333633/log.txt out.txt https://github.com/Skarsnik/QUsb2snes/files/7333639/out.txt

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Skarsnik/QUsb2snes/issues/101#issuecomment-941739450, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADDBK77FFVM6IVENJQYFCF3UGS7RXANCNFSM5FUJAPCQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

-- Sylvain "Skarsnik" Colinet

Victory was near but the power of the ring couldn't be undone

SVaeth commented 2 years ago

Sounds like I should just make my user a root user

that is the line in the readme for setting the serial configuration. Are you saying I need a different serial configuration to set the permissions for ttyACM0? Where would I find that?

black-sliver commented 2 years ago

You should not need the stty. Anyway you should not run GUI applications as root, and you should not run anything as root unless there is a reason to.

On arch, you should add your user to the uucp group, as described in https://wiki.archlinux.org/title/Users_and_groups#User_groups

black-sliver commented 2 years ago

also you have to log out and log in again (or reboot) for the user groups to be applied properly

SVaeth commented 2 years ago

well, I added the permissions, restarted, verified my user was added to the uucp group, ran QUsb2Snes, turned on the SuperNT, validated the ttyACM0 device was created, started QFile2Snes, and still nothing has happened. Same logs making the server request that endlessly never connects to the cartridge

SVaeth commented 2 years ago

I FINALLY got it working and detected in the QFile2Snes app. Somehow the the sd2snessupport flag got set to false. I think it's from the "enable SD2Snes/FXPak Pro support" option in the QUsb2Snes tray. I hit once just to be sure, and I guess it must have toggled it off instead of just making sure it was enabled. Probably should have something: either enables only doesn't toggle or has a check mark to show the enabled/disabled state at any given time

Thank you guys for your help. I also got some handy advice out of it like the tray icons plugin in gnome and the additional user groups aside from wheel that my user should have been added to

Cheers