HTTP Error 401: Unauthorized

207 views
Skip to first unread message

Pablo Revilla

unread,
Sep 13, 2020, 12:21:31 AM9/13/20
to weewx-user
I am trying to update wunderground but it is not letting me.
I am also attaching the config section.

Any ideas?

Sep 12 21:15:23 plex weewx[4240] DEBUG weewx.restx: Wunderground-PWS: Failed upload attempt 1: HTTP Error 401: Unauthorized
Sep 12 21:15:29 plex weewx[4240] DEBUG weewx.restx: Wunderground-PWS: Failed upload attempt 2: HTTP Error 401: Unauthorized
Sep 12 21:15:34 plex weewx[4240] DEBUG weewx.restx: Wunderground-PWS: Failed upload attempt 3: HTTP Error 401: Unauthorized
Sep 12 21:15:34 plex weewx[4240] ERROR weewx.restx: Wunderground-PWS: Failed to publish record 2020-09-12 21:15:00 PDT (1599970500): Failed upload after 3 tries


  [[Wunderground]]
        # This section is for configuring posts to the Weather Underground.

        # If you wish to do this, set the option 'enable' to true,
        # and specify a station (e.g., 'KORHOODR3') and password.
        # To guard against parsing errors, put the password in quotes.
        enable = True
        station =KCASANJO1246
        password ='mywundergroundpassword'

        # If you plan on using wunderfixer, set the following
        # to your API key:
        api_key ="myapikey"

        # Set the following to True to have weewx use the WU "Rapidfire"
        # protocol. Not all hardware can support it. See the User's Guide.
        rapidfire = False

##############################################################################

Tom Keffer

unread,
Sep 13, 2020, 9:00:50 AM9/13/20
to weewx-user
Things to try:

1. Double check your password. Did you get it correct?
2. Does your password include the pound ('#') character? If so, ConfigObj will interpret it as a comment. Put the password in quotes.
3. Does it contain the single quote ("'") character? If so, the password will need to be put in double quotes. 
4. Same with the double quote ('"') character. Put the password in single quotes.

-tk

--
You received this message because you are subscribed to the Google Groups "weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-user+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/a4a42717-c626-4077-98f9-15ed3d2d9d1cn%40googlegroups.com.

Pablo Revilla

unread,
Sep 13, 2020, 6:33:35 PM9/13/20
to weewx...@googlegroups.com
Tom, thank you for your reply.

I am using the "ID" and the "Key", do I need a special membership to upload my data to WU?

image.png

You received this message because you are subscribed to a topic in the Google Groups "weewx-user" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/weewx-user/ktAx0U5qias/unsubscribe.
To unsubscribe from this group and all its topics, send an email to weewx-user+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/CAPq0zEAPLTAGUqGJz%2BPXgOfswA6e3j3JEA9wfNXfMc%2BNfe0Lkw%40mail.gmail.com.

Tom Keffer

unread,
Sep 13, 2020, 6:48:38 PM9/13/20
to weewx-user
To upload, you need a station ID and your user password.

To download, you need a station ID and an API key.

Do, in this case, you need the former.

I don't know why the WU makes it so confusing. You're not the first to get tripped up by this.

-tk


Ken Waters

unread,
Sep 14, 2020, 12:39:06 AM9/14/20
to weewx...@googlegroups.com
I'm in the same boat with the same result as Pablo.  Running version 3.9.2 on Ubuntu Linux.  
Password is good, I double-checked it, and put it in single quotes (also tried it in double quotes).  Per your post, I am using my login password.

weewx.conf:
    [[Wunderground]]
        # This section is for configuring posts to the Weather Underground.

        # If you wish to do this, set the option 'enable' to true,
        # and specify a station (e.g., 'KORHOODR3') and password.
        # To guard against parsing errors, put the password in quotes.
        enable = true
        station = KAZMESA460
        password = '********'


        # Set the following to True to have weewx use the WU "Rapidfire"
        # protocol. Not all hardware can support it. See the User's Guide.
        rapidfire = False

syslog (after stop/start):
Sep 13 21:31:15 WeewxWeatherServer weewx[3369]: restx: Wunderground-PWS: Failed upload attempt 1: HTTP Error 401: Unauthorized
Sep 13 21:31:20 WeewxWeatherServer weewx[3369]: restx: Wunderground-PWS: Failed upload attempt 2: HTTP Error 401: Unauthorized
Sep 13 21:31:26 WeewxWeatherServer weewx[3369]: restx: Wunderground-PWS: Failed upload attempt 3: HTTP Error 401: Unauthorized
Sep 13 21:31:31 WeewxWeatherServer weewx[3369]: restx: Wunderground-PWS: Failed to publish record 2020-09-13 21:31:00 MST (1600057860): Failed upload after 3 tries

https://www.wunderground.com/member/devices:
image.png

So, I'll be watching to see how Pablo and others respond.

Thanks!

Ken

Ken Waters

unread,
Sep 14, 2020, 12:44:22 AM9/14/20
to weewx...@googlegroups.com
Hi Pablo,

I just noticed your conf file shows station ID:  KCASANJO1246 whereas your WUnderground devices shows KCASANJO1247.  Could that be the issue?

Ken

Tom Keffer

unread,
Sep 14, 2020, 7:02:42 AM9/14/20
to weewx-user
Pablo: as per Ken's suggestion, straighten out your station ID

Both: The WU has taken the station ID plus user password in the past, and that's what my station is using right now. But, now I see in the upload protocol notes that we should use the "Station Key registered with this PWS ID, case sensitive." Have you both tried the field "Key"?

-tk

Pablo Revilla

unread,
Sep 14, 2020, 12:26:15 PM9/14/20
to weewx...@googlegroups.com
no, actually I deleted everything and tried again that is why they are different.  but the id and password match.
:)

On Sun, Sep 13, 2020 at 9:44 PM Ken Waters <satwa...@gmail.com> wrote:

Ken Waters

unread,
Sep 14, 2020, 3:27:45 PM9/14/20
to weewx...@googlegroups.com
I tried it with both of them and still got rejected.

Ken

Tom Keffer

unread,
Sep 14, 2020, 3:34:26 PM9/14/20
to weewx-user
One last thing to try, although it's a long shot. Set debug=2. This will log extra debugging information, including the URL used to post to the WU. It will also obfuscate your password, so it won't help there, but at least we can see if the URL is well formed.

But, I doubt it will reveal anything.

-tk

Arend

unread,
Sep 14, 2020, 4:31:05 PM9/14/20
to weewx-user
I am uploading to Wunderground without using single or double quotes on my station name and password. Only that way I could get it to work.

Op maandag 14 september 2020 om 21:34:26 UTC+2 schreef tke...@gmail.com:

Ken Waters

unread,
Sep 14, 2020, 4:31:35 PM9/14/20
to weewx...@googlegroups.com
I finally got it working.  It *does* work by using the key.  I still get reject notices but then periodically I get one that shows it published and now I do get the "green light" when I log into the site.

Here are my log entries showing before and then after it started sending:

Sep 14 12:23:32 WeewxWeatherServer weewx[3369]: restx: Wunderground-PWS: Failed to publish record 2020-09-14 12:23:00 MST (1600111380): Failed upload after 3 tries
Sep 14 12:24:16 WeewxWeatherServer weewx[3369]: restx: Wunderground-PWS: Failed upload attempt 1: HTTP Error 401: Unauthorized
Sep 14 12:24:22 WeewxWeatherServer weewx[3369]: restx: Wunderground-PWS: Failed upload attempt 2: HTTP Error 401: Unauthorized
Sep 14 12:24:27 WeewxWeatherServer weewx[3369]: restx: Wunderground-PWS: Failed upload attempt 3: HTTP Error 401: Unauthorized
Sep 14 12:24:32 WeewxWeatherServer weewx[3369]: restx: Wunderground-PWS: Failed to publish record 2020-09-14 12:24:00 MST (1600111440): Failed upload after 3 tries
Sep 14 12:25:16 WeewxWeatherServer weewx[3369]: restx: Wunderground-PWS: Failed upload attempt 1: HTTP Error 401: Unauthorized
Sep 14 12:25:22 WeewxWeatherServer weewx[3369]: restx: Wunderground-PWS: Failed upload attempt 2: HTTP Error 401: Unauthorized
Sep 14 12:25:27 WeewxWeatherServer weewx[3369]: restx: Wunderground-PWS: Failed upload attempt 3: HTTP Error 401: Unauthorized
Sep 14 12:25:32 WeewxWeatherServer weewx[3369]: restx: Wunderground-PWS: Failed to publish record 2020-09-14 12:25:00 MST (1600111500): Failed upload after 3 tries

[restarted weewx]

Sep 14 12:25:32 WeewxWeatherServer weewx[3369]: restx: Shut down Wunderground-PWS thread.
Sep 14 12:25:36 WeewxWeatherServer weewx[23403]: engine: Loading service weewx.restx.StdWunderground
Sep 14 12:25:36 WeewxWeatherServer weewx[23403]: restx: Wunderground-PWS: Data for station KAZMESA460 will be posted
Sep 14 12:25:36 WeewxWeatherServer weewx[23403]: engine: Finished loading service weewx.restx.StdWunderground

Sep 14 12:26:16 WeewxWeatherServer weewx[23403]: restx: Wunderground-PWS: Failed upload attempt 1: HTTP Error 401: Unauthorized
Sep 14 12:26:22 WeewxWeatherServer weewx[23403]: restx: Wunderground-PWS: Failed upload attempt 2: HTTP Error 401: Unauthorized
Sep 14 12:26:27 WeewxWeatherServer weewx[23403]: restx: Wunderground-PWS: Failed upload attempt 3: HTTP Error 401: Unauthorized
Sep 14 12:26:32 WeewxWeatherServer weewx[23403]: restx: Wunderground-PWS: Failed to publish record 2020-09-14 12:26:00 MST (1600111560): Failed upload after 3 tries
Sep 14 12:27:16 WeewxWeatherServer weewx[23403]: restx: Wunderground-PWS: Failed upload attempt 1: HTTP Error 401: Unauthorized
Sep 14 12:27:22 WeewxWeatherServer weewx[23403]: restx: Wunderground-PWS: Failed upload attempt 2: HTTP Error 401: Unauthorized
Sep 14 12:27:27 WeewxWeatherServer weewx[23403]: restx: Wunderground-PWS: Published record 2020-09-14 12:27:00 MST (1600111620)

image.png

Ken

Tom Keffer

unread,
Sep 14, 2020, 4:49:51 PM9/14/20
to weewx-user
So, the conclusion is that it's normal WU flakiness, plus an unpublished API change?

Pablo Revilla

unread,
Sep 17, 2020, 11:43:45 AM9/17/20
to weewx...@googlegroups.com
Mine is also working now... no changes from my side. I am getting updates every 30 mins or so... still get lots of errors.

Thanks, everyone for the help! I am using the Station ID and the Key to submit my data.

Pablo

On Mon, Sep 14, 2020 at 12:34 PM Tom Keffer <tke...@gmail.com> wrote:
Reply all
Reply to author
Forward
0 new messages