Menu
Reply
  • 5
  • 0
  • 2
TheHirthinator
Tuning in
546 Views
Message 1 of 9
Flag for a moderator

Script Reboot Virgin Media SuperHub 2

Hello all,

New here Smiley Happy

I know this has been discussed before I can't see this being impossible at all.

I found the script that was kicking about early parts of 2015 which used to work but I don't think it's working anymore - maybe someone with some better script knowledge than me can dicipher that? 

http://ben.neise.co.uk/powershell-script-to-restart-a-virgin-media-superhub/ 

A bit of background is that the SH2 wireless drops out nearly every few days without fail. I've selected channels which have least traffic on, which again seems to last only a few days before dropping out again. When it drops I can't get on to the web GUI to reboot the router via a browser but the IP will still ping.  

I felt a script would be the best way to achieve what I'm trying to resolve, aside from that I reckon the router maybe faulty or due an upgrade?

I've been on the phone to VM support many times and they say there's nothing wrong with it but to be honest they don't seem to test much or understand what I'm telling them when I try to help them diagnose. Everything they suggest i.e reboot or change the channel will resolve it for a few days and I guess they see that as fixed. Wired connection is fine btw, it has dropped a few times but I assume this is VM network rather than my cable. 

0 Kudos
Reply
  • 3.88K
  • 120
  • 203
Forum Team (Retired) Adam_L
Forum Team (Retired)
502 Views
Message 2 of 9
Flag for a moderator

Re: Script Reboot Virgin Media SuperHub 2

Hi TheHirthinator, 

 

Thanks for posting to let us know that you've been experiencing some script reboot errors, I apologise for any inconvenience.

 

I have tested things from here and I can't see anything out of the ordinary, in fact the connection looks great! No errors or time outs showed up from here and all of the power levels are within the preferred ranges.

 

Are you still having these issues? If so, please respond to me here with a recent copy of your Hubs logs for me to compare with the data we have here. You can find these by opening your internet browser and typing 192.168.0.1 into the address bar, before logging in it will say 'Router Status' in the top right hand corner, click there and all the information needed is inside.

 

Also when these errors occur,. is there any noticeable change to the Hubs logs?

 

Take care, 

Thanks, 

Adam.


Tech fan? Have you read our Digital life blog yet? Check it out


0 Kudos
Reply
  • 5
  • 0
  • 2
TheHirthinator
Tuning in
490 Views
Message 3 of 9
Flag for a moderator

Re: Script Reboot Virgin Media SuperHub 2

Hey Adam,

 

I got the script working in the end, I wrote a little ps1 to add the username and password then call the original script which rebooted the router nicely. Then we had a powercut the other day and the router is now completely broken! 

I'm guessing the hardware was on the way out and this was possibly why I needed to reboot the router so much. 

I'll report back when we receive the new Hub and let you know if I still have to reboot it daily. 

 

Joe

  • 5
  • 0
  • 0
Eejit
Tuning in
477 Views
Message 4 of 9
Flag for a moderator

Re: Script Reboot Virgin Media SuperHub 2

Hi TheHirthinator
Do you have copies of the scripts you can post?
I've tried to use Ben Neise's script for day's and got no where. I wonder if it has something to do with the SuperHub 2 not asking for a username but I've tried to edit that out with no joy.

Eejit
0 Kudos
Reply
  • 5
  • 0
  • 2
TheHirthinator
Tuning in
469 Views
Message 5 of 9
Flag for a moderator

Re: Script Reboot Virgin Media SuperHub 2

Eejit.

What are you doing at the moment? I'm not sure how well you know Powershell or anything about this process so don't be offended if I'm teaching you to suck eggs, at least if I make it step by step everyone can understand Smiley Happy

Basically there's a few steps, don't touch the original restart VM SH2.ps1 script from Ben.

Try it manually first to see if you can get the router to reboot without error.

 

1. Open Powershell as admin

2. Type: Set-ExecutionPolicy Bypass then confirm with y

3. Type: Import-Module [the destination of Ben's script]

example: Import-Module C:\temp\restart VM SH2.ps1

4. Type: Restart-VirginRouter -RouterIP "xxx.xxx.x.x" -Username "admin" -Password "xxxxxxx"

example: Restart-VirginRouter -RouterIP "192.168.0.1" -Username "admin" -Password "password"

Just change the IP address and password to your parameters but leave the username as admin.

 

My script basically does what I've explained above but I don't think I can attach it here. I'll copy it in plain text if you want to automate the process like once a night with task scheduler or something Smiley Happy 

 

Hope that helps

 

0 Kudos
Reply
  • 5
  • 0
  • 0
Eejit
Tuning in
457 Views
Message 6 of 9
Flag for a moderator

Re: Script Reboot Virgin Media SuperHub 2

Hi,

Thanks for your response. I know only very little about Powershell so definately not offended :-)

I followed you directions but it came up with error

PS C:\Windows\system32> Import-Module C:\temp\reboot.ps1
PS C:\Windows\system32> Restart-VirginRouter -RouterIP "192.168.0.1" -Username "admin" -Password "***********"
VERBOSE: GET http://192.168.0.1/ with 0-byte payload
Invoke-WebRequest : The server committed a protocol violation. Section=ResponseHeader Detail=CR must be followed by LF
At C:\temp\reboot.ps1:51 char:11
+     $r1 = Invoke-WebRequest -Uri ("http://" + $routerIP + "/") -Sessi ...
+           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-WebRequest], WebExc
   eption
    + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeWebRequestCommand

Cannot index into a null array.
At C:\temp\reboot.ps1:52 char:5
+     Invoke-WebRequest -Uri ("http://" + $routerIP + $r1.forms[0].acti ...
+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : NullArray

Obviously the second part of the script, the actual reboot didn't work either, because the first problem is logging in. This is similar to my first attempts when I thought the issue might be the "admin" parameter when it doesn't exist on the login page.

I thought I might have corrupted Ben's code and his site seems to be down at the moment, but I got a fresh copy from github and that's the same.

Eejit

 

 

 

[MOD EDIT: Personal and private information has been removed from this post. Please do not post personal or private information in your public posts. Please review the Forum Guidelines]

0 Kudos
Reply
  • 5
  • 0
  • 2
TheHirthinator
Tuning in
453 Views
Message 7 of 9
Flag for a moderator

Re: Script Reboot Virgin Media SuperHub 2

OK well first I can see your password! Maybe you want to remove or edit the post Smiley Happy

I had similar issue a few days ago, just manually reboot the router and then try the script again. Can you actually browse to http://192.168.0.1

I never did the troubleshooting but I think if you can't get to the config page in a browser the hub may not be listening on port 80 so the script may not work at all. 

  • 5
  • 0
  • 0
Eejit
Tuning in
449 Views
Message 8 of 9
Flag for a moderator

Re: Script Reboot Virgin Media SuperHub 2

LOL The password isn't real, just as I suspect Ben's isn't "hunter2" :-)

I can't physically reboot the the SH2 via the power as I'm away and having to remote into a server on my network at home to try all this.

Once connected by remote I can however browse to http://192.168.0.1 and login and have rebooted this way but the results are the same :-(

 

Oh well. Thought it might have been a quick fix but looks like I'll have to wait until I get home next week and try to resolve it then.

 

Thanks for your help

0 Kudos
Reply
  • 5
  • 0
  • 2
TheHirthinator
Tuning in
446 Views
Message 9 of 9
Flag for a moderator

Re: Script Reboot Virgin Media SuperHub 2

See after a hard reboot if it works, then go from there. Just in case.
0 Kudos
Reply