Reboot Huawei B890

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
total_beginner
Newbie
Posts: 3
Joined: Fri Dec 11, 2015 8:51 am

Reboot Huawei B890

Post by total_beginner » Fri Jan 08, 2016 9:18 am

Hello
I am new in scripting and I have a real simple question - I want to reboot my modem to get a new IP.
I have a netgear modem which I can reboot with

Code: Select all

HTTPRequest>http://user:[email protected]/reboot.cgi,,GET,,HtmlText
unfortunately that doesn't work on the Huawei. When I start

Code: Select all

HTTPRequest>http://user:[email protected]/reboot.html,,GET,,HtmlText
I get the following HtmlText
  • <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <link rel="stylesheet" href="../css/main.css" type="text/css" />
    <script type="text/javascript" src="../lib/jquery-1.7.2.min.js"></script>
    <script type="text/javascript" src="../lib/log4javascript_lite.js"></script>
    <script type="text/javascript" src="../lib/jquery.qtip.js"></script>
    <script type="text/javascript" src="../js/changelang.js"></script>
    <script type="text/javascript" src="../js/refresh.js"></script>
    <script type="text/javascript" src="../js/checklogin.js"></script>
    <script type="text/javascript" src="../js/ping.js"></script>
    <script type="text/javascript" src="../js/redirect.js"></script>
    <script type="text/javascript" src="../js/reboot.js"></script>
    <title></title>
    </head>

    <body>
    <div id="all_content" class="bodybg">
    <div class="maintitle">
    <h1 id="title_label_reboot">
    <script type="text/javascript">dw(system_label_reboot);</script>
    </h1>
    </div>
    <div class="main_content">
    <p>
    <script type="text/javascript">dw(system_help_reboot);</script>
    </p>
    <div class="apply_button">
    <script type="text/javascript">create_button(system_label_reboot,"button_reboot");</script>
    </div>
    </div>
    <!--main_content end-->
    </div>
    </body>
    </html>
I think I have to start the javascript "reboot.js" on the modem but I have no idea how to do this (with a httprequest).

Any help would be great.Thank you.

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Re: Reboot Huawei B890

Post by Marcus Tettmar » Fri Jan 08, 2016 2:18 pm

Hi,

Javascript requires a browser to run in. You can't httprequest it to make it work. So you will probably have to do this by automating IE.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

total_beginner
Newbie
Posts: 3
Joined: Fri Dec 11, 2015 8:51 am

Re: Reboot Huawei B890

Post by total_beginner » Mon Jan 18, 2016 3:11 pm

Hello Marcus,

thank you very much for your answer. I have now tried it with automating IE but I am stuck at the point where I have to click on a button in an IFRAME. I found a codepiece (created in Phantomjs & Casper), but I do not know how to transpose that in the makro scheduler.
I can convert this codepiece from Casper

Code: Select all

casper.wait(3000, function () {
casper.thenClick(x(‘//*[@id=”label_reboot”]’), function() {
console.log(“click on reboot”);
});
});
into

Code: Select all

IETagEventByAttrib>{"http://192.168.1.1/setting.html},SPAN,ID=label_reboot,click,
but I have no idea how to deal with this part.

Code: Select all

casper.wait(3000, function () {
casper.withFrame(‘show_html’, function() {
casper.thenClick(x(‘//*[@id=”button_reboot”]’), function() {
console.log(“click on reboot in iframe”);
});
});

});
Again any help would be really great. Thanks

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Re: Reboot Huawei B890

Post by Marcus Tettmar » Tue Jan 19, 2016 11:03 am

What's the URL of the frame?
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

total_beginner
Newbie
Posts: 3
Joined: Fri Dec 11, 2015 8:51 am

Re: Reboot Huawei B890

Post by total_beginner » Tue Jan 19, 2016 2:57 pm

I think its

Code: Select all

http://192.168.1.1/reboot.html
or perhaps this codepiece does explain more ?

Code: Select all

<DIV id="frame_show">
<IFRAME id="show_html" class="content_right" src="reboot.html" frameBorder="0"></IFRAME>
</DIV>

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Re: Reboot Huawei B890

Post by Marcus Tettmar » Mon Jan 25, 2016 2:20 pm

Really need to see the generated HTML. The HTML you have privided is before the javascript has run. IE's developer tools should show you the rendered HTML. I can see that the element has ID of "button_reboot" but I'm not sure what kind of tag it is.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts