when following the sketch you propose to record data on Googler sheet, I receive the error -111
System time or library reference was not set
What do I need to do? what is the reason?
Hi.
Can you share more details about the error.?
One of our readers shared the following advice. Let me know if this helps.
”
Thank you for the hand-holding to get through this!
I solved a problem that others might find useful. After following your instructions exactly, I got the following error:
Token info: type = OAuth2.0 access token, status = on exchange request
Token info: type = OAuth2.0 access token, status = error
Token error: code: -1, message: Missing required parameter: assertion
What happened is that:
– I used a project name containing spaces, which Google automatically converted to hyphens in the service account.
– when copying the JSON file that includes the private key to my computer, I used the Windows default app Notepad.
– When I pasted the Notepad entry for “client_email” into the Arduino IDE, the IDE incorrectly added spaces between the hyphens. The IDE did this all by itself – must be some kind of bug. I checked this several times and each time the behavior was the same – it added unwanted spaces to the name. Those spaces had to be removed for the OAuth2.0 error to go away, leading to the lovely:
Token info: type = OAuth2.0 access token, status = on initializing
Token info: type = OAuth2.0 access token, status = on signing
Token info: type = OAuth2.0 access token, status = on exchange request
Token info: type = OAuth2.0 access token, status = ready
and a working ESP32-S2 -> Gsheets link!
(except every entry into the spreadsheet is repeated twice, I’ll have to figure that out later)
This might save someone some time to figure out at least a potential solution for the “OAuth2.0 access token, status = error” issue
“
there are ideas in your solution but not exactly the same
See the message
Very strange, it seems to work sometimes and sometimes I get the “error”
I though it was because the sheet was open on another computer when trying to connect to the sheet with the ESP
Be aware that I am using the Goggle sheet in French
Below are the message
16:14:28.785 -> Connecting to Wi-Fi..................
16:14:46.770 -> Connected with IP: 192.168.0.211
16:14:46.809 ->
16:14:46.809 -> Token info: type = OAuth2.0 access token, status = on initializing
16:15:06.807 -> Token info: type = OAuth2.0 access token, status = error
16:15:06.807 -> Token error: code: -111, message: System time or library reference time was not set. Use GSheet.setSystemTime to set time.
sorry, it seems the copy of message was poor format
Below is better for reading
16:43:16.617 -> Token info: type = OAuth2.0 access token, status = on initializing
16:43:26.586 -> Token info: type = OAuth2.0 access token, status = error
16:43:26.621 -> Token error: code: -111, message: System time or library reference time was not set. Use GSheet.setSystemTime to set time.
16:43:46.630 -> Token info: type = OAuth2.0 access token, status = error
16:43:46.630 -> Token error: code: -111, message: System time or library reference time was not set. Use GSheet.setSystemTime to set time.
16:44:06.605 -> Token info: type = OAuth2.0 access token, status = error
How to procees with this timeset
I have set my region and Time in the settings : UTC+01
sorry, it seems the copy of message was poor format
Below is better for reading
16:43:16.617 -> Token info: type = OAuth2.0 access token, status = on initializing
16:43:26.586 -> Token info: type = OAuth2.0 access token, status = error
16:43:26.621 -> Token error: code: -111, message: System time or library reference time was not set. Use GSheet.setSystemTime to set time.
16:43:46.630 -> Token info: type = OAuth2.0 access token, status = error
16:43:46.630 -> Token error: code: -111, message: System time or library reference time was not set. Use GSheet.setSystemTime to set time.
16:44:06.605 -> Token info: type = OAuth2.0 access token, status = error
How to procees with this timeset
I have set my region and Time in the settings : UTC+01