Balanduino Forum

Hardware => Questions => Topic started by: hfoakley1948 on March 27, 2014, 04:25:20 AM

Title: ps3 controller
Post by: hfoakley1948 on March 27, 2014, 04:25:20 AM
This discussion started on kickstarter but is probably should be in this forum . Basically I can not connect a new PS3 dual shock controller to the Balanduino . The process is turn the Balanduino on and insert the Bluetooth dongle
wait a bit the remove the dongle and connect the PS3 using a usb cable wait a bit remove the usb cable and reinsert the dongle and wait. Then I press the PS button to start  the  controller the 4 leds flash and then turn off but nothing else happens.The other buttons do not function . The Balanduino otherwise works but he PS3 controller is the best
interface for a class room.
Any help appreciated. Yours Fred
Title: Re: ps3 controller
Post by: Lauszus on March 27, 2014, 01:30:55 PM
Hi Fred,

It's good to hear that you and your students enjoy the Balanduino :)

Are you able to compile the code? Please follow these instructions: http://balanduino.net/get-started.
After that you need to enable debugging in the USB Host library: https://github.com/felis/USB_Host_Shield_2.0#enable-debugging.
This will allow me to see what is going on.

Regards
Lauszus
Title: Re: ps3 controller
Post by: Ahmed on March 27, 2014, 08:02:50 PM
here are the steps i used to get mine working:

now the controller should be paired to the balanduino usb dongle and you shouldn't have to repeat those steps again unless you sync the controller back to a PS3. If you press the PS home button on the controller after you turn on the balanduino it should sync and the controller will vibrate for a second to confirm that syncing is successful. By the way it sometimes takes a couple of tries to sync.
Title: Re: ps3 controller
Post by: hfoakley1948 on March 28, 2014, 06:12:17 AM

  Thanks for the replies . When I turn on the balanduino with the dongle in place  the green led turns on and stays on. The yellow led flashes twice then stays off  and there is one beep . I did not notice the blinking yellow led until Ahmed's comment. This sequence does not change if the dongle is removed.
  The yellow light is clearly flashing at the end of the construction video .
 Lauszus if you could give me a bit of help with directory  placement I would be happy to do a recompile with debug.The last paragraph of the getting started link does not make sense to me .What does  the -- 'firmware' folder-- refer to? The Readme.md file in the Firmware directory of the Balanduino_latest.zip shows a file structure for the sketchbook directory which does not work . Specifically the balanduino is not listed in the choice of boards . I have tried the arduino-1.0.5-r2 and arduino-1.5.6-r2 with the same results.
 I must be missing something simple, generally I am not so clueless.
Thanks Fred
Title: Re: ps3 controller
Post by: Ahmed on March 28, 2014, 01:10:23 PM
note that the balanduino should be turned on while laying down flat on either of its sides. and you're correct it should then turn on the green LED, beep once (short beep) and then the orange LED should keep blinking on and off if the dongle is connected to indicate that its waiting for bluetooth connection.

to turn on USB debugging, edit this file inside your arduino sketchbook "\libraries\USB_Host_Shield_20\settings.h" and change

Code: [Select]
#define ENABLE_UHS_DEBUGGING 0
to

Code: [Select]
#define ENABLE_UHS_DEBUGGING 1
save it, and then recompile and upload.
Title: Re: ps3 controller
Post by: hfoakley1948 on March 28, 2014, 11:59:27 PM
 Lauszus and Ahmed,

Thanks again . After deleting an old forgotten version of the arduino ide  , and a clean install of
1.5.6 the instructions in the"getting started link" work fine.
First I uploaded the  precompiled Balanduino.hex file from the Balanduino_latest zip. There was no change.
Next the \libraries\USB_Host_Shield_20\settings.h file was modified to enable debugging.
Then a recompile and upload.
The initial output from the serial monitor was a multi line menu print out . When I removed the dongle
and plugged in the ps3 controller the output was

ADK Init
Got 1st bad code for Proto: 04
getproto : Usb fail

with endless repeats.

The  yellow led does not blink like on the construction video.I have tried 3 USB to USB Mini cables
with out change . My clueless  newbie guess is a hardware fail.

Any help appreciated

Thanks
Fred
Title: Re: ps3 controller
Post by: Lauszus on March 29, 2014, 01:04:32 AM
Please try to run the following example in the USB Host library: https://github.com/felis/USB_Host_Shield_2.0/tree/master/examples/board_qc. This should tell if it's a hardware fault or not.

Regards
Lauszus
Title: Re: ps3 controller
Post by: hfoakley1948 on March 29, 2014, 08:47:29 PM
Lauszus,
 The results of running-- board_qc.ino -- are as follows:


Circuits at home 2011
Reading Revision
SpI long test...................spi long test passed
GPIO test
Test Failed
press any key to continue
---  Key Press ---
GPIO test passed
PLL Test......
Resetting oscillator
Reset Number 0
.
.
.
Reset Number 99

Checking USB device communication.

Waiting for device...
.
.

Nothing after this.Which is line number 151 in of board_qc.ino . For completeness the test was tried
twice with the Blue tooth  dongle in place and twice without the dongle.


Yours Fred
       
Title: Re: ps3 controller
Post by: Lauszus on March 30, 2014, 03:11:07 AM
Could you try to plug any other device into the USB Host port than the dongle - for instance the PS3 controller?
I need to see if it actually detects a device or it just stays at "Waiting for device".
Title: Re: ps3 controller
Post by: hfoakley1948 on March 30, 2014, 05:29:04 AM
Plugged in PS3 controller . It detects the controller. The last line  is

All tests passed . Press RESET to re start test.

Yours Fred
Title: Re: ps3 controller
Post by: Sarawuth on March 30, 2014, 04:50:16 PM
I can use PS3 controller. First turn on USB debug and follow with Ahmed instructions and I saw the balanduino board register Bluetooth dongle MAC to PS3 controller.

But I believed the Bluetooth dongle from the kit is not working. I have to use with another one.
Title: Re: ps3 controller
Post by: Lauszus on March 30, 2014, 05:56:13 PM
It sounds to me like the Bluetooth dongle is the issue then, as it never gets recognized by the USB Host code.
Do you got another one at hand, so we can see if that works?
Does the light come on inside the dongle when you plug it in?

Regards
Lauszus
Title: Re: ps3 controller
Post by: hfoakley1948 on March 30, 2014, 06:32:35 PM
Tried a spare Bluetooth dongle . It shows the same successful test as with the PS3
controller .
 The last line  is

All tests passed . Press RESET to re start test.

The led on the kit  Bluetooth dongle does not come on.
The led on my spare does light  .However it does
not pair with the PS3 controller.

Yours Fred
Title: Re: ps3 controller
Post by: Lauszus on March 30, 2014, 10:27:11 PM
Okay. Please upload the Balanduino code with debugging turned on in the USB Host library and then plug in the dongle and post the output here, then I will have a look at it.

Regards
Lauszus
Title: Re: ps3 controller
Post by: hfoakley1948 on April 01, 2014, 08:46:59 PM
Just tried a new Asus Bluetooth 4.0 dongle  from  Newegg . Which solved the problem.
Thanks all for the help.

Fred
Title: Re: ps3 controller
Post by: Purplemeanie on April 05, 2014, 01:12:59 AM
FWIW: I had the BT dongle from the kit go bad on me. It worked a couple of times and then no lights on the dongle when I powered the Balanduino and no BT connections.

I tried the dongle in a number of Macs and PCs but none of them would recognise it.

So I switched to a generic CSR dongle I had lying around and it's been working for the past week with no problems.

John
Title: Re: ps3 controller
Post by: Lauszus on April 06, 2014, 04:23:20 PM
We are very sorry to hear that so many received bad dongles!
We have contacted our supplier to get it fixed.

Regards
Lauszus
Title: Re: ps3 controller
Post by: LargoLobo on June 17, 2014, 03:28:41 AM
Does anyone know how the PS3 Dualshock controller is turned off? Mine stays on until the battery runs down. Sony says you have to have the playstation console to turn it off. That it's a function of the playstation. Can anyone verify that or know how to turn off the controller by its self to save the battery?
Title: Re: ps3 controller
Post by: Lauszus on June 20, 2014, 05:37:21 PM
@LargoLobo
Simply press the PS button on the controller and it the Balanduino will disconnect the controller

Regards
Lauszus
Title: Re: ps3 controller
Post by: Jimmy on July 29, 2014, 11:04:12 PM
@Lauszus,
Is it possible to use the PS3 controller with bluetooth.h to control other autonomous 2W/4W robots?
Wonder if you are working on adding obstacle avoidance Balanduino.  :)

Thanks,

Jimmy 
Title: Re: ps3 controller
Post by: Lauszus on July 30, 2014, 05:14:59 AM
@Jimmy
Yes of course! Simply take a look at the PS3BT example I have provided with the USB Host Shield library: https://github.com/felis/USB_Host_Shield_2.0/blob/master/examples/Bluetooth/PS3BT/PS3BT.ino.

No not at the moment, as I am on holiday ;)

Regards
Lauszus
Title: Re: ps3 controller
Post by: Jimmy on August 04, 2014, 10:23:36 PM
@Lauszus, How can I make a noise or a buzzer by pressing an O button on the PS3?

Thanks,

Jimmy
Title: Re: ps3 controller
Post by: Lauszus on August 05, 2014, 03:42:19 PM
@Jimmy
Simply do it like so:
Code: [Select]
if (PS3.PS3Connected && PS3.getButtonPress(CIRCLE))
    buzzer::Set();
else
    buzzer::Clear();

Regards
Lauszus
Title: Re: ps3 controller
Post by: LargoLobo on November 05, 2014, 02:58:07 AM
Can I use the PS3BT sketch on an Arduino Uno with a H-05 or 06 BT device to send commands from the PS3 to the Uno? What I need to identify is the pins on the Arduino to connect the BT device.   I uploaded the sketch to an Uno and it fits and comes up fine. I just don't know what pins to use to connect the external BT board (AdaFruit EZ-Link).

Thanks
Title: Re: ps3 controller
Post by: Lauszus on November 05, 2014, 04:45:34 AM
@LargoLobo
No you can't. Those modules only support SPP in slave mode. In order to communicate with PS3 controller it needs to supports HID in host mode.

Regards
Lauszus