mcolyer / smartermeter

A ruby library to access PG&E SmartMeter data
http://matt.colyer.name/projects/smartermeter/
MIT License
48 stars 15 forks source link

pachube upload failed, new issue #22

Closed tels7ar closed 12 years ago

tels7ar commented 12 years ago

Ok I have smartermeter-0.4.2 installed and that fixes the pachube errors. Now I see this:

I, [2012-02-09T07:49:16.338078 #5330]  INFO -- : Uploading 2012-02-07 to Pachube
I, [2012-02-09T07:49:16.517766 #5330]  INFO -- : Upload for 2012-02-07 failed

how do I debug this? I would assume something is wrong with my pachube info or something but I've double checked feed, api key, etc. The pachube debug console reports no activity so I would guess I'm not even getting to the authorization point or something.

mcolyer commented 12 years ago

If you git pull the latest code and then run bundler to get the new gem and finally run bundle exec smartermeter --debug it should give you the status of the pachube response. FWIW I just tried using it and it seemed to work fine, so it might just be a configuration issue.

tels7ar commented 12 years ago

Ok now we are getting closer:

D, [2012-02-10T07:04:41.529480 #6378] DEBUG -- : Pacube Response: #<Net::HTTPUnauthorized:0x00000002452408>

also note you spelled pachube wrong in that message.

Stupid question: are you supposed to put quotes around the api key? I tried both ways, didn't make a difference.

I generated my key through the pachube website under secure sharing->keys. My key has full public/private and read/write access. My .smartermeter file:

---
:start_date: 2012-02-06
:data_dir: /usr/lib/ruby/gems/1.9.1/gems/smartermeter-0.4.1/lib/data
:username: phollenback
:password: ! `XXXXXXXXXX

'
:transport: :pachube
:pachube:
  :api_key: XXXXXXXXXXX
  :feed_id: 47488
  :datastream_id: meter

feed_id and datastream_id match what pachube has on their website.

mcolyer commented 12 years ago

Something is wrong with either your feed_id or your API key. There shouldn't be any quotes around the API key. I'm not exactly sure how to debug it further to determine which of the two it is.

You might try regenerating your API key.

tels7ar commented 12 years ago

Regenerating the key fixed it, thanks!

D, [2012-02-10T16:48:23.689639 #6721] DEBUG -- : Pacube Response: #<Net::HTTPOK:0x00000000c93178>