Uploading data to WU from raspberry pi (newbie)

  • 1
  • Question
  • Updated 2 days ago
Hi All
I am very new to all this and just wanted someone to say it is or is not possible. I have a raspberry pi weather station and I am trying to upload my data to WU using python. I keep getting "401 unauthorized" errors, however my station ID and password are correct. I then read that the WU API has been retired. Is this my problem?

In WU, I can see my device status is OFFLINE. Is this normal?

Thanks in advance.
Tom
Photo of Tom

Tom

  • 7 Posts
  • 2 Reply Likes

Posted 3 weeks ago

  • 1
Photo of John Renyard

John Renyard

  • 6 Posts
  • 0 Reply Likes
I use Meteohub and another family member does too
https://wiki.meteohub.de/Buy_Software Download there.  It is very configurable for several sites
(Edited)
Photo of Claude Felizardo

Claude Felizardo

  • 38 Posts
  • 8 Reply Likes
I am using a very old and possibly no longer supported c++ program called OWW that still uses the original upload API.  OWW doesn't handle errors very well so I periodically have to restart which I just had to do but it is uploading correctly right now and I am now seeing my PWS on the wunderground website as well as CWOP, MesoWest and FindU.
Photo of Claude Felizardo

Claude Felizardo

  • 38 Posts
  • 8 Reply Likes
I did a google search for "wunderground upload protocol" and it looks like the first hit leads to a valid URL

https://feedback.weather.com/customer/en/portal/articles/2924682-pws-upload-protocol?b_id=17298

Looks like a 401 means your ID and PASSWORD don't match.  

Other useful links:

https://www.wunderground.com/pws/hardware-software

Photo of Tom

Tom

  • 7 Posts
  • 2 Reply Likes
Thanks guys, however the question still remains, is what I am trying to do possible ? Thanks
Photo of Claude Felizardo

Claude Felizardo

  • 38 Posts
  • 8 Reply Likes
Hi Tom, as I mentioned in my first reply the upload API is working using a C program that has not been modified in years.  I misspoke when I said OWW was written in C++, it's actually written in regular C. I use C++ at work so it must have been muscle memory when I typed that.  It should not matter if you use Python or any other prgramming language.  

I do plan to redo my PWS system probably using an old RaspPi I have lying around and will probably use Python unless I can find another package that already does most of what I want to do.  

What has changed is the download API is no longer valid.  I was able to find an update for my Logitech Media Server that just worked but my ElectricImp program stopped working and I haven't had time to fix it.

If you are getting a 401 while trying to do an upload, then either your ID is wrong or your PASSWORD is incorrect.  

Claude
Photo of Tom

Tom

  • 7 Posts
  • 2 Reply Likes
Thanks Claude, I got it to work !
My misunderstand, the password is not my login password, it is the "key" in the devices section. My bad. Thanks to ALL !
Photo of Claude Felizardo

Claude Felizardo

  • 38 Posts
  • 8 Reply Likes
Great.  So, is this a COTS PWS or DIY?  What kind of sensors?
Photo of Tom

Tom

  • 7 Posts
  • 2 Reply Likes
DIY. Pretty basic setup using sparkfun weather meter  SEN-08942 (rainfall, wind speed & direction) and adafruit BME280 (temp, pressure, humidity). Thanks again !
Photo of Tom

Tom

  • 7 Posts
  • 2 Reply Likes
Hi All, I am successfully uploading from my raspberry pi and I can see the data in my "Station Summary". The data looks 100% ok. The only annoying thing is the units of pressure. It is shown in hPa, however I would prefer mBar. I have searched, is it possible to change. It is easy to change from deg F to deg C, but cant see a pressure unit setting. Thanks alot
Photo of Detmar Berg

Detmar Berg

  • 21 Posts
  • 0 Reply Likes
I am lockink för the comopleate sckill
Photo of Claude Felizardo

Claude Felizardo

  • 38 Posts
  • 8 Reply Likes
Hi Tom, I'm looking at rebuilding my weather station.  What software are you using with your Raspberry Pi?
Photo of Tom

Tom

  • 7 Posts
  • 2 Reply Likes
Hi Claude, I use python. Here is a link to what i followed to build it. Software instructions are included. 
https://projects.raspberrypi.org/en/projects/build-your-own-weather-station
Photo of Claude Felizardo

Claude Felizardo

  • 38 Posts
  • 8 Reply Likes
Hi Tom,  Yes I started looking at that website last night. I have a lot of 1-wire sensors and I wasn't sure if this program would support my sensors without a lot of mods.  It looks like they make use of Initial State for a dashboard but I believe is not normally free and Oracle Cloud whereas I'd prefer to store my data locally using something like MySQL.  I have a Purple Air sensor which I believe uses a BME280 as well.  I'm also thinking of using MQTT to with one or more ESP8266 which have built-in WiFi.
Photo of Tom

Tom

  • 7 Posts
  • 2 Reply Likes
Hi Claude, I am no python expert, but i think you could use the examples on that webpage to help implement your stuff. My weather station is up and going but is 100% finished. I need to reset the rain every 24 hrs etc and calculate hourly rain fall. Here is another page which is useful. It is how i upload my info to weatherunderground. I then use a free app called "PWS monitor" to view my info.

Note: In section “Using Python to upload your data”, there is a mistake in the python. Command should be request.post, not requests.get.

https://projects.raspberrypi.org/en/projects/uploading-weather-data-to-weather-underground/4