Community Support

[This post is marked as unsolved] Issue API SDK / Access token  

  RSS
christophe
(@christophe)
Eminent Member

Hi, 

For a short time, I can see an issue in the events log, not always, but sometimes on my website, in weather station datas :

For example :

Horodatage : 2018-10-14 14:09:19 (il y a 5 heures) 
Système : API / SDK 3.6.2 
Service : Netatmo

Station : N/A (00:00:00:00:00:00) 
Module : N/A (00:00:00:00:00:00)

Code d’erreur : 
Message complet :

Detail: Array
(
[error] => Array
(
[code] => 3
[message] => Access token expired
)

Does anybody know how to solve it  

Thanks! 

This topic was modified 3 years ago by Pierre Lannoy
Quote
Posted : 14/10/2018 7:31 pm
Pierre Lannoy
(@pierre-lannoy)
Member Admin

Hello @chr-brenot!

TL;DR

That's normal (ie not an error) if you see just after this warning a notice event about regenerated token.

Long version:

You're right, you will see it sometimes. Note that's not an error (just a warning). It's the way Netatmo APIs work. Just after this warning, you can see a notice event from "Authentication" system telling that the access token (which failed some seconds ago) has been regenerated.
Netatmo uses access/refresh token paradigm for authorization to access API. It's done by exchanging an "access token" (associated with some authorizations) between the client (Weather Station, here) and the ressource provider (Netatmo, here). This token has a time-to-live and when it is expired, Netatmo refuses to answer (the warning you see). Weather Station then tries to obtain a new "access token" by using a "refresh token". If it succeeds (this is normally the case) you can see the notice event telling "all is ok", then Weather Station can resume the collect with the newly regenerated "access token".

I forgot what is the exact time-to-live of the access token for Netatmo, but you will see this warning regularly... That's not an error, just a sign your Netatmo account is "secured" from API viewpoint 😉

BTW: I've moved this question from "bug" to "question"...

This post was modified 3 years ago by Pierre Lannoy

If you like Weather Station, please consider to make a review to help make it known. That would be the best way to thank me...

ReplyQuote
Posted : 14/10/2018 8:43 pm
christophe
(@christophe)
Eminent Member

Allright! 

Thanks for your fast answer, and of course for this tool! 

ReplyQuote
Posted : 14/10/2018 8:52 pm
remember
(@remember)
Eminent Member

good afternoon
First of all, I have to congratulate you for the excellent work, I am testing the plugin and I do not know if it will be so linear, I had such a mistake and it happened in the WU.

Do these errors affect the plugin itself (data reads)?

ReplyQuote
Posted : 26/10/2018 3:35 pm
Pierre Lannoy
(@pierre-lannoy)
Member Admin

Hello @remember!

Do you mean you have a Netatmo station which produces the same warning? If so, there's definitely no impact on the plugin operations. This is the normal mode of operation for Netatmo APIs...

For your problem with WU, first of all it's not linked to the API/SDK warning. This error can have 2 reasons:

  • your cron is not reliable (have you read this?)
  • another problem with WU (WU is not reliable)

 

If you like Weather Station, please consider to make a review to help make it known. That would be the best way to thank me...

ReplyQuote
Posted : 26/10/2018 4:30 pm
remember
(@remember)
Eminent Member
Posted by: Pierre Lannoy

Hello @remember!

Do you mean you have a Netatmo station which produces the same warning? If so, there's definitely no impact on the plugin operations. This is the normal mode of operation for Netatmo APIs...

For your problem with WU, first of all it's not linked to the API/SDK warning. This error can have 2 reasons:

  • your cron is not reliable (have you read this?)
  • another problem with WU (WU is not reliable)

 

Pierre, thanks for your explanations, yes it's a netatmo. When checking the data through the graphics (plugin), there was also a glitch in the graphics, then it may be related to this problem, I'll leave it on to see what happens.

Another thing I have noticed is that in WU repeat 2 readings of x in x time, what will be the best update rate of the netatmo and how can this be done.

Thanks again, you are looking for PT translator?

ReplyQuote
Posted : 26/10/2018 4:40 pm
Pierre Lannoy
(@pierre-lannoy)
Member Admin
Posted by: remember
 
When checking the data through the graphics (plugin), there was also a glitch in the graphics, then it may be related to this problem, I'll leave it on to see what happens.
 

Ha. So the error is coming from Netatmo. If the collected data is wrong, for a reason or another, it will be wrongly sent to WU. Weather Station doesn't implements quality checking... If you see many glitches (by weeks) don't hesitate to tell it, I will contact Netatmo. But for now, it's not sufficient 😉

Posted by: remember
 
Another thing I have noticed is that in WU repeat 2 readings of x in x time, what will be the best update rate of the netatmo and how can this be done.
 

For WU, there's no "best" rate. The only important thing: it must be less than 12 minutes. And there's no way to tune it, as it is enforced by WU. Note this is not a concern that WU doubles or triples the entries, if this is consistent (from my point of view... and from theirs).

Posted by: remember
 
you are looking for PT translator?
 

Definitely YES!

At the beginning of the year, there was a person who had started translating into Portuguese. But he stopped along the way.
It would be fantastic if you are interested in continuing it. If so, please, read this... and tell me 🙂

And if you want to be Translation Editor, wow! Deal!

 

If you like Weather Station, please consider to make a review to help make it known. That would be the best way to thank me...

ReplyQuote
Posted : 26/10/2018 5:13 pm
remember
(@remember)
Eminent Member
Posted by: Pierre Lannoy
Posted by: remember
 
When checking the data through the graphics (plugin), there was also a glitch in the graphics, then it may be related to this problem, I'll leave it on to see what happens.
 

Ha. So the error is coming from Netatmo. If the collected data is wrong, for a reason or another, it will be wrongly sent to WU. Weather Station doesn't implements quality checking... If you see many glitches (by weeks) don't hesitate to tell it, I will contact Netatmo. But for now, it's not sufficient 😉

Posted by: remember
 
Another thing I have noticed is that in WU repeat 2 readings of x in x time, what will be the best update rate of the netatmo and how can this be done.
 

For WU, there's no "best" rate. The only important thing: it must be less than 12 minutes. And there's no way to tune it, as it is enforced by WU. Note this is not a concern that WU doubles or triples the entries, if this is consistent (from my point of view... and from theirs).

Posted by: remember
 
you are looking for PT translator?
 

Definitely YES!

At the beginning of the year, there was a person who had started translating into Portuguese. But he stopped along the way.
It would be fantastic if you are interested in continuing it. If so, please, read this... and tell me 🙂

And if you want to be Translation Editor, wow! Deal!

 

Thanks again for your help, yes I have translated some now with time, I translate what I can, I have already seen that there are many words!

Yes let's see what happens I will let connected to see how it behaves the repeat the two readings is that I do not understand!

If this happens again I inform you, so that you can contact netamo.

Best regards,
Alexandre Silva

ReplyQuote
Posted : 26/10/2018 6:02 pm

To participate, please connect first!