Xbox one controller (3.5mm headphone version) not recognised

Hi and thanks for reading this here post, lets get to it shall we?

The ultimate aim of this project use an Xbox Controller to control an RC boat.

I've to the point where I've got all the components but I'm lacking expertise.

I've got the following components:

Genuine arduino UNI

a keyes USB HOST shield

a Xbox one controller revision 2 (Model No. 1697)

I don't Know if it's because I have the newer version but having uploaded the basic sketch from the host shield 2.0 Library to the arduino no information other then the software is running is coming threw the serial monitor, also the light on the controller stays out.

I've run the diagnostics sketch for the host shield and it comes up working fine. I've exhausted my knowledge and would appreciate any kind of help!

How are you connecting a "headphone version" XBox controller to the USB host shield?

well at the moment I'm trying simply to connect it threw a USB cable, because I assume that would be more likely to work. I do have, and have tried the wireless dongle but the two won't even bond let alone send return anything threw the serial monitor.

does your USB Host shiled of choice have any documentation?

(Thats where I'd start)

I know Circuits@Home USB Host shield/site has info on this.. (not sure if it will help you in any way through)

I have an Uno and Keyes USB host shield working with USB keyboard, barcode reader, and mouse. But no game controller.

I suggest trying a simple USB device to ensure the shield and libary are working. For example, try a USB keyboard with the USBHIDBootKbd example.

Some USB devices need lots of power so you may need to plug power via the Uno barrel connector. My barcode reader says it needs 5V 500mA.

Does the game controller work on a PC?

Post all messages coming out the serial monitor.

What is the name of the example program you are running?

First off thanks for replying!

I've managed to get serial output from a mouse and it looks much like what the documentation suggest it should.

(the documentation can be found here: http://tinkbox.ph/sites/tinkbox.ph/files/downloads/Keyes%20-%20USB%20Host%20Shield.pdf)

I'm not sure about the power requirements but this controller runs fine on the power provided to it from the USB port on my laptop. Though I suppose the arduino is taking some power for itself which might be the problem. (the controller still wont do anything when it has batteries inserted)

I'm running the XBOXONE sketch in the USB host shield library 2.0 under the xbox directory.

this is all I'm getting:
XBOX USB Library Started
XBOX USB Library Started

I get an initial buzz from the controller which might be to indicate hat it has power but nothing happens after that.

Hope that helps!

Based on the mouse working and the message "XBOX USB Library Started" appearing, the shield hardware is working. If the controller has a battery, it may also be pulling extra current for charging so external power might help.

The only other thing I can suggest is to turn on debug in the XBOXONE.cpp library code. Uncomment the #defines then see settings.h.

// To enable serial debugging see "settings.h"
//#define EXTRADEBUG // Uncomment to get even more debugging data
//#define PRINTREPORT // Uncomment to print the report send by the Xbox ONE Controller

/* Set this to 1 to activate serial debugging */
#define ENABLE_UHS_DEBUGGING 0

This is a long shot because I did not write this code and do not have a Xbox controller but perhaps the folks at circuits@home might find debug output helpful.

I would ditch the controller and get it working with a pot or switch. If that works, then add the complexity of the controller.

I got a PS3 Dual Shock clone via USB to work with a 1 line change to Usb.cpp. The controller was working a while back but does not work with the latest IDE and host library. The proposed fix comments out the data toggle flip because it seems to generate more data toggle errors instead of fixing them.

  • IDE 1.6.7
  • USB Host Shield library 2.0 version 1.2.1

This change affects just about all USB devices so use with caution. The USB keyboard still works with this change.

Usb.cpp lives in Arduino/libraries/USB_Host_Shield_Library_2.0.

@@ -234,7 +234,7 @@
                 rcode = dispatchPkt(tokIN, pep->epAddr, nak_limit); //IN packet to EP-'endpoint'. Function takes care of NAKS.
                 if(rcode == hrTOGERR) {
                         // yes, we flip it wrong here so that next time it is actually correct!
+                        // no, do not flip it because it generates more toggle errors
+                        //pep->bmRcvToggle = (regRd(rHRSL) & bmRCVTOGRD) ? 0 : 1;
-                        pep->bmRcvToggle = (regRd(rHRSL) & bmRCVTOGRD) ? 0 : 1;
                         regWr(rHCTL, (pep->bmRcvToggle) ? bmRCVTOG1 : bmRCVTOG0); //set toggle value
                         continue;
                 }

If this works, I will send a pull request to circuits@home.

P.S. If this fix does not work, I suggest using library manager to install older versions of the USB Host Shield library. I found using version 1.0.0 works on the PS3 DS without the above fix.

I'm under the impression that what you'd like me to isn't in a sketch (I am very much a noob at programming and arduino as a hole)

I've tried opening the files in note pad but it's all on one like, any suggestion what what program I should use?

Any change you could send the altered files (or contents) and I could pop them in place?

I'm sorry for not being program literate, if it helps I'm fairly sure I've ruled put power issues. I Plugged the arduino, a mouse and the controller into a non powered (not powered other then from the USB port the arduino was plugged into in the first place) USB hub and every thing was happy power-wise so I'm left to conclude that its a programming issue. (unless anyone has any other suggestions)

Again thanks for your help!!!

See the attachments for the Usb.cpp with the proposed fix. The usbhost.png file shows where to drop Usb.cpp.

The USB host shield files are in Documents\Arduino\libraries\USB_Host_Shield_Library_2.0.

To ensure the IDE uses the new Usb.cpp, exit the IDE then run it again. This forces the IDE to use the latest version of the file.

Usb.cpp (33.9 KB)

I had a go at your suggestion. Sadly no joy.

Should I write to Circuits@home or the person who wrote the Xbox one code?

Because I can't debug this myself.

I will open an issue on the github repo for the shield library and send a link. There is no charge to register for github.com.

Try this different fix. This works for the PS3 also. The fix is in the same file Usb.cpp so drop it in the same folder.

Usb.cpp (33.9 KB)

Sadly no joy :frowning: