this post was submitted on 25 Sep 2024
30 points (100.0% liked)

Linux Gaming

15304 readers
9 users here now

Discussions and news about gaming on the GNU/Linux family of operating systems (including the Steam Deck). Potentially a $HOME away from home for disgruntled /r/linux_gaming denizens of the redditarian demesne.

This page can be subscribed to via RSS.

Original /r/linux_gaming pengwing by uoou.

Resources

WWW:

Discord:

IRC:

Matrix:

Telegram:

founded 1 year ago
MODERATORS
 

Warning: You might brick your controller! (Do this at your own discretion.)

Sister Reddit post

Preamble

About a month ago, Sony decided to forgo their still-functional Firmware Updater Tool (you get a "can't connect to the server" message and it doesn't let you download the firmware) and replace it with the PlayStation Accessories app.

This new app does not run on wine at all from what I can see, so I decided to try and get the previous tool (I'll call it FWUpdater) working again.

PlayStation Accessories, on launch, connects to playstation's server (https://fwupdater.dl.playstation.net/fwupdater/info.json) and checks if it's version is up-to-date, then checks if there is a new firmware for the controllers. As it seems, FWUpdater uses the same URL to check its version as well. As these are completely different programs, and the server reports the latest version for PlayStation Accessories only, FWUpdater gets confused and just displays "can't connect to the server" (correct me if I'm wrong).

After some experimentation, I figured out I could just spoof the version reported from the server (with mitmproxy) and get FWUpdater to fetch the necessary firmware.

Prerequisites (Ensure everything is up-to-date)

  • Python
  • Wine
  • Browser
  • Terminal-feet

Process

Step 1: mitmproxy

a. Install mitmproxy from your package manager (or grab the latest binaries from
mitmproxy.org and open a terminal in the mitmproxy folder.)

b. Run mitmweb, this should launch a web UI in your browser:

c. Select File in the upper left corner and then Install certificates. This will open up another page:

d. Setup your browser (in the browser setting) to connect to mitmproxy:

e. Reload the previous page and you should see the certificates for various platforms:

f. Download the Linux certificate and install them to your system trust store, following the instructions on the above page for your specific distro (for Arch Linux, you move the certificate into /etc/ca-certificates/trust-source/anchors/).

g. Revert the proxy settings in your browser.

Step 2: FWUpdater

a. Download the FWUpdater and extract it.

b. Create a new empty file, paste this in and save it as a python script (.py).

from mitmproxy import ctx
from mitmproxy import http
import json

def response(flow: http.HTTPFlow) -> None:
    if flow.request.pretty_url.endswith("/fwupdater/info.json"):
        data = json.loads(flow.response.get_text())
        data["ApplicationLatestVersion"] = "1.5.0.2"
        flow.response.text = json.dumps(data)

b. Start mitmproxy in a terminal with the script:

mitmproxy -s "path/to/the/above/script.py"

c. Start FWUpdater with the following command:

HTTP_PROXY="http://localhost:8080/" wine "path/to/FWUpdater.exe"

d. Profit.

Troubleshooting

1. "FWUpdater doesn't detect controller"

a. Run wine control joy.cpl, change any one of these settings (unchecking "Disable hidraw" should fix it in most cases), and run FWUpdater again:

Hope this helps (And I hope I didn't miss anything lmao)

top 4 comments
sorted by: hot top controversial new old
[–] [email protected] 2 points 1 month ago* (last edited 1 month ago) (1 children)

Thanks for sharing.

What errors are logged by Wine when ~~FWUpdater~~ the new tool fails to run? If you file a bug report, it might get fixed.

[–] [email protected] 0 points 1 month ago (1 children)

It's not FWUpdater but rather PlayStation Accessories that fails to run, and it might not be functional in wine for a while cause it apparently implements some undocumented APIs: https://reddit.rtrace.io/r/linux_gaming/comments/1f96183/running_the_new_playstation_accessories_app/

[–] [email protected] 2 points 1 month ago* (last edited 1 month ago)

Sorry; the new tool, then. A bug report is a good first step toward getting those APIs supported in Wine. (Even undocumented things are sometimes added.)

[–] [email protected] 4 points 1 month ago

Thank you for working on this and for sharing with everyone!