playactor icon indicating copy to clipboard operation
playactor copied to clipboard

Device PlayActor must be awake for initial registration

Open rafacampoamor opened this issue 3 years ago • 18 comments

When I prompt sudo playactor login It only responds with ERR Device PlayActor must be awake for initial registration.

What should I do?

EDIT: For more info, I have PS4 waker working with home bridge, I just wanted to get advantage of this new plugin. If I prompt playactor login --host-name PS4-654, I get to:

No credentials for PS4-654 and unable to request (need root permissions). Attempting to request root permissions now (we will relinquish them as soon as possible)... Registering with device via Second Screen. Open the PS4 Second Screen app and attempt to connect to the device named: PlayActor And then it "closes", not showing anything on Second Screen app and with the terminal waiting for a new prompt.

rafacampoamor avatar Sep 06 '22 10:09 rafacampoamor

Also, when I try other prompts like this one:

~ rafa$ playactor browse
{
  "address": {
    "address": "192.168.4.27",
    "family": "IPv4",
    "port": 987,
    "size": 159
  },
  "hostRequestPort": 987,
  "extras": {
    "statusLine": "620 Server Standby * HTTP/1.1",
    "statusCode": "620",
    "statusMessage": "Server",
    "status": "STANDBY"
  },
  "discoveryVersion": "00020020",
  "id": "1234567890AB",
  "name": "PlayActor",
  "status": "STANDBY",
  "type": "PS4"
}
{
  "address": {
    "address": "192.168.4.53",
    "family": "IPv4",
    "port": 51501,
    "size": 218
  },
  "hostRequestPort": 997,
  "extras": {
    "statusLine": "200 Ok",
    "statusCode": "200",
    "statusMessage": "Ok",
    "status": "AWAKE",
    "running-app-name": "No Man's Sky",
    "running-app-titleid": "CUSA03952"
  },
  "discoveryVersion": "00020020",
  "systemVersion": "09600011",
  "id": "F8461C714A3C",
  "name": "PS4-654",
  "status": "AWAKE",
  "type": "PS4"
}

I get all the accurate info, in the come app, the status of the PS4 is shown but not responsive to any command from home app showing this error on homebridge [homebridge-playstation] Unable to request credentials

rafacampoamor avatar Sep 06 '22 11:09 rafacampoamor

It seems like you must have another instance of playactor login running somewhere on your network for browse to reveal a second PS4 device named PlayActor (and for your login attempt to try to be trying to talk to it). If I had to guess, the Second Screen app may be confused by having two devices with the same ID (but this is a very wild guess).

If the Second Screen app is not showing PlayActor but is showing PS4-654 then it could be a networking situation, and I would recommend following the same debugging procedures outlined for ps4-waker. In particular, the --bind-address and --bind-port options seem to be helpful for some folks (see playactor login --help). If it's not showing anything (literally what you said, but usually not what people mean) then it's likely either a physical network connectivity situation (IE: the wifi your phone is on won't forward packets to the PS4 for some reason) or an app issue—sometimes restarting the phone can help with the latter.

If still no joy, you can try enabling debugging with the --debug flag and paste the output here. I recommend wrapping with three backticks (```Output```) rather than just one to make multiple lines of output easier to read. Heads up with that: most safety-critical output should be redacted, but it's always good to double check before hitting that submit button.

dhleong avatar Sep 06 '22 15:09 dhleong

Yes, you're right, the PS4 is showing on Second Screen but PlayActor isn't.

Tried that, got this response:

~ rafa$  playactor login --bind-address 192.168.4.256 --bind-port 876
 

Error: Unable to locate device: device (any)
    at PendingDevice.<anonymous> (/usr/local/lib/node_modules/playactor/dist/device/pending.js:82:19)
    at Generator.next (<anonymous>)
    at fulfilled (/usr/local/lib/node_modules/playactor/dist/device/pending.js:5:58)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)

When prompting the same but with the debug flag, I get this:

  playactor:cli:options findDevice with: DeviceOptions {
  enableDebug: true,
  machineFriendly: false,
  dontAutoOpenUrls: false,
  searchTimeout: 30000,
  connectTimeout: 15000,
  dontAuthenticate: false,
  alwaysAuthenticate: false,
  deviceOnlyPS4: false,
  deviceOnlyPS5: false,
  localBindAddress: '192.168.4.256',
  localBindPort: 876,
  credentialsPath: undefined,
  passCode: undefined,
  deviceIp: undefined,
  deviceHostName: undefined,
  deviceHostId: undefined
} +0ms
  playactor:discovery discover( {
  pingIntervalMillis: 5000,
  timeoutMillis: 30000,
  uniqueDevices: true,
  deviceIp: undefined,
  deviceType: undefined
} ) +0ms
  playactor:discovery:udp acquire @ 876 +0ms
  playactor:discovery:udp created new socket for  { localBindAddress: '192.168.4.256', localBindPort: 876 } +1ms
  playactor:discovery:udp acquire @ 876 +1ms
  playactor:discovery:udp joining existing socket for  { localBindAddress: '192.168.4.256', localBindPort: 876 } +0ms
  playactor:discovery:udp send: ██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████  to  255.255.255.255 : 987 +1ms
  playactor:discovery:udp send: ██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████  to  255.255.255.255 : 9302 +0ms
  playactor:discovery sending subsequent network discovery ping +5s
  playactor:discovery:udp send: ██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████  to  255.255.255.255 : 987 +5s
  playactor:discovery:udp send: ██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████  to  255.255.255.255 : 9302 +0ms
  playactor:discovery:udp listening on  { address: '0.0.0.0', family: 'IPv4', port: 53375 } +1ms
  playactor:discovery sending subsequent network discovery ping +5s
  playactor:discovery:udp send: ██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████  to  255.255.255.255 : 987 +5s
  playactor:discovery:udp send: ██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████  to  255.255.255.255 : 9302 +0ms
  playactor:discovery sending subsequent network discovery ping +5s
  playactor:discovery:udp send: ██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████  to  255.255.255.255 : 987 +5s
  playactor:discovery:udp send: ██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████  to  255.255.255.255 : 9302 +1ms
  playactor:discovery sending subsequent network discovery ping +5s
  playactor:discovery:udp send: ██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████  to  255.255.255.255 : 987 +5s
  playactor:discovery:udp send: ██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████  to  255.255.255.255 : 9302 +1ms
  playactor:discovery sending subsequent network discovery ping +5s
  playactor:discovery:udp send: ██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████  to  255.255.255.255 : 987 +5s
  playactor:discovery:udp send: ██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████  to  255.255.255.255 : 9302 +0ms
  playactor:discovery:udp closing udp network +5s
  playactor:discovery:udp release @ 876 +0ms
  playactor:discovery:udp closing udp network +1ms
  playactor:discovery:udp release @ 876 +0ms
Error: Unable to locate device: device (any)
    at PendingDevice.<anonymous> (/usr/local/lib/node_modules/playactor/dist/device/pending.js:82:19)
    at Generator.next (<anonymous>)
    at fulfilled (/usr/local/lib/node_modules/playactor/dist/device/pending.js:5:58)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)

Any ideas? :/

rafacampoamor avatar Sep 06 '22 15:09 rafacampoamor

I also tried to connect directly to the PS4 again and got this debug: playactor login --host-name PS4-654 --debug

  playactor:cli:options findDevice with: DeviceOptions {
  enableDebug: true,
  machineFriendly: false,
  dontAutoOpenUrls: false,
  searchTimeout: 30000,
  connectTimeout: 15000,
  dontAuthenticate: false,
  alwaysAuthenticate: false,
  deviceOnlyPS4: false,
  deviceOnlyPS5: false,
  localBindAddress: undefined,
  localBindPort: undefined,
  credentialsPath: undefined,
  passCode: undefined,
  deviceIp: undefined,
  deviceHostName: 'PS4-654',
  deviceHostId: undefined
} +0ms
  playactor:discovery discover( {
  pingIntervalMillis: 5000,
  timeoutMillis: 30000,
  uniqueDevices: true,
  deviceIp: undefined,
  deviceType: undefined
} ) +0ms
  playactor:discovery:udp acquire @ 0 +0ms
  playactor:discovery:udp created new socket for  { localBindAddress: undefined, localBindPort: undefined } +1ms
  playactor:discovery:udp acquire @ 0 +0ms
  playactor:discovery:udp joining existing socket for  { localBindAddress: undefined, localBindPort: undefined } +0ms
  playactor:discovery:udp send: ██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████  to  255.255.255.255 : 987 +1ms
  playactor:discovery:udp send: ██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████  to  255.255.255.255 : 9302 +0ms
  playactor:discovery:udp listening on  { address: '0.0.0.0', family: 'IPv4', port: 59186 } +2ms
  playactor:discovery:udp received device: {
  type: 'DEVICE',
  sender: { address: '192.168.4.27', family: 'IPv4', port: 987, size: 159 },
  version: '00020020',
  data: {
    type: 'DEVICE',
    statusLine: '620 Server Standby * HTTP/1.1',
    statusCode: '620',
    statusMessage: 'Server',
    status: 'STANDBY',
    'host-id': '████████████',
    'host-name': 'PlayActor',
    'host-request-port': '987',
    'host-type': 'PS4',
    'device-discovery-protocol-version': '00020020'
  }
} +123ms
  playactor:discovery:udp received device: {
  type: 'DEVICE',
  sender: { address: '192.168.4.27', family: 'IPv4', port: 987, size: 159 },
  version: '00030010',
  data: {
    type: 'DEVICE',
    statusLine: '620 Server Standby * HTTP/1.1',
    statusCode: '620',
    statusMessage: 'Server',
    status: 'STANDBY',
    'host-id': '████████████',
    'host-name': 'PlayActor',
    'host-request-port': '987',
    'host-type': 'PS4',
    'device-discovery-protocol-version': '00020020'
  }
} +1ms
  playactor:discovery:udp received device: {
  type: 'DEVICE',
  sender: { address: '192.168.4.27', family: 'IPv4', port: 987, size: 159 },
  version: '00020020',
  data: {
    type: 'DEVICE',
    statusLine: '620 Server Standby * HTTP/1.1',
    statusCode: '620',
    statusMessage: 'Server',
    status: 'STANDBY',
    'host-id': '████████████',
    'host-name': 'PlayActor',
    'host-request-port': '987',
    'host-type': 'PS4',
    'device-discovery-protocol-version': '00030010'
  }
} +0ms
  playactor:discovery:udp received device: {
  type: 'DEVICE',
  sender: { address: '192.168.4.27', family: 'IPv4', port: 987, size: 159 },
  version: '00030010',
  data: {
    type: 'DEVICE',
    statusLine: '620 Server Standby * HTTP/1.1',
    statusCode: '620',
    statusMessage: 'Server',
    status: 'STANDBY',
    'host-id': '████████████',
    'host-name': 'PlayActor',
    'host-request-port': '987',
    'host-type': 'PS4',
    'device-discovery-protocol-version': '00030010'
  }
} +0ms
  playactor:discovery:udp received device: {
  type: 'DEVICE',
  sender: { address: '192.168.4.27', family: 'IPv4', port: 987, size: 159 },
  version: '00020020',
  data: {
    type: 'DEVICE',
    statusLine: '620 Server Standby * HTTP/1.1',
    statusCode: '620',
    statusMessage: 'Server',
    status: 'STANDBY',
    'host-id': '████████████',
    'host-name': 'PlayActor',
    'host-request-port': '987',
    'host-type': 'PS4',
    'device-discovery-protocol-version': '00020020'
  }
} +1ms
  playactor:discovery:udp received device: {
  type: 'DEVICE',
  sender: { address: '192.168.4.27', family: 'IPv4', port: 987, size: 159 },
  version: '00030010',
  data: {
    type: 'DEVICE',
    statusLine: '620 Server Standby * HTTP/1.1',
    statusCode: '620',
    statusMessage: 'Server',
    status: 'STANDBY',
    'host-id': '████████████',
    'host-name': 'PlayActor',
    'host-request-port': '987',
    'host-type': 'PS4',
    'device-discovery-protocol-version': '00020020'
  }
} +0ms
  playactor:discovery:udp received device: {
  type: 'DEVICE',
  sender: { address: '192.168.4.27', family: 'IPv4', port: 987, size: 159 },
  version: '00020020',
  data: {
    type: 'DEVICE',
    statusLine: '620 Server Standby * HTTP/1.1',
    statusCode: '620',
    statusMessage: 'Server',
    status: 'STANDBY',
    'host-id': '████████████',
    'host-name': 'PlayActor',
    'host-request-port': '987',
    'host-type': 'PS4',
    'device-discovery-protocol-version': '00030010'
  }
} +0ms
  playactor:discovery:udp received device: {
  type: 'DEVICE',
  sender: { address: '192.168.4.27', family: 'IPv4', port: 987, size: 159 },
  version: '00030010',
  data: {
    type: 'DEVICE',
    statusLine: '620 Server Standby * HTTP/1.1',
    statusCode: '620',
    statusMessage: 'Server',
    status: 'STANDBY',
    'host-id': '████████████',
    'host-name': 'PlayActor',
    'host-request-port': '987',
    'host-type': 'PS4',
    'device-discovery-protocol-version': '00030010'
  }
} +0ms
  playactor:discovery:udp received device: {
  type: 'DEVICE',
  sender: { address: '192.168.4.53', family: 'IPv4', port: 59272, size: 158 },
  version: '00020020',
  data: {
    type: 'DEVICE',
    statusLine: '200 Ok',
    statusCode: '200',
    statusMessage: 'Ok',
    status: 'AWAKE',
    'host-id': '████████████',
    'host-type': 'PS4',
    'host-name': 'PS4-654',
    'host-request-port': '997',
    'device-discovery-protocol-version': '00020020',
    'system-version': '09600011'
  }
} +1ms
  playactor:discovery:udp received device: {
  type: 'DEVICE',
  sender: { address: '192.168.4.53', family: 'IPv4', port: 59272, size: 158 },
  version: '00030010',
  data: {
    type: 'DEVICE',
    statusLine: '200 Ok',
    statusCode: '200',
    statusMessage: 'Ok',
    status: 'AWAKE',
    'host-id': '████████████',
    'host-type': 'PS4',
    'host-name': 'PS4-654',
    'host-request-port': '997',
    'device-discovery-protocol-version': '00020020',
    'system-version': '09600011'
  }
} +0ms
  playactor:discovery:udp closing udp network +0ms
  playactor:discovery:udp release @ 0 +0ms
  playactor:discovery:udp closing udp network +1ms
  playactor:discovery:udp release @ 0 +0ms
  playactor:waker device {
  address: { address: '192.168.4.53', family: 'IPv4', port: 59272, size: 158 },
  hostRequestPort: 997,
  extras: {
    statusLine: '200 Ok',
    statusCode: '200',
    statusMessage: 'Ok',
    status: 'AWAKE'
  },
  discoveryVersion: '00020020',
  systemVersion: '09600011',
  id: 'F8461C714A3C',
  name: 'PS4-654',
  status: 'AWAKE',
  type: 'PS4'
} is already awake +0ms
  playactor:credentials:disk reading credentials at /Users/rafa/.config/playactor/credentials.json +0ms
  playactor:cli:pin non-login error encountered:  RootMissingError: No credentials for PS4-654 and unable to request (need root permissions).
    at RootManagingCredentialRequester.<anonymous> (/usr/local/lib/node_modules/playactor/dist/credentials/root-managing.js:35:23)
    at Generator.next (<anonymous>)
    at /usr/local/lib/node_modules/playactor/dist/credentials/root-managing.js:8:71
    at new Promise (<anonymous>)
    at __awaiter (/usr/local/lib/node_modules/playactor/dist/credentials/root-managing.js:4:12)
    at RootManagingCredentialRequester.requestForDevice (/usr/local/lib/node_modules/playactor/dist/credentials/root-managing.js:33:16)
    at DeviceTypeStrategyCredentialRequester.requestForDevice (/usr/local/lib/node_modules/playactor/dist/credentials/device-type-strategy.js:11:25)
    at CredentialManager.<anonymous> (/usr/local/lib/node_modules/playactor/dist/credentials.js:32:54)
    at Generator.next (<anonymous>)
    at fulfilled (/usr/local/lib/node_modules/playactor/dist/credentials.js:5:58) +0ms
No credentials for PS4-654 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,
  dontAutoOpenUrls: false,
  searchTimeout: 30000,
  connectTimeout: 15000,
  dontAuthenticate: false,
  alwaysAuthenticate: false,
  deviceOnlyPS4: false,
  deviceOnlyPS5: false,
  localBindAddress: undefined,
  localBindPort: undefined,
  credentialsPath: '/Users/rafa/.config/playactor/credentials.json',
  passCode: undefined,
  deviceIp: undefined,
  deviceHostName: 'PS4-654',
  deviceHostId: undefined
} +0ms
  playactor:discovery discover( {
  pingIntervalMillis: 5000,
  timeoutMillis: 30000,
  uniqueDevices: true,
  deviceIp: undefined,
  deviceType: undefined
} ) +0ms
  playactor:discovery:udp acquire @ 0 +0ms
  playactor:discovery:udp created new socket for  { localBindAddress: undefined, localBindPort: undefined } +0ms
  playactor:discovery:udp acquire @ 0 +1ms
  playactor:discovery:udp joining existing socket for  { localBindAddress: undefined, localBindPort: undefined } +0ms
  playactor:discovery:udp send: ██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████  to  255.255.255.255 : 987 +0ms
  playactor:discovery:udp send: ██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████  to  255.255.255.255 : 9302 +1ms
  playactor:discovery:udp listening on  { address: '0.0.0.0', family: 'IPv4', port: 57042 } +2ms
  playactor:discovery:udp received device: {
  type: 'DEVICE',
  sender: { address: '192.168.4.27', family: 'IPv4', port: 987, size: 159 },
  version: '00020020',
  data: {
    type: 'DEVICE',
    statusLine: '620 Server Standby * HTTP/1.1',
    statusCode: '620',
    statusMessage: 'Server',
    status: 'STANDBY',
    'host-id': '████████████',
    'host-name': 'PlayActor',
    'host-request-port': '987',
    'host-type': 'PS4',
    'device-discovery-protocol-version': '00020020'
  }
} +117ms
  playactor:discovery:udp received device: {
  type: 'DEVICE',
  sender: { address: '192.168.4.27', family: 'IPv4', port: 987, size: 159 },
  version: '00030010',
  data: {
    type: 'DEVICE',
    statusLine: '620 Server Standby * HTTP/1.1',
    statusCode: '620',
    statusMessage: 'Server',
    status: 'STANDBY',
    'host-id': '████████████',
    'host-name': 'PlayActor',
    'host-request-port': '987',
    'host-type': 'PS4',
    'device-discovery-protocol-version': '00020020'
  }
} +1ms
  playactor:discovery:udp received device: {
  type: 'DEVICE',
  sender: { address: '192.168.4.27', family: 'IPv4', port: 987, size: 159 },
  version: '00020020',
  data: {
    type: 'DEVICE',
    statusLine: '620 Server Standby * HTTP/1.1',
    statusCode: '620',
    statusMessage: 'Server',
    status: 'STANDBY',
    'host-id': '████████████',
    'host-name': 'PlayActor',
    'host-request-port': '987',
    'host-type': 'PS4',
    'device-discovery-protocol-version': '00030010'
  }
} +0ms
  playactor:discovery:udp received device: {
  type: 'DEVICE',
  sender: { address: '192.168.4.27', family: 'IPv4', port: 987, size: 159 },
  version: '00030010',
  data: {
    type: 'DEVICE',
    statusLine: '620 Server Standby * HTTP/1.1',
    statusCode: '620',
    statusMessage: 'Server',
    status: 'STANDBY',
    'host-id': '████████████',
    'host-name': 'PlayActor',
    'host-request-port': '987',
    'host-type': 'PS4',
    'device-discovery-protocol-version': '00030010'
  }
} +0ms
  playactor:discovery:udp received device: {
  type: 'DEVICE',
  sender: { address: '192.168.4.27', family: 'IPv4', port: 987, size: 159 },
  version: '00020020',
  data: {
    type: 'DEVICE',
    statusLine: '620 Server Standby * HTTP/1.1',
    statusCode: '620',
    statusMessage: 'Server',
    status: 'STANDBY',
    'host-id': '████████████',
    'host-name': 'PlayActor',
    'host-request-port': '987',
    'host-type': 'PS4',
    'device-discovery-protocol-version': '00020020'
  }
} +1ms
  playactor:discovery:udp received device: {
  type: 'DEVICE',
  sender: { address: '192.168.4.27', family: 'IPv4', port: 987, size: 159 },
  version: '00030010',
  data: {
    type: 'DEVICE',
    statusLine: '620 Server Standby * HTTP/1.1',
    statusCode: '620',
    statusMessage: 'Server',
    status: 'STANDBY',
    'host-id': '████████████',
    'host-name': 'PlayActor',
    'host-request-port': '987',
    'host-type': 'PS4',
    'device-discovery-protocol-version': '00020020'
  }
} +0ms
  playactor:discovery:udp received device: {
  type: 'DEVICE',
  sender: { address: '192.168.4.27', family: 'IPv4', port: 987, size: 159 },
  version: '00020020',
  data: {
    type: 'DEVICE',
    statusLine: '620 Server Standby * HTTP/1.1',
    statusCode: '620',
    statusMessage: 'Server',
    status: 'STANDBY',
    'host-id': '████████████',
    'host-name': 'PlayActor',
    'host-request-port': '987',
    'host-type': 'PS4',
    'device-discovery-protocol-version': '00030010'
  }
} +0ms
  playactor:discovery:udp received device: {
  type: 'DEVICE',
  sender: { address: '192.168.4.27', family: 'IPv4', port: 987, size: 159 },
  version: '00030010',
  data: {
    type: 'DEVICE',
    statusLine: '620 Server Standby * HTTP/1.1',
    statusCode: '620',
    statusMessage: 'Server',
    status: 'STANDBY',
    'host-id': '████████████',
    'host-name': 'PlayActor',
    'host-request-port': '987',
    'host-type': 'PS4',
    'device-discovery-protocol-version': '00030010'
  }
} +0ms
  playactor:discovery:udp received device: {
  type: 'DEVICE',
  sender: { address: '192.168.4.53', family: 'IPv4', port: 57070, size: 158 },
  version: '00020020',
  data: {
    type: 'DEVICE',
    statusLine: '200 Ok',
    statusCode: '200',
    statusMessage: 'Ok',
    status: 'AWAKE',
    'host-id': '████████████',
    'host-type': 'PS4',
    'host-name': 'PS4-654',
    'host-request-port': '997',
    'device-discovery-protocol-version': '00020020',
    'system-version': '09600011'
  }
} +1ms
  playactor:discovery:udp received device: {
  type: 'DEVICE',
  sender: { address: '192.168.4.53', family: 'IPv4', port: 57070, size: 158 },
  version: '00030010',
  data: {
    type: 'DEVICE',
    statusLine: '200 Ok',
    statusCode: '200',
    statusMessage: 'Ok',
    status: 'AWAKE',
    'host-id': '████████████',
    'host-type': 'PS4',
    'host-name': 'PS4-654',
    'host-request-port': '997',
    'device-discovery-protocol-version': '00020020',
    'system-version': '09600011'
  }
} +0ms
  playactor:discovery:udp closing udp network +1ms
  playactor:discovery:udp release @ 0 +0ms
  playactor:discovery:udp closing udp network +0ms
  playactor:discovery:udp release @ 0 +0ms
  playactor:waker device {
  address: { address: '192.168.4.53', family: 'IPv4', port: 57070, size: 158 },
  hostRequestPort: 997,
  extras: {
    statusLine: '200 Ok',
    statusCode: '200',
    statusMessage: 'Ok',
    status: 'AWAKE'
  },
  discoveryVersion: '00020020',
  systemVersion: '09600011',
  id: 'F8461C714A3C',
  name: 'PS4-654',
  status: 'AWAKE',
  type: 'PS4'
} is already awake +0ms
  playactor:credentials:disk reading credentials at /Users/rafa/.config/playactor/credentials.json +0ms
  playactor:discovery:udp acquire @ 987 +2ms
  playactor:discovery:udp created new socket for  { localBindAddress: undefined, localBindPort: 987 } +0ms
  playactor:discovery:udp acquire @ 987 +0ms
  playactor:discovery:udp joining existing socket for  { localBindAddress: undefined, localBindPort: 987 } +1ms
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:cli:root root proxied; this process became nop +0ms

rafacampoamor avatar Sep 06 '22 15:09 rafacampoamor

I think the problem might be that "wake" time for Playactor to send the signal to Second Screen is set up as +0ms

Can be that? In that case, how can I solve it?

Thanks!!

rafacampoamor avatar Sep 06 '22 15:09 rafacampoamor

What is that .4.256 address? That seems incorrect. Each octet cannot be greater than 255. --bind-address should specifically be an address on a network card connected to your machine that has access to the same network your phone is on. It should be visible in ifconfig somewhere.

I think the problem might be that "wake" time for Playactor to send the signal to Second Screen is set up as +0ms

That number is just how long has elapsed since the previous log was written. What might weird is that the next line is printed immediately.... Does the process actually end there or is it hanging there, still running, and you have to ctrl-c to stop it? It looks like the device emulation is (unexpectedly) stopping quietly, but would be good to confirm.

I see that it's still detecting another device called PlayActor. If that's there due to the homebridge, I would recommend shutting that down first. I wouldn't think it would matter, but it's best to remove any weird variables like that.

dhleong avatar Sep 06 '22 17:09 dhleong

What is that .4.256 address?

Oops! My bad! changed it to a used and an unused IP address. Still the same.

It looks like the device emulation is (unexpectedly) stopping quietly, but would be good to confirm.

Yes, It stops just at the moment it shows the Open the PS4 Second Screen app… PlayActor

About homebridge… I don't actually know how to kill the service. Every time I kill the process, it restarts again by itself. I'm going to disable the plugin, if it helps…

rafacampoamor avatar Sep 06 '22 18:09 rafacampoamor

So, I changed IP for a good one, disabled the homebridge plugin and restarted homebridge. Run a debug again and… Is the second PlayActor still there? Maybe I'll restart the hole system

playactor login --host-name PS4-654 --bind-address 192.168.4.253 --bind-port 876 --debug
  playactor:cli:options findDevice with: DeviceOptions {
  enableDebug: true,
  machineFriendly: false,
  dontAutoOpenUrls: false,
  searchTimeout: 30000,
  connectTimeout: 15000,
  dontAuthenticate: false,
  alwaysAuthenticate: false,
  deviceOnlyPS4: false,
  deviceOnlyPS5: false,
  localBindAddress: '192.168.4.253',
  localBindPort: 876,
  credentialsPath: undefined,
  passCode: undefined,
  deviceIp: undefined,
  deviceHostName: 'PS4-654',
  deviceHostId: undefined
} +0ms
  playactor:discovery discover( {
  pingIntervalMillis: 5000,
  timeoutMillis: 30000,
  uniqueDevices: true,
  deviceIp: undefined,
  deviceType: undefined
} ) +0ms
  playactor:discovery:udp acquire @ 876 +0ms
  playactor:discovery:udp created new socket for  { localBindAddress: '192.168.4.253', localBindPort: 876 } +1ms
  playactor:discovery:udp acquire @ 876 +0ms
  playactor:discovery:udp joining existing socket for  { localBindAddress: '192.168.4.253', localBindPort: 876 } +0ms
  playactor:discovery:udp send: ██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████  to  255.255.255.255 : 987 +1ms
  playactor:discovery:udp send: ██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████  to  255.255.255.255 : 9302 +0ms
  playactor:discovery sending subsequent network discovery ping +5s
  playactor:discovery:udp send: ██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████  to  255.255.255.255 : 987 +5s
  playactor:discovery:udp send: ██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████  to  255.255.255.255 : 9302 +0ms
  playactor:discovery:udp listening on  { address: '0.0.0.0', family: 'IPv4', port: 58149 } +1ms
  playactor:discovery sending subsequent network discovery ping +5s
  playactor:discovery:udp send: ██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████  to  255.255.255.255 : 987 +5s
  playactor:discovery:udp send: ██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████  to  255.255.255.255 : 9302 +0ms
  playactor:discovery sending subsequent network discovery ping +5s
  playactor:discovery:udp send: ██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████  to  255.255.255.255 : 987 +5s
  playactor:discovery:udp send: ██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████  to  255.255.255.255 : 9302 +1ms
  playactor:discovery sending subsequent network discovery ping +5s
  playactor:discovery:udp send: ██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████  to  255.255.255.255 : 987 +5s
  playactor:discovery:udp send: ██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████  to  255.255.255.255 : 9302 +0ms
  playactor:discovery sending subsequent network discovery ping +5s
  playactor:discovery:udp send: ██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████  to  255.255.255.255 : 987 +5s
  playactor:discovery:udp send: ██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████  to  255.255.255.255 : 9302 +1ms
  playactor:discovery:udp closing udp network +5s
  playactor:discovery:udp release @ 876 +0ms
  playactor:discovery:udp closing udp network +0ms
  playactor:discovery:udp release @ 876 +0ms
Error: Unable to locate device: device named PS4-654
    at PendingDevice.<anonymous> (/usr/local/lib/node_modules/playactor/dist/device/pending.js:82:19)
    at Generator.next (<anonymous>)
    at fulfilled (/usr/local/lib/node_modules/playactor/dist/device/pending.js:5:58)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)

rafacampoamor avatar Sep 06 '22 18:09 rafacampoamor

So, I restarted the Mac and now the process doesn't end by itself, but still no PlayActor on the Second Screen app. Tried again, changing the IP and port and got the same error message than before.

Here is the debug log for the first try (the best one):

playactor login --debug
  playactor:cli:options findDevice with: DeviceOptions {
  enableDebug: true,
  machineFriendly: false,
  dontAutoOpenUrls: false,
  searchTimeout: 30000,
  connectTimeout: 15000,
  dontAuthenticate: false,
  alwaysAuthenticate: false,
  deviceOnlyPS4: false,
  deviceOnlyPS5: false,
  localBindAddress: undefined,
  localBindPort: undefined,
  credentialsPath: undefined,
  passCode: undefined,
  deviceIp: undefined,
  deviceHostName: undefined,
  deviceHostId: undefined
} +0ms
  playactor:discovery discover( {
  pingIntervalMillis: 5000,
  timeoutMillis: 30000,
  uniqueDevices: true,
  deviceIp: undefined,
  deviceType: undefined
} ) +0ms
  playactor:discovery:udp acquire @ 0 +0ms
  playactor:discovery:udp created new socket for  { localBindAddress: undefined, localBindPort: undefined } +1ms
  playactor:discovery:udp acquire @ 0 +0ms
  playactor:discovery:udp joining existing socket for  { localBindAddress: undefined, localBindPort: undefined } +0ms
  playactor:discovery:udp send: ██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████  to  255.255.255.255 : 987 +1ms
  playactor:discovery:udp send: ██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████  to  255.255.255.255 : 9302 +0ms
  playactor:discovery:udp listening on  { address: '0.0.0.0', family: 'IPv4', port: 61544 } +2ms
  playactor:discovery:udp received device: {
  type: 'DEVICE',
  sender: { address: '192.168.4.53', family: 'IPv4', port: 51162, size: 158 },
  version: '00020020',
  data: {
    type: 'DEVICE',
    statusLine: '200 Ok',
    statusCode: '200',
    statusMessage: 'Ok',
    status: 'AWAKE',
    'host-id': '████████████',
    'host-type': 'PS4',
    'host-name': 'PS4-654',
    'host-request-port': '997',
    'device-discovery-protocol-version': '00020020',
    'system-version': '09600011'
  }
} +111ms
  playactor:discovery:udp received device: {
  type: 'DEVICE',
  sender: { address: '192.168.4.53', family: 'IPv4', port: 51162, size: 158 },
  version: '00030010',
  data: {
    type: 'DEVICE',
    statusLine: '200 Ok',
    statusCode: '200',
    statusMessage: 'Ok',
    status: 'AWAKE',
    'host-id': '████████████',
    'host-type': 'PS4',
    'host-name': 'PS4-654',
    'host-request-port': '997',
    'device-discovery-protocol-version': '00020020',
    'system-version': '09600011'
  }
} +1ms
  playactor:discovery:udp closing udp network +0ms
  playactor:discovery:udp release @ 0 +0ms
  playactor:discovery:udp closing udp network +0ms
  playactor:discovery:udp release @ 0 +0ms
  playactor:waker device {
  address: { address: '192.168.4.53', family: 'IPv4', port: 51162, size: 158 },
  hostRequestPort: 997,
  extras: {
    statusLine: '200 Ok',
    statusCode: '200',
    statusMessage: 'Ok',
    status: 'AWAKE'
  },
  discoveryVersion: '00020020',
  systemVersion: '09600011',
  id: 'F8461C714A3C',
  name: 'PS4-654',
  status: 'AWAKE',
  type: 'PS4'
} is already awake +0ms
  playactor:credentials:disk reading credentials at /Users/rafa/.config/playactor/credentials.json +0ms
  playactor:cli:pin non-login error encountered:  RootMissingError: No credentials for PS4-654 and unable to request (need root permissions).
    at RootManagingCredentialRequester.<anonymous> (/usr/local/lib/node_modules/playactor/dist/credentials/root-managing.js:35:23)
    at Generator.next (<anonymous>)
    at /usr/local/lib/node_modules/playactor/dist/credentials/root-managing.js:8:71
    at new Promise (<anonymous>)
    at __awaiter (/usr/local/lib/node_modules/playactor/dist/credentials/root-managing.js:4:12)
    at RootManagingCredentialRequester.requestForDevice (/usr/local/lib/node_modules/playactor/dist/credentials/root-managing.js:33:16)
    at DeviceTypeStrategyCredentialRequester.requestForDevice (/usr/local/lib/node_modules/playactor/dist/credentials/device-type-strategy.js:11:25)
    at CredentialManager.<anonymous> (/usr/local/lib/node_modules/playactor/dist/credentials.js:32:54)
    at Generator.next (<anonymous>)
    at fulfilled (/usr/local/lib/node_modules/playactor/dist/credentials.js:5:58) +0ms
No credentials for PS4-654 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,
  dontAutoOpenUrls: false,
  searchTimeout: 30000,
  connectTimeout: 15000,
  dontAuthenticate: false,
  alwaysAuthenticate: false,
  deviceOnlyPS4: false,
  deviceOnlyPS5: false,
  localBindAddress: undefined,
  localBindPort: undefined,
  credentialsPath: '/Users/rafa/.config/playactor/credentials.json',
  passCode: undefined,
  deviceIp: undefined,
  deviceHostName: undefined,
  deviceHostId: undefined
} +0ms
  playactor:discovery discover( {
  pingIntervalMillis: 5000,
  timeoutMillis: 30000,
  uniqueDevices: true,
  deviceIp: undefined,
  deviceType: undefined
} ) +0ms
  playactor:discovery:udp acquire @ 0 +0ms
  playactor:discovery:udp created new socket for  { localBindAddress: undefined, localBindPort: undefined } +0ms
  playactor:discovery:udp acquire @ 0 +1ms
  playactor:discovery:udp joining existing socket for  { localBindAddress: undefined, localBindPort: undefined } +0ms
  playactor:discovery:udp send: ██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████  to  255.255.255.255 : 987 +1ms
  playactor:discovery:udp send: ██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████  to  255.255.255.255 : 9302 +0ms
  playactor:discovery:udp listening on  { address: '0.0.0.0', family: 'IPv4', port: 54043 } +2ms
  playactor:discovery:udp received device: {
  type: 'DEVICE',
  sender: { address: '192.168.4.53', family: 'IPv4', port: 58866, size: 158 },
  version: '00020020',
  data: {
    type: 'DEVICE',
    statusLine: '200 Ok',
    statusCode: '200',
    statusMessage: 'Ok',
    status: 'AWAKE',
    'host-id': '████████████',
    'host-type': 'PS4',
    'host-name': 'PS4-654',
    'host-request-port': '997',
    'device-discovery-protocol-version': '00020020',
    'system-version': '09600011'
  }
} +118ms
  playactor:discovery:udp received device: {
  type: 'DEVICE',
  sender: { address: '192.168.4.53', family: 'IPv4', port: 58866, size: 158 },
  version: '00030010',
  data: {
    type: 'DEVICE',
    statusLine: '200 Ok',
    statusCode: '200',
    statusMessage: 'Ok',
    status: 'AWAKE',
    'host-id': '████████████',
    'host-type': 'PS4',
    'host-name': 'PS4-654',
    'host-request-port': '997',
    'device-discovery-protocol-version': '00020020',
    'system-version': '09600011'
  }
} +1ms
  playactor:discovery:udp closing udp network +1ms
  playactor:discovery:udp release @ 0 +0ms
  playactor:discovery:udp closing udp network +0ms
  playactor:discovery:udp release @ 0 +0ms
  playactor:waker device {
  address: { address: '192.168.4.53', family: 'IPv4', port: 58866, size: 158 },
  hostRequestPort: 997,
  extras: {
    statusLine: '200 Ok',
    statusCode: '200',
    statusMessage: 'Ok',
    status: 'AWAKE'
  },
  discoveryVersion: '00020020',
  systemVersion: '09600011',
  id: 'F8461C714A3C',
  name: 'PS4-654',
  status: 'AWAKE',
  type: 'PS4'
} is already awake +0ms
  playactor:credentials:disk reading credentials at /Users/rafa/.config/playactor/credentials.json +0ms
  playactor:discovery:udp acquire @ 987 +2ms
  playactor:discovery:udp created new socket for  { localBindAddress: undefined, localBindPort: 987 } +1ms
  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 } +1ms
^C

rafacampoamor avatar Sep 06 '22 18:09 rafacampoamor

Just to clarify: after you see the "Open the PS4 Second Screen app" prompt, are you opening the app and scanning for devices?

It looks like it's doing the right thing and is just waiting for the app to ping it. If you are opening the app after seeing that prompt, then that means it's not receiving messages from the app for some reason, which could point to the router not forwarding the UDP packets for... some reason 🤔

As a sanity check: your Mac and your phone are both on the same WiFi, correct?

EDIT: Also, it looks like the ghost "PlayActor" device is gone, so that's good :)

dhleong avatar Sep 06 '22 19:09 dhleong

I was thinking something like this would be the reason as it’s not the first time my Eero router messes with PS services (in fact I had to wire my PS4 to play online because it kept disconnecting). Have you any insight on this?

rafacampoamor avatar Sep 06 '22 19:09 rafacampoamor

I don’t have any direct suggestions since I don’t have an eero, but it’s interesting to learn that other services are having issue on the wifi.

Basically the way the protocol works is:

  1. The phone app sends a broadcast message asking any PS4 messages on the network to identify themselves
  2. Physical PS4 devices (and playactor) receive these messages
  3. The receivers all respond by sending a message to the sender (via the information in the broadcast) with their own messages identifying themselves.

Since we don’t see any log output indicating that we’ve received messages, it’s likely that somewhere on the network that broadcast message in step 1 is not reaching your Mac. But, because it can see the PS4, we can assume that it does reach wired devices. You could try wiring in your Mac to the router directly, if practical, just as a test. Alternatively, you could search the router's settings for something about broadcast messages, device discovery, things like that. It may be a privacy setting.

Out of curiosity, how did you get ps4-waker working? I would expect playactor’s setup process to be fairly equivalent to ps4-waker’s—if ps4-waker works without any special hacks then it’s possible I missed a trick or two when migrating that code to playactor...

On Sep 6, 2022 at 3:32:05 PM, rafacampoamor @.***> wrote:

I was thinking something like this would be the reason as it’s not the first time my Eero router messes with PS services (in fact I had to wire my PS4 to play online because it kept disconnecting). Have you any insight on this?

— Reply to this email directly, view it on GitHub https://github.com/dhleong/playactor/issues/54#issuecomment-1238568523, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAGHIFVQ32WXT3NQITW6BZ3V46L3LANCNFSM6AAAAAAQFWUQAI . You are receiving this because you commented.Message ID: @.***>

dhleong avatar Sep 06 '22 20:09 dhleong

I've tried switching to the cable router wifi and still doesn't see the PlayActor device while still sees the PS4-654 on the Second Screen app… It's really strange

rafacampoamor avatar Sep 06 '22 20:09 rafacampoamor

Out of curiosity, how did you get ps4-waker working? I would expect playactor’s setup process to be fairly equivalent to ps4-waker’s—if ps4-waker works without any special hacks then it’s possible I missed a trick or two when migrating that code to playactor…

I followed this instructions https://www.reddit.com/r/homebridge/comments/hox47a/guide_ps4_to_homekit_homebridge/

rafacampoamor avatar Sep 06 '22 20:09 rafacampoamor

Huh. So basically just the normal flow and it worked without any tricks? I’m not sure when I’ll have time to set up my PS4 to test this but it’s possible there’s something wacky going on.

In the meantime, you may be able to manually prepare the credentials file based on the credentials established by ps4-waker.

Create a file at: /Users/rafa/.config/playactor/credentials.json

It should look like:

{ <deviceId>: }

Where is the contents of the ps4-waker credentials file and <deviceId> is the id property from the browse command results, in quotes.

On Sep 6, 2022 at 4:10:05 PM, rafacampoamor @.***> wrote:

Out of curiosity, how did you get ps4-waker working? I would expect playactor’s setup process to be fairly equivalent to ps4-waker’s—if ps4-waker works without any special hacks then it’s possible I missed a trick or two when migrating that code to playactor…

I followed this instructions https://www.reddit.com/r/homebridge/comments/hox47a/guide_ps4_to_homekit_homebridge/

— Reply to this email directly, view it on GitHub https://github.com/dhleong/playactor/issues/54#issuecomment-1238601456, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAGHIFR2DHOPKCWRZFB2AELV46QJ3ANCNFSM6AAAAAAQFWUQAI . You are receiving this because you commented.Message ID: @.***>

dhleong avatar Sep 06 '22 20:09 dhleong

Got it!

Now a tricky one… When configuring Homebridge-playstation, I get an error and I'm not sure is not because of my JSON file.

Connecting to <XXXXXXXX>...
Unexpected token < in JSON at position 4

Discovering next device...

Did not authenticate to any consoles.

So, just to be sure, the complete JSON syntax should be:

{
  <"XXXXXX">:<"yyyyyyyyyyyyyyyyyyyyyyy">
}

just that?

Thanks for all the help

rafacampoamor avatar Sep 06 '22 22:09 rafacampoamor

There should not be any <> in the file; that was just to show the location.

IIRC the credential file is a JSON object and not a string, so where you have YYY should not be in quotes.

Something like:

{
  "01234567AF": {
    "type": "a",
    "credential": "0135426858ab356"
  }
}

This is a guess from memory but hopefully is sufficient to put you on the right track.

dhleong avatar Sep 06 '22 22:09 dhleong

Just for you to know, I think we've arrive to a block. In the Homebridge-Playstation GitHub, I got into this, which seems pretty much what is happening to me. I think there's an update needed 😔

rafacampoamor avatar Sep 07 '22 09:09 rafacampoamor