Tag Archives: python

Example – Control Kodi with Rns-e

Note: If you have the full AudiRns Full Beta plugin, the following functionality is already processed.
Please install the following plugin so not, of deinstalleer deze.

 

If your Rns-e is on TV / VIDEO mode (or newer versions on MEDIA) using the buttons generate Can messages.

For example, this Can message are using a Python script to convert in Kodi commands. I have chosen to JSONRPC commands. These are short commands that are sent through HTTP headers and then responds that Kodi. After on the ' Select ' button (the large rotary button) for example, I use the following code to respond: [xbmc.executeJSONRPC('{"jsonrpc":"2.0","method":"Input.Select","id":1}')]

Because this functionality actually allows a Web server to control Kodi, you need to allow this feature in Kodi. "Allow control of Kodi via HTTP" in the "Web server" menu.

800px-Settings.services.webserver

The Python script I develloped for control with Rns-e buttons:

Rnse_Control (167 downloads)

 

 
Or download the directly installable Kodi plugin:

Download now: Plugin Kodi operate with Rns-e
 

 
[whohit]Control Kodi with Rns-e[/whohit]

Python Can

In the post about installing PiCan I described how you could use the tooling for CAN message receiving / sending.
However these are rather hard to understand .C scripts, which I had some trouble with to customize.

For this reason I chose to install the Hard byte-Python Can software on my Raspberry Pi. Python is a fairly easy programming language, and has no need to compile the code. Also Python is being used as default programming language for Kodi plug-ins. Both of these components are very useful to serve as interface between my Audi / Rns-e and my Raspberry Pi.

To install the Pycan library, you can run the following command;

[pip install python-can]

In the AudiRns FULL Beta plugin I have processed all of the default settings.

Do you want to set the correct settings (for example to use when the example plugins), then open;
[nano /etc/can.conf]
and put the following content to the file;
can.rc['interface'] = 'socketcan_ctypes'
can.rc['channel'] = 'can0'


[whohit]Python Can[/whohit]