Made a newbie mess with Python

Python and python framework

Moderator: leecollings

Post Reply
bkoch
Posts: 5
Joined: Tuesday 30 October 2018 12:22
Target OS: -
Domoticz version:
Contact:

Made a newbie mess with Python

Post by bkoch »

I wanted to add the Kodi Players hardware on my RPi with Debian and Domoticz V4.9700. So I added it using instructions on https://github.com/dnpwwo/Domoticz-Kodi-Plugin. I got the new hardware and got the 4 devices and an awful lot of errors like "onMessage' failed 'TypeError':'a bytes-like object is required, not 'str''." So I figured I didn't have Python V3.4 or higher. I loggon and entered "python" and I appeared to have Python V2.7.13. Then I added Python 3.7 using the shell script on https://gist.github.com/SeppPenner/6a5a ... 524417761d.

It dit not work, complaining about missing runtime 3.x (if I remember correctly) I installed runtime 3.5 and somewhere in the struggle my Kodi Players hardware was gone. I deleted and installed the plugin again and I got the hardware and 4 devices back. Also the errors came back.

So I have now 3 versions of Python and still the errors. The first 2 errorlines are:
Error: (Kodi woonkamer) ----> Line 148 in /home/pi/domoticz/plugins/Domoticz-Kodi-Plugin/plugin.py, function onMessage
2018-10-30 12:01:38.920 Error: (Kodi woonkamer) 'onMessage' failed 'TypeError':'a bytes-like object is required, not 'str''.

Any ideas?
mtsinc
Posts: 6
Joined: Monday 29 October 2018 17:45
Target OS: Linux
Domoticz version:
Contact:

Re: Made a newbie mess with Python

Post by mtsinc »

I'm not a Python guru, but my understanding is that Python is a lot like Java, and in Java, having a dozen or so different VMs of various different release levels and flavors installed is just fine. The only thing is that you have to tell the application which one of those installed VMs you want that particular application to use.

There's supposed to be some sort of guideline in the basic Domoticz documentation that is intended to help with that, and I'm going to have to throw you on its mercy, alas.

I cheated. I found a Docker image for Domoticz so I'm running it quite happily in its own little pre-built world.
bkoch
Posts: 5
Joined: Tuesday 30 October 2018 12:22
Target OS: -
Domoticz version:
Contact:

Re: Made a newbie mess with Python

Post by bkoch »

Using directions on https://www.domoticz.com/wiki/Using_Python_plugins and further, I managed to start Domoticz with Python 3.5:
2018-10-30 15:26:55.579 Status: PluginSystem: Started, Python version '3.5.3'.

It does start up:
2018-10-30 15:26:58.517 Status: (Kodi woonkamer) Initialized version 2.6.4, author 'dnpwwo'

a soon as it connects to the computer running kodi, I get an endless repetition of the next 3 lines:

2018-10-30 15:27:35.670 Error: (Kodi woonkamer) 'onMessage' failed 'TypeError':'a bytes-like object is required, not 'str''.
2018-10-30 15:27:35.670 Error: (Kodi woonkamer) ----> Line 641 in /home/pi/domoticz/plugins/Domoticz-Kodi-Plugin/plugin.py, function onMessage
2018-10-30 15:27:35.670 Error: (Kodi woonkamer) ----> Line 148 in /home/pi/domoticz/plugins/Domoticz-Kodi-Plugin/plugin.py, function onMessage

I have no clue.
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 1 guest