ps3 not working

I had my ps working but when i started the controls over internet i noticed my ps3 wasn't working anymore.
I get this return
Traceback (most recent call last):
File "/home/pi/diddyred/diddyRedJoy.py", line 109, in
events = pygame.event.get()
pygame.error: video system not initialized

what can i do to restore my ps3 controls and also be able to livestream my camera?

thanks!

piborg's picture

There is a bit of a bug with pygame unfortunately with how it handles not having a graphical display.
This affects use over SSH or other terminal logins.

What you can try is editing the diddyRedJoy.py script.
Look for the line:

#pygame.display.set_mode((1,1))

and delete the # so it looks like:

pygame.display.set_mode((1,1))

It is a bit confusing, on some installs making this change stops things working correctly.
This is a bug relating to pygame itself sadly.

If that does not work on its own you should be able to run the script in a VNC session.
This will allow access to the graphical system and make pygame happy.

When I follow the instructions in "How to connect a PS3 remote to the new Raspberry Pi Zero W" I get to the place where I'm executing "sudo ~/sixpair" and get the following response "No controller found on USB busses."
PS3 Controller is plugged into a USB hub. Using a new TTX PS3 Controller. Using a Pi 0 W. Running Raspian Jessie. Any thoughts on why the Pi0W is not seeing the PS3 controller?

piborg's picture

We have seen a lot of trouble from people using non-official controllers, especially the cheaper ones from China.

Is this the controller you have: https://www.amazon.co.uk/Tech-Wireless-Controller-Brand-Blue/dp/B00CXXEW2O
If so the reviews suggest that the controllers are problematic even when used for a PS3 console.

Wiith the USB cable plugged into the PS3 Controller I can control the ThunderBorg with the PS3 Controller. (LIght 1 is steady on.) But pairing with the PS3 controller is unsuccessful with the USB cable connected or disconnected. With the USB cable connected when I try to pair using the Bluetooth GUI I get a popup saying "please enter 'xxxxxx' on device PLAYSTATION(R)3 Controller. I don't know how to enter a number. There are no alternative choices to choose. After a short time a popup saying "Pairing failed - GDBus.Error:org.bluez.Error.AuthenticationFailed: Authentication Failed". With the USB cable connected when I use the blueman-applet it appears like I am successful in pairing, see attachment. But when I disconnect the USB cable all four lights on the controller start blinking as though I am not paired. ANy thoughts on things to try? Running Rpi3 with Raspian Jessie. Pairing with my bluetooth speaker works fine.

piborg's picture

It sounds like the Raspberry Pi is getting confused about what type of device the controller is.

It might help if we can get some more detail about this controller. Could you take a screenshot after doing the following:

  1. Power off the Raspberry Pi
  2. Make sure the controller is not attached via the USB cable
  3. Power the Raspberry Pi
  4. Connect the PS3 controller using the USB cable now
  5. Wait a few seconds
  6. Run this command: dmesg

You should see something like the image below with lines talking about the controller being connected.

If you could take a copy / screenshot of the output for us to look at :)

Followed your instructions to get dmesg results. See attached file.

Attachments: 
piborg's picture

The bad news is that it looks like this is an unofficial controller by Gasia:

[   21.493156] input: Gasia Co.,Ltd PS(R) Gamepad as /devices/ ...

We have seen people struggle to get these controllers to pair correctly with the Raspberry Pi, but it may still be possible.

If you have not already, I would suggest trying our older PS3 setup guide which uses the terminal instead of the GUI: https://www.piborg.org/blog/build/rpi-ps3-help
This may get around the keyboard / gamepad mismatch you seem to have gotten stuck on.

As a long shot there is a guide here which lists the steps needed to get these controllers to work with RetroPie. It may prove helpful, but it may not work with anything other than RetroPie either.

Trying to connect a PS3 Dualshock3 to a Pi3 running latest Raspbian. Followed this thread but get the ID's you get for an apparently real device using dmesg and ls /dev/input
Following your original script everything works until I try to Add New Device, either the device ID just flashes in the window and cannot be selected? OR it comes up as PLAYSTATION(R)03 Controller but requests a PIN code (saying 'OK' always fails).
Any ideas?

piborg's picture

It is possible that the Pi is getting confused and thinks the PS3 controller is actually a keyboard, this would explain the PIN code dialog appearing all the time. If this is the case you will probably have more luck using our older terminal based setup instructions instead: https://www.piborg.org/blog/build/rpi-ps3-help

Another possibility is that the controller battery is getting low, which can cause problems with getting the connection setup. If this is the problem then it should go away if you just let the controller charge for an hour or so. If you use a PlayStation to charge the controller remember to re-run the sixpair steps as it will probably pair the controller to the console again.

Tried text based but get's stuck in a loop where the device seems to appear and disappear.. So it appeared to work then the device disconnected. Vis:

petebrg@ppibrg:~ $ sudo bluetoothctl
[NEW] Controller B8:27:EB:AE:38:AE ppibrg [default]
[NEW] Device E0:AE:5E:A1:1D:65 E0-AE-5E-A1-1D-65
[bluetooth]# discoverable on
Changing discoverable on succeeded
[CHG] Controller B8:27:EB:AE:38:AE Discoverable: yes
[bluetooth]# agent on
Agent registered
[CHG] Device E0:AE:5E:A1:1D:65 Connected: yes
[CHG] Device E0:AE:5E:A1:1D:65 Connected: no
[CHG] Device E0:AE:5E:A1:1D:65 Connected: yes
[CHG] Device E0:AE:5E:A1:1D:65 Connected: no
[CHG] Device E0:AE:5E:A1:1D:65 Connected: yes
[CHG] Device E0:AE:5E:A1:1D:65 Connected: no
[CHG] Device E0:AE:5E:A1:1D:65 Connected: yes
[CHG] Device E0:AE:5E:A1:1D:65 Connected: no
[CHG] Device E0:AE:5E:A1:1D:65 Connected: yes
[CHG] Device E0:AE:5E:A1:1D:65 Connected: no
[CHG] Device E0:AE:5E:A1:1D:65 Connected: yes
[CHG] Device E0:AE:5E:A1:1D:65 Connected: no
[CHG] Device E0:AE:5E:A1:1D:65 Connected: yes
[CHG] Device E0:AE:5E:A1:1D:65 Connected: no
[CHG] Device E0:AE:5E:A1:1D:65 Connected: yes
[CHG] Device E0:AE:5E:A1:1D:65 Connected: no
[CHG] Device E0:AE:5E:A1:1D:65 Connected: yes
[CHG] Device E0:AE:5E:A1:1D:65 Connected: no
[CHG] Device E0:AE:5E:A1:1D:65 Connected: yes
[CHG] Device E0:AE:5E:A1:1D:65 Connected: no

Perhaps I need a clean re-install?

piborg's picture

It looks like it may be partly setup already. Try the following steps to allow the controller to stay connected.

Start the Bluetooth setup again:

sudo bluetoothctl
discoverable on
agent on

Power on the PS3 controller, you should start seeing the Connected: yes and Connected: no lines again.

Run the trust command:

trust E0:AE:5E:A1:1D:65

Hopefully you will see some messages similar to this:

[CHG] Device E0:AE:5E:A1:1D:65 Trusted: yes
Changing E0:AE:5E:A1:1D:65 trust succeeded

If that worked the lines should stop with Connected: yes at the end. You may need to power the PS3 controller again before it works.

Get this:

[bluetooth]# discoverable on
Changing discoverable on succeeded
[CHG] Controller B8:27:EB:AE:38:AE Discoverable: yes
[bluetooth]# agent on
Agent registered
[CHG] Device E0:AE:5E:A1:1D:65 Connected: yes
[E0-AE-5E-A1-1D-65]# trust E0:AE:5E:A1:1D:65
[CHG] Device E0:AE:5E:A1:1D:65 Trusted: yes
Changing E0:AE:5E:A1:1D:65 trust succeeded
[CHG] Device E0:AE:5E:A1:1D:65 Connected: no
[CHG] Device E0:AE:5E:A1:1D:65 Connected: yes
[E0-AE-5E-A1-1D-65]# devices

Device E0:AE:5E:A1:1D:65 E0-AE-5E-A1-1D-65
[CHG] Controller B8:27:EB:AE:38:AE Discovering: yes
[CHG] Controller B8:27:EB:AE:38:AE Discovering: no
[CHG] Controller B8:27:EB:AE:38:AE Discoverable: no
[E0-AE-5E-A1-1D-65]#

Sony now has no light lit and any button pressing doesn't change that.
Attempt to pair on GUI or CLI still complains about requiring PIN code and fails. Wrong Agent?

piborg's picture

We have seen this "no light" situation before, though I am unsure what causes it. In our case the controller worked just fine at this point, it just does not indicate it is connected.

If it is working then you should be able to do the following:

  1. Turn of the Pi and wait a few seconds.
  2. Turn the Pi on and wait until it has started.
  3. Press the PS button on the controller.
    The LEDs should blink for a few seconds and then turn off instead of showing a single LED like normal.
  4. Run ls /dev/input/js* in a terminal.
    At least one device should be shown, probably /dev/input/js0.
    If you get this far the controller is correctly paired.
  5. Test the PS3 controller is working using the device name from the last command with jstest: jstest /dev/input/js0.
    The numbers shown should change as you move the joysticks around, if so everything is working properly :)

Good call - although the lights are all out and the GUI does not show that it's paired it does work.
"If" I had just ignored the comment that one light needed to show on the controller I would have got there sooner, but have learn't lots about bluetoothctl in the process ;-)

Thanks for your help - appreciated.

Sorry to butt in to this thread, I just wanted to say that my PS3 hasn't shown a light since I upgraded from Wheezy to Jessie way back. It is still the same after the recent upgrade to Stretch. Other than that it's working well.

Butt in - nah, no apology neccessary - I call it additional support, thanks for your input. :-)

Hi,

I'm trying to make a PS3 controller talk to my pi zero w (running stretch), ready to control a robot. I've followed the instructions here: https://www.piborg.org/blog/pi-zero-wifi-ps3

It all seems to go ok with no error messages. Until I get to the this command:
sudo ~/sixpair

At which point I get a message saying "No controller found on USB busses.".

I've been reading loads of posts/forums about this. I'm trying to confirm that my controllers are genuine. I've attached the dmesg output but to be honest I'm not sure my pi is recognising the controller at all. There are some lines in the dmseg about an OTG Controller:

[ 0.912444] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
[ 0.918132] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[ 0.923820] usb usb1: Product: DWC OTG Controller
[ 0.929387] usb usb1: Manufacturer: Linux 4.14.50+ dwc_otg_hcd

But these are present even if I reboot without the controller attached. I'm using a 2A power supply for the pi zero w and I've charged the controller via my macbook for an hour.

Is the OTG controller just a red-herring?
How else can I find if my ps3 controllers are genuine?
Or should I just by the piborg controller instead or will I have trouble with that too??

Thanks!

Will

Attachments: 
piborg's picture

What do you have connecting the USB on the Pi Zero to the PS3 controller? We have had problems before with cheap USB hubs not working properly with a Pi Zero in the past.

Also do you have other devices connected to the USB at the same time?

I’m using a micro USB adapter and a regular cable. No hub and no other devices. (Connecting over Vnc so no need for keyboard and mouse).

piborg's picture

I have one idea what the problem might be, it could be that the PS3 controller is flat / very low battery.

We have seen PS3 and PS4 controllers being "uncooperative" when they are low on battery. That includes connecting them to the Raspberry Pi via a USB cable.

I would suggest leaving the PS3 controller plugged in to charge overnight and then try again. Be aware that the controllers do not seem to charge properly from wall socket chargers. I would suggest plugging the controller into an actual PS3 or a PC / Laptop which is powered on.

Hi - I do appreciate your help with this but I'm still struggling. I left the ps3 controller on charge via the ps3 overnight. Plugged back into the pi zero and printed the dmesg. I've attached this.

Do the 4 red leds on the ps3 controller usually flash when you plug it into a pi? They're not.

I rebooted as well and did dmseg again - also attached.

I'm stuck now really. I should see the controller come up in the dmesg printout right? With the manufacturer so I know it's genuine.

If you have any more ideas I'm all ears! Otherwise I'll try once again with different cables/adapters.

piborg's picture

I have checked a controller both on a Pi Zero and a Pi 3, in both cases the four LEDs start flashing a couple of seconds after connecting the controller.

I would suspect the cable as being a likely culprit in this case.

Yep - it was my usb adapter. I now have a good dmesg result showing it's a genuine controller. But my good luck didn't continue...

I've been following your instructions here: https://www.piborg.org/blog/pi-zero-wifi-ps3
Sixpair seems to work ok. But at the end of step 4 - when I press the PS3 button I get a solid red light. Step 5 fails as the controller doesn't show up in the list of devices. Any ideas please??

piborg's picture

Usually the LEDs only stay solid on when the controller is connected, so it is possible that it is already setup. When you get to that stage what result do you get from this command:

ls /dev/input/js*

Another possible problem is that the controller has paired with the PS3 console. Unfortunately it will do this if you plug the controller into the console to charge. If that is the case you can re-run the sixpair command with the controller attached to pair it with the Pi again. If it is already paired correctly then both of the values shown when running sixpair will match.

You might be on to something. I booted the pi. Connected the controller. Ran sixpair and both values still matched. Made the pi discoverable. Pressed ps button - this time 4 flashing lights. Clicked on 'Add Device' - it didn't appear in the list.

So I ran the command as you said:

ls /dev/input/js*

And got the reply:

ls: cannot access '/dev/input/js*': No such file or directory

I had a look in the /dev/input folder. There is just one folder called 'mice'.

Hi Piborg, did you see my question about joystick/Pi3 connections on a separate thread under 'Rasberry Pi General Discussions' a few days ago? Do I have a dud gamepad or am I doing something wrong do you think?

Thanks

piborg's picture

Sorry about the slow reply, I have answered your question on the original thread :)

Subscribe to Comments for "ps3 not working"