digital-dream-labs / vector-web-setup

Tool to perform initial configuration of Vector robots.
MIT License
65 stars 57 forks source link

Error in bot authentication. Please try again. #31

Closed fjp closed 3 years ago

fjp commented 3 years ago

Hi, thanks for the vector-web-setup. Unfortunately I cannot login because of the following error:

Error in bot authentication. Please try again.

I've reset my password already and rebooted Vector but it didn't help.

error-in-bot-authentication1

Is there a step that I am missing or doing wrong?

Thank you.

kercre123 commented 3 years ago

Are you using it over localhost or through an https domain? CORS (Cross-origin resource sharing) doesn't like it if it isn't localhost.

fjp commented 3 years ago

@kercre123 I use the web-setup with http://localhost:8000. After running vector-web-setup serve I got:

Server running on ip 0.0.0.0 and port 8000
Server running. Go to http://localhost:8000 to use it
fjp commented 3 years ago

Currently I am trying to authenticate with the anki-auth command but I don't know what to enter for the session-token: From the help command:

anki-auth               Provision Vector with Anki account.
                        anki-auth {session_token}

I got there by disabeling the auto-setup flow:

enable auto-setup flow

[v5] VECTORID$
status
              ssid: connected-to-wifi
        wifi state: online
      access point: off
     build version: v1.6.0.3331-b235687_os1.6.0.3331-2cd9983-201904051705
   is ota updating: no
     serial number: serialnumber
   has cloud owner: yes
   is cloud authed: no
fjp commented 3 years ago

I don't know how it exactly happened but after resetting and some restarts Vector now updated to v1.7.0.3412. Unfortunately I still get the same error when I try to sign in:

Error in bot authentication. Please try again.

build version: v1.7.0.3412-274dfc2_os1.7.0.3412-17f9b40-202007030846

grant-olson commented 3 years ago

I find the best way to get more information on this problem is to open the Chrome web developer tools. Then you can see if the problem is getting a session token after signing in, or applying the new token to the robot. Do this by examining the Network tab and seeing if the request completed with a successful 200 or if there is another error, and examining the 'console' tab for any errors printed out.

If the first part does work then you will be able to find a token in the AJAX response to the sign in which could be applied via the anki-auth command, but in that case I would expect the normal web interface to work as well.

I've also can't swear that this is true, but I think I've seen problems where the web setup flow assumes you have a new out-of-the-box Vector, and doesn't account for someone else having already created an account. So if you're trying to connect with a new account you could try to erase user data before trying to sign up with your new account:

  1. Put Vector in his cradle.
  2. Tap the button to get the pairing screen.
  3. Lift his forklift arm up and down to get to the admin screen.
  4. Rotate treads to select "erase user data".
  5. Lift forklift up and down to select.
  6. Rotate treads to select "yes"
  7. Lift forklift up and down to select.
fjp commented 3 years ago

Thanks @grant-olson for the detailed instructions. I got it working with the iOS App after I erased the user data and countless restarts and Bluetooth/Wifi connection tries. I guess erasing the user data did solve the issue. After that Vector also displayed ddl.io/v instead of anki.com/v for the first time. The examples from vector-python-sdk are working great :partying_face:. You can see the remote control example running here. Thanks for the great work :+1:

I'll try to connecting with the vector-web-setup too and your instructions because I think it is convenient to not rely only on the iOS app.