User avatar
kelle62819
Posts: 11
Joined: Sat Dec 28, 2013 6:51 am
Location: St Jean de Boiseau, France

Using Sony Buzz! controllers with Raspberry Pi

Sat Dec 28, 2013 7:10 am

Hello all,

I just received my 1st Raspberry Pi for Christmas and am starting my first project. I am trying to build a quiz show style buzzer platform using Sony Buzz! controllers (http://au.playstation.com/media/oJoan3o ... uzzers.JPG)

They come in sets of 4 that connect by USB to a Playstation 2 or 3. I would like to build a platform with a powered USB hub and 16-20 buzzers.

Using PyUSB and some nice tutorials from others, I have successfully connected a set of controllers and sniffed the messages sent from the controllers to the RPi. So, I am set there, I can detect which of the 5 buttons per buzzer are pressed.

My problem is that the big red buzzers on the controllers are able to light up. So, the PS2 is sending USB messages to the controllers to turn on and off these lights. I have borrowed a friend's PS2 with the game so that I can see the lights lighting up, but I have no way of sniffing these messages so that I can duplicate them with my platform. I don't think I can "sniff" with the RPi because it is a host as is the PS2 and there would be conflict.

Any help would be appreciated.

Jeff

User avatar
kelle62819
Posts: 11
Joined: Sat Dec 28, 2013 6:51 am
Location: St Jean de Boiseau, France

Re: Using Sony Buzz! controllers with Raspberry Pi

Sat Dec 28, 2013 10:09 am

The only solution that I have found is a hardware USB Protocol Analyzer, but the price is prohibitive.

hippy
Posts: 6500
Joined: Fri Sep 09, 2011 10:34 pm
Location: UK

Re: Using Sony Buzz! controllers with Raspberry Pi

Sat Dec 28, 2013 2:48 pm

A long time ago I interfaced the Buzz controllers to a PC and a lot of work on decoding its 'USB commands' has been done already. A trawl through your favourite search engine might get you what you need and save on doing the analysis yourself.

Eg - http://www.zimbio.com/Gamers+Buzz,+News ... rs+working

"Optional step here, but one I found particularly heartening: Enter 00, FF, FF, FF, FF, FF, FF then click write and the red light at the top of each controller will come on and remain lit. (Not essential but could come in handy in the dark!)"

And - http://planet-source-code.com/vb/script ... 4&lngWId=1

User avatar
kelle62819
Posts: 11
Joined: Sat Dec 28, 2013 6:51 am
Location: St Jean de Boiseau, France

Re: Using Sony Buzz! controllers with Raspberry Pi

Mon Dec 30, 2013 6:04 pm

SUCCESS!!

Thank you for the above article, it helped me in figuring this out and I've learned a ton about USB in the process.

The lighting and extinction of the buzzer lights is done through a USB Control Transfer request with a type of SET_CONFIGURATION

The line of code below turns on all 4 Buzz controller lights:

Code: Select all

dev.ctrl_transfer(0x0, 9, 0,0,[0x0,0xFF,0xFF,0xFF,0xFF])
The parameters for the ctrl_transfer request I figured out with the help of the table on this page: http://www.usbmadesimple.co.uk/ums_4.htm. The first 2 parameters designate the SET CONFIGURATION request type and the last parameter is the message indicating which lights to light (0x0 for off, 0xFF for on) mapped as follows [0x0, <4th controller>, <3rd controller>,<2nd controller>,<1st controller>]

So excited to have finally figured it out!!!

hippy
Posts: 6500
Joined: Fri Sep 09, 2011 10:34 pm
Location: UK

Re: Using Sony Buzz! controllers with Raspberry Pi

Wed Jan 01, 2014 11:07 pm

kelle62819 wrote:Thank you for the above article, it helped me in figuring this out and I've learned a ton about USB in the process.
Glad it helped and thanks for detailing the solution. I only used the Buzz as input sensors and, having a few other sets I have been meaning to put to similar use, it is very useful to have four outputs as well.

Computer Exchange, Cash Converters etc are good places to pick them up cheap in the UK.

User avatar
kelle62819
Posts: 11
Joined: Sat Dec 28, 2013 6:51 am
Location: St Jean de Boiseau, France

Re: Using Sony Buzz! controllers with Raspberry Pi

Wed Jan 08, 2014 2:00 pm

Well, I ran into a lot of issues with Pyusb. I was able to write programs that played with the lights on the controllers without problem and others that used the buttons as inputs without trouble but when I started switching back and forth between inputs and outputs I ran into a lot of errors (pipe errors, entity not found, etc)

I ended up stepping up a layer, losing Pyusb and communicating with the HID device driver. The default HID driver recognizes the Buzz! controllers as a 20 button joystick and is usable as such. I ended up using the cython-hidapi library (https://github.com/gbishop/cython-hidapi) that is a python wrapper for the C HIDAPI library. It took a little googling to get it to compile on the Rasp. Pi but I was able to get it to work and it is much more stable than going at the USB protocol directly. I have updated the cython-hidapicode to support multiple identical devices and the author (Gary Bishop) incorporated my code into the main codeline.

I think for people trying to get two-way communication to controllers, gamepads, etc. working with python, this is a great option.

User avatar
ulysess
Posts: 306
Joined: Thu Aug 02, 2012 6:35 am
Location: Spain
Contact: Website

Re: Using Sony Buzz! controllers with Raspberry Pi

Thu Feb 27, 2014 3:53 pm

Hi kelle62819,

I'd like to know If you can share your code with us. I have Buzz and want to develop a quiz game like you.

Thanks! :D
kelle62819 wrote:Well, I ran into a lot of issues with Pyusb. I was able to write programs that played with the lights on the controllers without problem and others that used the buttons as inputs without trouble but when I started switching back and forth between inputs and outputs I ran into a lot of errors (pipe errors, entity not found, etc)

I ended up stepping up a layer, losing Pyusb and communicating with the HID device driver. The default HID driver recognizes the Buzz! controllers as a 20 button joystick and is usable as such. I ended up using the cython-hidapi library (https://github.com/gbishop/cython-hidapi) that is a python wrapper for the C HIDAPI library. It took a little googling to get it to compile on the Rasp. Pi but I was able to get it to work and it is much more stable than going at the USB protocol directly. I have updated the cython-hidapicode to support multiple identical devices and the author (Gary Bishop) incorporated my code into the main codeline.

I think for people trying to get two-way communication to controllers, gamepads, etc. working with python, this is a great option.
Mis apuntes de...Raspberry Pi: http://misapuntesde.com
Google Docs RPi: http://goo.gl/Iwhbq

rom555
Posts: 1
Joined: Sun Sep 20, 2015 11:06 pm

Re: Using Sony Buzz! controllers with Raspberry Pi

Sun Sep 20, 2015 11:10 pm

Hi, kelle62819,

would you mind sharing some hidapi code how to interface with the buzzer! controller?

Many thanks.
R.

User avatar
Nfarrow
Posts: 47
Joined: Sat Dec 20, 2014 1:24 am
Location: Oklahoma, USA
Contact: Website Facebook Twitter YouTube

Re: Using Sony Buzz! controllers with Raspberry Pi

Thu Oct 22, 2015 8:50 am

You might want to try pi-bowl if you don't want to use Sony Buzz.
https://github.com/kenanbit/pi-bowl

A Python (Tkinter, RPi.GPIO) program for running a scholars bowl buzzer hub from a Raspberry Pi, managing timing, scoring, buzzer lockout, and player recognition.
Twitter: @farrownick
Instagram veggievampire
I own a lot of Pis....

User avatar
wkelly42
Posts: 8
Joined: Wed Oct 12, 2016 4:50 pm

Re: Using Sony Buzz! controllers with Raspberry Pi

Mon Nov 28, 2016 3:46 pm

I hate to necropost, but I'm working on a similar project and could use some direction. Unfortunately, the articles linked in this thread have vanished :-(

I have several sets of the controllers, and am using one as a sort of test subject. I've actually cut one controller away from the rest, and have tried wiring it up to the GPIO pins on my Pi 3. All I've been able to do is determine that I have the ground right - I get no other feedback when I press any of the buttons. Any direction I could get would be greatly appreciated.

LewisCowles1986
Posts: 6
Joined: Fri Mar 18, 2016 9:24 pm

Re: Using Sony Buzz! controllers with Raspberry Pi

Sat May 26, 2018 5:45 pm

https://gist.github.com/Lewiscowles1986 ... 3a7b9351f6

Gives HID read and write codes for a number of operations. Nothing is greater than 8 bytes (64-bit unsigned int), with 6-byte read, so whatever people need, it should be trivial to parse out button presses, and send in the limited state it takes.

Return to “Gaming”