Raspberry Pi power via PS4 usb port + screen capture footage

Share your videos of GIMX in action
cortega1
Posts: 34
Joined: Wed Mar 30, 2016 3:34 pm

Raspberry Pi power via PS4 usb port + screen capture footage

Post by cortega1 »

I was able to power a model B with a 700mhz single core, 256mb ram and 2 usb ports, from a usb port on my PS4 using an automated Raspberry Pi image made by Waveform (http://gimx.fr/forum/viewtopic.php?f=11&t=1435). I was able to run this model directly from the PS4 usb port for power since this earlier model does not require much power to run. I was using a CUH-1200 model PS4. I can not confirm the following for the PS4, but since it is using usb 3, it should put out 5v 900ma (from what I've read), which is 300ma lower then the recommended power supply output for my model RPi, but 400ma higher then the boards power usage according to https://www.raspberrypi.org/help/faqs/ in the "I. power" section.


https://youtu.be/HjVOQaFLNDU

Check out at least the first 2 & 1/2 minutes and let me know what you think.

I also made another couple of video that shows the CPU % usage on the RPi. The first video only shows the RPi screen. This video depicts 3 different scenarios (RPi with no DIY adapter, RPi with just the DIY adapter attached, & RPi with DIY adapter and wheel) to see the CPU usage for during each scenario.


https://youtu.be/NMzek9H2oRo

In the last video I included the RPi screen showing CPU usage alongside the corresponding gameplay.


https://youtu.be/6uh9tOmf_RE


-----------------------------------------------------------------------------------------------------------------------------------------------------------
To get a more detailed explanation of the setup in the post below check out this link :arrow: (http://gimx.fr/forum/viewtopic.php?f=11&t=1687)
Last edited by cortega1 on Fri Jun 17, 2016 6:25 pm, edited 2 times in total.
User avatar
Rudi Rastelli
Posts: 16
Joined: Sat Jun 04, 2016 3:17 pm

Re: Raspberry Pi power via PS4 usb port + screen capture foo

Post by Rudi Rastelli »

@cortega
Your video inspired me to make my own 'PiGimx' for using my good old G27 at my fairly new PS4. So..... let me say THX.

Only i use the headless version + on-board UART. The Pi is powered via the 5V on the Teensy, which i put inside Pi's case.
So my solution so far is simple and handy: [PS4]<----->[Pi]<----->[DS4 and G27]

I plan to make a tutorial on how to build this.... but this will take some time.
Meanwhile i'll show u some pics i've made while building:

1. The Teensy++ with resistive voltage divider and cables

The orange cable is the 5V and connected to a seperate plug... this way u can simply unplug it from Pi and power Pi the usual way (for the faint hearted ^^)

2. The Teensy++ connected with Pi's serial port and 5V


3. The Teensy++ glued into Pi's case


4. Final look of the 'PiGimx' with the Teensy USB connector


Regards
Rudi
alkex92
Posts: 5
Joined: Mon Jun 06, 2016 9:13 am

Re: Raspberry Pi power via PS4 usb port + screen capture foo

Post by alkex92 »

@Rudi
thx to your photos now i've clear how to wire everything!!
have u had low latency problems using the RPi USB to UART instead of a stand-alone one (a CP2102 for example)?
cortega1
Posts: 34
Joined: Wed Mar 30, 2016 3:34 pm

Re: Raspberry Pi power via PS4 usb port + screen capture foo

Post by cortega1 »

Rudi Rastelli wrote:@cortega
Your video inspired me to make my own 'PiGimx' for using my good old G27 at my fairly new PS4. So..... let me say THX.

Only i use the headless version + on-board UART. The Pi is powered via the 5V on the Teensy, which i put inside Pi's case.
So my solution so far is simple and handy: [PS4]<----->[Pi]<----->[DS4 and G27]

I plan to make a tutorial on how to build this.... but this will take some time...
Rudi, If you end up making a tutorial, I'd love to see it. Please post it here, or leave a link. I'm glad my video inspired you to make one and take it to another level! :D

I also run my RPi headless, but for the second and third videos I hooked it up to a capture card because I was curious about what was actually happening on the RPi's end while everything was running. Until I recorded the first screen capture video, I didn't even know if the RPi logged into the GUI or ran through the terminal with the image I've been using... I recorded it for a guy in another forum (https://www.gtplanet.net/forum/threads/ ... t-11369279) who didn't have everything for his setup yet (hence, the 3 different stages in screen capture video one). I was lucky enough to get my hands on a second capture card for a ridiculously good price just after posting that video, so I thought it would be cool to see the CPU usage alongside gameplay. (A nightmare to get synced up :shock: )

If you (or anyone else) have any ideas of things you would like to see me try with the setup, please let me know. I might have to part ways with my beloved G27 sometime in the near future :( .
User avatar
Rudi Rastelli
Posts: 16
Joined: Sat Jun 04, 2016 3:17 pm

Re: Raspberry Pi power via PS4 usb port + screen capture foo

Post by Rudi Rastelli »

alkex92 wrote:@Rudi
thx to your photos now i've clear how to wire everything!!
have u had low latency problems using the RPi USB to UART instead of a stand-alone one (a CP2102 for example)?
TBH i've made only one gaming session with this setup yesterday (DIRT RALLY) and i didn't notice any latency... Man, it was pure fun ! :D
But that doesn't mean that there isn't any latency... only i didn't notice. Others might be more sensitive.
And... i can not compare to the DIY-Adapter-Way because i don't have one.

But i noticed a small drawback:
When everthing is plugged as stated in my last post and i turn on PS4 then Pi starts as well (ok that's normal because it's powered by PS4).
Now when PS4 has finished booting and i press the leftmost of the orange buttons on G27 (the PS-button) nothing happens :shock:
I have to wait a view minutes until the LED on DS4 blinks yellow. Then PS-button (and all other buttons) on G27 work as expected.
Currently i don't know if there's a way to avoid this waiting time !?

Ah well... I've posted about some probs i faced while following the wiki: http://gimx.fr/forum/viewtopic.php?p=94 ... 3633#p9478
In addition to the wiki i've disabled DHCP client on Pi and gave it a static IP in order to speed up boot a bit and to have better access via SSH.
cortega1 wrote: Rudi, If you end up making a tutorial, I'd love to see it. Please post it here, or leave a link.
I'm currently working on a tutorial in my native language (german)... but when it's ready and i'm pleased with it i'll make a translated version here.
From my point of view this is a question of honour and a way to show some respect for @Matlo's good and hard work on this amazing project

Regards
Rudi
cortega1
Posts: 34
Joined: Wed Mar 30, 2016 3:34 pm

Re: Raspberry Pi power via PS4 usb port + screen capture foo

Post by cortega1 »

Rudi Rastelli wrote: But i noticed a small drawback:
When everthing is plugged as stated in my last post and i turn on PS4 then Pi starts as well (ok that's normal because it's powered by PS4).
Now when PS4 has finished booting and i press the leftmost of the orange buttons on G27 (the PS-button) nothing happens :shock:
I have to wait a view minutes until the LED on DS4 blinks yellow. Then PS-button (and all other buttons) on G27 work as expected.
Currently i don't know if there's a way to avoid this waiting time !?
...
Rudi,
Is the wait time around 45 seconds? Also, did your wheel go through its calibration spin a second time just before you were able to hit the button? If yes (to at least the second), its normal. You won't be able to hit the PS equivalent button until the gimx software actually boots. In my case its about 45 seconds from the time I hit the power button on the PS4 to turn it on. The first spin up of the wheel (calibration) should happen when the RPi just turns on, and the second should happen when the GIMX has started and is running. The only way I can see around it is to get a more powerful RPi. If I can justify it, I might get a hold of a RPi zero to see if it can offer any improvements in a one usb port configuration. The RPi 2 and 3 would most likely reduce the boot time, but they need more power then one usb port on the PS4 can provide. I've also thought about trying an RPi 2 using using a usb cable that can get power from both ports on the PS4 to see if it would work.

I currently have this cable to try... if I can find a good deal on a RPi2
Image
Its what I'm currently using instead of the hub and two cables that I was using in the video. With the current RPi I can get away with only using the white male usb port for both power and data, but the red cable (currently not used) is there for extra power if needed. Just not sure if it would handle that much power since it is USB 2.0.

@Matlo did a great job. I really appreciate everything he has done, and all the things that have come out of it.
User avatar
Rudi Rastelli
Posts: 16
Joined: Sat Jun 04, 2016 3:17 pm

Re: Raspberry Pi power via PS4 usb port + screen capture foo

Post by Rudi Rastelli »

It's more than just 45 secs... wheel becomes ready when led on ds4 has flashed yellow.
One thing i've noticed is : When i power pi through a PSU and then un-plug and re-plug the 'teensy' wheel comes ready immediatly... but i don't wanna use PSU.

I'm not sure if we can compare our installments because you used the gui version, while i followed the gimx-pi-wiki resulting in a pure command line version.

Regarding power usage of newer pi modells:
Check out this blog : http://blog.pimoroni.com/raspberry-pi-3/
It tells us a Pi3 uses ~750mA when all cores are at 100% load.... I guess GIMX is far far away from producing such a heavy load and/or using all cores . And the connected usb-devices (G27 and DS4) doesn't drain much if any. A way to be sure about that is to measure our power usage.
So overall i believe a PS4 can easily power a pi3 in the way we use it.

Regards
Rudi
cortega1
Posts: 34
Joined: Wed Mar 30, 2016 3:34 pm

Re: Raspberry Pi power via PS4 usb port + screen capture foo

Post by cortega1 »

I may look into getting a couple of USB amp meters to do some experiments. I will probably start by looking into how much power is being drawn by the DS4 controller from the Pi's USB port, because that will add to the overall power consumption of the RPi.
cortega1
Posts: 34
Joined: Wed Mar 30, 2016 3:34 pm

Re: Raspberry Pi power via PS4 usb port + screen capture foo

Post by cortega1 »

Rudi made a more detailed post of his setup here (http://gimx.fr/forum/viewtopic.php?f=11&t=1687)
I would advocate that you check it out if you want a more streamlines approach to your GIMX setup.
cortega1
Posts: 34
Joined: Wed Mar 30, 2016 3:34 pm

Re: Raspberry Pi power via PS4 usb port + screen capture foo

Post by cortega1 »

I finally got my hands on a USB ampmeter. The one I picked up can read voltage, amperage, and also keeps a record of accumulated amperage.

The first trial I ran I connected the amp meter directly inline with the USB port on the PS4. It read slightly over 5 volts and had amp readings from ~540ma to slightly over 600ma at times. The total accumulated amperage was 70ma after a little more then 5 minute run.

On this first run, I ran into the first issue I've ever hand using GIMX with my RPi setup. The wheel became locked to the right and the pedals stuck, so the car would keep driving slammed against the wall. After about 10 seconds or so everything came back and I was able to finish the race. I was not sure if it was because of the amp meter being present, or if I just didn't connect everything properly. When I tried to start the setup with out the amp meter I thought I had broken something or corrupted the card, but after disconnecting everything and connecting it back it worked fine.

The second trial I ran was connected to just the power going into the RPi. I read slightly under 5 volts and had amp readings from ~330ma to near 400ma at times. The total accumulated amperage was 35ma after a 5 minute run.

I attempted to get readings from the controller by connected the meter between the controller and RPi, and I also tried to get readings between the PS4 and the GIMX uart end but was unable to get readings in these configurations.

I tried the setup with the amp meter reading from the PS4's USB port a second time. This time I read slightly over 5 volts again and had amp readings from ~540ma to slightly over 600ma again, but this time I was able to get through the race with no issues and the accumulated amperage was 55ma after a 5 minute run.

Comparing the two successful runs, it appears that the GIMX DIY adapter, or a backfeed into the DS4 controller (I have the DIY adapter and DS4 controller connected through the same hub), is consuming ~200ma. I will keep playing around with the meter to see if I can get readings through other configurations and report back if I find anything else interesting.
Post Reply