Just testing this (very nice and useful idea, btw.) and so far I can connect typing
remote-cli 192.168.1.11 8080 user password,
but the online help suggest you may also safe a file
/home/osmc/cli-remote.conf
containing those login data in this form: Alternatively, save a file called /home/osmc/cli_remote.conf with this: {"ip": <your_ip>, "port": <your_port>, "user" : <your_user>, "pssw": <your_pass<
It now just seems that this example is somewhat mistyped, at least I cannot figure out what this line really should look like…
Anyway, just a very minor glitch, but would be a nice feature for ‘my future convenience’
Looks like missing closing curly bracket (and one > round the wrong way.
Everything in the <> including the <> would be replaced with your data (looks like a file in json format).
/home/osmc/cli_remote.conf (@fzinken: yeah, typo on my side, it’s named correctly on my pi’s…),
thus this posting…
What ever, it does work giving the connection data manually, so no big deal for me, especially having in mind that the OSMC team has to deal with other ‘customers’ at the moment yelling about somewhat ‘broken’ devices after the January update, and I don’t intend to chime in there
the python script expects another filename:
Line 21 with open('/home/osmc/kodi_cli_remote.conf' , 'r') as f:
E_D_I_T: WRONG FROM HERE ON - FOR SOLUTION SEE NEXT POST
the connection string inside that file must look like this (according to lines 12 to 18): {'ip': 'ip-address', 'port': '8080', 'user': 'username', 'pssw': 'password',}
Works as expected →
EDIT: screw that, it doesn’t
I had put my connection data directly into the script (lines 12 to 18) and while testing further I forgot to revert that change… so, still no luck with the conf-file.
Line 21:
another filename is expected ( kodi_cli_remote.conf)
instead of cli_remote.conf as stated in line 44
Line 24:
instead of settings = json.load(single)
it has to be settings = json.loads(single)
as there’s a string that has to be read and not a filestream anymore
Line 31:
instead of {"ip": <your_ip>, "port": <your_port>, "user" : <your_user>, "pssw": <your_pass<
the line in kodi_cli_remote.conf must look like this: {"ip": "your_ip", "port": "your_port", "user": "your_user", "pssw": "your_pass"}
f.e. {"ip": "192.168.1.11", "port": "8080", "user": "xbmc", "pssw": "xbmc"}
The file is changed to /home/osmc/cli_remote.conf.
The file contents are described as {"ip": "your_ip", "port": "your_port", "user" : "your_user (optional)", "pssw": "your_pass (optional)"}
Also note, if you are using this script ON the device after SSH’ing into it, then you don’t need to pass it the IP address, the default 127.0.0.1 will work. The new way arguments are parsed will allow cli-remote p=8080 if you only want to change the port.
Similarly, the file could just contain {“port”: “8080”}, with the defaults used for the others.
Thank YOU (and this is the whole OSMC-Team, its communitiy and particularly Team Kodi!) for your efforts!
Just set up a Pi1 from scratch today utilizing a physical keyboard only till the point this remote-cli was available (connected to ethernet), since then using a ssh shell from my PC WITHOUT the need to hot-plug a keyboard, that sufficed to f.e. configure my WLAN (and anything else, keyboard unplugged from this point on!) really easy and fast while still using Kodi’s GUI!!
Really handy, I love it, tends to be ingenious!
Btw.: as I’m not familiar with Python and Json yet - was I right in stating that settings = json.load(single)
was wrong and should have been replaced with settings = json.loadS(single), as you didn’t mention that?
'cause I just had to read a bit (!?) about json.load() vs.jsons.load() before I decided to post this, so any statement might make me learn a little, whether it’s right or not…
You need to ensure the http server is running in Settings → Services → Webserver → Allow control of Kodi via HTTP. The port, username and password are there too.