Kodi Community Forum
v17 StopPVRManager / StartPVRManager - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: PVR & Live TV Support (https://forum.kodi.tv/forumdisplay.php?fid=167)
+---- Forum: MythTV (https://forum.kodi.tv/forumdisplay.php?fid=170)
+---- Thread: v17 StopPVRManager / StartPVRManager (/showthread.php?tid=310084)



StopPVRManager / StartPVRManager - tarmacalastair - 2017-03-20

Hi,
Have loved the MythTv addon for Kodi and been using it for some time.

My OSMC install on a Pi 3 has recently auto upgraded from 16 to 17.1 and now the Start and Stop PVRManager functions don't work. I was using:

Code:
xbmc-send --action="StopPVRManager"

I used to ssh to my Pi from my phone and start or stop the MythTv plugin to allow the backend to shut down as it's only switched on when in use or when recording. I also have a crontab to stop the PVR at night as the Pi does other jobs so is left on. (I found that if I disabled the setting in the addon to allow the backend to shut down then it would shut down in the middle of playback)

Can you advise if there is another way to disable and enable the addon from the command line please or if the above command can be made to work somehow? It still works on my other pi and Ubuntu installs that are both still on Kodi 16.

Thanks,
Al


RE: StopPVRManager / StartPVRManager - trogggy - 2017-03-20

I use a couple of little scripts to enable / disable dvbviewer.
The default.py for disabling is simply:
Code:
#!/usr/bin/python
# -*- coding: utf-8 -*-
#import xbmc,xbmcgui,xbmcplugin
import xbmc

xbmc.executeJSONRPC('{"jsonrpc":"2.0","method":"Addons.SetAddonEnabled","id":8,"params":{"addonid":"pvr.dvbviewer","enabled":false}}')
Change the addonid to mythtv, add an addon.xml, zip it up and install - make another with enabled:true and do likewise.
Then use
Code:
xbmc-send --action="RunScript(script.whatever)"
That - or something like it - should work. I switched from using start / stop pvrmanager when I moved to krypton.
I don't do the last part though - I enable via the gui - so the command may not be exactly right RunScript is a built-in function though, so it should work.


RE: StopPVRManager / StartPVRManager - janbar - 2017-03-20

The addon pvr.mythtv allows the backend to shutdown when kodi activates its screen saver even blocking is enabled.


RE: StopPVRManager / StartPVRManager - tarmacalastair - 2017-03-21

Janbar, thanks, that is fantastic. I had my screensaver turned off. I've now enabled it and sure enough, the message in Mythwelcome now changes from MythTV is idle to MythTV is idle and will shut down in x seconds. After x seconds the backend does indeed shut down.

Trogggy, thanks for the pointers. Sadly you lost me after the first line!

It looks like the StartPVRManager might control the whole PVR environment, not just the MythTV one so apologies if I've posted in the wrong place. In Kodi 16 there is a menu item: System->Settings->TV->General and then an "Enabled" option. This has disappeared in Kodi 17.

I'd still like to disable the PVR Manager from time to time so if anyone has any ideas please share.

Thanks.


RE: StopPVRManager / StartPVRManager - tarmacalastair - 2017-03-24

Oh dear, now I've followed Janbar's advice and left the pvr.mythtv addon enabled, but I now get this problem:

Every time I power up my kodi box (it reboots every day at 0200) it notices that the backend it not available and says, No response from MythTV backend. Do you want to retry? If I say no, because I know the backend is down, then, when I do want to use the add-on later I have to go through all the Add-ons Settings, navigate all the way to MythTV, disable it and then enable it again. Sometimes the Pi freezes at this point and I have to pull the plug to start it up again.

I have tried changing the Disable "Connection lost" warnings setting but it still happens.

It would be really useful to be able to enable and disable the addon via SSH then I could get my wife/family to simply click a button on their phones to turn it on or off as needed.

Can anyone help without having to resort to python, etc?

Thanks.


RE: StopPVRManager / StartPVRManager - dbowles1975 - 2017-04-28

(2017-03-20, 18:57)tarmacalastair Wrote: Hi,
Have loved the MythTv addon for Kodi and been using it for some time.

My OSMC install on a Pi 3 has recently auto upgraded from 16 to 17.1 and now the Start and Stop PVRManager functions don't work. I was using:

Code:
xbmc-send --action="StopPVRManager"

I used to ssh to my Pi from my phone and start or stop the MythTv plugin to allow the backend to shut down as it's only switched on when in use or when recording. I also have a crontab to stop the PVR at night as the Pi does other jobs so is left on. (I found that if I disabled the setting in the addon to allow the backend to shut down then it would shut down in the middle of playback)

Can you advise if there is another way to disable and enable the addon from the command line please or if the above command can be made to work somehow? It still works on my other pi and Ubuntu installs that are both still on Kodi 16.

Thanks,
Al
Try this:

1. Create a menu shortcut then select "change action" - "custom item" and use StopPVRManager as the function. Name it however you want.
2. Create a menu shortcut then select "change action" - "custom item" and use StartPVRManager as the function. Name it however you want.

You can't restart the PVR without stopping it first so If you click the first shortcut and wait a few seconds then click the second shortcut it will restart the PVR. I can't confirm this works in Krypton but it should.


RE: StopPVRManager / StartPVRManager - trogggy - 2017-04-28

(2017-04-28, 01:57)dbowles1975 Wrote: I can't confirm this works in Krypton but it should.
It doesn't. See above.


StopPVRManager / StartPVRManager - hdhdhdhdhd511 - 2017-05-01

(2017-03-20, 18:57)tarmacalastair Wrote: Hi,
Have loved the MythTv addon for Kodi and been using it for some time.

My OSMC install on a Pi 3 has recently auto upgraded from 16 to 17.1 and now the Start and Stop PVRManager functions don't work. I was using:

Code:
xbmc-send --action="StopPVRManager"

I used to ssh to my Pi from my phone and start or stop the MythTv plugin to allow the backend to shut down as it's only switched on when in use or when recording. I also have a crontab to stop the PVR at night as the Pi does other jobs so is left on. (I found that if I disabled the setting in the addon to allow the backend to shut down then it would shut down in the middle of playback)

Can you advise if there is another way to disable and enable the addon from the command line please or if the above command can be made to work somehow? It still works on my other pi and Ubuntu installs that are both still on Kodi 16.

Thanks,
Al






Sent from my iPod touch


RE: StopPVRManager / StartPVRManager - teeedubb - 2017-05-01

Code:
curl -s -H "Content-Type: application/json" -v -X POST -d '{"jsonrpc": "2.0", "method": "Addons.SetAddonEnabled", "params": { "addonid": "pvr.mythtv", "enabled": true }, "id": 1}' http://localhost:9191/jsonrpc

curl -s -H "Content-Type: application/json" -v -X POST -d '{"jsonrpc": "2.0", "method": "Addons.SetAddonEnabled", "params": { "addonid": "pvr.mythtv", "enabled": false }, "id": 1}' http://localhost:9191/jsonrpc

You need to update the ip address + port to suit.Only downside I found was that kodi is prone to crashing when disabling/enabling the pvr addon.


RE: StopPVRManager / StartPVRManager - tarmacalastair - 2017-05-02

Thanks teeedubb. This does seem to work but also seems to hang kodi pretty much every time for me.

As a long-winded way of getting it to work I can run your command and then restart Kodi using sudo systemctl restart mediacenter

Any idea if there's a way of issuing the equivalent of StopPVRManager with the curl/json method? (StopPVRManager used to disable the whole PVR subsystem without having to target specific addon(s).

dbowles1975 - thanks for the suggestions. I can't work out how to create a shortcut though - I'm using the Confluence skin.


RE: StopPVRManager / StartPVRManager - teeedubb - 2017-05-03

From what I could gather, Stop/StartPVRManager has been removed from newer kodi releases.


RE: StopPVRManager / StartPVRManager - kiwiwayne - 2017-11-02

(2017-05-02, 15:23)tarmacalastair Wrote: Thanks teeedubb. This does seem to work but also seems to hang kodi pretty much every time for me.

My thanks to teeedubb also, I had figured it was an issue with the distribution I was using rather than support for these built-in commands being dropped.

tarmacalastair, do you make sure that you aren't in any of the PVR screens before disabling? This causes crashes without fail. Here is a python script I use to restart my PVR manager that seems to work regardless of which screen I am parked on:
Code:
import xbmc, time

#return to homescreen
xbmc.executebuiltin('ActivateWindow(home)')

#sleep long enough for the home screen to come up
time.sleep(2)

#stop PVR addon
xbmc.executeJSONRPC('{"jsonrpc":"2.0", "method":"Addons.SetAddonEnabled", "params":{ "addonid": "pvr.mythtv", "enabled": false }, "id":1}')
#start PVR addon
xbmc.executeJSONRPC('{"jsonrpc":"2.0", "method":"Addons.SetAddonEnabled", "params":{ "addonid": "pvr.mythtv", "enabled": true }, "id":1}')

Cheers
Wayne


RE: StopPVRManager / StartPVRManager - nickr - 2017-11-04

Simple: stop rebooting your machine at 2.00 am.


RE: StopPVRManager / StartPVRManager - yoyoma2 - 2018-08-02

(2017-05-01, 16:01)teeedubb Wrote:
Code:
curl -s -H "Content-Type: application/json" -v -X POST -d '{"jsonrpc": "2.0", "method": "Addons.SetAddonEnabled", "params": { "addonid": "pvr.mythtv", "enabled": true }, "id": 1}' http://localhost:9191/jsonrpc

curl -s -H "Content-Type: application/json" -v -X POST -d '{"jsonrpc": "2.0", "method": "Addons.SetAddonEnabled", "params": { "addonid": "pvr.mythtv", "enabled": false }, "id": 1}' http://localhost:9191/jsonrpc

You need to update the ip address + port to suit.Only downside I found was that kodi is prone to crashing when disabling/enabling the pvr addon.                
Thanks teeedubb that works great.  By adding a call to first run the "advanced wake on lan" addon and waiting for the server to wake up my problem like the OP is fixed.
Code:
# hack: try to reset pvr addon at startup with server awake to make sure pvr works
curl -s -H "Content-Type: application/json" -v -X POST -d '{"jsonrpc": "2.0", "method": "Addons.ExecuteAddon","params": {"addonid": "script.advanced.wol" }, "id": 1}' http://localhost:9191/jsonrpc

until ping -c1 mypvrserverhostname &>/dev/null; do :; done
sleep 10 # wait for pvr services on the server to start up

# reset the pvr addon with the pvr server awake
curl -s -H "Content-Type: application/json" -v -X POST -d '{"jsonrpc": "2.0", "method": "Addons.SetAddonEnabled", "params": { "addonid": "pvr.mythtv", "enabled": false }, "id": 1}' http://localhost:9191/jsonrpc

sleep 3

curl -s -H "Content-Type: application/json" -v -X POST -d '{"jsonrpc": "2.0", "method": "Addons.SetAddonEnabled", "params": { "addonid": "pvr.mythtv", "enabled": true }, "id": 1}' http://localhost:9191/jsonrpc
# end of hack 
The only problem is that kodi automatically tries to start the pvr at startup which generates an error since the pvr backend server is asleep before the above code fixes this.  Disabling the pvr addon in the database as shown below before starting kodi avoided that error and the above code later reenables it without error once the backend pvr server is awake.  Warning: backup your database before attempting this.
Code:
sqlite3 Addons27.db "update installed set enabled=0 where addonID='pvr.mythtv'"



RE: StopPVRManager / StartPVRManager - HoldenCaulfield - 2019-04-13

(2017-05-03, 09:50)teeedubb Wrote: From what I could gather, Stop/StartPVRManager has been removed from newer kodi releases.

Hello teeedubb, how can I contact you to get answer from you, because I need help to install the Steam-AddOn on my Kodi (Leia). Is it not compatible, because I get an error message, that the installation insn't successful.

Regards