ESPTeamsPresence icon indicating copy to clipboard operation
ESPTeamsPresence copied to clipboard

Successful compilation of platform.io, for ESP32-S3. Uploaded, only white light onboard LED.

Open alexburkert opened this issue 3 weeks ago • 3 comments
trafficstars

Owing to both a self-inflicted soldering issue and having previously bought a 12V LED strip (instead of 5V), I needed to restart this project on a new ESP32-S3 board.

I used the same platformio.ini as in Bug #48.

  • I have completed the configuration page.

  • The device is connected to wifi.

Once, I briefly saw that the LED lights on the LED strip lit green. This appeared for a very brief duration, sub-second.

I am able to connect via WIFI to http://espteamspresence.local/

When I click on Start device login, I'm not provided a code to pass into https://login.microsoftonline.com/common/oauth2/deviceauth (the URL that Open device login redirects toward)

Would you please advise?

Thank you,

Burkert

alexburkert avatar Nov 04 '25 00:11 alexburkert

If its any help, the following is the (redacted) serial output, taken from https://espressif.github.io/esptool-js/

ESP-ROM:esp32s3-20210327
Build:Mar 27 2021
rst:0x1 (POWERON),boot:0x2b (SPI_FAST_FLASH_BOOT)
SPIWP:0xee
mode:DIO, clock div:1
load:0x3fce3808,len:0x4bc
load:0x403c9700,len:0xbd8
load:0x403cc700,len:0x2a0c
entry 0x403c98d0

setup() Starting up...
setAnimation: 0, 0-0, Mode: 0, Color: 16777215, Speed: 3000
                                                           [   232][E][esp32-hal-rmt.c:632] rmtInit(): RMT failed to initilize.
[   245][E][esp32-hal-rgb-led.c:18] neopixelWrite(): RGB LED driver initialization failed!
Config size: 325
Loaded config 'iwcThingName'= 'ESPTeamsPresence'
Loaded config 'iwcApPassword'= <hidden>
Loaded config 'iwcWifiSsid'= 'REDACTED'
Loaded config 'iwcWifiPassword'= <hidden>
Loaded config 'iwcApTimeout'= '30'
Loaded config 'clientId'= '3837bbf0-30fb-47ad-bce8-f460ba9880c3'
Loaded config 'tenantId'= 'REDACTED.onmicrosoft.com'
Loaded config 'pollInterval'= '60'
Loaded config 'numLeds'= '35'
[   286][E][ESPmDNS.cpp:65] begin(): Failed starting MDNS
[   295][E][ESPmDNS.cpp:148] addService(): Failed adding service http.tcp.

setup() ready...
SPIFFS.begin() 
SkipApStartup mode was applied
State changing from: 0 to 3
Connecting to [BIGGEREARS] (password is hidden)
State changed from: 0 to 3
WiFi connecting
setAnimation: 0, 0-35, Mode: 16, Color: 255, Speed: 3000
                                                        ======================================================================
WiFi connected
IP address: RE.DA.CT.ED
State changing from: 3 to 4
Accepting connection
State changed from: 3 to 4
setAnimation: 0, 0-35, Mode: 16, Color: 65280, Speed: 3000
                                                          startMDNS()
mDNS responder started: ESPTeamsPresence.local
loadContext() - File empty
Wifi connected, waiting for requests ...
======================================================================

Thank you,

Burkert

alexburkert avatar Nov 04 '25 01:11 alexburkert

Hi @alexburkert,

it's hard for me to support this project at the moment, because I don't have a M365 tenant available to test against (and not the board you're using), so I can just say based on the logs:

  • The reason why ti LEDs don't work seems to be connected with RMT error. The RMT implementation of the ESP32-S3 seems to be fundamentally different from the ESP32. There was a long discussion in the FastLED project about this. You might get around this by upgrading to the latest WS2812FX library version and get rid of the RMT code, or by swapping out the used LED library completely. Maybe you can also get some help in the WS2812FX project regarding this error message.
  • The rest of the log looks OK.

Many greetings!

toblum avatar Nov 04 '25 19:11 toblum

Tobias,

I believe that I've gotten it compiled & its sent an authorization request to you. The instructions sounded like I need to await your approval. Would you please confirm that to be the case?

What I added to platformio.ini under the lib_deps section is https://github.com/ednieuw/Adafruit_NeoPixel-esp32#master

Additionally, I downloaded to the src directory the file, Adafruit_NeoPixel.h

Finally, I added an include to main.cpp, to include the downloaded file, #include "Adafruit_NeoPixel.h"

I'm still not seeing the LED light strip light up, but, I'm farther along than I was.

alexburkert avatar Nov 06 '25 05:11 alexburkert

Hi @alexburkert,

there is nothing in the process where I need to consent. Maybe you need consent from your tenant admin. That might be the case, depending on how your tenant is configured.

Just including the Adafruit library won't be enough. That's noi drop-in replacement. You will have to adjust the code to initialize and use it. But that's nothing I can assist you with.

Many greetings!

toblum avatar Nov 06 '25 18:11 toblum

Tobias,

I've tried a few other things with this ESP32-S3, to no avail.

I've opted to purchase a different board.

Can you confirm if this board will work with your project's firmware.bin file?

Thank you,

Burkert

alexburkert avatar Nov 07 '25 02:11 alexburkert

@toblum

I've taken delivery of the new board. I believe it to be of class DOIT ESP32 DEVKIT V1.

Opted to build using platformio.ini, using all of the defaults which ship with the project. Installed onto the aforementioned ESP32 devkit V1. Connected to wifi.

The LED lights start with a solid white color. Then, once connected to wifi, the LEDs change to an animated flashing green sequence.

From http://espteamspresence.local/, I click on start device login.

As soon as that loads an authentication key, the LED animation changes to a flashing pink or purple color.

After I've completed the application login, the LED animation remains a flashing pink or purple color.

If I restart the ESP32 devkit V1, the LED lights restart with a solid white color. Then, once connected to wifi, the LEDs change to an animated flashing green sequence.

Would you please advise?

Thank you,

Burkert

alexburkert avatar Nov 07 '25 21:11 alexburkert

Hi @alexburkert,

now that the lights work, the hardware-side seems to be OK The running green light means that wifi is connected and it's trying to get a token to talk to M365. What does the console say? It should provide more informations.

Many greetings!

toblum avatar Nov 07 '25 21:11 toblum

@toblum

I am unsure if it will be helpful, but the following is the Serial Monitor output from the Platform.IO Extension on MicroSoft VSCode :

Reconnecting to COM4     Connected!
ets Jul 29 2019 12:21:46

rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0030,len:184
load:0x40078000,len:12680
load:0x40080400,len:2908
entry 0x400805c4

setup() Starting up...
setAnimation: 0, 0-0, Mode: 0, Color: 16777215, Speed: 3000
Config size: 325
Loaded config 'iwcThingName'= 'ESPTeamsPresence'
Loaded config 'iwcApPassword'= <hidden>
Loaded config 'iwcWifiSsid'= 'REDACTED'
Loaded config 'iwcWifiPassword'= <hidden>
Loaded config 'iwcApTimeout'= '30'
Loaded config 'clientId'= '3837bbf0-30fb-47ad-bce8-f460ba9880c3'
Loaded config 'tenantId'= 'REDACTED.onmicrosoft.com'
Loaded config 'pollInterval'= '60'
Loaded config 'numLeds'= '35'
setup() ready...
SPIFFS.begin()
SkipApStartup mode was applied
State changing from: 0 to 3
Connecting to [REDACTED] (password is hidden)
State changed from: 0 to 3
WiFi connecting
setAnimation: 0, 0-35, Mode: 16, Color: 255, Speed: 3000
======================================================================
WiFi connected
IP address: RE.DA.CT.ED
State changing from: 3 to 4
Accepting connection
State changed from: 3 to 4
setAnimation: 0, 0-35, Mode: 16, Color: 65280, Speed: 3000
startMDNS()
mDNS responder started: ESPTeamsPresence.local
loadContext() - File empty
Wifi connected, waiting for requests ...
======================================================================       
handleRoot()
Requested non-existing page '/favicon.ico' arguments(GET):0
handleFileRead: /favicon.ico
handleStartDevicelogin()
[HTTPS] Method: POST, Response code: 200
setAnimation: 0, 0-35, Mode: 16, Color: 4194432, Speed: 3000
======================================================================
pollForToken()
[HTTPS] Request failed: connection refused
Device login failed
====================================================================== 
����������������������������������������������������������������andleRoot()
Requested non-existing page '/favicon.ico' arguments(GET):0
handleFileRead: /favicon.ico
handleStartDevicelogin()
[HTTPS] Request failed: connection refused
handleStartDevicelogin()
[HTTPS] Request failed: connection refused
handleStartDevicelogin()
[HTTPS] Method: POST, Response code: 200
setAnimation: 0, 0-35, Mode: 16, Color: 4194432, Speed: 3000
======================================================================       
pollForToken()
[HTTPS] Method: POST, Response code: 400
pollForToken() - Wating for authorization by user: AADSTS70016: OAuth 2.0 device flow error. Authorization is pending. Continue polling. Trace ID: 64e9274b-ca8d-476d-91f8-33ad4c6b3e00 Correlation ID: e8a920d6-8a68-4317-9c7b-c0b624aaef43 Timestamp: 2025-11-08 04:36:57Z

pollForToken()
[HTTPS] Method: POST, Response code: 400
pollForToken() - Wating for authorization by user: AADSTS70016: OAuth 2.0 device flow error. Authorization is pending. Continue polling. Trace ID: 29e89ed2-e938-4cd7-abd9-e2ca786a4000 Correlation ID: e8a920d6-8a68-4317-9c7b-c0b624aaef43 Timestamp: 2025-11-08 04:37:04Z

pollForToken()
[HTTPS] Request failed: connection refused
Device login failed
======================================================================       
handleStartDevicelogin()
[HTTPS] Method: POST, Response code: 200
setAnimation: 0, 0-35, Mode: 16, Color: 4194432, Speed: 3000
======================================================================       
pollForToken()
[HTTPS] Method: POST, Response code: 400
pollForToken() - Wating for authorization by user: AADSTS70016: OAuth 2.0 device flow error. Authorization is pending. Continue polling. Trace ID: 28288683-042c-4614-b6d1-3080ae9b1100 Correlation ID: 49df9c33-85b5-40ff-addc-69225ea51148 Timestamp: 2025-11-08 04:37:39Z

pollForToken()
����������������������������������������������������������������TPS] Request failed: read Timeout
Device login failed
======================================================================

alexburkert avatar Nov 08 '25 04:11 alexburkert

Hi @alexburkert,

the log looks like you started the auth process and the light is waiting for you to complte the device auth so that it can receive the token and go on. Also some of these requests seem to fail which might be due to network issues. But the most work so that seems to be no general error. All in all it looks like you need to finish auth once and then ist can go on.

toblum avatar Nov 08 '25 21:11 toblum

@toblum

Thank you for the suggestion. I have attempted the authorization on more than one occasion, to the same outcome.

I have opted to try your original firmware.bin file, with the same outcome. That said, the log looks a tad different. Would you please advise if perhaps there is something else which is needed?

ets Jul 29 2019 12:21:46

rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0030,len:184
load:0x40078000,len:12680
load:0x40080400,len:2908
entry 0x400805c4

setup() Starting up...
setAnimation: 0, 0-0, Mode: 0, Color: 16777215, Speed: 3000
                                                           Config size: 325
Loaded config 'iwcThingName'= 'ESPTeamsPresence'
Loaded config 'iwcApPassword'= <hidden>
Loaded config 'iwcWifiSsid'= 'REDACTED'
Loaded config 'iwcWifiPassword'= <hidden>
Loaded config 'iwcApTimeout'= '30'
Loaded config 'clientId'= '3837bbf0-30fb-47ad-bce8-f460ba9880c3'
Loaded config 'tenantId'= 'REDACTED.onmicrosoft.com'
Loaded config 'pollInterval'= '60'
Loaded config 'numLeds'= '15'
[    73][E][ESPmDNS.cpp:65] begin(): Failed starting MDNS
[    85][E][ESPmDNS.cpp:148] addService(): Failed adding service http.tcp.

setup() ready...
SPIFFS.begin() 
SkipApStartup mode was applied
State changing from: 0 to 3
Connecting to [REDACTED] (password is hidden)
State changed from: 0 to 3
WiFi connecting
setAnimation: 0, 0-15, Mode: 16, Color: 255, Speed: 3000
                                                        ======================================================================
WiFi connected
IP address: RE.DA.CT.ED
State changing from: 3 to 4
Accepting connection
State changed from: 3 to 4
setAnimation: 0, 0-15, Mode: 16, Color: 65280, Speed: 3000
                                                          startMDNS()
mDNS responder started: ESPTeamsPresence.local
loadContext() - File empty
Wifi connected, waiting for requests ...
======================================================================
handleStartDevicelogin()
[HTTPS] Method: POST, Response code: 200
                                        setAnimation: 0, 0-15, Mode: 16, Color: 4194432, Speed: 3000
                                                                                                    ======================================================================
pollForToken()
              [HTTPS] Method: POST, Response code: 400
                                                      pollForToken() - Wating for authorization by user: AADSTS70016: OAuth 2.0 device flow error. Authorization is pending. Continue polling. Trace ID: 72a04b41-fef2-4721-958d-a8cdfd6a6100 Correlation ID: 49da6161-ba7e-4321-b9e4-434e69e0d75a Timestamp: 2025-11-09 15:57:19Z

                                                                                  pollForToken()
                                                                                                [ 58389][E][ssl_client.cpp:37] _handle_error(): [start_ssl_client():273]: (-9984) X509 - Certificate verification failed, e.g. CRL, CA or signature check failed
[ 58403][E][WiFiClientSecure.cpp:144] connect(): start_ssl_client: -9984
[HTTPS] Request failed: connection refused
                                          Device login failed
======================================================================

Thank you,

Burkert

alexburkert avatar Nov 09 '25 16:11 alexburkert

Hi @alexburkert,

It looks like this is an SSL certificate issue. Microsoft seems to be using different certificates for https://login.microsoftonline.com now, possibly depending on the underlying infrastructure you connect to. I was able to reproduce the error today and observed the new certificate and updated the code.

I've released a new version: v0.18.6. Please test with this one first.

As a secondary option, I've also updated firmware-nocertcheck.bin, which should also resolve the problem if the first fix doesn't work.

Many greetings!

toblum avatar Nov 09 '25 19:11 toblum

@toblum

Thank you for the updated package.

When I try the firmware.bin package, I am not provided an authorization token. The output looks like as follows:

ets Jul 29 2019 12:21:46

rst:ets Jul 29 2019 12:21:46

rst:ets Jul 29 2019 12:21:46

rst:ets Jul 29 2019 12:21:46

rst:ets Jul 29 2019 12:21:46

rst:ets Jul 29 2019 12:21:46

rst:ets Jul 29 2019 12:21:46

rst:ets Jul 29 2019 12:21:46

rst:ets Jul 29 2019 12:21:46

rst:ets Jul 29 2019 12:21:46

rst:ets Jul 29 2019 12:21:46

rst:ets Jul 29 2019 12:21:46

rst:ets Jul 29 2019 12:21:46

rst:ets Jul 29 2019 12:21:46

rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0030,len:184
load:0x40078000,len:12680
load:0x40080400,len:2908
entry 0x400805c4

setup() Starting up...
setAnimation: 0, 0-0, Mode: 0, Color: 16777215, Speed: 3000
                                                           Config size: 325
Loaded config 'iwcThingName'= 'ESPTeamsPresence'
Loaded config 'iwcApPassword'= <hidden>
Loaded config 'iwcWifiSsid'= 'REDACTED'
Loaded config 'iwcWifiPassword'= <hidden>
Loaded config 'iwcApTimeout'= '30'
Loaded config 'clientId'= '3837bbf0-30fb-47ad-bce8-f460ba9880c3'
Loaded config 'tenantId'= 'REDACTED.onmicrosoft.com'
Loaded config 'pollInterval'= '60'
Loaded config 'numLeds'= '15'
[    63][E][ESPmDNS.cpp:65] begin(): Failed starting MDNS
[    75][E][ESPmDNS.cpp:148] addService(): Failed adding service http.tcp.

setup() ready...
SPIFFS.begin() 
SkipApStartup mode was applied
State changing from: 0 to 3
Connecting to [REDACTED] (password is hidden)
State changed from: 0 to 3
WiFi connecting
setAnimation: 0, 0-15, Mode: 16, Color: 255, Speed: 3000
                                                        ======================================================================
WiFi connected
IP address: RE.DA.CT.ED
State changing from: 3 to 4
Accepting connection
State changed from: 3 to 4
setAnimation: 0, 0-15, Mode: 16, Color: 65280, Speed: 3000
                                                          startMDNS()
mDNS responder started: ESPTeamsPresence.local
loadContext() - File empty
Wifi connected, waiting for requests ...
======================================================================
andleRoot()
[ 17052][E][WebServer.cpp:638] _handleRequest(): request handler not found
Requested non-existing page '/favicon.ico' arguments(GET):0
handleFileRead: /favicon.ico
handleStartDevicelogin()
[ 20898][E][ssl_client.cpp:37] _handle_error(): [start_ssl_client():273]: (-9984) X509 - Certificate verification failed, e.g. CRL, CA or signature check failed
[ 20913][E][WiFiClientSecure.cpp:144] connect(): start_ssl_client: -9984
[HTTPS] Request failed: connection refused

If instead I try the firware-nocertcheck.bin package, I am provided an authorization token. I complete the process and the output looks like as follows :

ets Jul 29 2019 12:21:46

rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0030,len:184
load:0x40078000,len:12680
load:0x40080400,len:2908
entry 0x400805c4

setup() Starting up...
WARNING: Checking of HTTPS certificates disabled.
setAnimation: 0, 0-0, Mode: 0, Color: 16777215, Speed: 3000
                                                           Config size: 325
Loaded config 'iwcThingName'= 'ESPTeamsPresence'
Loaded config 'iwcApPassword'= <hidden>
Loaded config 'iwcWifiSsid'= 'REDACTED'
Loaded config 'iwcWifiPassword'= <hidden>
Loaded config 'iwcApTimeout'= '30'
Loaded config 'clientId'= '3837bbf0-30fb-47ad-bce8-f460ba9880c3'
Loaded config 'tenantId'= 'REDACTED.onmicrosoft.com'
Loaded config 'pollInterval'= '60'
Loaded config 'numLeds'= '15'
[    85][E][ESPmDNS.cpp:65] begin(): Failed starting MDNS
[    93][E][ESPmDNS.cpp:148] addService(): Failed adding service http.tcp.

setup() ready...
SPIFFS.begin() 
SkipApStartup mode was applied
State changing from: 0 to 3
Connecting to [REDACTED] (password is hidden)
State changed from: 0 to 3
WiFi connecting
setAnimation: 0, 0-15, Mode: 16, Color: 255, Speed: 3000
                                                        ======================================================================
WiFi connected
IP address: RE.DA.CT.ED
State changing from: 3 to 4
Accepting connection
State changed from: 3 to 4
setAnimation: 0, 0-15, Mode: 16, Color: 65280, Speed: 3000
                                                          startMDNS()
mDNS responder started: ESPTeamsPresence.local
loadContext() - File empty
Wifi connected, waiting for requests ...
======================================================================
handleStartDevicelogin()
[HTTPS] Method: POST, Response code: 200
                                        setAnimation: 0, 0-15, Mode: 16, Color: 4194432, Speed: 3000
                                                                                                    ======================================================================
pollForToken()
              [HTTPS] Method: POST, Response code: 400
                                                      pollForToken() - Wating for authorization by user: AADSTS70016: OAuth 2.0 device flow error. Authorization is pending. Continue polling. Trace ID: a93d810d-9d13-44fc-89da-3ddd535e0700 Correlation ID: 4d740867-7912-4603-9ccd-ed065c3dbe37 Timestamp: 2025-11-10 13:36:19Z

                                                                                  pollForToken()
                                                                                                [HTTPS] Method: POST, Response code: 400
                pollForToken() - Wating for authorization by user: AADSTS70016: OAuth 2.0 device flow error. Authorization is pending. Continue polling. Trace ID: ee1f2034-88bf-487f-a9c3-5cda77780600 Correlation ID: 4d740867-7912-4603-9ccd-ed065c3dbe37 Timestamp: 2025-11-10 13:36:25Z

                                            pollForToken()
                                                          [HTTPS] Method: POST, Response code: 400
                                                                                                  pollForToken() - Wating for authorization by user: AADSTS70016: OAuth 2.0 device flow error. Authorization is pending. Continue polling. Trace ID: 7df42fa5-aefc-4d57-b790-561a598f7100 Correlation ID: 4d740867-7912-4603-9ccd-ed065c3dbe37 Timestamp: 2025-11-10 13:36:32Z

      pollForToken()
                    [HTTPS] Method: POST, Response code: 400
                                                            pollForToken() - Wating for authorization by user: AADSTS70016: OAuth 2.0 device flow error. Authorization is pending. Continue polling. Trace ID: 816c9cfc-c78a-4f2c-9210-30672c0b0100 Correlation ID: 4d740867-7912-4603-9ccd-ed065c3dbe37 Timestamp: 2025-11-10 13:36:38Z

                                                                                        pollForToken()
                                                                                                      [HTTPS] Method: POST, Response code: 400
                                                                           
                      pollForToken() - Wating for authorization by user: AADSTS70016: OAuth 2.0 device flow error. Authorization is pending. Continue polling. Trace ID: 84e73c07-15ec-437e-ba6d-24dbd4699100 Correlation ID: 4d740867-7912-4603-9ccd-ed065c3dbe37 Timestamp: 2025-11-10 13:36:45Z

                                                  pollForToken()
                                                                [HTTPS] Method: POST, Response code: 400
                                                                                                        pollForToken() - Wating for authorization by user: AADSTS70016: OAuth 2.0 device flow error. Authorization is pending. Continue polling. Trace ID: a3a59316-c488-4292-8ed4-84db6bc80500 Correlation ID: 4d740867-7912-4603-9ccd-ed065c3dbe37 Timestamp: 2025-11-10 13:36:52Z

            pollForToken()
                          [HTTPS] Method: POST, Response code: 400
                                                                  pollForToken() - Wating for authorization by user: AADSTS70016: OAuth 2.0 device flow error. Authorization is pending. Continue polling. Trace ID: 7bfb0d63-c98d-49e3-b9ff-9d62394b7600 Correlation ID: 4d740867-7912-4603-9ccd-ed065c3dbe37 Timestamp: 2025-11-10 13:36:58Z

                                                                                              pollForToken()
                                                                                                            [HTTPS] Method: POST, Response code: 400
                            pollForToken() - Wating for authorization by user: AADSTS70016: OAuth 2.0 device flow error. Authorization is pending. Continue polling. Trace ID: 791a5db1-4b1d-48a2-a922-2ac0f3bf7000 Correlation ID: 4d740867-7912-4603-9ccd-ed065c3dbe37 Timestamp: 2025-11-10 13:37:05Z

                                                        pollForToken()
                                                                      [HTTPS] Method: POST, Response code: 400
                                                                                                              pollForToken() - Wating for authorization by user: AADSTS70016: OAuth 2.0 device flow error. Authorization is pending. Continue polling. Trace ID: 46d32707-480d-4d0f-9b1e-2ae479118a00 Correlation ID: 4d740867-7912-4603-9ccd-ed065c3dbe37 Timestamp: 2025-11-10 13:37:11Z

                  pollForToken()
                                [HTTPS] Method: POST, Response code: 400
                                                                        pollForToken() - Wating for authorization by user: AADSTS70016: OAuth 2.0 device flow error. Authorization is pending. Continue polling. Trace ID: f7787d1b-5a4e-45c9-bd0c-9b3decfc0600 Correlation ID: 4d740867-7912-4603-9ccd-ed065c3dbe37 Timestamp: 2025-11-10 13:37:18Z

                                                                                                    pollForToken()
                                                                                                                  [HTTPS] Method: POST, Response code: 400
                                  pollForToken() - Wating for authorization by user: AADSTS70016: OAuth 2.0 device flow error. Authorization is pending. Continue polling. Trace ID: fc72452c-0ade-4303-b99c-5ec3641a9000 Correlation ID: 4d740867-7912-4603-9ccd-ed065c3dbe37 Timestamp: 2025-11-10 13:37:24Z

                                                              pollForToken()
                                                                            [HTTPS] Method: POST, Response code: 400
                                                                                                                    pollForToken() - Wating for authorization by user: AADSTS70016: OAuth 2.0 device flow error. Authorization is pending. Continue polling. Trace ID: 1af06a1b-46c7-444e-b3d1-1287f5a57400 Correlation ID: 4d740867-7912-4603-9ccd-ed065c3dbe37 Timestamp: 2025-11-10 13:37:31Z

                        pollForToken()
                                      [HTTPS] Method: POST, Response code: 400
                                                                              pollForToken() - Wating for authorization by user: AADSTS70016: OAuth 2.0 device flow error. Authorization is pending. Continue polling. Trace ID: 6aae0046-1220-4aa1-a137-e99bcac86b00 Correlation ID: 4d740867-7912-4603-9ccd-ed065c3dbe37 Timestamp: 2025-11-10 13:37:38Z

                                                                                                          pollForToken()
                                                                                                                       [HTTPS] Method: POST, Response code: 400
                                       pollForToken() - Wating for authorization by user: AADSTS70016: OAuth 2.0 device flow error. Authorization is pending. Continue polling. Trace ID: e43ad2e4-bf3e-42e8-9f96-960d55ab7100 Correlation ID: 4d740867-7912-4603-9ccd-ed065c3dbe37 Timestamp: 2025-11-10 13:37:44Z

                                                                   pollForToken()
                                                                                 [HTTPS] Method: POST, Response code: 400
 pollForToken() - Wating for authorization by user: AADSTS70016: OAuth 2.0 device flow error. Authorization is pending. Continue polling. Trace ID: be95f0a2-1959-46e1-81f5-940c71ff8800 Correlation ID: 4d740867-7912-4603-9ccd-ed065c3dbe37 Timestamp: 2025-11-10 13:37:51Z

                             pollForToken()
                                           [HTTPS] Method: POST, Response code: 400
                                                                                   pollForToken() - Wating for authorization by user: AADSTS70016: OAuth 2.0 device flow error. Authorization is pending. Continue polling. Trace ID: 0aec7df3-c5a3-4157-8bfc-632f677a7300 Correlation ID: 4d740867-7912-4603-9ccd-ed065c3dbe37 Timestamp: 2025-11-10 13:37:57Z

                                                                                                               pollForToken()
     [HTTPS] Method: POST, Response code: 400
                                             pollForToken() - Wating for authorization by user: AADSTS70016: OAuth 2.0 device flow error. Authorization is pending. Continue polling. Trace ID: 925f7a1c-aafb-4a7a-b739-4ff648b57700 Correlation ID: 4d740867-7912-4603-9ccd-ed065c3dbe37 Timestamp: 2025-11-10 13:38:04Z

                                                                         pollForToken()
                                                                                       [HTTPS] Method: POST, Response code: 400
       pollForToken() - Wating for authorization by user: AADSTS70016: OAuth 2.0 device flow error. Authorization is pending. Continue polling. Trace ID: c37090ee-f2a9-4a97-99b7-6df41c327a00 Correlation ID: 4d740867-7912-4603-9ccd-ed065c3dbe37 Timestamp: 2025-11-10 13:38:11Z

                                   pollForToken()
                                                 [HTTPS] Method: POST, Response code: 400
                                                                                         pollForToken() - Wating for authorization by user: AADSTS70016: OAuth 2.0 device flow error. Authorization is pending. Continue polling. Trace ID: a7c2b57d-2523-4f3f-81ee-677af0280500 Correlation ID: 4d740867-7912-4603-9ccd-ed065c3dbe37 Timestamp: 2025-11-10 13:38:17Z

                                                                                                                     pollForToken()
           [HTTPS] Method: POST, Response code: 400
                                                   pollForToken() - Wating for authorization by user: AADSTS70016: OAuth 2.0 device flow error. Authorization is pending. Continue polling. Trace ID: 1905ddcf-c891-4dc8-ac74-0ecc4bce8700 Correlation ID: 4d740867-7912-4603-9ccd-ed065c3dbe37 Timestamp: 2025-11-10 13:38:26Z

                                                                               pollForToken()
                                                                                             [HTTPS] Method: POST, Response code: 400
             pollForToken() - Wating for authorization by user: AADSTS70016: OAuth 2.0 device flow error. Authorization is pending. Continue polling. Trace ID: c16d1e80-7a15-4a4b-bfbd-bea27ecd9200 Correlation ID: 4d740867-7912-4603-9ccd-ed065c3dbe37 Timestamp: 2025-11-10 13:38:33Z

                                         pollForToken()
                                                       [HTTPS] Method: POST, Response code: 400
                                                                                               pollForToken() - Wating for authorization by user: AADSTS70016: OAuth 2.0 device flow error. Authorization is pending. Continue polling. Trace ID: 19984f5a-9ff3-45e1-aca3-7344ddd47300 Correlation ID: 4d740867-7912-4603-9ccd-ed065c3dbe37 Timestamp: 2025-11-10 13:38:40Z

   pollForToken()
                 [HTTPS] Method: POST, Response code: 400
                                                         pollForToken() - Wating for authorization by user: AADSTS70016: OAuth 2.0 device flow error. Authorization is pending. Continue polling. Trace ID: 6c8a8ae0-f475-4659-b5f6-bbf5a3329200 Correlation ID: 4d740867-7912-4603-9ccd-ed065c3dbe37 Timestamp: 2025-11-10 13:38:46Z

                                                                                     pollForToken()
                                                                                                   [HTTPS] Method: POST, Response code: 400
                   pollForToken() - Wating for authorization by user: AADSTS70016: OAuth 2.0 device flow error. Authorization is pending. Continue polling. Trace ID: a7d31d09-0a5e-4b44-bb5c-9d067acd8100 Correlation ID: 4d740867-7912-4603-9ccd-ed065c3dbe37 Timestamp: 2025-11-10 13:38:54Z

                                               pollForToken()
                                                             [HTTPS] Method: POST, Response code: 400
                                                                                                     pollForToken() - Wating for authorization by user: AADSTS70016: OAuth 2.0 device flow error. Authorization is pending. Continue polling. Trace ID: 281e5a49-3997-4951-885a-24f614346800 Correlation ID: 4d740867-7912-4603-9ccd-ed065c3dbe37 Timestamp: 2025-11-10 13:39:02Z

         pollForToken()
                       [HTTPS] Method: POST, Response code: 400
                                                               pollForToken() - Wating for authorization by user: AADSTS70016: OAuth 2.0 device flow error. Authorization is pending. Continue polling. Trace ID: 3733c3c4-fc82-4046-abd6-9afde8ea0600 Correlation ID: 4d740867-7912-4603-9ccd-ed065c3dbe37 Timestamp: 2025-11-10 13:39:08Z

                                                                                           pollForToken()
                                                                                                         [HTTPS] Method: POST, Response code: 400
                         pollForToken() - Wating for authorization by user: AADSTS70016: OAuth 2.0 device flow error. Authorization is pending. Continue polling. Trace ID: 71501b75-d4ed-46fe-90f3-c42973908400 Correlation ID: 4d740867-7912-4603-9ccd-ed065c3dbe37 Timestamp: 2025-11-10 13:39:15Z

                                                     pollForToken()
                                                                   [HTTPS] Method: POST, Response code: 400
                                                                                                           pollForToken() - Wating for authorization by user: AADSTS70016: OAuth 2.0 device flow error. Authorization is pending. Continue polling. Trace ID: b81f47a8-167b-4d51-8e63-50dbc6836200 Correlation ID: 4d740867-7912-4603-9ccd-ed065c3dbe37 Timestamp: 2025-11-10 13:39:21Z

               pollForToken()
                             [HTTPS] Method: POST, Response code: 400
                                                                     pollForToken() - Wating for authorization by user: AADSTS70016: OAuth 2.0 device flow error. Authorization is pending. Continue polling. Trace ID: 0d5f8e30-7d98-4dcb-89ca-feea62619200 Correlation ID: 4d740867-7912-4603-9ccd-ed065c3dbe37 Timestamp: 2025-11-10 13:39:28Z

                                                                                                 pollForToken()
                                                                                                               [HTTPS] Method: POST, Response code: 400
                               pollForToken() - Wating for authorization by user: AADSTS70016: OAuth 2.0 device flow error. Authorization is pending. Continue polling. Trace ID: ea37026e-2994-4887-95a3-67abc07c5f00 Correlation ID: 4d740867-7912-4603-9ccd-ed065c3dbe37 Timestamp: 2025-11-10 13:39:34Z

                                                           pollForToken()
                                                                         [HTTPS] Method: POST, Response code: 400
                                                                                                                 pollForToken() - Wating for authorization by user: AADSTS70016: OAuth 2.0 device flow error. Authorization is pending. Continue polling. Trace ID: 71eee4e5-3706-4b61-97f4-df1519cf7700 Correlation ID: 4d740867-7912-4603-9ccd-ed065c3dbe37 Timestamp: 2025-11-10 13:39:41Z

                     pollForToken()
                                   [HTTPS] Method: POST, Response code: 400
                                                                           pollForToken() - Wating for authorization by user: AADSTS70016: OAuth 2.0 device flow error. Authorization is pending. Continue polling. Trace ID: fe941a64-6fd2-4db0-af56-4af98d257e00 Correlation ID: 4d740867-7912-4603-9ccd-ed065c3dbe37 Timestamp: 2025-11-10 13:39:47Z

                                                                                                       pollForToken()
                                                                                                                     [HTTPS] Method: POST, Response code: 400
                                     pollForToken() - Wating for authorization by user: AADSTS70016: OAuth 2.0 device flow error. Authorization is pending. Continue polling. Trace ID: 3a5004e0-1ca4-4d0b-baf9-8a76d33a6a00 Correlation ID: 4d740867-7912-4603-9ccd-ed065c3dbe37 Timestamp: 2025-11-10 13:39:54Z

                                                                 pollForToken()
                                                                               [HTTPS] Method: POST, Response code: 400
                                                                                                                       pollForToken() - Wating for authorization by user: AADSTS70016: OAuth 2.0 device flow error. Authorization is pending. Continue polling. Trace ID: d134664f-bf20-48ec-936e-5951a0fa0500 Correlation ID: 4d740867-7912-4603-9ccd-ed065c3dbe37 Timestamp: 2025-11-10 13:40:01Z

                           pollForToken()
                                         [HTTPS] Method: POST, Response code: 400
                                                                                 pollForToken() - Wating for authorization by user: AADSTS70016: OAuth 2.0 device flow error. Authorization is pending. Continue polling. Trace ID: 3142e904-714d-4d18-89eb-27977d360c00 Correlation ID: 4d740867-7912-4603-9ccd-ed065c3dbe37 Timestamp: 2025-11-10 13:40:07Z

                                                                                                             pollForToken()
   [HTTPS] Method: POST, Response code: 400
                                           pollForToken() - Wating for authorization by user: AADSTS70016: OAuth 2.0 device flow error. Authorization is pending. Continue polling. Trace ID: b0397906-0f6f-46c2-9634-7735be176b00 Correlation ID: 4d740867-7912-4603-9ccd-ed065c3dbe37 Timestamp: 2025-11-10 13:40:14Z

                                                                       pollForToken()
                                                                                     [HTTPS] Method: POST, Response code: 400
     pollForToken() - Wating for authorization by user: AADSTS70016: OAuth 2.0 device flow error. Authorization is pending. Continue polling. Trace ID: ace241ea-b153-40e4-bb71-024222395a00 Correlation ID: 4d740867-7912-4603-9ccd-ed065c3dbe37 Timestamp: 2025-11-10 13:40:20Z

                                 pollForToken()
                                               [HTTPS] Method: POST, Response code: 400
                                                                                       pollForToken() - Wating for authorization by user: AADSTS70016: OAuth 2.0 device flow error. Authorization is pending. Continue polling. Trace ID: 99f58bb4-0062-466d-abd9-1b1424897000 Correlation ID: 4d740867-7912-4603-9ccd-ed065c3dbe37 Timestamp: 2025-11-10 13:40:27Z

                                                                                                                   pollForToken()
         [HTTPS] Method: POST, Response code: 400
                                                 pollForToken() - Wating for authorization by user: AADSTS70016: OAuth 2.0 device flow error. Authorization is pending. Continue polling. Trace ID: 281e5a49-3997-4951-885a-24f60d406800 Correlation ID: 4d740867-7912-4603-9ccd-ed065c3dbe37 Timestamp: 2025-11-10 13:40:33Z

                                                                             pollForToken()
                                                                                           [HTTPS] Method: POST, Response code: 400
           pollForToken() - Wating for authorization by user: AADSTS70016: OAuth 2.0 device flow error. Authorization is pending. Continue polling. Trace ID: 462b3da4-25b7-41b6-a2c5-d5b4bf2b6f00 Correlation ID: 4d740867-7912-4603-9ccd-ed065c3dbe37 Timestamp: 2025-11-10 13:40:40Z

                                       pollForToken()

The latter portion of the output will indefinitely loop.

Would you please advise?

Thank you,

Burkert

alexburkert avatar Nov 10 '25 13:11 alexburkert

Hi @alexburkert, the first variant seems to work most of the time. I looks like MS is routing to different servers that use different certificates. The second nocertcheck version seems to work fine from a communication perspective. The message just says that it's waiting for you to complete the login process. If you are able to complete the devce login process successfully, the light should receive the token and continue. But from here it's hard for me to support as I can#t try it out myself.

Greetings

toblum avatar Nov 11 '25 21:11 toblum

@toblum

When I run the firmware.bin file provided with v0.18.6, after going through configuration, if I press on Start device login, it does not provide an authentication code.

When I run the firmware-nocertcheck.bin file provided with v0.18.6, after going through configuration, if I press on Start device login, it an authentication code is provided. After completing the device login process,

Image

, the light's status does not change and the serial output repeats with messages to the effect of,

ets Jul 29 2019 12:21:46

rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0030,len:184
load:0x40078000,len:12680
load:0x40080400,len:2908
entry 0x400805c4

setup() Starting up...
WARNING: Checking of HTTPS certificates disabled.
setAnimation: 0, 0-0, Mode: 0, Color: 16777215, Speed: 3000
                                                           Config size: 325
Wrong config version.
[    42][E][ESPmDNS.cpp:65] begin(): Failed starting MDNS
[    48][E][ESPmDNS.cpp:148] addService(): Failed adding service http.tcp.

Number of LEDs not given, using 16.
setup() ready...
SPIFFS.begin() 
E (51) SPIFFS: mount failed, -10025
SkipApStartup is requested, but either no WiFi was set up, or configButton was pressed.
AP password was not set in configuration
State changing from: 0 to 1
Setting up AP: ESPTeamsPresence
With default password: <hidden>
AP IP address: 192.168.4.1
State changed from: 0 to 1
Detected AP mode
setAnimation: 0, 0-16, Mode: 16, Color: 16777215, Speed: 3000
                                                             Connection to AP.
[ 42422][E][WebServer.cpp:638] _handleRequest(): request handler not found
Request for ipv6.msftconnecttest.com redirected to 192.168.4.1
handleFileRead: /connecttest.txt
[ 42651][E][WebServer.cpp:638] _handleRequest(): request handler not found
Request for www.msftconnecttest.com redirected to 192.168.4.1
handleFileRead: /connecttest.txt
[ 42900][E][WebServer.cpp:638] _handleRequest(): request handler not found
Request for www.msftconnecttest.com redirected to 192.168.4.1
handleFileRead: /connecttest.txt
[ 43131][E][WebServer.cpp:638] _handleRequest(): request handler not found
Request for ipv6.msftconnecttest.com redirected to 192.168.4.1
handleFileRead: /connecttest.txt
[ 43360][E][WebServer.cpp:638] _handleRequest(): request handler not found
Request for www.msftconnecttest.com redirected to 192.168.4.1
handleFileRead: /connecttest.txt
[ 43588][E][WebServer.cpp:638] _handleRequest(): request handler not found
Request for www.msftconnecttest.com redirected to 192.168.4.1
handleFileRead: /connecttest.txt
[ 47367][E][WebServer.cpp:638] _handleRequest(): request handler not found
Request for www.msftconnecttest.com redirected to 192.168.4.1
handleFileRead: /redirect
handleRoot()
Configuration page requested.
Rendering 'iwcThingName' with value: ESPTeamsPresence
Rendering 'iwcApPassword' with value: <hidden>
Rendering 'iwcWifiSsid' with value: 
Rendering 'iwcWifiPassword' with value: <hidden>
Rendering separator
Rendering 'clientId' with value: 
Rendering 'tenantId' with value: 
Rendering 'pollInterval' with value: 
Rendering 'numLeds' with value: 
[ 73709][E][WebServer.cpp:638] _handleRequest(): request handler not found
Request for www.msftconnecttest.com redirected to 192.168.4.1
handleFileRead: /connecttest.txt
[ 73937][E][WebServer.cpp:638] _handleRequest(): request handler not found
Request for ipv6.msftconnecttest.com redirected to 192.168.4.1
handleFileRead: /connecttest.txt
[ 74183][E][WebServer.cpp:638] _handleRequest(): request handler not found
Request for www.msftconnecttest.com redirected to 192.168.4.1
handleFileRead: /connecttest.txt
[ 74434][E][WebServer.cpp:638] _handleRequest(): request handler not found
Request for ipv6.msftconnecttest.com redirected to 192.168.4.1
handleFileRead: /connecttest.txt
Updating configuration
Value of arg 'iwcThingName' is:ESPTeamsPresence
iwcThingName='ESPTeamsPresence'
Value of arg 'iwcApPassword' is:REDACTED
iwcApPassword was set
Value of arg 'iwcWifiSsid' is:REDACTED
iwcWifiSsid='BIGGEREARS'
Value of arg 'iwcWifiPassword' is:REDACTED
iwcWifiPassword was set
Value of arg 'clientId' is:3837bbf0-30fb-47ad-bce8-f460ba9880c3
clientId='3837bbf0-30fb-47ad-bce8-f460ba9880c3'
Value of arg 'tenantId' is:REDACTED-3234-4da9-8cde-82d554e17f2b
tenantId='REDACTED-3234-4da9-8cde-82d554e17f2b'
Value of arg 'pollInterval' is:95
pollInterval='95'
Value of arg 'numLeds' is:15
numLeds='15'
Config size: 325
Saving config 'iwcThingName'= 'ESPTeamsPresence'
Saving config 'iwcApPassword'= <hidden>
Saving config 'iwcWifiSsid'= 'REDACTED'
Saving config 'iwcWifiPassword'= <hidden>
Saving config 'iwcApTimeout'= '30'
Saving config 'clientId'= '3837bbf0-30fb-47ad-bce8-f460ba9880c3'
Saving config 'tenantId'= 'REDACTED-3234-4da9-8cde-82d554e17f2b'
Saving config 'pollInterval'= '95'
Saving config 'numLeds'= '15'
Configuration was updated.
Disconnected from AP.
State changing from: 1 to 3
E (104015) wifi_netif: esp_wifi_internal_reg_rxcb for if=1 failed with 12289
E (104016) wifi_init_default: esp_wifi_register_if_rxcb for if=0x3ffb5ad8 failed with 259
Connecting to [BIGGEREARS] (password is hidden)
State changed from: 1 to 3
WiFi connecting
setAnimation: 0, 0-16, Mode: 16, Color: 255, Speed: 3000
                                                        ======================================================================
WiFi connected
IP address: RE.DA.CT.ED
State changing from: 3 to 4
Accepting connection
State changed from: 3 to 4
setAnimation: 0, 0-16, Mode: 16, Color: 65280, Speed: 3000
                                                          startMDNS()
mDNS responder started: ESPTeamsPresence.local
loadContext() - File empty
Wifi connected, waiting for requests ...
======================================================================
handleRoot()
handleStartDevicelogin()
[HTTPS] Method: POST, Response code: 200
                                        setAnimation: 0, 0-16, Mode: 16, Color: 4194432, Speed: 3000
                                                                                                    ======================================================================
pollForToken()
              [HTTPS] Method: POST, Response code: 400
                                                      pollForToken() - Wating for authorization by user: AADSTS70016: OAuth 2.0 device flow error. Authorization is pending. Continue polling. Trace ID: 8284c80a-ecdf-476b-a3ce-addf14100f00 Correlation ID: 1f30cafb-db6e-4967-8988-35a3682873f9 Timestamp: 2025-11-12 17:14:22Z

                                                                                  pollForToken()
                                                                                                [HTTPS] Method: POST, Response code: 400
                pollForToken() - Wating for authorization by user: AADSTS70016: OAuth 2.0 device flow error. Authorization is pending. Continue polling. Trace ID: 4ff6a153-64d8-45b4-8039-bf4d89150900 Correlation ID: 1f30cafb-db6e-4967-8988-35a3682873f9 Timestamp: 2025-11-12 17:14:29Z

                                            pollForToken()
                                                          [HTTPS] Method: POST, Response code: 400
                                                                                                  pollForToken() - Wating for authorization by user: AADSTS70016: OAuth 2.0 device flow error. Authorization is pending. Continue polling. Trace ID: 7d9a35b6-8c66-412b-90b7-622bd65c1100 Correlation ID: 1f30cafb-db6e-4967-8988-35a3682873f9 Timestamp: 2025-11-12 17:14:35Z

The last message repeats every 7 or so seconds.

At present, the LED lights are in a rotating animation which is pink or purple in color.

The board which I am using is labeled, ESP32 DEVKIT V1 TYPE-C.

Would you please advise?

Thank you,

Burkert

alexburkert avatar Nov 12 '25 17:11 alexburkert

Hi @alexburkert,

as already mentioned: The nocert version works perfectly fine now. No problem from the device anymore. The only thing left is to complete authentication. Then the device will work.

Your screenshot says it all: You tenant admin needs to approve your request to use the device. The admin was already notified and has now to decide if your request will be accepted or declined. If your request is approved, you just need to do auth once more and everything will be fine. As I can't help from this point on, I'll close this issue for now.

Greetings!

toblum avatar Nov 14 '25 21:11 toblum