Hardware libsicksaxis - connect sixaxis/DS3 to the Wii

xerpi

Well-Known Member
OP
Member
Joined
Dec 25, 2011
Messages
212
Trophies
1
Age
28
Location
Barcelona
XP
1,330
Country
Hi guys, these days I've been writing a library called "sicksaxis" (yeah sick xD) for the Wii.
It's very simple, it allows you to connect your sixaxis and dualshock 3 via USB to the Wii and read its data.

Lib SickSaxis allows:
  • Read the buttons
  • Read the analog sticks
  • Read the motion sensors (accelerometer and gyro)
  • Read the button pressure
  • Rumble
  • Turn on/off the LEDs
  • Set the controller's MAC
  • Get the controller's MAC
Version 2:
  • Rewritten from scratch
  • Should be more stable
Version 1.0 improvements:
  • Reorganizated the code
  • Improved some functions
  • Changed synchronous USB functions to asyncrhonous (this means it won't lag anymore)
Download version 2.0
GitHub: https://github.com/xerpi/libsicksaxis


A video:




Old versions:
This is not yet a library, it's just a homebrew, I mean the library source is compiled with the main.c
 
  • Like
Reactions: RiCK420 and filfat

boomario

Well-Known Member
Member
Joined
Oct 31, 2012
Messages
449
Trophies
1
XP
2,275
Country
Brazil
Awesome work :lol:
please continue with this wonderful work and maybe in future we will be able to play some games with dualshock 3 wihout any problems.
 

xerpi

Well-Known Member
OP
Member
Joined
Dec 25, 2011
Messages
212
Trophies
1
Age
28
Location
Barcelona
XP
1,330
Country
Awesome work :lol:
please continue with this wonderful work and maybe in future we will be able to play some games with dualshock 3 wihout any problems.

Thanks :P
Well, currently it's only a library, it can be useful for current homebrew (and maybe new), I mean, if you grab some emulator's code for example, you can implement this library very easily.
The hard this would be to write a IOS driver to support sixaxis/dualshock3 natively.
And even a harder think would be to do the same via bluetooth.

If you find an interesting open source Wii project, tell me and I'll try to implement libsicksaxis :)
 

phrozenfeonix

Well-Known Member
Newcomer
Joined
Oct 28, 2008
Messages
52
Trophies
1
XP
175
Country
United States
You wouldn't be able to implement this into dios mios, for sure. Apparently there is already so much space restriction involved with the code, that the devs can't even fit in an ntfs support module.
 

daxtsu

Well-Known Member
Member
Joined
Jun 9, 2007
Messages
5,627
Trophies
2
XP
5,194
Country
Antarctica
Hi, do you have any idea why the sample stops updating the controller info after about 5 seconds? I compiled it with the latest commit from https://github.com/xerpi/libsicksaxis, connected a genuine Sony DS3 via a USB cable, and saw it started printing button info and such to the screen, but after about 5 seconds, it just completely stops. I do have a USB hard drive connected to the Wii while trying this; is there a problem with this library and USB hard drives?

I modified the sample like so, to remove the "opening" part (I wanted it to always print the info, as pressing 1 or 2 freezes the homebrew :unsure: ):
Code:
int main(int argc, char **argv)
{
    srand(time(NULL));
    IOS_ReloadIOS(58);
    usleep(100 * 100000);
    USB_Initialize();
    init_video();
    WPAD_Init();
       
    ss_init();
    struct ss_device dev, dev2;
    ss_initialize(&dev);
   
 
    while(run) {
        WPAD_ScanPads();
        u32 pressed = WPAD_ButtonsDown(0);
        printf("\x1b[2;1H  \n");
        printf("Press 1 or 2 to open the controllers:  %d\n", lol);
        USB_DeviceChangeNotifyAsync(USB_CLASS_HID, change_cb, (void*)&lol);
       
        if (!ss_is_connected(&dev)) {
                if (ss_open(&dev)>0) {
                    ss_start_reading(&dev);
                    ss_set_removal_cb(&dev, removal_callback, (void*)1);
                }
        } else {
            print_ss_data(&dev);
        }
 
        if (pressed & WPAD_BUTTON_HOME) run = 0;
        VIDEO_WaitVSync();
        VIDEO_ClearFrameBuffer (rmode, xfb, COLOR_BLACK);
    }
    ss_close(&dev);
    ss_close(&dev2);
    USB_Deinitialize();
    exit(0);
    return 0;
}

Edit: I found the problem myself. USB_DeviceChangeNotifyAsync(USB_CLASS_HID, change_cb, (void*)&lol); shouldn't be called on every loop iteration. It causes the Wii to freeze. If it's async, it doesn't need to be called every frame.
 

xerpi

Well-Known Member
OP
Member
Joined
Dec 25, 2011
Messages
212
Trophies
1
Age
28
Location
Barcelona
XP
1,330
Country
Hi, do you have any idea why the sample stops updating the controller info after about 5 seconds? I compiled it with the latest commit from https://github.com/xerpi/libsicksaxis, connected a genuine Sony DS3 via a USB cable, and saw it started printing button info and such to the screen, but after about 5 seconds, it just completely stops. I do have a USB hard drive connected to the Wii while trying this; is there a problem with this library and USB hard drives?

I modified the sample like so, to remove the "opening" part (I wanted it to always print the info, as pressing 1 or 2 freezes the homebrew :unsure: ):
Code:
int main(int argc, char **argv)
{
    srand(time(NULL));
    IOS_ReloadIOS(58);
    usleep(100 * 100000);
    USB_Initialize();
    init_video();
    WPAD_Init();
     
    ss_init();
    struct ss_device dev, dev2;
    ss_initialize(&dev);
 
 
    while(run) {
        WPAD_ScanPads();
        u32 pressed = WPAD_ButtonsDown(0);
        printf("\x1b[2;1H  \n");
        printf("Press 1 or 2 to open the controllers:  %d\n", lol);
        USB_DeviceChangeNotifyAsync(USB_CLASS_HID, change_cb, (void*)&lol);
     
        if (!ss_is_connected(&dev)) {
                if (ss_open(&dev)>0) {
                    ss_start_reading(&dev);
                    ss_set_removal_cb(&dev, removal_callback, (void*)1);
                }
        } else {
            print_ss_data(&dev);
        }
 
        if (pressed & WPAD_BUTTON_HOME) run = 0;
        VIDEO_WaitVSync();
        VIDEO_ClearFrameBuffer (rmode, xfb, COLOR_BLACK);
    }
    ss_close(&dev);
    ss_close(&dev2);
    USB_Deinitialize();
    exit(0);
    return 0;
}

Edit: I found the problem myself. USB_DeviceChangeNotifyAsync(USB_CLASS_HID, change_cb, (void*)&lol); shouldn't be called on every loop iteration. It causes the Wii to freeze. If it's async, it doesn't need to be called every frame.



Thanks for noticing that USB_DeviceChangeNotifyAsync bug! I'll take a deeper look once I've ended my finals.
 

daxtsu

Well-Known Member
Member
Joined
Jun 9, 2007
Messages
5,627
Trophies
2
XP
5,194
Country
Antarctica
No problem. Out of curiosity, does libsicksaxis support connecting DS3 controllers wirelessly? I saw some code to get and set the mac address, but when I tried to use either one, it seemed to crash (I'm sure I was doing it wrong somehow..).
 

AbdallahTerro

da KiNG
Member
Joined
Jan 14, 2012
Messages
6,052
Trophies
0
Location
Ideas factory :)
Website
ccabz.wordpress.com
XP
3,123
Country
Hi guys, these days I've been writing a library called "sicksaxis" (yeah sick xD) for the Wii.
It's very simple, it allows you to connect your sixaxis and dualshock 3 via USB to the Wii and read its data.

Lib SickSaxis allows:
  • Read the buttons
  • Read the analog sticks
  • Read the motion sensors (accelerometer and gyro)
  • Read the button pressure
  • Rumble
  • Turn on/off the LEDs
  • Set the controller's MAC
  • Get the controller's MAC
Version 2:
  • Rewritten from scratch
  • Should be more stable
This is not yet a library, it's just a homebrew, I mean the library source is compiled with the main.c
Yo!
first thanks for this awesome library
second is there a way on earth to make it work in USB Loaders when a cIOS is used (force cIOS option "on" that is)
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • BakerMan
    I rather enjoy a life of taking it easy. I haven't reached that life yet though.
  • Veho @ Veho:
    Peen apple.
    +1
  • Psionic Roshambo @ Psionic Roshambo:
    "pine unf apple" doesn't count! Lol
  • Psionic Roshambo @ Psionic Roshambo:
    Employee code of conduct videos are awesome!!! Did you know eating the other employees is bad? I didn't know... Lol
    +1
  • AncientBoi @ AncientBoi:
    Anymore males there? :blush:
  • Psionic Roshambo @ Psionic Roshambo:
    All of us lol
  • Psionic Roshambo @ Psionic Roshambo:
    I got free every channel so that's awesome lol
    +1
  • AncientBoi @ AncientBoi:
    Give me ALL the gay pron channels, since you won't be watching them :blush::D
    +1
  • Psionic Roshambo @ Psionic Roshambo:
    Lol they exist?
    +1
  • Psionic Roshambo @ Psionic Roshambo:
    Hmmm so Mario Does Luigi's plumbing is a bad movie? Lol
  • Psionic Roshambo @ Psionic Roshambo:
    These videos are soooo dry
  • Psionic Roshambo @ Psionic Roshambo:
    Please click all suspicious links sent your email
    +1
  • BigOnYa @ BigOnYa:
    What to do today? Cut grass for 3-4 hours, or just get drunk and play video games... Hmm
    +1
  • BigOnYa @ BigOnYa:
    I need a remote controlled mower, so I can sit on the couch and do both.
  • BigOnYa @ BigOnYa:
    Sounds good to me, video games and booze it is then.
    +1
  • denpafan @ denpafan:
    Good choice
    +1
  • BigOnYa @ BigOnYa:
    Now what to play, Starfield or Fallout4. And what to drink, beer or Whiskey and Coke. Such tough decisions.
  • BigOnYa @ BigOnYa:
    Looks like its whiskey & coke, only 4 beers left. And think ill start with Falllout. :grog:
  • rqkaiju2 @ rqkaiju2:
    THIS IMAGE IS SO SCARY WTF. THAT SURE AS HELL IS NOT A CAT THATS LIKE A FUCKING DEMON

    Untitled2.png
  • Psionic Roshambo @ Psionic Roshambo:
    Bonus points for running things over with the lawn mower?
    +1
  • Psionic Roshambo @ Psionic Roshambo:
    Monster truck Lawn Mower extreme
    +1
  • BakerMan @ BakerMan:
    she was an apple appstore girl
    he was an uptodown boy
    BakerMan @ BakerMan: she was an apple appstore girl he was an uptodown boy