Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Arduino-based Spinner not Working on MiSTer #807

Open
skooterblog opened this issue Aug 31, 2023 · 13 comments
Open

Arduino-based Spinner not Working on MiSTer #807

skooterblog opened this issue Aug 31, 2023 · 13 comments

Comments

@skooterblog
Copy link

I bought an Arduino-based spinner from AliExpress ( https://s.click.aliexpress.com/e/_Den7Cox ) and MiSTer only recognizes its four buttons, but not the wheel. The controller test core also detects nothing from the wheel.

I tried putting its VID/PID in the mister.ini file like this:

spinner_vid=0x2341
spinner_pid=0x8037
spinner_throttle=100

But it didn't help.

On Windows, the wheel works as the mouse's x-axis, while the buttons register as joystick buttons.

@sorgelig
Copy link
Member

sorgelig commented Sep 1, 2023

There is no support of such kind spinner. If it implements mouse for wheel, then it should use buttons as a mouse buttons.
If it's arduino based, then probably it can be re-flashed with spinner sketch supported by MiSTer (need to tweak for pins used in your device).
You can check the code here:
https://github.com/MiSTer-devel/Retro-Controllers-USB-MiSTer/tree/master/PaddleTwoControllersUSB

@skooterblog
Copy link
Author

I learned how to flash the Arduino code. I did that using this code:
https://github.com/willoucom/Arduino_ArcadeSpinner

I updated the button pins according to what I found on my device.

And MiSTer still refuses to use its spin. In Windows, it works just fine in all four modes. But MiSTer only sees the buttons no matter which modes I run.

@sorgelig
Copy link
Member

sorgelig commented Sep 5, 2023

What VID/PID of your board? MiSTer expects Arduino Micro, though new vid/pid can be added

@skooterblog
Copy link
Author

2341/8037

@sorgelig
Copy link
Member

sorgelig commented Sep 6, 2023

Make sure uniq (or name) field has string MiSTer-S1. This is important for MiSTer to recognize your device as a spinner.
I see in your code you change it depending on button, but it actually gets read only at connection of device or booting the MiSTer.
Spinner in MiSTer works as an overlay input device, so you still need a joystick for directional control. Spinner doesn't need buttons assignment. It supposed to have only one button and knob.

if (strstr(uniq, "MiSTer-S1")) input[n].quirk = QUIRK_PDSP;

@skooterblog
Copy link
Author

When I use the spinner mode MiSTer recognizes it as a spinner. I see the "P1 Spinner" message in the OSD when I press the spinner button. However, moving the wheel doesn't register in the input test core or in the games.

I know that the wheel is working because I can move the "Dial" in the Windows joystick test.

Captura de tela 2023-09-06 124058

@sorgelig
Copy link
Member

sorgelig commented Sep 6, 2023

You can connect USB console to MiSTer and check debug messages. When you use Menu core, it gives many messages from input devices. There you may see how your spinner getting recognized and what messages it generates. It may help to understand the problem.
By the way, if it generates paddle signals, then cores requiring spinner won't react on it.

@skooterblog
Copy link
Author

skooterblog commented Sep 8, 2023

This is the output I get when I connect the spinner in MiSTer Spinner mode, press the buttons, and turn the wheel. The wheel doesn't generate any output:

============ PuTTY log 2023.09.07 23:19:32 ============
Switch to core frame buffer
The file mouse2 was created.
Close all devices.
Open up to 30 input devices.
make_unique(289B,0057,-1)
make_unique(0E8F,3013,1)
make_unique(16C0,05E1,1)
make_unique(045E,02A1,1)
make_unique(8282,3201,1)
make_unique(1209,FACA,1)
opened 0( 0): /dev/input/event10 (2341:8037:175e31e0) 6 "usb-ffb40000.usb-1.5/input3/HIDGDMiSTer-S1 Spinner" "HIDGDMiSTer-S1 Spinner"
opened 1( 1): /dev/input/event9 (2341:8037:9d67b43f) 6 "usb-ffb40000.usb-1.5/input2/HIDGDMiSTer-S1 Spinner" "HIDGDMiSTer-S1 Spinner"
opened 2( 1): /dev/input/mouse2 (2341:8037:9d67b43f) 6 "usb-ffb40000.usb-1.5/input2/HIDGDMiSTer-S1 Spinner" "HIDGDMiSTer-S1 Spinner"
opened 3( 3): /dev/input/event8 (054c:0ce6:08328651) 4 "7c:66:ef:49:6f:37" "Wireless Controller Touchpad"
restore player 1 to /dev/input/event8 (7c:66:ef:49:6f:37)
opened 4( 3): /dev/input/mouse1 (054c:0ce6:08328651) 4 "7c:66:ef:49:6f:37" "Wireless Controller Touchpad"
opened 5( 3): /dev/input/event6 (054c:0ce6:08328651) 3 "7c:66:ef:49:6f:37" "Wireless Controller"
opened 6( 6): /dev/input/event4 (0040:073d:17e49709) 0 "usb-ffb40000.usb-1.7/input1" "2.4 GHz RF Receiver"
opened 7( 6): /dev/input/event3 (0040:073d:17e49709) 0 "usb-ffb40000.usb-1.7/input1" "2.4 GHz RF Receiver System Control"
opened 8( 6): /dev/input/event2 (0040:073d:17e49709) 0 "usb-ffb40000.usb-1.7/input1" "2.4 GHz RF Receiver Consumer Control"
opened 9( 6): /dev/input/event1 (0040:073d:17e49709) 0 "usb-ffb40000.usb-1.7/input1" "2.4 GHz RF Receiver Mouse"
opened 10( 6): /dev/input/mouse0 (0040:073d:17e49709) 0 "usb-ffb40000.usb-1.7/input1" "2.4 GHz RF Receiver"
opened 11(11): /dev/input/event0 (0040:073d:17e49708) 0 "usb-ffb40000.usb-1.7/input0" "2.4 GHz RF Receiver"
The file event9 was created.
The file js2 was created.
The file event10 was created.
Close all devices.
Open up to 30 input devices.
make_unique(289B,0057,-1)
make_unique(0E8F,3013,1)
make_unique(16C0,05E1,1)
make_unique(045E,02A1,1)
make_unique(8282,3201,1)
make_unique(1209,FACA,1)
opened 0( 0): /dev/input/event10 (2341:8037:175e31e0) 6 "usb-ffb40000.usb-1.5/input3/HIDGDMiSTer-S1 Spinner" "HIDGDMiSTer-S1 Spinner"
opened 1( 1): /dev/input/event9 (2341:8037:9d67b43f) 6 "usb-ffb40000.usb-1.5/input2/HIDGDMiSTer-S1 Spinner" "HIDGDMiSTer-S1 Spinner"
opened 2( 1): /dev/input/mouse2 (2341:8037:9d67b43f) 6 "usb-ffb40000.usb-1.5/input2/HIDGDMiSTer-S1 Spinner" "HIDGDMiSTer-S1 Spinner"
opened 3( 3): /dev/input/event8 (054c:0ce6:08328651) 4 "7c:66:ef:49:6f:37" "Wireless Controller Touchpad"
restore player 1 to /dev/input/event8 (7c:66:ef:49:6f:37)
opened 4( 3): /dev/input/mouse1 (054c:0ce6:08328651) 4 "7c:66:ef:49:6f:37" "Wireless Controller Touchpad"
opened 5( 3): /dev/input/event6 (054c:0ce6:08328651) 3 "7c:66:ef:49:6f:37" "Wireless Controller"
opened 6( 6): /dev/input/event4 (0040:073d:17e49709) 0 "usb-ffb40000.usb-1.7/input1" "2.4 GHz RF Receiver"
opened 7( 6): /dev/input/event3 (0040:073d:17e49709) 0 "usb-ffb40000.usb-1.7/input1" "2.4 GHz RF Receiver System Control"
opened 8( 6): /dev/input/event2 (0040:073d:17e49709) 0 "usb-ffb40000.usb-1.7/input1" "2.4 GHz RF Receiver Consumer Control"
opened 9( 6): /dev/input/event1 (0040:073d:17e49709) 0 "usb-ffb40000.usb-1.7/input1" "2.4 GHz RF Receiver Mouse"
opened 10( 6): /dev/input/mouse0 (0040:073d:17e49709) 0 "usb-ffb40000.usb-1.7/input1" "2.4 GHz RF Receiver"
opened 11(11): /dev/input/event0 (0040:073d:17e49708) 0 "usb-ffb40000.usb-1.7/input0" "2.4 GHz RF Receiver"
Gamecontrollerdb for mapping: 050000004c050000e60c000000810000,Wireless Controller,dpright:h0.2,dpleft:h0.8,dpdown:h0.4,dpup:h0.1,b:b1,a:b0,y:b2,x:b3,leftshoulder:b5,rightshoulder:b6,back:b9,start:b10,guide:b11,menuok:b0,menuesc:b1,leftx:a0,lefty:a1,rightx:a3,righty:a4,asysx:a0,asysy:a1,platform:MiSTer,
2341:8037:00 P0 Input event: type=EV_KEY, code=288(0x120), value=1
Device usb-ffb40000.usb-1.5/input3/HIDGDMiSTer-S1 Spinner assigned to player 1
2341:8037:00 P1 Input event: type=EV_KEY, code=288(0x120), value=0
2341:8037:00 P1 Input event: type=EV_KEY, code=288(0x120), value=1
2341:8037:00 P1 Input event: type=EV_KEY, code=288(0x120), value=0
2341:8037:00 P1 Input event: type=EV_KEY, code=288(0x120), value=1
2341:8037:00 P1 Input event: type=EV_KEY, code=288(0x120), value=0

@skooterblog
Copy link
Author

And this is the output in the default mode:

The file mouse1 was created.
Close all devices.
Open up to 30 input devices.
make_unique(289B,0057,-1)
make_unique(0E8F,3013,1)
make_unique(16C0,05E1,1)
make_unique(045E,02A1,1)
make_unique(8282,3201,1)
make_unique(1209,FACA,1)
opened 0( 0): /dev/input/event7 (2341:8037:adf5efbc) 7 "usb-ffb40000.usb-1.5/input3/HIDGDMiSTer-A1 Spinner" "HIDGDMiSTer-A1 Spinner"
opened 1( 1): /dev/input/event6 (2341:8037:33ff721b) 7 "usb-ffb40000.usb-1.5/input2/HIDGDMiSTer-A1 Spinner" "HIDGDMiSTer-A1 Spinner"
opened 2( 1): /dev/input/mouse1 (2341:8037:33ff721b) 7 "usb-ffb40000.usb-1.5/input2/HIDGDMiSTer-A1 Spinner" "HIDGDMiSTer-A1 Spinner"
opened 3( 3): /dev/input/event4 (0040:073d:17e49709) 0 "usb-ffb40000.usb-1.7/input1" "2.4 GHz RF Receiver"
opened 4( 3): /dev/input/event3 (0040:073d:17e49709) 0 "usb-ffb40000.usb-1.7/input1" "2.4 GHz RF Receiver System Control"
opened 5( 3): /dev/input/event2 (0040:073d:17e49709) 0 "usb-ffb40000.usb-1.7/input1" "2.4 GHz RF Receiver Consumer Control"
opened 6( 3): /dev/input/event1 (0040:073d:17e49709) 0 "usb-ffb40000.usb-1.7/input1" "2.4 GHz RF Receiver Mouse"
opened 7( 3): /dev/input/mouse0 (0040:073d:17e49709) 0 "usb-ffb40000.usb-1.7/input1" "2.4 GHz RF Receiver"
opened 8( 8): /dev/input/event0 (0040:073d:17e49708) 0 "usb-ffb40000.usb-1.7/input0" "2.4 GHz RF Receiver"
The file event6 was created.
The file js0 was created.
The file event7 was created.
Close all devices.
Open up to 30 input devices.
make_unique(289B,0057,-1)
make_unique(0E8F,3013,1)
make_unique(16C0,05E1,1)
make_unique(045E,02A1,1)
make_unique(8282,3201,1)
make_unique(1209,FACA,1)
opened 0( 0): /dev/input/event7 (2341:8037:adf5efbc) 7 "usb-ffb40000.usb-1.5/input3/HIDGDMiSTer-A1 Spinner" "HIDGDMiSTer-A1 Spinner"
opened 1( 1): /dev/input/event6 (2341:8037:33ff721b) 7 "usb-ffb40000.usb-1.5/input2/HIDGDMiSTer-A1 Spinner" "HIDGDMiSTer-A1 Spinner"
opened 2( 1): /dev/input/mouse1 (2341:8037:33ff721b) 7 "usb-ffb40000.usb-1.5/input2/HIDGDMiSTer-A1 Spinner" "HIDGDMiSTer-A1 Spinner"
opened 3( 3): /dev/input/event4 (0040:073d:17e49709) 0 "usb-ffb40000.usb-1.7/input1" "2.4 GHz RF Receiver"
opened 4( 3): /dev/input/event3 (0040:073d:17e49709) 0 "usb-ffb40000.usb-1.7/input1" "2.4 GHz RF Receiver System Control"
opened 5( 3): /dev/input/event2 (0040:073d:17e49709) 0 "usb-ffb40000.usb-1.7/input1" "2.4 GHz RF Receiver Consumer Control"
opened 6( 3): /dev/input/event1 (0040:073d:17e49709) 0 "usb-ffb40000.usb-1.7/input1" "2.4 GHz RF Receiver Mouse"
opened 7( 3): /dev/input/mouse0 (0040:073d:17e49709) 0 "usb-ffb40000.usb-1.7/input1" "2.4 GHz RF Receiver"
opened 8( 8): /dev/input/event0 (0040:073d:17e49708) 0 "usb-ffb40000.usb-1.7/input0" "2.4 GHz RF Receiver"
2341:8037:00 P0 Input event: type=EV_KEY, code=288(0x120), value=1
Gamecontrollerdb: mapping buttons for 03000000412300003780000001010000
Gamecontrollerdb: mapping analog axes for 03000000412300003780000001010000
Gamecontrollerdb for mapping: 03000000412300003780000001010000,HIDGDMiSTer-A1 Spinner,b:b1,a:b0,back:b2,start:b3,guide:b2,guide2:b3,menuesc:b0,menuok:b1,platform:MiSTer,
Device usb-ffb40000.usb-1.5/input3/HIDGDMiSTer-A1 Spinner assigned to player 1
FileOpenEx(open) File:/media/fat/config/kbd_2341_8037_HIDGDMiSTer-A1_Spinner.map, error: No such file or directory.
PS2 code(make) for core: 255(0xFF)
Switch to core frame buffer
2341:8037:00 P1 Input event: type=EV_KEY, code=288(0x120), value=0
PS2 code(break) for core: 255(0xFF)
2341:8037:00 P1 Input event: type=EV_KEY, code=288(0x120), value=1
PS2 code(make) for core: 255(0xFF)
2341:8037:00 P1 Input event: type=EV_KEY, code=288(0x120), value=0
PS2 code(break) for core: 255(0xFF)
/media/usb0 is NOT a VFAT mountpoint.
/media/usb1 is NOT a VFAT mountpoint.
/media/usb2 is NOT a VFAT mountpoint.
/media/usb3 is NOT a VFAT mountpoint.
2341:8037:00 P1 Input event: type=EV_KEY, code=289(0x121), value=1
PS2 code(make) for core: 90(0x5A)
pFileExt = (null)
Start to scan dir: /media/fat/
Position on item:
Got 6 dir entries
2341:8037:00 P1 Input event: type=EV_KEY, code=289(0x121), value=0
PS2 code(break) for core: 90(0x5A)
2341:8037:00 P1 Input event: type=EV_KEY, code=290(0x122), value=1
PS2 code(make) for core: 14(0xE)
2341:8037:00 P1 Input event: type=EV_KEY, code=290(0x122), value=0
PS2 code(break) for core: 14(0xE)
2341:8037:00 P1 Input event: type=EV_KEY, code=288(0x120), value=1
PS2 code(make) for core: 255(0xFF)
2341:8037:00 P1 Input event: type=EV_KEY, code=288(0x120), value=0
PS2 code(break) for core: 255(0xFF)
2341:8037:00 P1 Input event: type=EV_KEY, code=291(0x123), value=1
2341:8037:00 P1 Input event: type=EV_KEY, code=291(0x123), value=0
2341:8037:00 P1 Input event: type=EV_KEY, code=291(0x123), value=1
2341:8037:00 P1 Input event: type=EV_KEY, code=291(0x123), value=0

@sorgelig
Copy link
Member

sorgelig commented Sep 8, 2023

According to logs you didn't try to turn the wheel to check what events are generated

@skooterblog
Copy link
Author

But I did. I guess that's the issue. MiSTer doesn't see the wheel movements. But Windows does.

@sorgelig
Copy link
Member

sorgelig commented Sep 8, 2023

If there is no debug info about wheel move, then linux driver doesn't supply them.

@skooterblog
Copy link
Author

Sonik helped me too understand the pins code and I flashed it with your code: https://github.com/MiSTer-devel/Retro-Controllers-USB-MiSTer/tree/master/PaddleTwoControllersUSB

I still only get the button working on mister and the wheel is ignored. On Windows the wheel work just fine, moving both the axis.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants