How to fix pio remote agent start: You are not authorized! Please log in to PlatformIO Account.

Problem:

When running

pio remote agent start

you see an error message like

2021-10-05 17:37:23 [info] Name: Raspberry Pi
2021-10-05 17:37:23 [info] Connecting to PlatformIO Remote Development Cloud                                                                    
2021-10-05 17:37:23 [info] Successfully connected
2021-10-05 17:37:23 [info] Authenticating
2021-10-05 17:37:23 [error] You are not authorized! Please log in to PlatformIO Account.                                                        
2021-10-05 17:37:23 [info] Successfully disconnected

Solution

You need to login to your PlatformIO account. Run

pio account login

which will prompt you for your username & password. If you don’t have an account, register using

pio account register