Thread: [Reconnect working] Netgear Router N300 DGN2200v3
View Single Post
  #14  
Old 06.09.2012, 14:54
Freeloader
Guest
 
Posts: n/a
Default

Thanks again for the script, Freeloader!



Code:
I tried 5s initially as LordOfThunder mentioned above, but 2s seems to work just fine in my case with no failures. YMMV of course. Also, thanks for correcting the model name in the thread title.
Youre welcome, well 5 is better as you dont want the reconnection to be too fast because when u send the disconnect command to router this takes time, and you do not want the connect command to be sent when the router is still disconnecting. But if your router can disconnect in 2 seconds this shouldnt be a problem.

Quote:
A few more questions, if you don't mind. I'm completely new to HSRC of course, so is it necessary to have all those separate STEPs? Why can't we have just one STEP with everything else inside?
I didnt create the scripting language, Im sure the creator must have his//her reasons
Quote:
Also, the script as I understand it basically goes like this:

Code:
1.a) Send GET request to RST_st_poe.htm with auth
1.b) Parse id URL parameter with RegEx and store in var num
2) Send POST request to setup.cgi with id parsed above and appropriate todo (disconnect) etc. parameters

3) Wait for x seconds

4.a) Send GET request to RST_st_poe.htm with auth
4.b) Parse id URL parameter with RegEx and store in var num
5) Send POST request to setup.cgi with id parsed above and appropriate todo (connect) etc. parameters
Is it necessary to repeat 1.a) and 1.b) as 4.a) and 4.b)? When I use the WebUI, disconnecting doesn't log me out and I don't need to re-login to connect, so the id value seems to remain constant. So isn't it possible to do the same via the script, i.e. login/auth just once, parse the id, then use it to first disconnect and then reconnect? (Hopefully this is not a really stupid question , but if it is, please let me know why my assumption is incorrect.)
Yes you understand this correctly, but the ID value will change when you hard reboot the router (power button or reboot button in interface), there fore the script will not function. This can also happen when the electricity goes off.


Quote:
Awesome! But will there be a review to ensure people don't submit junk code? And even if there is a review, reviewers can only judge the code quality, and not whether it actually works unless they also own the same device...
Before the users commitment (upload process) JD will first verify the script > meaning it will perform a reconnection by executing the script. This will ensure that junk can not be uploaded to database.

So all in all without JDownloaders verification end user can not upload his/her script

After the script is added to database another user can use JDownloader reconnection wizard which can scan through the similar models until it finds a working script, and even if a working script is found > the end user still can continue (will have an option for) scanning for further scripts > as the reconnection wizard is also capable of finding faster reconnection scripts. Faster reconnection scripts are usually scripts which use the ppoe disconnect > reconnect option and they usually do not include those extra junk headers which get caught between the beginning of the login process and ending of disconnection/reconnection.

So basically the only junk code that can get in there is presented within the example script below; most of the headers in this script arent necessary but they exist as the reconnect recorder records every step which has been executed by the end user when he/she tries to reconnect the router via user interface.

Most of the headers within this script arent necessary but this doesnt mean that it doesnt work. Marked junk with bold, again it doesnt mean that it doesnt work.
[[[HSRC]]]
[[[STEP]]]
[[[REQUEST]]]
GET / HTTP/1.1
Host: %%%routerip%%%
[[[/REQUEST]]]
[[[/STEP]]]

[[[STEP]]]

[[[REQUEST]]]
GET /html/js/alphaindex.js HTTP/1.1
Host: %%%routerip%%%
[[[/REQUEST]]]
[[[/STEP]]]

[[[STEP]]]
[[[REQUEST]]]
POST /cgi-bin/webcm HTTP/1.1
Host: %%%routerip%%%

getpage=..%2Fhtml%2Fframe.htm&errorpage=..%2Fhtml%2Findex.html&login%3Acommand%2Fusername=%%%user%%% &login%3Acommand%2Fpassword=%%%pass%%%&var%3Aerrormsg=Error
[[[/REQUEST]]]
[[[/STEP]]]

[[[STEP]]]
[[[REQUEST]]]
GET /cgi-bin/webcm?getpage=../html/home.htm HTTP/1.1
Host: %%%routerip%%%
[[[/REQUEST]]]
[[[/STEP]]]

[[[STEP]]]

[[[REQUEST]]]
GET /html/js/alpha.js HTTP/1.1
Host: %%%routerip%%%
[[[/REQUEST]]]
[[[/STEP]]]

[[[STEP]]]

[[[REQUEST]]]
GET /cgi-bin/webcm?getpage=../html/tools/index.htm HTTP/1.1
Host: %%%routerip%%%
[[[/REQUEST]]]
[[[/STEP]]]

[[[STEP]]]

[[[REQUEST]]]
GET /cgi-bin/webcm?getpage=../html/tools/syscommands.htm HTTP/1.1
Host: %%%routerip%%%
[[[/REQUEST]]]
[[[/STEP]]]

[[[STEP]]]

[[[REQUEST]]]
GET /html/js/error.js HTTP/1.1
Host: %%%routerip%%%
[[[/REQUEST]]]
[[[/STEP]]]

[[[STEP]]]

[[[REQUEST]]]
GET /html/js/jsl.js HTTP/1.1
Host: %%%routerip%%%
[[[/REQUEST]]]
[[[/STEP]]]

[[[STEP]]]
[[[REQUEST]]]
POST /cgi-bin/webcm HTTP/1.1
Host: %%%routerip%%%

getpage=..%2Fhtml%2Ftools%2Frestartmodem.htm&var%3Acom=restart&var%3Arestart=1
[[[/REQUEST]]]
[[[/STEP]]]

[[[STEP]]]
[[[REQUEST]]]
POST /cgi-bin/webcm HTTP/1.1
Host: %%%routerip%%%

getpage=..%2Fhtml%2Ftools%2Frestartmodem.htm&logic%3Acommand%2Freboot=&var%3Arestart=0
[[[/REQUEST]]]
[[[/STEP]]]

[[[STEP]]]
[[[REQUEST]]]
GET /html/index.html HTTP/1.1
Host: %%%routerip%%%
[[[/REQUEST]]]
[[[/STEP]]]

[[[/HSRC]]]

Last edited by Freeloader; 06.09.2012 at 15:03.
Reply With Quote