Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No "PlayActor" device listed in PS4 Second Screen app #25

Closed
esabol opened this issue Apr 14, 2021 · 19 comments
Closed

No "PlayActor" device listed in PS4 Second Screen app #25

esabol opened this issue Apr 14, 2021 · 19 comments
Assignees

Comments

@esabol
Copy link
Contributor

esabol commented Apr 14, 2021

I have both a PS4 and PS5. I've successfully configured ps4-waker in the past.

When I execute playactor login on my Mac, it says to "Open the PS4 Second Screen app and attempt to connect to the device named: PlayActor". When I go into the PS4 Second Screen app, I don't see any device named "PlayActor". All I ever see is my PS4. I've hit Refresh many times. Any suggestions or tips?

In my PS4's Mobile App Connection Settings, I have an entry for PS4 Waker. Is it possible to transfer the credentials from ps4-waker to playactor and skip this step?

@NikDevx
Copy link

NikDevx commented Apr 15, 2021

I have both a PS4 and PS5. I've successfully configured ps4-waker in the past.

When I execute playactor login on my Mac, it says to "Open the PS4 Second Screen app and attempt to connect to the device named: PlayActor". When I go into the PS4 Second Screen app, I don't see any device named "PlayActor". All I ever see is my PS4. I've hit Refresh many times. Any suggestions or tips?

In my PS4's Mobile App Connection Settings, I have an entry for PS4 Waker. Is it possible to transfer the credentials from ps4-waker to playactor and skip this step?

You cannot connect both consoles at the same time with playactor. I think so.
For ps4 you can use https://github.com/dhleong/ps4-waker

First, you need to disconnect your PS4 from the network. And then connect ps5 with playactor. After successfully connecting ps5, you need to turn off ps5 and then connect ps4 with https://github.com/dhleong/ps4-waker

It works fine for me. I also have ps4 and ps5.

@esabol
Copy link
Contributor Author

esabol commented Apr 15, 2021

You cannot connect both consoles at the same time with playactor. I think so.

That doesn't seem right to me. I think it should be possible to use playactor with both a PS4 and PS5. Surely, you just need to specify --host-name PS5-123 or --host-name PS4-345, depending on which one you want to connect to.

Just to clarify, I currently have playactor working with my PS5. I just can't get it working with my PS4.

@esabol esabol changed the title No "PlayActor" device listed in Second Screen app No "PlayActor" device listed in PS4 Second Screen app Apr 15, 2021
@NikDevx
Copy link

NikDevx commented Apr 15, 2021

You cannot connect both consoles at the same time with playactor. I think so.

That doesn't seem right to me. I think it should be possible to use playactor with both a PS4 and PS5. Surely, you just need to specify --host-name PS5-123 or --host-name PS4-345, depending on which one you want to connect to.

Just to clarify, I currently have playactor working with my PS5. I just can't get it working with my PS4.

I understood.

@LordZork
Copy link

@NikDevx I don't think that's the issue (connecting both at the same time), as @esabol was having this problem before he connected his PS5 with playactor. I know this because he posted this problem in one of my discussions and – at the time – he hadn't yet connected his PS5.

Something else is going on. Though, I'm not exactly sure what as I have yet to try playactor with my PS4... only my PS5. Like you, I still use ps4-waker with my PS4.

That said... @esabol... I do believe you should try disconnecting ps4-waker and your PS4 from Second Screen, and start from scratch. You can always set it up again if you are unable to resolve your playactor issue.

Also, as already mentioned, you can use ps4-waker with your PS4... and playactor with your PS5.

@dhleong
Copy link
Owner

dhleong commented Apr 15, 2021

@LordZork is correct here; you should be able to connect any number of devices with playactor, provided you target the correct one with --host-id or --host-name.

@esabol I'll try to take a look at reproducing this over the weekend. The behavior with the PS4 should be pretty identical to that of ps4-waker. I haven't tested it in a while, but I was able to successfully connect mine. Have you tried any of the ps4-waker troubleshooting steps?

IIRC you cannot directly transfer credentials to another computer, because that device won't have been registered with the PS4 and it will ignore WAKEUP packets from it, but you could certainly try. The ~/.config/playactor/credentials.json is a map if HOST-ID to credentials. You may be able to copy the JSON from your existing credentials file as the value associated with the HOST-ID key in that file.

@esabol
Copy link
Contributor Author

esabol commented Apr 15, 2021

@LordZork is correct here; you should be able to connect any number of devices with playactor, provided you target the correct one with --host-id or --host-name.

Uh, that’s what I said.

@esabol I'll try to take a look at reproducing this over the weekend. The behavior with the PS4 should be pretty identical to that of ps4-waker. I haven't tested it in a while, but I was able to successfully connect mine. Have you tried any of the ps4-waker troubleshooting steps?

No, but I’ll try the --bind option and report back.

IIRC you cannot directly transfer credentials to another computer, because that device won't have been registered with the PS4 and it will ignore WAKEUP packets from it, but you could certainly try.

Well, it’s not a different computer. It’s the same computer. After a lot of searching, I eventually found where ps4-waker and playactor store the credentials, but the contents don’t look at all similar, but maybe it’s a difference between PS4 and PS5? I’ll try --bind first.

@dhleong
Copy link
Owner

dhleong commented Apr 15, 2021

Uh, that’s what I said.

You both said it; their comment was just the last I saw. No need to get territorial; we're all just trying to help each other out here!

It’s the same computer.

Ah in that case it might "just work!" The PS4 and PS5 do indeed have different credential formats since we connect to them in different ways, but they can both live in the same playactor credentials file. It'll look something like:

{
  "<host-id-for-ps4>": {
    "user-credential": "...",
    "device-type": "C",
    // ...
  },
  "<host-id-for-ps5>": {
    "RP-Key": "...",
    // ...
  }
}

Playactor may include some extra info in the block for the PS4 than ps4-waker did, but I think they should be similar enough. This is all off the top of my head, however, so I could be mistaken!

@esabol
Copy link
Contributor Author

esabol commented Apr 15, 2021

Anyway, I tried specifying --bind-address, and there was still no PlayActor device listed in the PS4 Second Screen app after many refreshes.

@esabol
Copy link
Contributor Author

esabol commented Apr 15, 2021

Well, I got it working. I'm not sure how though. Here's what I did:

After many tries using playactor, I thought I'd try reproducing getting the credentials using ps4-waker. So I moved ~/.ps4-wake.credentials.json out of the way and ran ps4-waker. The "PS4-Waker" device showed up right away in the PS4 Second Screen app. I connected to it, and ps4-waker saved the credentials to ~/.ps4-wake.credentials.json. The contents of the new ~/.ps4-wake.credentials.json file and the contents of the old one are identical. From this I concluded that there's nothing wrong with my network configuration or my Mac or anything like that. This is how it is supposed to work.

So I thought I'd try playactor one more time.... This time it worked! I still never saw the "PlayActor" device listed in the PS4 Second Screen app. What I did differently though was that I connected to my PS4 in the PS4 Second Screen app and then disconnected. From that interaction, it appears playactor was able to get the credentials.

Fortunately, I executed playactor with the --debug option, so I was able to capture this interaction. Looking closely at the debug output, is it possible playactor is pretending to be "PS4-895" instead of "PlayActor"? So when I connected to PS4-895 in the PS4 Second Screen app, it was actually connecting to playactor and not my PS4? Or is playactor sniffing the credentials somehow?

 playactor login --debug --host-name PS4-895 --bind-address 192.168.1.101
  playactor:cli:options findDevice with: DeviceOptions {
  enableDebug: true,
  machineFriendly: false,
  searchTimeout: 30000,
  connectTimeout: 15000,
  dontAuthenticate: false,
  localBindAddress: '192.168.1.101',
  localBindPort: undefined,
  credentialsPath: undefined,
  passCode: undefined,
  deviceIp: undefined,
  deviceHostName: 'PS4-895',
  deviceHostId: undefined
} +0ms
  playactor:discovery discover( { pingIntervalMillis: 5000, timeoutMillis: 30000, uniqueDevices: true } ) +0ms
  playactor:discovery:udp acquire @ 0 +0ms
  playactor:discovery:udp created new socket for  { localBindAddress: '192.168.1.101', localBindPort: undefined } +1ms
  playactor:discovery:udp acquire @ 0 +1ms
  playactor:discovery:udp joining existing socket for  { localBindAddress: '192.168.1.101', localBindPort: undefined } +1ms
  playactor:discovery:udp send: <Buffer 53 52 43 48 20 2a 20 48 54 54 50 2f 31 2e 31 0a 64 65 76 69 63 65 2d 64 69 73 63 6f 76 65 72 79 2d 70 72 6f 74 6f 63 6f 6c 2d 76 65 72 73 69 6f 6e 3a ... 9 more bytes>  to  255.255.255.255 : 987 +1ms
  playactor:discovery:udp send: <Buffer 53 52 43 48 20 2a 20 48 54 54 50 2f 31 2e 31 0a 64 65 76 69 63 65 2d 64 69 73 63 6f 76 65 72 79 2d 70 72 6f 74 6f 63 6f 6c 2d 76 65 72 73 69 6f 6e 3a ... 9 more bytes>  to  255.255.255.255 : 9302 +2ms
  playactor:discovery:udp listening on  { address: '192.168.1.101', family: 'IPv4', port: 56740 } +5ms
  playactor:discovery:messages parse: HTTP/1.1 200 Ok
host-id:709E292195BF
host-type:PS4
host-name:PS4-895
host-request-port:997
device-discovery-protocol-version:00020020
system-version:08508021
running-app-name:YouTube
running-app-titleid:CUSA01015
 +0ms
  playactor:discovery:udp received device: {
  type: 'DEVICE',
  sender: { address: '192.168.1.4', family: 'IPv4', port: 53404, size: 213 },
  version: '00020020',
  data: {
    type: 'DEVICE',
    statusLine: '200 Ok',
    statusCode: '200',
    statusMessage: 'Ok',
    status: 'AWAKE',
    'host-id': '709E292195BF',
    'host-type': 'PS4',
    'host-name': 'PS4-895',
    'host-request-port': '997',
    'device-discovery-protocol-version': '00020020',
    'system-version': '08508021',
    'running-app-name': 'YouTube',
    'running-app-titleid': 'CUSA01015'
  }
} +8ms
  playactor:discovery:messages parse: HTTP/1.1 200 Ok
host-id:709E292195BF
host-type:PS4
host-name:PS4-895
host-request-port:997
device-discovery-protocol-version:00020020
system-version:08508021
running-app-name:YouTube
running-app-titleid:CUSA01015
 +2ms
  playactor:discovery:udp received device: {
  type: 'DEVICE',
  sender: { address: '192.168.1.4', family: 'IPv4', port: 53404, size: 213 },
  version: '00030010',
  data: {
    type: 'DEVICE',
    statusLine: '200 Ok',
    statusCode: '200',
    statusMessage: 'Ok',
    status: 'AWAKE',
    'host-id': '709E292195BF',
    'host-type': 'PS4',
    'host-name': 'PS4-895',
    'host-request-port': '997',
    'device-discovery-protocol-version': '00020020',
    'system-version': '08508021',
    'running-app-name': 'YouTube',
    'running-app-titleid': 'CUSA01015'
  }
} +1ms
  playactor:discovery:udp closing udp network +2ms
  playactor:discovery:udp release @ 0 +1ms
  playactor:discovery:udp closing udp network +0ms
  playactor:discovery:udp release @ 0 +0ms
  playactor:waker device {
  address: { address: '192.168.1.4', family: 'IPv4', port: 53404, size: 213 },
  hostRequestPort: 997,
  extras: {
    statusLine: '200 Ok',
    statusCode: '200',
    statusMessage: 'Ok',
    status: 'AWAKE',
    'running-app-name': 'YouTube',
    'running-app-titleid': 'CUSA01015'
  },
  discoveryVersion: '00020020',
  systemVersion: '08508021',
  id: '709E292195BF',
  name: 'PS4-895',
  status: 'AWAKE',
  type: 'PS4'
} is already awake +0ms
  playactor:credentials:disk reading credentials at /Users/esabol/.config/playactor/credentials.json +0ms
  playactor:cli:pin non-login error encountered:  RootMissingError: No credentials for PS4-895 and unable to request (need root permissions).
    at RootManagingCredentialRequester.<anonymous> (/Users/esabol/lib/npm/lib/node_modules/playactor/dist/credentials/root-managing.js:35:23)
    at Generator.next (<anonymous>)
    at /Users/esabol/lib/npm/lib/node_modules/playactor/dist/credentials/root-managing.js:8:71
    at new Promise (<anonymous>)
    at __awaiter (/Users/esabol/lib/npm/lib/node_modules/playactor/dist/credentials/root-managing.js:4:12)
    at RootManagingCredentialRequester.requestForDevice (/Users/esabol/lib/npm/lib/node_modules/playactor/dist/credentials/root-managing.js:33:16)
    at DeviceTypeStrategyCredentialRequester.requestForDevice (/Users/esabol/lib/npm/lib/node_modules/playactor/dist/credentials/device-type-strategy.js:11:25)
    at CredentialManager.<anonymous> (/Users/esabol/lib/npm/lib/node_modules/playactor/dist/credentials.js:32:54)
    at Generator.next (<anonymous>)
    at fulfilled (/Users/esabol/lib/npm/lib/node_modules/playactor/dist/credentials.js:5:58) +0ms
No credentials for PS4-895 and unable to request (need root permissions).
Attempting to request root permissions now (we will relinquish them as soon as possible)...
  playactor:cli:options findDevice with: DeviceOptions {
  enableDebug: true,
  machineFriendly: false,
  searchTimeout: 30000,
  connectTimeout: 15000,
  dontAuthenticate: false,
  localBindAddress: '192.168.1.101',
  localBindPort: undefined,
  credentialsPath: '/Users/esabol/.config/playactor/credentials.json',
  passCode: undefined,
  deviceIp: undefined,
  deviceHostName: 'PS4-895',
  deviceHostId: undefined
} +0ms
  playactor:discovery discover( { pingIntervalMillis: 5000, timeoutMillis: 30000, uniqueDevices: true } ) +0ms
  playactor:discovery:udp acquire @ 0 +0ms
  playactor:discovery:udp created new socket for  { localBindAddress: '192.168.1.101', localBindPort: undefined } +0ms
  playactor:discovery:udp acquire @ 0 +1ms
  playactor:discovery:udp joining existing socket for  { localBindAddress: '192.168.1.101', localBindPort: undefined } +0ms
  playactor:discovery:udp send: <Buffer 53 52 43 48 20 2a 20 48 54 54 50 2f 31 2e 31 0a 64 65 76 69 63 65 2d 64 69 73 63 6f 76 65 72 79 2d 70 72 6f 74 6f 63 6f 6c 2d 76 65 72 73 69 6f 6e 3a ... 9 more bytes>  to  255.255.255.255 : 987 +1ms
  playactor:discovery:udp send: <Buffer 53 52 43 48 20 2a 20 48 54 54 50 2f 31 2e 31 0a 64 65 76 69 63 65 2d 64 69 73 63 6f 76 65 72 79 2d 70 72 6f 74 6f 63 6f 6c 2d 76 65 72 73 69 6f 6e 3a ... 9 more bytes>  to  255.255.255.255 : 9302 +2ms
  playactor:discovery:udp listening on  { address: '192.168.1.101', family: 'IPv4', port: 58991 } +4ms
  playactor:discovery:messages parse: HTTP/1.1 200 Ok
host-id:709E292195BF
host-type:PS4
host-name:PS4-895
host-request-port:997
device-discovery-protocol-version:00020020
system-version:08508021
running-app-name:YouTube
running-app-titleid:CUSA01015
 +0ms
  playactor:discovery:udp received device: {
  type: 'DEVICE',
  sender: { address: '192.168.1.4', family: 'IPv4', port: 58313, size: 213 },
  version: '00020020',
  data: {
    type: 'DEVICE',
    statusLine: '200 Ok',
    statusCode: '200',
    statusMessage: 'Ok',
    status: 'AWAKE',
    'host-id': '709E292195BF',
    'host-type': 'PS4',
    'host-name': 'PS4-895',
    'host-request-port': '997',
    'device-discovery-protocol-version': '00020020',
    'system-version': '08508021',
    'running-app-name': 'YouTube',
    'running-app-titleid': 'CUSA01015'
  }
} +7ms
  playactor:discovery:messages parse: HTTP/1.1 200 Ok
host-id:709E292195BF
host-type:PS4
host-name:PS4-895
host-request-port:997
device-discovery-protocol-version:00020020
system-version:08508021
running-app-name:YouTube
running-app-titleid:CUSA01015
 +2ms
  playactor:discovery:udp received device: {
  type: 'DEVICE',
  sender: { address: '192.168.1.4', family: 'IPv4', port: 58313, size: 213 },
  version: '00030010',
  data: {
    type: 'DEVICE',
    statusLine: '200 Ok',
    statusCode: '200',
    statusMessage: 'Ok',
    status: 'AWAKE',
    'host-id': '709E292195BF',
    'host-type': 'PS4',
    'host-name': 'PS4-895',
    'host-request-port': '997',
    'device-discovery-protocol-version': '00020020',
    'system-version': '08508021',
    'running-app-name': 'YouTube',
    'running-app-titleid': 'CUSA01015'
  }
} +1ms
  playactor:discovery:udp closing udp network +1ms
  playactor:discovery:udp release @ 0 +1ms
  playactor:discovery:udp closing udp network +0ms
  playactor:discovery:udp release @ 0 +0ms
  playactor:waker device {
  address: { address: '192.168.1.4', family: 'IPv4', port: 58313, size: 213 },
  hostRequestPort: 997,
  extras: {
    statusLine: '200 Ok',
    statusCode: '200',
    statusMessage: 'Ok',
    status: 'AWAKE',
    'running-app-name': 'YouTube',
    'running-app-titleid': 'CUSA01015'
  },
  discoveryVersion: '00020020',
  systemVersion: '08508021',
  id: '709E292195BF',
  name: 'PS4-895',
  status: 'AWAKE',
  type: 'PS4'
} is already awake +0ms
  playactor:credentials:disk reading credentials at /Users/esabol/.config/playactor/credentials.json +0ms
  playactor:discovery:udp acquire @ 987 +6ms
  playactor:discovery:udp created new socket for  { localBindAddress: '192.168.1.101', localBindPort: 987 } +1ms
  playactor:discovery:udp acquire @ 987 +0ms
  playactor:discovery:udp joining existing socket for  { localBindAddress: '192.168.1.101', localBindPort: 987 } +0ms
Registering with device via Second Screen.
Open the PS4 Second Screen app and attempt to connect to the device named:
  PlayActor
  playactor:credentials:mim emulating device; awaiting WAKE... +0ms
  playactor:discovery:udp listening on  { address: '192.168.1.101', family: 'IPv4', port: 987 } +2ms
  playactor:discovery:messages parse: SRCH * HTTP/1.1
device-discovery-protocol-version:00020020 +791ms
  playactor:credentials:mim received: {
  type: 'SRCH',
  sender: { address: '192.168.1.26', family: 'IPv4', port: 50589, size: 58 },
  version: '00020020',
  data: { type: 'SRCH', 'device-discovery-protocol-version': '00020020' }
} +781ms
  playactor:discovery:messages parse: SRCH * HTTP/1.1
device-discovery-protocol-version:00020020 +0ms
  playactor:credentials:mim received: {
  type: 'SRCH',
  sender: { address: '192.168.1.26', family: 'IPv4', port: 50589, size: 58 },
  version: '00030010',
  data: { type: 'SRCH', 'device-discovery-protocol-version': '00020020' }
} +0ms
  playactor:credentials:mim respond to SRCH request from { address: '192.168.1.26', family: 'IPv4', port: 50589, size: 58 } +1ms
  playactor:discovery:udp send: <Buffer 48 54 54 50 2f 31 2e 31 20 36 32 30 20 53 65 72 76 65 72 20 53 74 61 6e 64 62 79 20 2a 20 48 54 54 50 2f 31 2e 31 0a 64 65 76 69 63 65 2d 64 69 73 63 ... 32 more bytes>  to  192.168.1.26 : 50589 +781ms
  playactor:discovery:udp send: <Buffer 48 54 54 50 2f 31 2e 31 20 36 32 30 20 53 65 72 76 65 72 20 53 74 61 6e 64 62 79 20 2a 20 48 54 54 50 2f 31 2e 31 0a 64 65 76 69 63 65 2d 64 69 73 63 ... 32 more bytes>  to  192.168.1.26 : 50589 +0ms
  playactor:credentials:mim respond to SRCH request from { address: '192.168.1.26', family: 'IPv4', port: 50589, size: 58 } +0ms
  playactor:discovery:udp send: <Buffer 48 54 54 50 2f 31 2e 31 20 36 32 30 20 53 65 72 76 65 72 20 53 74 61 6e 64 62 79 20 2a 20 48 54 54 50 2f 31 2e 31 0a 64 65 76 69 63 65 2d 64 69 73 63 ... 32 more bytes>  to  192.168.1.26 : 50589 +0ms
  playactor:discovery:udp send: <Buffer 48 54 54 50 2f 31 2e 31 20 36 32 30 20 53 65 72 76 65 72 20 53 74 61 6e 64 62 79 20 2a 20 48 54 54 50 2f 31 2e 31 0a 64 65 76 69 63 65 2d 64 69 73 63 ... 32 more bytes>  to  192.168.1.26 : 50589 +1ms
  playactor:discovery:messages parse: SRCH * HTTP/1.1
device-discovery-protocol-version:00020020 +1s
  playactor:credentials:mim received: {
  type: 'SRCH',
  sender: { address: '192.168.1.26', family: 'IPv4', port: 50589, size: 58 },
  version: '00020020',
  data: { type: 'SRCH', 'device-discovery-protocol-version': '00020020' }
} +999ms
  playactor:discovery:messages parse: SRCH * HTTP/1.1
device-discovery-protocol-version:00020020 +0ms
  playactor:credentials:mim received: {
  type: 'SRCH',
  sender: { address: '192.168.1.26', family: 'IPv4', port: 50589, size: 58 },
  version: '00030010',
  data: { type: 'SRCH', 'device-discovery-protocol-version': '00020020' }
} +1ms
  playactor:credentials:mim respond to SRCH request from { address: '192.168.1.26', family: 'IPv4', port: 50589, size: 58 } +0ms
  playactor:discovery:udp send: <Buffer [REDACTED] bytes>  to  192.168.1.26 : 50589 +999ms
  playactor:discovery:udp send: <Buffer [REDACTED] more bytes>  to  192.168.1.26 : 50589 +1ms
  playactor:credentials:mim respond to SRCH request from { address: '192.168.1.26', family: 'IPv4', port: 50589, size: 58 } +1ms
  playactor:discovery:udp send: <Buffer [REDACTED] bytes>  to  192.168.1.26 : 50589 +0ms
  playactor:discovery:udp send: <Buffer [REDACTED] bytes>  to  192.168.1.26 : 50589 +1ms
  playactor:discovery:messages parse: WAKEUP * HTTP/1.1
client-type:i
user-credential:[REDACTED]
auth-type:C
device-discovery-protocol-version:00020020
model:i
app-type:c +4ms
  playactor:credentials:mim received: {
  type: 'WAKEUP',
  sender: { address: '192.168.1.26', family: 'IPv4', port: 50589, size: 186 },
  version: '00020020',
  data: {
    type: 'WAKEUP',
    'client-type': 'i',
    'user-credential': '[REDACTED]',
    'auth-type': 'C',
    'device-discovery-protocol-version': '00020020',
    model: 'i',
    'app-type': 'c'
  }
} +2ms
  playactor:discovery:messages parse: WAKEUP * HTTP/1.1
client-type:i
user-credential:[REDACTED]
auth-type:C
device-discovery-protocol-version:00020020
model:i
app-type:c +0ms
  playactor:credentials:mim received: {
  type: 'WAKEUP',
  sender: { address: '192.168.1.26', family: 'IPv4', port: 50589, size: 186 },
  version: '00030010',
  data: {
    type: 'WAKEUP',
    'client-type': 'i',
    'user-credential': '[REDACTED]',
    'auth-type': 'C',
    'device-discovery-protocol-version': '00020020',
    model: 'i',
    'app-type': 'c'
  }
} +1ms
  playactor:credentials:mim received WAKEUP from { address: '192.168.1.26', family: 'IPv4', port: 50589, size: 186 } +0ms
  playactor:discovery:udp closing udp network +2ms
  playactor:discovery:udp release @ 987 +1ms
  playactor:discovery:udp closing udp network +0ms
  playactor:discovery:udp release @ 987 +0ms
  playactor:credentials:root Restored user ID to: 503 +0ms
  playactor:credentials:disk reading credentials at /Users/esabol/.config/playactor/credentials.json +2s
  playactor:credentials:disk writing credentials to  /Users/esabol/.config/playactor/credentials.json +1ms
  playactor:socket:open requesting device wake up to ensure socket availability +0ms
  playactor:waker:udp sending  <Buffer 57 41 4b 45 55 50 20 2a 20 48 54 54 50 2f 31 2e 31 0a 63 6c 69 65 6e 74 2d 74 79 70 65 3a 69 0a 75 73 65 72 2d 63 72 65 64 65 6e 74 69 61 6c 3a 38 31 ... 137 more bytes> to: 192.168.1.4 987 +0ms
  playactor:waker:udp sending  <Buffer 4c 41 55 4e 43 48 20 2a 20 48 54 54 50 2f 31 2e 31 0a 63 6c 69 65 6e 74 2d 74 79 70 65 3a 69 0a 75 73 65 72 2d 63 72 65 64 65 6e 74 69 61 6c 3a 38 31 ... 137 more bytes> to: 192.168.1.4 987 +1ms
  playactor:socket:open attempting to open socket... +259ms
  playactor:socket:tcp socket connected! +0ms
  playactor:socket:open performing handshake and login... +4ms
  playactor:socket:tcp >> ClientHelloPacket {
  protocolVersion: { major: 2, minor: 0 },
  type: 1868784496,
  totalLength: 28
} ( <Buffer 1c 00 00 00 70 63 63 6f 00 00 02 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00> ) +3ms
  playactor:socket:tcp << <Buffer 24 00 00 00 70 63 63 6f 00 00 02 00 00 00 00 00 01 00 00 00 45 09 d4 0c 58 40 36 79 aa 5d 31 6b 0f d3 50 c8> +2ms
  playactor:socket:BufferPacketProcessor  ... decoded:  <Buffer 24 00 00 00 70 63 63 6f 00 00 02 00 00 00 00 00 01 00 00 00 45 09 d4 0c 58 40 36 79 aa 5d 31 6b 0f d3 50 c8> +0ms
  playactor:socket:base determined next packet length:  36 (actual: 36; padding: undefined) +0ms
  playactor:socket:base have 36 of expected 36 +0ms
  playactor:socket:BufferPacketProcessor dispatch: ServerHelloPacket {
  type: 1868784496,
  version: 131072,
  result: 0,
  option: 1,
  seed: <Buffer [REDACTED]>,
  errorCode: undefined
} +2ms
  playactor:proc:handshake received greeting: ServerHelloPacket {
  type: 1868784496,
  version: 131072,
  result: 0,
  option: 1,
  seed: <Buffer [REDACTED]>,
  errorCode: undefined
} +0ms
  playactor:socket:tcp >> HandshakePacket {
  key: <Buffer [REDACTED] more bytes>,
  seed: <Buffer [REDACTED] >,
  type: 32,
  totalLength: 280
} ( <Buffer [REDACTED] bytes> ) +100ms
  playactor:socket:tcp switch to codec: CryptoCodec {
  initVector: <Buffer [REDACTED]>,
  seed: <Buffer 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00>,
  algorithm: 'aes-128-cbc',
  paddingSize: 16,
  cipher: Cipheriv {
    _decoder: null,
    _options: undefined,
    [Symbol(kHandle)]: CipherBase {}
  },
  decipher: Decipheriv {
    _decoder: null,
    _options: undefined,
    [Symbol(kHandle)]: CipherBase {}
  },
  padEncoding: true,
  chunkDecoding: true
} +1ms
  playactor:socket:tcp >> LoginPacket {
  userCredential: '[REDACTED]',
  type: 30,
  totalLength: 384,
  info: 1025,
  config: {
    appLabel: 'PlayStation',
    model: 'PlayActor',
    osVersion: '4.4',
    passCode: '',
    pinCode: '',
    appendHostnameToModel: true
  }
} :  <Buffer [REDACTED] bytes> +2ms
  playactor:socket:tcp << <Buffer [REDACTED]> +163ms
  playactor:socket:crypto decoding 16  of  16 total buffered +0ms
  playactor:socket:BufferPacketProcessor  ... decoded:  <Buffer 10 00 00 00 07 00 00 00 00 00 00 00 00 00 00 00> +265ms
  playactor:socket:base determined next packet length:  16 (actual: 16; padding: 16) +266ms
  playactor:socket:base have 16 of expected 16 +0ms
  playactor:socket:BufferPacketProcessor dispatch: LoginResultPacket {
  data: <Buffer 10 00 00 00 07 00 00 00 00 00 00 00 00 00 00 00>,
  type: 7,
  result: 0
} +0ms
  playactor:socket:tcp >> StatusPacket { status: 0, type: 20, totalLength: 12 } :  <Buffer 0c 00 00 00 14 00 00 00 00 00 00 00> +2ms
  playactor:socket:tcp close() +1ms
  playactor:socket:tcp requesting polite disconnect +0ms
  playactor:socket:tcp >> ByePacket { totalLength: 8, type: 4 } :  <Buffer 08 00 00 00 04 00 00 00> +0ms
  playactor:socket:tcp socket closed: undefined +101ms
  playactor:cli:root root proxied; this process became nop +0ms

Anyway, I'm now able to wake up and standby both my PS4 and my PS5 using playactor.

EDITED TO ADD: I meant to mention that I was able to reproduce this starting from a clean slate. I renamed ~/.config and started all over again with playactor login --host-name PS4-895 and then connected to PS4-895 in the PS4 Second Screen app, and that worked.

@dhleong
Copy link
Owner

dhleong commented Apr 15, 2021

I think you may have discovered a bug in the PS4 Second Screen app, haha. Here's what I think happened:

  • We responded to the app's SEARCH request, but due to incorrect filtering I omitted the host-name, host-type, etc. keys from that message—this is why PlayActor didn't actually show up in the app
  • Because the message was somewhat well formatted but didn't actually include the right identifier information, perhaps the app accidentally replaced the destination IP address associated with your actual PS4 with that of your computer (from playactor)
  • Now when you attempted to connect to your device, because the IP address was swapped out, it sent it to playactor

This is all a guess; I haven't tested against my actual device yet, but I fixed my bug and PlayActor shows up in the Second Screen app, so that bit should work properly now 🤞

@esabol
Copy link
Contributor Author

esabol commented Apr 15, 2021

Great! Thanks!

@esabol
Copy link
Contributor Author

esabol commented Apr 16, 2021

Hmmm, I just upgraded to 0.2.3, and I'm still not seeing any "PlayActor" device in the PS4 Second Screen app.... 😢

...
  playactor:waker device {
  address: { address: '192.168.1.4', family: 'IPv4', port: 59525, size: 213 },
  hostRequestPort: 997,
  extras: {
    statusLine: '200 Ok',
    statusCode: '200',
    statusMessage: 'Ok',
    status: 'AWAKE',
    'running-app-name': 'YouTube',
    'running-app-titleid': 'CUSA01015'
  },
  discoveryVersion: '00020020',
  systemVersion: '08508021',
  id: '709E292195BF',
  name: 'PS4-895',
  status: 'AWAKE',
  type: 'PS4'
} is already awake +0ms
  playactor:credentials:disk reading credentials at /Users/esabol/.config/playactor/credentials.json +0ms
  playactor:discovery:udp acquire @ 987 +4ms
  playactor:discovery:udp created new socket for  { localBindAddress: '192.168.1.101', localBindPort: 987 } +0ms
  playactor:discovery:udp acquire @ 987 +0ms
  playactor:discovery:udp joining existing socket for  { localBindAddress: '192.168.1.101', localBindPort: 987 } +0ms
Registering with device via Second Screen.
Open the PS4 Second Screen app and attempt to connect to the device named:
  PlayActor
  playactor:credentials:mim emulating device { hostId: '1234567890AB', hostName: 'PlayActor' } awaiting WAKE... +0ms
  playactor:discovery:udp listening on  { address: '192.168.1.101', family: 'IPv4', port: 987 } +2ms

The debug output says it's emulating a host with the name "PlayActor", so I think it should be working, but not for me for some reason. 🤷 Let me know if there's anything else you want me to try.

@dhleong
Copy link
Owner

dhleong commented Apr 16, 2021

Do you see any lines like "responding to SRCH" when --debug is enabled?

@esabol
Copy link
Contributor Author

esabol commented Apr 16, 2021

Do you see any lines like "responding to SRCH" when --debug is enabled?

Interestingly, I don't if I --bind-address <IP>, but I do if I leave that off.

Here's an example:

...
  playactor:discovery:udp acquire @ 987 +0ms
  playactor:discovery:udp joining existing socket for  { localBindAddress: undefined, localBindPort: 987 } +0ms
Registering with device via Second Screen.
Open the PS4 Second Screen app and attempt to connect to the device named:
  PlayActor
  playactor:credentials:mim emulating device { hostId: '1234567890AB', hostName: 'PlayActor' } awaiting WAKE... +0ms
  playactor:discovery:udp listening on  { address: '0.0.0.0', family: 'IPv4', port: 987 } +2ms
  playactor:discovery:messages parse: SRCH * HTTP/1.1
device-discovery-protocol-version:00020020 +6s
  playactor:credentials:mim received: {
  type: 'SRCH',
  sender: { address: '192.168.1.26', family: 'IPv4', port: 63326, size: 58 },
  version: '00020020',
  data: { type: 'SRCH', 'device-discovery-protocol-version': '00020020' }
} +6s
  playactor:discovery:messages parse: SRCH * HTTP/1.1
device-discovery-protocol-version:00020020 +0ms
  playactor:credentials:mim received: {
  type: 'SRCH',
  sender: { address: '192.168.1.26', family: 'IPv4', port: 63326, size: 58 },
  version: '00030010',
  data: { type: 'SRCH', 'device-discovery-protocol-version': '00020020' }
} +0ms
  playactor:credentials:mim respond to SRCH request from { address: '192.168.1.26', family: 'IPv4', port: 63326, size: 58 } +0ms
  playactor:discovery:udp send: 485454502f312e312036323020536572766572205374616e646279202a20485454502f312e310a686f73742d69643a3132333435363738393041420a686f73742d6e616d653a506c61794163746f720a686f73742d726571756573742d706f72743a3938370a686f73742d747970653a5053340a6465766963652d646973636f766572792d70726f746f636f6c2d76657273696f6e3a30303032303032300a  to  192.168.1.26 : 63326 +6s
  playactor:discovery:udp send: 485454502f312e312036323020536572766572205374616e646279202a20485454502f312e310a686f73742d69643a3132333435363738393041420a686f73742d6e616d653a506c61794163746f720a686f73742d726571756573742d706f72743a3938370a686f73742d747970653a5053340a6465766963652d646973636f766572792d70726f746f636f6c2d76657273696f6e3a30303033303031300a  to  192.168.1.26 : 63326 +0ms
  playactor:credentials:mim respond to SRCH request from { address: '192.168.1.26', family: 'IPv4', port: 63326, size: 58 } +1ms
  playactor:discovery:udp send: 485454502f312e312036323020536572766572205374616e646279202a20485454502f312e310a686f73742d69643a3132333435363738393041420a686f73742d6e616d653a506c61794163746f720a686f73742d726571756573742d706f72743a3938370a686f73742d747970653a5053340a6465766963652d646973636f766572792d70726f746f636f6c2d76657273696f6e3a30303032303032300a  to  192.168.1.26 : 63326 +0ms
  playactor:discovery:udp send: 485454502f312e312036323020536572766572205374616e646279202a20485454502f312e310a686f73742d69643a3132333435363738393041420a686f73742d6e616d653a506c61794163746f720a686f73742d726571756573742d706f72743a3938370a686f73742d747970653a5053340a6465766963652d646973636f766572792d70726f746f636f6c2d76657273696f6e3a30303033303031300a  to  192.168.1.26 : 63326 +0ms
  playactor:discovery:messages parse: SRCH * HTTP/1.1
device-discovery-protocol-version:00020020 +921ms
  playactor:credentials:mim received: {
  type: 'SRCH',
  sender: { address: '192.168.1.26', family: 'IPv4', port: 63326, size: 58 },
  version: '00020020',
  data: { type: 'SRCH', 'device-discovery-protocol-version': '00020020' }
} +920ms
  playactor:discovery:messages parse: SRCH * HTTP/1.1
device-discovery-protocol-version:00020020 +0ms
  playactor:credentials:mim received: {
  type: 'SRCH',
  sender: { address: '192.168.1.26', family: 'IPv4', port: 63326, size: 58 },
  version: '00030010',
  data: { type: 'SRCH', 'device-discovery-protocol-version': '00020020' }
} +0ms
  playactor:credentials:mim respond to SRCH request from { address: '192.168.1.26', family: 'IPv4', port: 63326, size: 58 } +1ms
  playactor:discovery:udp send: 485454502f312e312036323020536572766572205374616e646279202a20485454502f312e310a686f73742d69643a3132333435363738393041420a686f73742d6e616d653a506c61794163746f720a686f73742d726571756573742d706f72743a3938370a686f73742d747970653a5053340a6465766963652d646973636f766572792d70726f746f636f6c2d76657273696f6e3a30303032303032300a  to  192.168.1.26 : 63326 +921ms
  playactor:discovery:udp send: 485454502f312e312036323020536572766572205374616e646279202a20485454502f312e310a686f73742d69643a3132333435363738393041420a686f73742d6e616d653a506c61794163746f720a686f73742d726571756573742d706f72743a3938370a686f73742d747970653a5053340a6465766963652d646973636f766572792d70726f746f636f6c2d76657273696f6e3a30303033303031300a  to  192.168.1.26 : 63326 +0ms
  playactor:credentials:mim respond to SRCH request from { address: '192.168.1.26', family: 'IPv4', port: 63326, size: 58 } +0ms
  playactor:discovery:udp send: 485454502f312e312036323020536572766572205374616e646279202a20485454502f312e310a686f73742d69643a3132333435363738393041420a686f73742d6e616d653a506c61794163746f720a686f73742d726571756573742d706f72743a3938370a686f73742d747970653a5053340a6465766963652d646973636f766572792d70726f746f636f6c2d76657273696f6e3a30303032303032300a  to  192.168.1.26 : 63326 +0ms
  playactor:discovery:udp send: 485454502f312e312036323020536572766572205374616e646279202a20485454502f312e310a686f73742d69643a3132333435363738393041420a686f73742d6e616d653a506c61794163746f720a686f73742d726571756573742d706f72743a3938370a686f73742d747970653a5053340a6465766963652d646973636f766572792d70726f746f636f6c2d76657273696f6e3a30303033303031300a  to  192.168.1.26 : 63326 +0ms
  playactor:discovery:messages parse: SRCH * HTTP/1.1
device-discovery-protocol-version:00020020 +999ms
  playactor:credentials:mim received: {
  type: 'SRCH',
  sender: { address: '192.168.1.26', family: 'IPv4', port: 63326, size: 58 },
  version: '00020020',
  data: { type: 'SRCH', 'device-discovery-protocol-version': '00020020' }
} +998ms
  playactor:discovery:messages parse: SRCH * HTTP/1.1
device-discovery-protocol-version:00020020 +1ms
  playactor:credentials:mim received: {
  type: 'SRCH',
  sender: { address: '192.168.1.26', family: 'IPv4', port: 63326, size: 58 },
  version: '00030010',
  data: { type: 'SRCH', 'device-discovery-protocol-version': '00020020' }
} +1ms
  playactor:credentials:mim respond to SRCH request from { address: '192.168.1.26', family: 'IPv4', port: 63326, size: 58 } +0ms
  playactor:discovery:udp send: 485454502f312e312036323020536572766572205374616e646279202a20485454502f312e310a686f73742d69643a3132333435363738393041420a686f73742d6e616d653a506c61794163746f720a686f73742d726571756573742d706f72743a3938370a686f73742d747970653a5053340a6465766963652d646973636f766572792d70726f746f636f6c2d76657273696f6e3a30303032303032300a  to  192.168.1.26 : 63326 +999ms
  playactor:discovery:udp send: 485454502f312e312036323020536572766572205374616e646279202a20485454502f312e310a686f73742d69643a3132333435363738393041420a686f73742d6e616d653a506c61794163746f720a686f73742d726571756573742d706f72743a3938370a686f73742d747970653a5053340a6465766963652d646973636f766572792d70726f746f636f6c2d76657273696f6e3a30303033303031300a  to  192.168.1.26 : 63326 +0ms
  playactor:credentials:mim respond to SRCH request from { address: '192.168.1.26', family: 'IPv4', port: 63326, size: 58 } +0ms
  playactor:discovery:udp send: 485454502f312e312036323020536572766572205374616e646279202a20485454502f312e310a686f73742d69643a3132333435363738393041420a686f73742d6e616d653a506c61794163746f720a686f73742d726571756573742d706f72743a3938370a686f73742d747970653a5053340a6465766963652d646973636f766572792d70726f746f636f6c2d76657273696f6e3a30303032303032300a  to  192.168.1.26 : 63326 +0ms
  playactor:discovery:udp send: 485454502f312e312036323020536572766572205374616e646279202a20485454502f312e310a686f73742d69643a3132333435363738393041420a686f73742d6e616d653a506c61794163746f720a686f73742d726571756573742d706f72743a3938370a686f73742d747970653a5053340a6465766963652d646973636f766572792d70726f746f636f6c2d76657273696f6e3a30303033303031300a  to  192.168.1.26 : 63326 +0m

I upgraded to 0.2.4 prior to the above attempt.

@esabol
Copy link
Contributor Author

esabol commented Apr 18, 2021

May I suggest reopening this issue? I don’t think it is resolved.

@dhleong dhleong self-assigned this Apr 21, 2021
@dhleong
Copy link
Owner

dhleong commented Apr 21, 2021

I just tested again locally and it works fine for me. It's possible there's still something off in the implementation but it seems to be doing what ps4-waker did.

Interestingly, I don't if I --bind-address , but I do if I leave that off.

Are you saying in either case that the "PlayActor" device does not appear in the Second Screen app?

@esabol
Copy link
Contributor Author

esabol commented Apr 21, 2021

I just tested again locally and it works fine for me. It's possible there's still something off in the implementation but it seems to be doing what ps4-waker did.

Well, not for me. I think there’s something off.

Interestingly, I don't if I --bind-address , but I do if I leave that off.

Are you saying in either case that the "PlayActor" device does not appear in the Second Screen app?

Correct. With or without --bind-address, “PlayActor” does not appear in the PS4 Second Screen app. If it did in either case, I’d consider it to be working and wouldn’t be asking you to reopen this issue. That was only in response to your question regarding the presence of "responding to SRCH" lines in the debug output. ps4-waker works without --bind on my system, for what it’s worth.

@dhleong
Copy link
Owner

dhleong commented Apr 25, 2021

Well, not for me. I think there’s something off.

It's possible—this code is much less battle-tested than ps4-waker. I'm not trying to dismiss your experience, here. I'm just trying to gather data, and the fact that it works fine on my network/etc is very important data.

If it did in either case, I’d consider it to be working and wouldn’t be asking you to reopen this issue.

Again, I'm just trying to make things as clear as possible to focus a potential investigation. From my reading of your last comment, I thought perhaps without --bind-address it was working for you, since it was responding to the SRCH packet. For it to receive SRCH and respond to it, but for the app to not receive that response, is very unexpected. I would expect that, since it works for me in the same situation, you would not have problems as long as playactor is receiving the SRCH.

Are you using the PS4 Second Screen app on iOS or Android? I'm using Android; perhaps the iOS app is parsing the packet differently, and I'm not sending exactly the same thing ps4-waker is.

ps4-waker works without --bind on my system, for what it’s worth.

This is very valuable information, thank you.

The reason I have not reopened this issue is because the original issue as reported and as reproduced on my end has been fixed. I'm in data-gathering mode right now, and may prefer to open a new, separate issue, since there may be a separate bug in the code.

@esabol
Copy link
Contributor Author

esabol commented Apr 25, 2021

Are you using the PS4 Second Screen app on iOS or Android?

iOS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants