NOTE: We are trying the emulate the Skylanders Portal for the Wii/WiiU/PS3/PS4 games! Xbox 360 (and most likely ONE, as well) looks for a certain security chip in any USB peripheral attached. This is most likely impossible to emulate with an Arduino
Download The Portable Arduino Environment (with example code)
Download The Test GUI Program
Download Zadig 2.0.1
So I wanted to figure out a way to get the Skylanders Swap Force game to recognize my Arduino Micro (Micro and Leonardo have Atmega32u4 which are capable of emulating USB devices). I plugged the Portal into my Windows machine and saw that the Portal was recognized as a Raw HID device. I opened up USBVIEW (lsusb for Windows, basically) and copied down the Vendor ID and Product ID. I searched through my Arduino Installation to find the main USB core code. Finally, I found USBCore.cpp located in \hardware\arduino\avr\cores\arduino\.
I finally found some interesting code in the file:
As you can see, by changing USB_VID and USB_PID in the line of code, you can change the VID and PID of your Arduino board. I changed mine to the VID and PID of my Portal (all Swap Force Portals have the same PID and VID)
At the end, both lines 75 and 78 read the following:
Now, I did brick my Arduino Micro quite a few times messing around with the Keyboard.h's library's main code. Luckily I had my Uno (clone) which I was able to reflash the Micro's bootloader with. If you try this, I recommend you have the same.
So I put together a minimal sketch that includes the Keyboard.h library:
And uploaded this to my Micro. I fired up Skylanders Swap Force on my Wii and plugged in the Arduino Micro into the USB port of the Wii. Here's where I got excited: THE GAME RECOGNIZED IT AS A PORTAL! Now I got excited I fired up a Test GUI from a library called HIDAPI, and I plugged in my main Portal. I started placing figures on the Portal and the Portal would send data to the computer (however, the colors of the Portal were not changing based off of the type of character I placed on the Portal).
I used Serial.write(); to try to replicate the data that the Portal was sending to my PC, but I forgot that the Portal used a Raw HID method of data transfer, not Serial. So Serial wouldn't work.
I ripped my copy of Skylanders Swap Force to a WBFS file and started the game in Dolphin. It recognized the (real) Portal, but it wouldn't recognize figures. So I followed these instructions to get the Portal working, and got it. Make sure to use Zadig 2.0.1! So now Dolphin is recognizing the Portal and it's working just like a real console. Because we replaced the driver in Zadig, the Test GUI won't recognize our Portal anymore, so I used USBlyzer to see the data.
I think all we need now is a way to write RAW (!) HID data from the Arduino, because that's the protocol the Portal uses.
I'd really like to get this figured out and get a character emulated.
I used a fresh and portable Arduino environment to do this. You can download it here. This includes the test.ino sketch.
If you're skeptical right away, here's a video:
Download The Portable Arduino Environment (with example code)
Download The Test GUI Program
Download Zadig 2.0.1
So I wanted to figure out a way to get the Skylanders Swap Force game to recognize my Arduino Micro (Micro and Leonardo have Atmega32u4 which are capable of emulating USB devices). I plugged the Portal into my Windows machine and saw that the Portal was recognized as a Raw HID device. I opened up USBVIEW (lsusb for Windows, basically) and copied down the Vendor ID and Product ID. I searched through my Arduino Installation to find the main USB core code. Finally, I found USBCore.cpp located in \hardware\arduino\avr\cores\arduino\.
I finally found some interesting code in the file:
Code:
D_DEVICE(0x00,0x00,0x00,64,USB_VID,USB_PID,0x100,IMANUFACTURER,IPRODUCT,ISERIAL,1);
As you can see, by changing USB_VID and USB_PID in the line of code, you can change the VID and PID of your Arduino board. I changed mine to the VID and PID of my Portal (all Swap Force Portals have the same PID and VID)
At the end, both lines 75 and 78 read the following:
Code:
D_DEVICE(0x00,0x00,0x00,64,0x1430,0x0150,0x100,IMANUFACTURER,IPRODUCT,ISERIAL,1);
Now, I did brick my Arduino Micro quite a few times messing around with the Keyboard.h's library's main code. Luckily I had my Uno (clone) which I was able to reflash the Micro's bootloader with. If you try this, I recommend you have the same.
So I put together a minimal sketch that includes the Keyboard.h library:
Code:
#include <Keyboard.h>
void setup(){
Keyboard.begin();
}
void loop(){
//nothing to see here
}
And uploaded this to my Micro. I fired up Skylanders Swap Force on my Wii and plugged in the Arduino Micro into the USB port of the Wii. Here's where I got excited: THE GAME RECOGNIZED IT AS A PORTAL! Now I got excited I fired up a Test GUI from a library called HIDAPI, and I plugged in my main Portal. I started placing figures on the Portal and the Portal would send data to the computer (however, the colors of the Portal were not changing based off of the type of character I placed on the Portal).
I used Serial.write(); to try to replicate the data that the Portal was sending to my PC, but I forgot that the Portal used a Raw HID method of data transfer, not Serial. So Serial wouldn't work.
I ripped my copy of Skylanders Swap Force to a WBFS file and started the game in Dolphin. It recognized the (real) Portal, but it wouldn't recognize figures. So I followed these instructions to get the Portal working, and got it. Make sure to use Zadig 2.0.1! So now Dolphin is recognizing the Portal and it's working just like a real console. Because we replaced the driver in Zadig, the Test GUI won't recognize our Portal anymore, so I used USBlyzer to see the data.
I think all we need now is a way to write RAW (!) HID data from the Arduino, because that's the protocol the Portal uses.
I'd really like to get this figured out and get a character emulated.
I used a fresh and portable Arduino environment to do this. You can download it here. This includes the test.ino sketch.
Last edited by dpad_5678,