ktnrg45 / pyremoteplay

Python API for using PlayStation Remote Play
https://pyremoteplay.readthedocs.io/
GNU General Public License v3.0
29 stars 11 forks source link

[Question] How the Device Discovery Works? #1

Closed marcussacana closed 2 years ago

marcussacana commented 2 years ago

First for all, sorry for the invalid issue, well... I have a PS4 tool (DirectPackageInstaller) that I created, and I wanted ask you how the remoteplay discovery works to implement in my tool, is there any documentation about that or something like that? Unfortunately I'm not familiar enough with the use of sockets and networking to understand just by reading your source code, so I would like some tips, Maybe your code is like some server that the PS4 sends packets to? Or maybe your code connect connects to socket in a static IP? (I saw that 255.255.255.0) anyway, I don't have a lot of networking experience so I'd like to get some tips on how I can implement a PS4 IP discovery. I don't need to detect if the PS4 is On or Sleep, I only need to know the IP address

ktnrg45 commented 2 years ago

Hi, you would simply send this message via UDP to port 987 and listen for a response:

SRCH * HTTP/1.1\ndevice-discovery-protocol-version:00030010\n

Since you are trying to discover ips, you would send it to the broadcast address of your network. 255.255.255.255 is for all interfaces.

marcussacana commented 2 years ago

Thank you, I will give a shoot