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

Support passcode login #65

Closed
Roessler89 opened this issue Dec 2, 2017 · 22 comments
Closed

Support passcode login #65

Roessler89 opened this issue Dec 2, 2017 · 22 comments
Assignees
Labels
enhancement New feature or request

Comments

@Roessler89
Copy link

Hi,

I've searched through the issues here (and Google of course) but haven't found anyone getting this exact same error message. I've been able to successfully set up ps4-waker to connect to my ps4, go through the registration process and then I can even wake and send it to standby via ps4-waker.

However, when I attempt to wake it, it tries to log in ("Logging in...") but then gives the error "Login Error: PIN_IS_NEEDED". Now, that sounds like it's asking me to re-register, so I did, 3 times to no avail.

I've tried copying the credentials file to a different location, setting permissions to 777 on the credentials file (desperation attempt I guess), nothing has worked thus far. I've verified I'm using the same PS4 account when pairing and gone through your troubleshooting guide.

Couldn't work it out, so now I guess I need your help.

I can wake the ps4 using ps4-waker, just not login. This is running on Windows 10 x64, Fall Creators Update.

Any help would be greatly appreciated.

@dhleong
Copy link
Owner

dhleong commented Dec 3, 2017

Are you using the Windows command prompt, or the Windows 10 bash thing?

I haven't tested with Windows either way, but I seem to recall people having issues with Windows. I'm not entirely sure what would be different, but there it is.

Something you could try is using the --pin cli arg to manually pass the pin code (get it by going into the PS4 settings and manually adding a device). I've never had to use that myself from what I can recall, but the code path is there....

@Roessler89
Copy link
Author

Roessler89 commented Dec 4, 2017

Hey mate,

Thank you for your reply. I've tested both the command prompt, Git bash and PowerShell (eww, I know but desperate times). I should've mentioned that I had already tried the --pin argument, but to make sure I tried it again today.

If I try "ps4-waker --pin PIN_FROM_PS4" with the PS4 off, it times out with the "Could not detect a suitable device" error (sorry, going off top my head, wording might be slightly off). If I wake the ps4 using "ps4-waker" then attempt the --pin flag, it just goes straight into the registration process again.

Something tells me it simply won't work on Windows at all. I do have a Mac, but that's not on all the time, so can't be used as a server. Might try it on my NAS, see if that works (Linux based).

@dhleong
Copy link
Owner

dhleong commented Dec 4, 2017

Okay I just tried it from the Windows 10 command line (making sure to allow it access when the Windows Firewall prompt came up!) and, while the instructions are now dated, everything worked. I'll update the instructions in the app, but When it asks for a pin code on initial registration, you need to go to Settings > Playstation App Connection Settings > Add Device and get the pin code from there. You should get some output from ps4-waker saying "future uses should succeed."

If you've already tried this and still get the PIN_IS_NEEDED error... I'm not sure. I haven't reproduced that. Maybe deleted your credentials and document step by step everything you do, copy and paste all the output from ps4-waker, and I can try to reproduce it here.

EDIT: I just realized I didn't read my own app output correctly, and this is already what it says. I was just going through settings thinking I knew what it said and where to go... ¯\(ツ)

@Roessler89
Copy link
Author

Hey mate,

Thank you for the reply. I was already getting this output, but you're right and I apologise, I should have been documenting this properly. I will have another attempt soon when I have the time and update this thread accordingly.

I'll also try to get this running on my Qnap NAS, as now that I think about it, that's probably a better way to go anyway. Nonetheless, for brevity, I will attempt again on Windows and document my methodology and all output.

@Roessler89
Copy link
Author

So I've made another attempt on Windows, documented below. Tried for the last hour to get node global packages playing nicely with my Qnap NAS, only to find it's an extremely annoying and difficult thing to do. Even tried the Docker images etc. Anyway, not relevant for here, so allow me to describe what happened with my Windows machine:

  1. Deleted credentials file.

  2. Run ps4-waker
    Output:
    No credentials; Use Playstation App and try to connect to PS4-Waker
    (Terminal still running, waiting for connection)

  3. Open Playstation App, Open Second Screen, Select "PS4-Waker (In Rest Mode)"
    Playstation app says "Connecting".
    Terminal output:

Got credentials!  { 'client-type': 'a',
  'auth-type': 'C',
  'user-credential': 'REMOVED FOR SECURITY' }
Go to 'Settings -> PlayStation(R) App Connection Settings -> Add Device' on your PS4 to obtain the PIN code.
Pin code>

(Terminal still running, waiting for input)

  1. Go to PS4, select Add Device and obtain PIN code.

  2. Enter PIN code into terminal.
    Terminal output:

Go to 'Settings -> PlayStation(R) App Connection Settings -> Add Device' on your PS4 to obtain the PIN code.
Pin code> PIN REMOVED FOR SECURITY
Logged into device! Future uses should succeed

PS: Noticed a notification come up on the PS4 that I had disconnected my companion app, this came up when the pin code was entered and PS4 Waker informed me that I was logged into the device. PS4 Second Screen displayed a popup "Cannot connect to the PS4 within the time limit".

  1. Put PS4 into rest mode via ps4-waker standby.
    Terminal output:
$ ps4-waker standby
WAKEUP sent to device... 192.168.0.81
Logging in...

PS4 successfully goes into rest mode.

  1. Use ps4-waker without arguments to wake the PS4 (after waiting long enough to ensure the PS4 is actually in rest mode).
    Terminal output:
$ ps4-waker
WAKEUP sent to device... 192.168.0.81
Logging in...
Login error: PIN_IS_NEEDED

PS4 wakes up, but cannot login (stays on the login screen).

@dhleong
Copy link
Owner

dhleong commented Dec 16, 2017

Sorry for the delay, I've been busy and this sort of fell off my radar.

I believe PIN_IS_NEEDED means the device didn't completely register with the Playstation, but I'm not sure what would cause that—and there's no error, so at least the Playstation claimed it worked. Could you maybe go to the PlayStation App Connection Settings page like you were going to do "Add Device" to get a pin, and see what other devices are listed?

There should be one for your smartphone and one called "PS4 Waker " plus the first few characters of your computer's name. If it's not there, that's why PIN_IS_NEEDED, but I'm still not entirely sure what to do about it since I can't reproduce the issue myself. If it is, maybe try deleting it and reconnecting again? These are just wild guesses... ;)

@Roessler89
Copy link
Author

Roessler89 commented Dec 27, 2017

Hey, sorry for my delay in reply also. It's the silly season so getting time to play around with side projects becomes slightly harder, so I fully understand your delay. :)

So I looked at what devices were listed, I had my old iPhone listed and my PC (correct PC name) listed there also. I have already tried doing what you suggested, nevertheless I deleted both, connected my new phone (Google Pixel 2 XL), then attempted to connect PS4-Waker again and... Same thing. PIN_IS_NEEDED.

Having a look at devices listed now lists both my new phone and my PC. So it definitely connects at some point, especially since I can use PS4-Waker to put my PS4 in standby (rest) mode.

I have absolutely now idea what's going on at the moment as now errors except PIN_IS_NEEDED is being thrown. When I have more time I'll look into it in more detail, including inspecting the code further (only done a quick glance) to see if I can get it working. In the meantime I'll also try on my Mac and try to establish if my PC is having troubles or if my PS4 is having issues.

EDIT: Just tested on my Macbook Pro and am having the exact same issue. PIN_IS_NEEDED after a successful connection to the PS4 and sending the PS4 to sleep via PS4-Waker. Perhaps there is an issue with my PS4 setup? I've noticed that when the PS4 is started up by PS4-Waker that the PS4 shows the "Press the PS button to login" message, rather than jumping straight to user selection which it normally does when I turn it on via my TV remote (HDMI wake signal).

I do appreciate your replies and help, however don't feel as though you MUST reply within a few days etc., because in essence you are providing free tech support. Enjoy your holidays mate, perhaps we'll chat after the new year.

@dhleong
Copy link
Owner

dhleong commented Dec 27, 2017 via email

@FluBBaOfWard
Copy link

FluBBaOfWard commented Jan 8, 2018

Does this have anything to do with PS4 "password" login? I have the same problem as well, I guess it wants my "password" to login to my PS4 account.

@dhleong
Copy link
Owner

dhleong commented Jan 8, 2018

You can set a password on the PS4 in addition to the PSN account login? If so that might be related, but I think @Roessler89 was saying the app worked fine without anything extra....

@FluBBaOfWard
Copy link

Yes, sorry, not my PSN account but my PS4 account. On the Playstation app I get a prompt to enter my "password" and then it logs me in. PS4Waker works great as soon as I'm logged in.

@dhleong
Copy link
Owner

dhleong commented Jan 8, 2018 via email

@FluBBaOfWard
Copy link

The reason I wrote "password" is because it's a 4 digit pin code so I don't think you have to be too worried about security in this case, it's mostly so that people in your house don't login unsupervised.

@dhleong
Copy link
Owner

dhleong commented Jan 9, 2018 via email

@Roessler89
Copy link
Author

G'day,

Sorry it's been a while since I replied, silly season etc.

FluBBaOfWard is correct. I actually tested this a couple weeks back before the break, and wasn't too surprised to discover PS4 Waker works as intended - more embarrassed I didn't think of it earlier.

Anyways, if the purpose of PS4 Waker is to wake the PS4 and login the correct account, I think it is the responsibility of PS4 Waker to handle the 4 digit PIN code upon login. When I have more time, I'll do my best to investigate how to implement the PIN code registration and handling of the PIN code when logging in.

For now, it works since I've removed my PIN, and it's time to spend my energy on connecting my Google Home to the PS4 via PS4 Waker, so that I can do the obvious things. 😄

@dhleong
Copy link
Owner

dhleong commented May 17, 2018

Hi @Roessler89 it's been a few months but I definitely agree ps4-waker should be able to handle the PIN code negotiation, my comment was just with regards to securely storing that pin code not being ps4-waker's responsibility. I've been busy with other projects and haven't had time to look into this yet, but I imagine at some point we'll add another cli flag, or perhaps read stdin to get the pin code to handle this case.

@dhleong dhleong changed the title Login error: PIN_IS_NEEDED Support pin-code login May 17, 2018
@dhleong dhleong added the enhancement New feature or request label May 17, 2018
@dhleong dhleong closed this as completed in 44c2445 Oct 2, 2018
@dhleong
Copy link
Owner

dhleong commented Oct 2, 2018

Hey @Roessler89 sorry it's been so long, but I've started using my PS4 a bit more recently and was able to find some time so I went ahead and added this in version 1.5.0. It turns out the PIN_IS_REQUIRED error was a misunderstanding on my part, and this feature is actually called "passcode," which probably caused some of the confusion.

Anyway, you can now use the --pass command line flag to provide your passcode when logging in.

@dhleong dhleong self-assigned this Oct 2, 2018
@dhleong dhleong changed the title Support pin-code login Support passcode login Oct 2, 2018
@Roessler89
Copy link
Author

@dhleong champion effort mate, much appreciated! I honestly haven't had any time to even turn on my PS4 recently, so hopefully I can test this out in a few weeks. In any case, well done and thank you!

@danjono
Copy link

danjono commented Dec 11, 2018

Just thought I should add to this since I was searching around for an answer to this and was struggling. Might be worth sticking this in your readme @dhleong that the button presses translate into these digits for the passcode https://i.imgur.com/p76ERg5.png

@dhleong
Copy link
Owner

dhleong commented Dec 11, 2018

@danjono What do you need those for? Does the builtin passcode support (the --pass flag) not work for you?

@danjono
Copy link

danjono commented Dec 11, 2018

Oh no the --pass flag works, I was just a bit thrown off how to enter my login code since I use R1 R2 etc. I forgot they corresponded to numbers so I could imagine others might forget too.

@dhleong
Copy link
Owner

dhleong commented Dec 11, 2018 via email

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

No branches or pull requests

4 participants