Power Off command fails

bowlingbeeg's Avatar Topic Author
User User
  • Posts: 248
  • Thanks: 33

Power Off command fails

2 years 3 months ago - 2 years 3 months ago
#2661
I'm trying to integrate the Kodi driver with my Ugoos AM6b+ and I'm trying to get the Power Off to work but it gives me an error.  Not sure if I messed something up or it's an issue with the driver.

06/06/2024 00:26:30.26 · DEBUG · Server.doCommand - AV|64~Power~Off from dashboard-fx-l367 
06/06/2024 00:26:30.26 · DEBUG · Kodi.doCommand - Cmd=[64~Power~Off] Client=[dashboard-fx-l367] 
06/06/2024 00:26:30.26 · DEBUG · Kodi.TX:CoreElec - {"jsonrpc":"2.0","method":"Player.Stop","params":{"playerid":-1},"id":"Player.Stop"} 
06/06/2024 00:26:30.26 · DEBUG · Kodi.RX:CoreElec - {"error":{"code":-32602,"data":{"method":"Player.Stop","stack":{"message":"Value between 0 (inclusive) and 2 (inclusive) expected but -1 received","name":"playerid","type":"integer"}},"message":"Invalid params."},"id":"Player.Stop","jsonrpc":"2.0"} 
Last edit: 2 years 3 months ago by bowlingbeeg.

Please Log in or Create an account to join the conversation.

bowlingbeeg's Avatar Topic Author
User User
  • Posts: 248
  • Thanks: 33

Re: Power Off command fails

2 years 3 months ago
#2665
I'm also seeing this with other commands like PlayPause

06/06/2024 13:57:11.57 · DEBUG · Kodi.TX:Kodi (CoreELEC) - {"jsonrpc":"2.0","id":"Player.GetItem","method":"Player.GetItem","params":{"playerid":1,"properties":["title","album","artist","season","episode","duration","showtitle","tvshowid","file","art"]}}
06/06/2024 13:57:11.57 · DEBUG · Kodi.RX:Kodi (CoreELEC) - {"id":"Player.GetProperties","jsonrpc":"2.0","result":{"percentage":19.961753845214845,"repeat":"off","shuffled":false,"speed":1,"time":{"hours":0,"milliseconds":342,"minutes":22,"seconds":27},"totaltime":{"hours":1,"milliseconds":618,"minutes":52,"seconds":29}}}
06/06/2024 13:57:11.57 · DEBUG · Kodi.RX:Kodi (CoreELEC) - {"id":"Player.GetItem","jsonrpc":"2.0","result":{"item":{"album":"","art":{"fanart":"image://https<removed>","icon":"image://DefaultVideo.png/","poster":"image://https<removed>","thumb":"image://https<removed>"},"artist":[],"episode":-1,"file":"smb://192.168.10.43/Media/My Movies/Movies/The Age of Adaline (2015)/The Age of Adaline (2015).mkv","label":"The Age of Adaline","season":-1,"showtitle":"","title":"","tvshowid":-1,"type":"unknown"}}}
06/06/2024 13:57:11.57 · DEBUG · Server.doCommand - AV|{{active_kodi_{{clientname}}}}~PlayPause from dashboard-fx-l367
06/06/2024 13:57:11.57 · DEBUG · Server.doCommand - AV|64~PlayPause
06/06/2024 13:57:11.57 · DEBUG · Kodi.doCommand - Cmd=[64~PlayPause] Client=[dashboard-fx-l367]
06/06/2024 13:57:11.57 · DEBUG · Kodi.TX:Kodi (CoreELEC) - {"jsonrpc":"2.0","method":"Player.PlayPause","params":{"playerid":-1,"play":"toggle"},"id":"Player.PlayPause"}
06/06/2024 13:57:11.57 · DEBUG · Kodi.RX:Kodi (CoreELEC) - {"error":{"code":-32602,"data":{"method":"Player.PlayPause","stack":{"message":"Value between 0 (inclusive) and 2 (inclusive) expected but -1 received","name":"playerid","type":"integer"}},"message":"Invalid params."},"id":"Player.PlayPause","jsonrpc":"2.0"}

Please Log in or Create an account to join the conversation.

bowlingbeeg's Avatar Topic Author
User User
  • Posts: 248
  • Thanks: 33

Re: Power Off command fails

2 years 3 months ago
#2668
Also, is there a "test" command for Kodi so that we could build our own JSON-RPC commands if we find something missing?

Please Log in or Create an account to join the conversation.

bowlingbeeg's Avatar Topic Author
User User
  • Posts: 248
  • Thanks: 33

Re: Power Off command fails

2 years 3 months ago
#2697
@davep any chance you've had time to look into this?

Please Log in or Create an account to join the conversation.

bowlingbeeg's Avatar Topic Author
User User
  • Posts: 248
  • Thanks: 33

Re: Power Off command fails

2 years 3 months ago
#2701
Just thought I'd mention that I tried these again with the new driver and they're still failing.

Please Log in or Create an account to join the conversation.

davep's Avatar
Admin Admin
  • Posts: 371
  • Thanks: 98

Re: Power Off command fails

2 years 3 months ago - 2 years 3 months ago
#2704
Notice this string in the RX response. "playerid":-1
Internally Kodi has three types of players Video (1), Music (2), Photos (3). You have to send commands targeting the specific player.
When the Kodi driver polls it gets the current active player from the now playing query and stores that internally. It also creates a {{av_<ID>_activeplayerid}} server variable.

The driver does not know what the active player is when you issue the power off command and it's using the default value -1. We clearly see that other messages in that log show that the player id should be 1.

There is something wrong with the now playing requests that I am making. I'm still stuck in this hotel waiting for repairs to be completed on my home and I don't have enough hardware here with me to do a full test a Kodi player. However, I just modified the Kodi driver so that the default player id will be 1 instead of -1. This might be enough to get us by until I can get back home next week. Give the new driver a try and let me know if it helped.


 
Last edit: 2 years 3 months ago by davep.

Please Log in or Create an account to join the conversation.

Time to create page: 0.302 seconds