• Skip to main content
  • Skip to primary sidebar

RNTLab.com

The Ultimate Shortcut to Learn Electronics and Programming with Open Source Hardware and Software

  • Courses
  • Forum
    • Forum
    • Ask Question
  • Shop
  • Account
  • Blog
  • Login

Data Logging to Google sheet ERROR -111

Q&A Forum › Category: ESP32 › Data Logging to Google sheet ERROR -111
0 Vote Up Vote Down
Michel Dubois asked 4 months ago

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?

6 Answers
0 Vote Up Vote Down
Sara Santos Staff answered 4 months ago

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
 
“

0 Vote Up Vote Down
Sara Santos Staff answered 4 months ago

Let me know if this helps, or if the issue persists.
Regards,
Sara

0 Vote Up Vote Down
Michel Dubois answered 4 months ago

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.
 

 

0 Vote Up Vote Down
Michel Dubois answered 4 months ago

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

0 Vote Up Vote Down
Michel Dubois answered 4 months ago

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

0 Vote Up Vote Down
Sara Santos Staff answered 4 months ago

Hi.
I just tested the project and everything is working as expected.
 
Don’t change the time in the code. Let it be as it is. Let me know if that fixes the issue.
Regards,
Sara

Primary Sidebar

Login to Ask or Answer Questions

This Forum is private and it’s only available for members enrolled in our Courses.

Login »

Latest Course Updates

  • [New Edition] Build ESP32-CAM Projects eBook – 2nd Edition April 16, 2025
  • [eBook Updated] Learn ESP32 with Arduino IDE eBook – Version 3.2 April 16, 2025

You must be logged in to view this content.

Contact Support - Refunds - Privacy - Terms - MakerAdvisor.com - Member Login

Copyright © 2013-2025 · RandomNerdTutorials.com · All Rights Reserved

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.