User Tools

Site Tools


auto-oz

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
auto-oz [2010/08/19 09:54]
gabe created
auto-oz [2013/09/28 16:06] (current)
Line 1: Line 1:
 ====== auto-oz ====== ====== auto-oz ======
 +
 +===== Updates =====
 +==== May 11 2011 ====
 +My service expired last night. My renew script still isn't working, but I didn't try very hard. All I did was run:<​code>​
 +curl -K curlcfg2 http://​google.com -v
 +curl -K curlcfg2 http://​phc.prontonetworks.com/​cgi-bin/​authlogin -v
 +curl -K curlcfg2 "​https://​register.prontonetworks.com/​registration/​Main.jsp?​wispId=5338&​nasId=00:​1b:​24:​78:​ab:​82&​tempName=selAuth&​orgUrl=&​userMacId=00:​23:​69:​b3:​ce:​65"​ -v -c /​tmp/​cookiejar
 +curl -K curlcfg2 -d '​username=$$$$$$$$&​password=$$$$$$$$&​changePassword='​ "​https://​register.prontonetworks.com/​registration/​customization/​default/​CheckValidUserToLogin.jsp"​ -v -b /​tmp/​cookiejar -c /​tmp/​cookiejar
 +curl -K curlcfg2 https://​register.prontonetworks.com/​registration/​chooseAuth.do -d '​loginUserId=$$$$$$$$&​loginPassword=$$$$$$$$&​authType=Pronto'​ -e "​https://​register.prontonetworks.com/​registration/​customization/​default/​CheckValidUserToLogin.jsp"​ -v -b /​tmp/​cookiejar -c /​tmp/​cookiejar ​
 +curl -K curlcfg2 https://​register.prontonetworks.com/​registration/​buyAPlan.do -d '​planId=#############&​rPM=Yes&​selectPG=Verisign&​agree=agree'​ -v -b /​tmp/​cookiejar -c /​tmp/​cookiejar ​
 +curl -K curlcfg2 https://​register.prontonetworks.com/​registration/​buyAPlanConfirm.do -d '​planId=#############&​planType=PREPAID&​requestComingFrom=BuyAPlan&​paymentMethodId=CC&​customerId=#############&​creditCardNumber=################&​creditCardId=#############'​ -v -c /​tmp/​cookiejar -b /​tmp/​cookiejar ​
 +curl -K curlcfg2 https://​register.prontonetworks.com/​registration/​process.jsp -v -b /​tmp/​cookiejar -c /​tmp/​cookiejar ​
 +curl -K curlcfg2 https://​phc.prontonetworks.com/​cgi-bin/​authlogin -d '​serviceName=ProntoAuthentication&​userId=$$$$$$$$&​password=$$$$$$$$'​ -v -b /​tmp/​cookiejar -c /​tmp/​cookiejar
 +curl -K curlcfg2 "​http://​www.onezone.ca/​wifi/​wifi_success.html?​wispId=5338&​nasId=00:​1b:​24:​78:​ab:​82&​newReg=Y&​sessionId=#############&​freePlan=N"​ -v -b /​tmp/​cookiejar -c /​tmp/​cookiejar
 +curl -K curlcfg2 "​http://​www.onezone.ca/​wifi/​wifi_checkaccount.html?​wispId=5338&​sessionId=#############&​nasId=00:​1b:​24:​78:​ab:​82&​newReg=Y"​ -v -b /​tmp/​cookiejar -c /​tmp/​cookiejar
 +curl -K curlcfg2 "​https://​register.prontonetworks.com/​registration/​Main.jsp?​wispId=5338&​nasId=00:​1b:​24:​78:​ab:​82&​sessionId=#############"​ -v -b /​tmp/​cookiejar -c /​tmp/​cookiejar
 +</​code>​
 +You need the file /​sbin/​curlcfg2,​ which contains:<​code>​
 +-A "​Mozilla/​5.0 (iPhone; U; CPU iPhone OS 2_2_1 like Mac OS X; en-us) AppleWebKit/​525.18.1 (KHTML, like Gecko) Version/​3.1.1 Mobile/5H11 Safari/​525.20"​
 +-k
 +</​code>​
 +
 +Note that you'll need to replace "​$$$$$$$$"​ with your username or password as appropriate,​ and "#############"​ with whatever the appropriate number is, matching whatever was received in the results of the last command. If you run these commands twice, it'll bill your account twice, but give you two months of service. You can confirm this by checking your oz account info (for which you don't need cookies):
 +  - Go to http://​www.onezone.ca/​wifi/​myaccount.html?​wispId=5338&​nasId=00:​1b:​24:​78:​ab:​82 (from anywhere)
 +  - Click My Account
 +  - Log in with username and password
 +  - Click Home
 +
 +
 +==== April 13 2011 ====
 +I was expecting the service at SLM to die on Sunday (10th), but it was still running until 2am last night. When I got in today, there were 53 instances of '​onezone-check.pl'​ running on the auto-oz router, each one also having an instance of udhcpc. I ran:
 +<​code>​killall onezone-check.pl</​code>​
 +And then:
 +<​code>/​sbin/​onezone-check.pl</​code>​
 +And we were online. So maybe Onezone didn't log us out; maybe the router was just choking. Just to see what would happen, I ran:
 +<​code>​cd /sbin
 +./​onezone-logout.sh
 +./​onezone-check.pl</​code>​
 +And it came up fine. 
 +
 +So, last time I was here I ran the renew script a second time to see if it would credit me another month. At the time I remember thinking that it hadn'​t. But looking now, it's not set to expire until May 10th. 
 +
 +Unfortunately,​ I can't get the renew script to run anymore. When it tries to run the shell onezone-Mainjsp.sh script, it hangs. Launching curl from a shell script from a perl script was working before, but appears not to now. I rebooted the router; same problem. I tried setting a timeout in curl by setting '-m 10' in curlcfg, but that didn't do anything.
 +
 +==== March 3 2011 ====
 +<​code>​
 +what's happening is that on this command:
 +curl -K curlcfg https://​register.prontonetworks.com/​registration/​customization/​default/​CheckValidUserToLogin.jsp -d "​username=XXX&​password=YYYYYY&​changePassword="​ -e "​https://​register.prontonetworks.com/​registration/​Main.jsp?​wispId=5338&​nasId=00:​1b:​24:​78:​ab:​82&​tempName=selAuth&​orgUrl=&​userMacId=00:​23:​69:​b3:​ce:​65"​ -b /​tmp/​cookiejar
 +
 +onezone returns:
 +Session Timed out. Error in Proceeding Further. Please close and restart your browser.
 +
 +I tried removing the "-b /​tmp/​cookiejar"​ from the command, and it does the same thing.
 +
 +So, I guess we need to go further back to find the spot it stop complaining about this. Let's try:
 +curl -K curlcfg "​https://​register.prontonetworks.com/​registration/​Main.jsp?​wispId=5338&​nasId=00:​1b:​24:​78:​ab:​82&​tempName=selAuth&​orgUrl=&​userMacId=00:​23:​69:​b3:​ce:​65"​ -b /​tmp/​cookiejar
 +curl -K curlcfg https://​register.prontonetworks.com/​registration/​customization/​default/​CheckValidUserToLogin.jsp -d "​username=XXX&​password=YYYYYY&​changePassword="​ -e "​https://​register.prontonetworks.com/​registration/​Main.jsp?​wispId=5338&​nasId=00:​1b:​24:​78:​ab:​82&​tempName=selAuth&​orgUrl=&​userMacId=00:​23:​69:​b3:​ce:​65"​ -c /​tmp/​cookiejar
 +
 +Same problem. Check the cookies. It's setting the same one:
 +register.prontonetworks.com FALSE /​registration TRUE 0 JSESSIONID 0a0a0a4730d54b28d991910e4309a603ca5a1fbe4e94.e3yQbx4TbNeLe34Lb3mKchePbhn0n6jAmljGr5XDqQLvpAe
 +register.prontonetworks.com FALSE /​registration TRUE 0 JSESSIONID 0a0a0a4730d54b28d991910e4309a603ca5a1fbe4e94.e3yQbx4TbNeLe34Lb3mKchePbhn0n6jAmljGr5XDqQLvpAe
 +
 +Let's try deleting the cookie file.
 +rm /​tmp/​cookiejar
 +curl -K curlcfg "​https://​register.prontonetworks.com/​registration/​Main.jsp?​wispId=5338&​nasId=00:​1b:​24:​78:​ab:​82&​tempName=selAuth&​orgUrl=&​userMacId=00:​23:​69:​b3:​ce:​65"​ -c /​tmp/​cookiejar
 +
 +It gave us the same cookie again:
 +register.prontonetworks.com FALSE /​registration TRUE 0 JSESSIONID 0a0a0a4730d5cfc25258927348bb8e5af08d27bdf765.e3yQbx4TbNeLe34Lb3mKchePbhn0n6jAmljGr5XDqQLvpAe
 +
 +Well, let's keep going:
 +curl -K curlcfg https://​register.prontonetworks.com/​registration/​customization/​default/​CheckValidUserToLogin.jsp -d "​username=XXX&​password=YYYYYY&​changePassword="​ -e "​https://​register.prontonetworks.com/​registration/​Main.jsp?​wispId=5338&​nasId=00:​1b:​24:​78:​ab:​82&​tempName=selAuth&​orgUrl=&​userMacId=00:​23:​69:​b3:​ce:​65"​ -b /​tmp/​cookiejar
 +
 +This time it didn't return the session timeout message. I think maybe it's because I had my "​-b"​ and "​-c"​ confused on the commandline. -b is to read, -c is to write.
 +
 +Let's run the script again:
 +./​onezone-renew.pl
 +
 +It did the same thing: die at ./​onezone-renew.pl line 67.
 +
 +[.......]
 +
 +The renew wasn't working and so I logged in manually through my browser to try to see what was up. All I did was log in and the whole rig started working immediately.
 +
 +So... that means there'​s something'​s wrong with the onezone-login.sh script. It looks like that script isn't reading cookies, which is maybe the problem. ​
 +This is awkward, because when the login doesn'​t work, the onezone-check script going straight to try to renew. Awkward, eh?
 +
 +So, I modified onezone-login.sh to get a cookie, and then send that cookie along with the login request. To the extent that my tests now are valid, it seems to be working.
 +
 +There'​s also the problem of multiple instances running. Fix this too!
 +</​code>​
 +
 +===== Installation =====
  
 This is a way to configure an OpenWRT router to connect in client mode to the OneZone network. ​ I've tested it ONLY using whiterussian-rc5,​ on a Linksys WRT54GL and a Motorola WR850G.  ​ This is a way to configure an OpenWRT router to connect in client mode to the OneZone network. ​ I've tested it ONLY using whiterussian-rc5,​ on a Linksys WRT54GL and a Motorola WR850G.  ​
Line 23: Line 115:
   - run this:<​code>​   - run this:<​code>​
 ipkg update ipkg update
-ipkg install microperl+ipkg install microperl ​curl
 cd /sbin cd /sbin
 wget http://​wirelesstoronto.ca/​dist/​om-checkin.pl wget http://​wirelesstoronto.ca/​dist/​om-checkin.pl
Line 36: Line 128:
 wget http://​wirelesstoronto.ca/​dist/​om-checkin.conf.pl wget http://​wirelesstoronto.ca/​dist/​om-checkin.conf.pl
 ifconfig eth0 ifconfig eth0
 +</​code>​
 +<​code>​
 +WARNING: auto-oz is still in development. the versions of these files on the server aren't the newest ones. If you're interested, contact Gabe.
 </​code>​ </​code>​
   - it will output the mac address. ​ Copy it, and add the node to the OM dashboard. ​ The dashboard will then calculate its IP address.   - it will output the mac address. ​ Copy it, and add the node to the OM dashboard. ​ The dashboard will then calculate its IP address.
auto-oz.1282229652.txt.gz ยท Last modified: 2013/09/28 16:06 (external edit)