matthewwall / weewx-netatmo

weewx driver for netatmo weather station
GNU General Public License v3.0
7 stars 16 forks source link

HTTP 400 Error #5

Closed robfwtx closed 6 years ago

robfwtx commented 6 years ago

From syslog...

Nov 8 12:36:16 nas weewx[26867]: restx: WOW: Posting not enabled. Nov 8 12:36:16 nas weewx[26867]: restx: AWEKAS: Posting not enabled. Nov 8 12:36:16 nas weewx[26867]: engine: Starting up weewx version 3.7.1 Nov 8 12:36:16 nas weewx[26867]: engine: Starting main packet loop. Nov 8 12:36:16 nas weewx[26867]: netatmo: netatmo-client: failed attempt 1 of 5 to get data: HTTP Error 400: Nov 8 12:36:27 nas weewx[26867]: netatmo: netatmo-client: failed attempt 2 of 5 to get data: HTTP Error 400: Nov 8 12:36:38 nas weewx[26867]: netatmo: netatmo-client: failed attempt 3 of 5 to get data: HTTP Error 400: Nov 8 12:36:48 nas weewx[26867]: netatmo: netatmo-client: failed attempt 4 of 5 to get data: HTTP Error 400: Nov 8 12:36:59 nas weewx[26867]: netatmo: netatmo-client: failed attempt 5 of 5 to get data: HTTP Error 400: Bad Request Nov 8 12:37:09 nas weewx[26867]: netatmo: netatmo-client: failed to get data after 5 attempts

What am I missing in my setup? I have my keys entered and set the netatmo "app" active.

robfwtx commented 6 years ago

Bad URL. Should be .com instead of .net.

ref: https://dev.netatmo.com/resources/technical/samplessdks/codesamples#getstationsdata

robfwtx commented 6 years ago

Ok, I'm lost. To complete the App registration, I'm missing two things: Webhook and Redirect URI. Where do I find examples of what has to be setup for this App to work with your script?

matthewwall commented 6 years ago

what are 'Webhook' and 'Redirect URL'?

you need 4 things from netatmo: username, password, client id, and client secret.

this is my netatmo stanza from weewx.conf, and it has been working for a couple of years now:

[netatmo]
    mode = cloud
    username = xxxx
    password = xxxx
    client_id = xxxx
    client_secret = xxxx
    driver = user.netatmo
matthewwall commented 6 years ago

the username and password are whatever you use to login to netatmo.com

the client id and client secret are generated by netatmo.com when you create an app in the developer pages

you do not need redirect uri or webhook url or anything else on the app creation page

matthewwall commented 6 years ago

no activity on this, so i am assuming that everything is working as designed.

thk70 commented 6 years ago

I just tried and got the same issue. However it looks like the driver initialization doesen't write the authentication parameters in the weewx.conf file. Entering the manually afterwards works.

Can the five minute interval of the data fetching be changed (lowered)?

Thank you for the driver.

WiggyToo commented 5 years ago

@thk70 Thanks - this fixed it for me, same thing - the values had to be entered manually @matthewwall Many thanks for writing the driver