Hub reboot URL doesn't seem to work


#1

My hub slows down every 7-8 days, so I want to schedule a weekly reboot at a suitable time.

I was under the impression the following URL should work to reboot the hub, but it isn't.

curl -k -sb $cookiefile -X POST https://ip.address/hub/reboot

The cookie is recovered using:

curl -k -c $cookiefile -d username=$username -d password=$password https://ip.address/login

The same cookie works fine for my nightly backup. I also tried port 8081 - no luck there either. What is the correct URL to reboot?

Thanks!


#2

Also interested in this auto reboot procedure. Ever since I got the hub I've been noticing these slowdowns as well. It's very quick for about a week, then most of my motion base lighting slows down to a SmartThings speed :confused:. My motion sensors show active instantly however, it seems like a processing problem between my iris motions and ge switches. I've noticed this with no customs apps/drivers on my hub, now I have a bunch and I'm glad it's not worse. Wondering where your noticing these slowdowns?


#3

I don't have user authentication turned on but your reboot url is the same as what I use...just without secure http....I use http://ipaddress/hub/reboot. Maybe try without the "s" on your reboot curl command. :man_shrugging:

curl -k -sb $cookiefile -X POST http://ip.address/hub/reboot


#4

@stephack

I tried that also - didn't work.

I'm really perplexed, because it reboots through the UI. And when I look at the page source, it seems to me that it should work:

reboot: function() {
            1 == confirm("Are you sure you want to reboot the hub?") && $.post("/hub/reboot").done(this.successMessage)
        },

#5

Have you tried temporarily disabling user authentication and trying it again? That would nail down whether your link is correct or whether it's an authentication problem.


#6

@stephack @Ryan780

Solved! It will not reboot (via curl) if I am logged on via the web interface. But if I log out, and then use curl, it works. That's weird.


#7

Probably won't let you "log-in" twice.


#8

Can you create a second "admin" account and do the reboot with that account?


#9

@GatVlieg

I don't think you can create a second account on the hub itself.


#10

Would you use a remote URL at the same time as you are logged into the hub though?


#11

My Mac desktop is logged in more or less all the time.


#12

I had not turned on user authentication, but reading this thread I thought I'd try a test.

After setting up a user and turning on authentication, I plugged this into Chrome on my local Windows machine:

http://192.168.XXX.XXX:8080/hub/reboot

This redirected me to the user credentials login screen with this URL:

http://192.168.XXX.XXX:8080/login?loginRedirect=%2Fhub%2Freboot

After entering in my credentials the hub UI popped up with URL http://192.168.XXX.XXX:8080/hub/reboot, but I get a 404 Error.

I tried re-loading on http://192.168.XXX.XXX:8080/hub/reboot but I just keep getting the 404.

Interestingly, even with authentication enabled, I can access the Hub Diagnostic Tool (http://192.168.0.102:8081) without any need to login.

Anyhow, it appears (?) that turning on user authentication disables local use of the reboot URL without passing on credentials in a cookie as with @aaiyar's confirmed method.

For anyone not using hub user authentication, I use a no-middleman solution suggested elsewhere (sorry, can't find the post at the moment):

I use @ogiewon's HTTP Momentary Switch device and set it up as a "Reboot Button":

Then you can make a rule that pushes / switches it every XX days, giving you self-contained automated reboots, as well as externally /manually available if so desired.

If the momentary reset back to the off state isn't fast enough, just change line 44 from

runIn(1, toggleOff)

which resets in 1 second to something like

runInMillis(200, toggleOff)

which shortens it to 200 milliseconds. That worked for me. It doesn't really matter because switching on or off will both result in a push event that reboots the hub.


#13

I had issues trying to do the soft reboot and getting the 404 error. Bobby said it was because I was logged in. Once I logged out I could do it. Is your hub not rebooting from that page because you are logged in ?

Could we use @ogiewon app there to do a shutdown VS a reboot - I guess we just change the URL path ?


#14

I wasn't trying to reboot from the web page.

I was writing a shell script to reboot the hub from my Odroid as a weekly cron job. The shell script (execute on my Odroid) would not reboot the hub if I was logged in via the web page. The solution was to make sure I was logged out before running the shell script.