XBMC JSON-RPC Reboot Freeze
#1
Hi

Just after some info, or help in the right direction. I have a home automation style webUI at home that controls a few things aroung the house, and I wanted to add some basic functions to it for XBMC. I have tested a few things using JSON-RPC, Directions etc, but the main function I want is a hard reset for XBMC, Linux and the lot, as I do have frequent issues with freezing and what not that the soft reset cannot fix. Currently I use an SSH App on my phone to reboot, but that is not very "Wife Friendly".

What I have been playing with is just the strings, straight into the address bar, so this is what I am trying at the moment:
Code:
http://HOMEIP:8080/jsonrpc?request={"jsonrpc": "2.0", "id": 1, "method": "System.Reboot"}

The issue is, it just freezes, doesnt matter where it is, during playback, or on the home screen, the player just freezes. And I have left it a while, but it doesd not reboot. I still have SSH access at this point and can reboot, no issues. I just would like to know if there is a reason this does not seem to work, and if there is anywhere I could find a log of what is going wrong.

I am using Frodo, 12.2, and I think Linux 11.10 (I have attempted to upgrade to 12.04 but for what ever reason it does nothing, I will be upgrading this as soon as I get a bigger SSD).

Thank you
Kirt
Reply
#2
I wasn't even aware that you could do that. I just tried to do that and it worked fine.

I dual boot my lounge htpc between ubuntu precise and openelec. Both run gotham. Both work if I run your code in my browser on my laptop. On both systems it was at the main menu.

I would be looking at the usual log ~/.xbmc/temp/xbmc.log and the system logs in /var/log. You could ssh in and run
Code:
tail -f ~/.xbmc/temp/xbmc.log
and watch the log 'live' as you run the JSON query.

This could very well be a permissions problem. Generally users other than root do not have permission to reboot your system, except via sudo. I am a little unsure how XBMC in a general sense gets around this. openelec runs as root, and on my precise system the user that runs xbmc has full sudo rights, which may be affecting something. However this is all conjecture.
If I have helped you or increased your knowledge, click the 'thumbs up' button to give thanks :) (People with less than 20 posts won't see the "thumbs up" button.)
Reply
#3
Hi Nickr, thank you for your reply. I had a feeling permissions may have had something todo with it, since it runs on its own user, which requires a password todo a reboot. I will try again and check that log, I seem to remember there being some sort of way to allow a user to reboot without a password, so if that is the issue I might look into this.

It took me a while to find out about this also, i am trying to make a "Wife Friendly" way to hard reboot the system if it gets stuck, and if I can get this to work, it should be something that will not be affected by future updates. It might also be that Frodo does not support the reboot, but I will look into it.

You are using XBMC on both PCs? or OpenElec (I am not sure if Gotham is what OpenElec uses as a codename also)?

Thank You
Kirt
Reply
#4
So I have tested again, as mentions, left, right, up, down are all working. When running reboot I get this on the webUI
Code:
{"id":1,"jsonrpc":"2.0","result":"OK"}

And in that log file I get these lines
Code:
21:35:27 T:3008759616  NOTICE: Storing total System Uptime
21:35:27 T:3008759616  NOTICE: Saving settings
21:35:27 T:3008759616  NOTICE: stop all
21:35:27 T:3008759616  NOTICE: PVRManager - stopping
21:35:28 T:3008759616  NOTICE: ES: Stopping event server
21:35:28 T:3008759616  NOTICE: stopping zeroconf publishing
21:35:28 T:3008759616  NOTICE: Webserver: Stopping...
21:35:28 T:3008759616  NOTICE: WebServer: Stopped the webserver
21:35:28 T:3008759616  NOTICE: Webserver: Stopped...
21:35:28 T:2580515648  NOTICE: ES: UDP Event server stopped
21:35:28 T:3008759616  NOTICE: stop dvd detect media
21:35:28 T:3008759616  NOTICE: stop sap announcement listener
21:35:28 T:3008759616  NOTICE: clean cached files!
21:35:28 T:3008759616  NOTICE: unload skin
21:35:29 T:2735700800 WARNING: The python script "/home/citris/.xbmc/addons/service.skin.widgets/default.py" has left several classes in memory that we couldn't clean up. The classes include: Monitor,Window,Player
21:35:29 T:2651843392  NOTICE: StorageServer-2.5.4 Closed down
21:35:34 T:3008759616   ERROR: XBPyThread::stop - script /home/citris/.xbmc/addons/service.watchdog/service.py didn't stop in 5 seconds - let's kill it
21:35:34 T:3008759616  NOTICE: stop python

Any Ideas? Not really sure what to make of it... It might just be that my installation is so borked at the moment from attempting to update that's causing the issue.
Reply
#5
Can't you just reboot using the option that XBMC presents when you click the power icon in XBMC?
If I have helped you or increased your knowledge, click the 'thumbs up' button to give thanks :) (People with less than 20 posts won't see the "thumbs up" button.)
Reply
#6
(2014-06-24, 22:15)nickr Wrote: Can't you just reboot using the option that XBMC presents when you click the power icon in XBMC?

Nope, for what ever reason if I press the power button and reboot it does, sometimes work. But (Because Wake on Sleep and other things refuse to work despite many hours of work) the machine stays on contently. Its not a slow PC either, its an overkill system, but every so ofter, 1-2 times a week, XBMC will lock up in different ways, Live TV might cause it to freeze, Playing a movie it will load audio, but no picture then freeze shortly after, and so on. Usually these things only happen after its been on a day or 2, but on rare occasions it can happen when its only been on an hour or so. So I have to use SSH to remote in and reboot it using sudo reboot and my user details. But my wife would not know how todo this, and since the Media player is in accessible, its not really an option to press the reset button.

So I am looking for a solution that lets me hard reboot the box using a command pushed from a web interface, and this seemed like an easy solution. Otherwise I will probably have to work out some way to send SSH Exec request from a remote server.
Reply

Logout Mark Read Team Forum Stats Members Help
XBMC JSON-RPC Reboot Freeze0