Closed kruton closed 13 years ago
It looks like the original code is working now (as the maintenance page is gone).
Can you verify that this change still works? If it does I'll go ahead and merge it as it would be more robust.
This is still not working for me. I get the following error:
I, [2011-04-25T09:02:02.214988 #83978] INFO -- : Attempting to fetch data for: 2011-04-24 I, [2011-04-25T09:02:02.215137 #83978] INFO -- : Logging in as XXXXXXXX E, [2011-04-25T09:02:03.502308 #83978] ERROR -- : Login failed. E, [2011-04-25T09:02:03.502412 #83978] ERROR -- : #<Mechanize::Page {url
{meta} {title "PG&E | Login"} {iframes} {frames} {links
{forms
{name "login"} {method "POST"} {action "/eum/login"} {fields
@name="USER",
@node=
#(Element:0x808d4430 {
name = "input",
attributes = [
#(Attr:0x808bb534 { name = "type", value = "text" }),
#(Attr:0x808bb494 { name = "class", value = "text" }),
#(Attr:0x808bb318 { name = "id", value = "username" }),
#(Attr:0x808bb250 { name = "name", value = "USER" })]
}),
@value="">
#<Mechanize::Form::Field:0x1011a2050
@name="PASSWORD",
@node=
#(Element:0x808d43a4 {
name = "input",
attributes = [
#(Attr:0x8089d778 { name = "type", value = "password" }),
#(Attr:0x8089d764 { name = "class", value = "text" }),
#(Attr:0x8089d73c { name = "id", value = "password" }),
#(Attr:0x8089d728 { name = "name", value = "PASSWORD" })]
}),
@value="">}
{radiobuttons} {checkboxes} {file_uploads} {buttons
@name=nil,
@node=
#(Element:0x808d21d0 {
name = "input",
attributes = [
#(Attr:0x80878a2c { name = "type", value = "submit" }),
#(Attr:0x80878a18 { name = "value", value = "Submit" }),
#(Attr:0x80878a04 {
name = "onclick",
value = "javascript:if (!inputValidate()) {return false;}"
}),
#(Attr:0x808789dc {
name = "class",
value = "move-forward btn-login"
})]
}),
@value="Submit">}>}>
E, [2011-04-25T09:02:03.511066 #83978] ERROR -- : If this happens repeatedly your login information may be incorrect E, [2011-04-25T09:02:03.511122 #83978] ERROR -- : Remove ~/.smartermeter and restart to re-configure smartermeter. I, [2011-04-25T09:02:03.511164 #83978] INFO -- : Successfully fetched:
Yes, it still works. It basically imitates clicking on the "Log-In" link on the main pge.com webpage.
The only problem one might run into is that the login form does not come up if you are already logged in, but I think the old way has that problem as well.
luckyspin, are you using the commit from this pull request? Also, did your log in work before?
I was not using the commit from this pull, just the default version in 0.3.3. I had reported it in #11 and that got closed in favor if this issue.
And yes, my login was working before a few days ago.
Try pulling the commit from this issue and see if it fixes the problem.
I am just going to include your change as it works in both cases. @kruton Thanks for digging into that!
I pulled the commit and now I have a different error:
E, [2011-04-30T16:54:40.575374 #14278] ERROR -- : undefined method USER=' for nil:NilClass (NoMethodError) /Library/Ruby/Gems/1.8/gems/smartermeter-0.3.3/lib/smartermeter/service.rb:36:in
login'
(eval):12:in form_with' /Library/Ruby/Gems/1.8/gems/smartermeter-0.3.3/lib/smartermeter/service.rb:35:in
login'
/Library/Ruby/Gems/1.8/gems/mechanize-1.0.0/lib/mechanize.rb:262:in get' /Library/Ruby/Gems/1.8/gems/smartermeter-0.3.3/lib/smartermeter/service.rb:34:in
login'
/Library/Ruby/Gems/1.8/gems/smartermeter-0.3.3/lib/smartermeter/daemon.rb:145:in service' /Library/Ruby/Gems/1.8/gems/smartermeter-0.3.3/lib/smartermeter/daemon.rb:166:in
connect'
/Library/Ruby/Gems/1.8/gems/smartermeter-0.3.3/lib/smartermeter/daemon.rb:178:in fetch_dates' /Library/Ruby/Gems/1.8/gems/smartermeter-0.3.3/lib/smartermeter/daemon.rb:126:in
run'
/Library/Ruby/Gems/1.8/gems/smartermeter-0.3.3/lib/smartermeter/daemon.rb:19:in start' /Library/Ruby/Gems/1.8/gems/smartermeter-0.3.3/bin/smartermeter:11 /usr/bin/smartermeter:19:in
load'
/usr/bin/smartermeter:19
E, [2011-04-30T16:54:40.575529 #14278] ERROR -- : If this happens repeatedly your login information may be incorrect
E, [2011-04-30T16:54:40.575566 #14278] ERROR -- : Remove ~/.smartermeter and restart to re-configure smartermeter.
I, [2011-04-30T16:54:40.575611 #14278] INFO -- : Successfully fetched:
^C/Library/Ruby/Gems/1.8/gems/smartermeter-0.3.3/lib/smartermeter/daemon.rb:131:in sleep': Interrupt from /Library/Ruby/Gems/1.8/gems/smartermeter-0.3.3/lib/smartermeter/daemon.rb:131:in
run'
from /Library/Ruby/Gems/1.8/gems/smartermeter-0.3.3/lib/smartermeter/daemon.rb:19:in start' from /Library/Ruby/Gems/1.8/gems/smartermeter-0.3.3/bin/smartermeter:11 from /usr/bin/smartermeter:19:in
load'
from /usr/bin/smartermeter:19
Any insight into what is causing this?
Are you sure you're using the latest master? It looks like you are using the v0.3.3 release according to the backtrace (which doesn't contain this change). That said, it should still work as that's the version I'm currently running.
However the error seems to indicate that SmarterMeter can't find the login form.
Try visiting http://www.pge.com/myhome/ and verify that the login form element action equals https://www.pge.com/eum/login.
For some reason the login stopped working for me, but changing it to this seems to have fixed it.