Binding for Apple-TV

nope, I need the Java side, so an apt-get (pip installs Python modules)

I tried loading the module supplied by the python3-jpy package, which turns into an exception

2019-02-23 19:46:36.768 [WARN ] [mmon.WrappedScheduledExecutorService] - Scheduled runnable ended with an exception: 
java.lang.UnsatisfiedLinkError: Native Library /usr/lib/python3/dist-packages/jdl.cpython-35m-arm-linux-gnueabihf.so already loaded in another classloader
	at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1907) ~[?:?]
	at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1824) ~[?:?]
	at java.lang.Runtime.load0(Runtime.java:809) ~[?:?]
	at java.lang.System.load(System.java:1086) ~[?:?]
	at org.jpy.DL.<clinit>(DL.java:70) ~[?:?]
	at org.jpy.PyLib.preloadPythonLib(PyLib.java:438) ~[?:?]
	at org.jpy.PyLib.loadLib(PyLib.java:405) ~[?:?]
	at org.jpy.PyLib.<clinit>(PyLib.java:465) ~[?:?]
	at org.openhab.binding.appletv.internal.jpy.LibPyATV.<init>(LibPyATV.java:154) ~[?:?]

so it seems that openhab already loaded the jpy platform module (maybe for the Jython support). I have no clue how to marry both instances.

Could you please post your jpy and jdl files here (add a .pdf extention than it’s possible to upload them here). I have the jpy modules in the bundle so can add those for your platform (in fact it’s the same binary, but with a different filename so I expect that we don’t get that exception)
/usr/local/lib/python3.6/site-packages/jpy*.so and jdl*.so

This is Python, but we need the platform modules. However, as a next step I also need to call Java from Python to signal play events, but that’s down the road



Do you also have Python 3.5?
/usr/local/lib/python3.5/site-packages/jpy*.so + jdl*.so?
In thise case please post all 4 files. I’m not sure if Python 3.6 is already in common use


Coud you please check if you have the zeroconf package in your dist-packages or site-packages?

some progress:

2019-02-23 21:02:26.525 [DEBUG] [pletv.internal.AppleTVHandlerFactory] - Apple-TV.PyATV: Initialize PyATV (current installation path: 'null')
2019-02-23 21:02:26.531 [INFO ] [pletv.internal.AppleTVHandlerFactory] - Apple-TV.PyATV: Modules will be installed in '/var/lib/openhab2/tmp/ohlib-8819438317684466323'
2019-02-23 21:02:26.535 [DEBUG] [pletv.internal.AppleTVHandlerFactory] - Apple-TV.PyATV: Platform info: 'linux', architecture: 'arm'
2019-02-23 21:02:26.539 [DEBUG] [pletv.internal.AppleTVHandlerFactory] - Apple-TV.PyATV: jpyLib=lib/jpy/lib.linux-armv7l-3.5
2019-02-23 21:02:26.543 [DEBUG] [pletv.internal.AppleTVHandlerFactory] - Apple-TV.PyATV: jpy.pythonExecutable: /usr/bin/python3
2019-02-23 21:02:26.546 [DEBUG] [pletv.internal.AppleTVHandlerFactory] - Apple-TV.PyATV: jpy.pythonLib: /usr/lib/arm-linux-gnueabihf/libpython3.5m.so
2019-02-23 21:02:26.549 [DEBUG] [pletv.internal.AppleTVHandlerFactory] - Apple-TV.PyATV: jpy.jpyLib: /var/lib/openhab2/tmp/ohlib-8819438317684466323/jpy.so
2019-02-23 21:02:26.553 [DEBUG] [pletv.internal.AppleTVHandlerFactory] - Apple-TV.PyATV: jpy.jdlLib: /var/lib/openhab2/tmp/ohlib-8819438317684466323/jdl.so
2019-02-23 21:02:26.557 [DEBUG] [pletv.internal.AppleTVHandlerFactory] - Apple-TV.PyATV: jpy.pythonPrefix: /usr
2019-02-23 21:02:27.689 [DEBUG] [pletv.internal.AppleTVHandlerFactory] - Apple-TV.PyATV: Starting Python
2019-02-23 21:02:29.802 [INFO ] [pletv.internal.AppleTVHandlerFactory] - Apple-TV.PyATV: load PyATV
2019-02-23 21:02:31.194 [ERROR] [pletv.internal.AppleTVHandlerFactory] - Apple-TV.PyATV: Unable to start Python (jpy): Error in Python interpreter:
Type: <class 'ImportError'>
Value: Unable to find avahi command-line tools
Line: 11
Namespace: <module>
File: /var/lib/openhab2/tmp/ohlib-8819438317684466323/pyatv/pyatv_api.py (class java.lang.RuntimeException)

I fixed the avahi command line tools with

sudo apt-get install avahi-utils

make sure you have the zeroconf and sh module installed


Traceback (most recent call last):
  File "./pyatv_api.py", line 11, in <module>
    from zeroconf import Zeroconf
ImportError: cannot import name 'Zeroconf'

The zeroconf package is installed. However.

  • python3 --version returns “3.5.3”
  • pip3 --version returns “pip 19.0.3 from /usr/local/lib/python3.6/site-packages/pip (python 3.6)”

So something seems to be mixed up: Python3 default is 3.5.3 wheras pip3 is a 3.6

any idea?


Could you please check if you find libpython3.6.so, otherwise you need to rebuild your Python 3.6

./configure --enable-shared --prefix=/usr/local
make
make install

more progress

  • I run “python3.5 get-pip.py” and “pip3.5 install pyatv zeroconf sh”
  • I’m able to run the pyatv_api.py (which is the modified main module) without errors, which means that at least Pythom 3.5 is finding the required import modules
    but I see in the openhab.log

On macOS it looks good for a first step (Debugger)

2019-02-24 00:47:41.231 [DEBUG] [.o.b.a.i.AppleTVHandlerFactory:48   ] - Apple-TV.PyATV: jpyLib=lib/jpy/lib.macosx-x86_64-3.6
2019-02-24 00:47:42.354 [DEBUG] [.o.b.a.i.AppleTVHandlerFactory:48   ] - Apple-TV.PyATV: jpy.pythonExecutable: /usr/bin/python3
2019-02-24 00:47:42.704 [DEBUG] [.o.b.a.i.AppleTVHandlerFactory:48   ] - Apple-TV.PyATV: jpy.pythonLib: /usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/libpython3.6.dylib
2019-02-24 00:47:42.938 [DEBUG] [.o.b.a.i.AppleTVHandlerFactory:48   ] - Apple-TV.PyATV: jpy.jpyLib: /var/folders/4y/vwvhk_fs1938xbk0k6z1h5t80000gn/T/ohlib-5251290356757614168/jpy.so
2019-02-24 00:47:43.230 [DEBUG] [.o.b.a.i.AppleTVHandlerFactory:48   ] - Apple-TV.PyATV: jpy.jdlLib: /var/folders/4y/vwvhk_fs1938xbk0k6z1h5t80000gn/T/ohlib-5251290356757614168/jdl.so
2019-02-24 00:47:43.659 [DEBUG] [.o.b.a.i.AppleTVHandlerFactory:48   ] - Apple-TV.PyATV: jpy.pythonPrefix: /usr
org.jpy.PyLib: entered static initializer
org.jpy.PyLibConfig: entered static initializer
org.jpy.PyLibConfig: exited static initializer
org.jpy.PyLib: DL.dlopen("/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/libpython3.6.dylib", DL.RTLD_GLOBAL + DL.RTLD_LAZY
org.jpy.PyLib: System.load("/var/folders/4y/vwvhk_fs1938xbk0k6z1h5t80000gn/T/ohlib-5251290356757614168/jpy.so")
org.jpy.PyLib: exited static initializer
2019-02-24 00:47:51.975 [DEBUG] [.o.b.a.i.AppleTVHandlerFactory:48   ] - Apple-TV.PyATV: Starting Python
org.jpy.PyLib: Starting Python with 8 extra module path(s):
org.jpy.PyLib:   /var/folders/4y/vwvhk_fs1938xbk0k6z1h5t80000gn/T/ohlib-5251290356757614168
org.jpy.PyLib:   /usr/lib/python3/dist-packages
org.jpy.PyLib:   /usr/lib/python3/site-packages
org.jpy.PyLib:   /usr/local/lib/python3.6/dist-packages
org.jpy.PyLib:   /usr/local/lib/python3.6/site-packages
org.jpy.PyLib:   /usr/local/lib/python3.5/dist-packages
org.jpy.PyLib:   /usr/local/lib/python3.5/site-packages
org.jpy.PyLib:   /var/folders/4y/vwvhk_fs1938xbk0k6z1h5t80000gn/T/ohlib-5251290356757614168/pyatv
PyLib_startPython: entered: jenv=0x7fd3872891f8, pyInit=0, JPy_Module=0x0
PyLib_startPython: global Python interpreter information:
  Py_GetProgramName()     = "python3"
  Py_GetPrefix()          = "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6"
  Py_GetExecPrefix()      = "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6"
  Py_GetProgramFullPath() = "/Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home/bin/java"
  Py_GetPath()            = "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python36.zip:/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6:/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6:/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/lib-dynload"
  Py_GetPythonHome()      = "(null)"
  Py_GetVersion()         = "3.6.5 (default, Mar 30 2018, 06:42:10) 
[GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.39.2)]"
  Py_GetPlatform()        = "darwin"
  Py_GetCompiler()        = "
[GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.39.2)]"
  Py_GetBuildInfo()       = "default, Mar 30 2018, 06:42:10"
PyLib_startPython: exiting: jenv=0x7fd3872891f8, pyInit=1, JPy_Module=0x121168548
2019-02-24 00:48:17.647 [INFO ] [.o.b.a.i.AppleTVHandlerFactory:44   ] - Apple-TV.PyATV: load PyATV
Java_org_jpy_PyLib_importModule: name='pyatv_api'
PyLib_CallAndReturnObject: objId=0x12117e6d8, isMethodCall=0, name='PyATV', argCount=0
PyLib_CallAndReturnObject: objId=0x1205890b8, isMethodCall=1, name='check', argCount=0
2019-02-24 00:48:45.210 [DEBUG] [.o.b.a.i.AppleTVHandlerFactory:48   ] - Apple-TV.PyATV: Sending remote key(s): top_menu
Hello from PyATV
PyLib_CallAndReturnObject: objId=0x1205890b8, isMethodCall=1, name='exec', argCount=1
_run_application)=
cli_handler()
parse_args()
parse_args() done
cli_handler() log
cli_handler() sanity check
retrieve_commands()
retrieve_commands() done
handle_command(0xCF670625989EE1EC)
details: name=Apple TV, address=192.168.6.123, login_id=0xCF670625989EE1EC
DEBUG: GET URL: http://192.168.6.123:3689/login?pairing-guid=0xCF670625989EE1EC&hasFP=1
DEBUG: _login_request: mlog: [container, dmap.loginresponse]
  mstt: 200 [uint, dmap.status]
  mlid: 1785533856 [uint, dmap.sessionid]

INFO: Logged in and got session id 1785533856
DEBUG: POST URL: http://192.168.6.123:3689/ctrl-int/1/controlpromptentry?session-id=1785533856&prompt-id=0
DEBUG: -> Data[24]: b'636d626500000007746f706d656e75636d63630000000100'
DEBUG: _post_request: 

on the Raspberry it behaves differtent

2019-02-23 22:16:58.055 [DEBUG] [pletv.internal.AppleTVHandlerFactory] - Apple-TV.PyATV: Sending remote key(s): menu
2019-02-23 22:16:58.070 [ERROR] [pletv.internal.AppleTVHandlerFactory] - Apple-TV.PyATV: Exception on PyATV call: Error in Python interpreter:
Type: <class 'AttributeError'>
Value: module 'jpy_stdout' has no attribute 'writelines'
Line: 461
Namespace: exec

Looks like the runtime environment is not initialized correctly or something with the installation is wrong.

Ok, some answers to your questions:

Zeroconf I did have installed, but sh not yet, so I just installed it.
I also didn’t have the avahi-utils and just installed those.
I have no idea whats going on with your python 3.5 / 3.6 issues

I didn’t have the file libpython3.6.so, so i’m rebuilding with the --enable-shared config option.

Attached the jpy*.so and jdl*.so for both 3.5 and 3.6 (with pdf added to the filename)
jdl.cpython-35m-x86_64-linux-gnu.so.pdf (28.3 KB)
jdl.cpython-36m-x86_64-linux-gnu.so.pdf (28.3 KB)
jpy.cpython-35m-x86_64-linux-gnu.so.pdf (554.5 KB)
jpy.cpython-36m-x86_64-linux-gnu.so.pdf (556.4 KB)

I am still thinking; is there not a way to automatically install the required modules without having to pack them into the binding?
For example, if you can execute a python script from the binding (i know the binding itself is java, but still) then the python script can install all required modules and return the path of the files back to your java code. You really would just be executing a command from java and catching the returned output.

Again slightly modified from my earlier posted script (Pip gave me some headache, but now all works)

import pip
import pkg_resources, subprocess

required_pkgs = ['jpy','pyatv','zeroconf','sh']
installed_pkgs = [pkg.key for pkg in pkg_resources.working_set]

for package in required_pkgs:
    if package not in installed_pkgs:
        subprocess.check_call(["python3", '-m', 'pip', 'install', package])

import jpy
print (jpy.__file__)

This would check for packages and if not present install them, the last line that’s put out is the path & filename of jpy. If you can somehow execute this script from the binding and store the last line that is returned, then you have a string with the location of jpy.

This way you wouldn’t have to package all kinds of different versions of jpy into the binding.

EDIT: The above script can still be refined a bit more; it works with pip version 10.0 or higher, but pip versions below 10.0 need to be handled a bit differently. Most people seem to have at least pip version 10.0 so it’s not such a big deal, but still


Also, for Debian (and i think for Raspbian as well) the easiest way to get python3 and libpython would be to just apt-get install python3.5 libpython3.5

For me personally i wanted to get the latest python3.6 and hence building from source


Rebuilding python is now done.
Still no libpython3.6.so but i do now have a libpython3.6m.so
Not sure why the letter ‘m’ is there, but is that what you need?

yep, I’m already keeping that in mind. Even if those might not be auto-installed by the binding (which should be possible) the documentation should include the depend modules, because existing setups could be very different (more or less modules already installed).

One impact with jpy is that it needs the platform specific modules. That was the reasons why I like the option to install “python3-jpy with apt-get”. Obviously those modules are already loaded by openHAB (maybe by the integrated Jython support) so a load attempt by the binding results in a exception (see above). So for the moment I want to stay with the embedded modules, that could be changed later.


I could fix my Python3.5 setup by running “python3.5 get-pip.py” and “pip3.5 install zeroconf”. So your snippet could be part of an auto-install - it’s on the list :wink: Integration that script should be easy, but first 1 want to move forward to get a working alpha on macOS, Raspi and Synology (your environment)


I had version 18 and now 19 - I think this could also be handled by the script (pip3 install --upgrade pip)

yes, that’s correct and would be the smart thing to use the jpy modules installed by package python3-jpy. Python 3.5 will be the preferred choice, 3.6 is not widely adapted.

yes, libpython3.6m.so is the correct one, which I used for the 3.6 testing - same result like 3.5 :frowning:


What I don’t get is why it is working on macOS and not the Raspberry.


I’ll add your modules to the bundle so you could do some testing on your side. I already contacted the developer of pyatv - maybe he could provide some hints

alpha2 is ready to test on macOS and Raspberry, maybe Synology
https://github.com/markus7017/org.openhab.binding.appletv/blob/alpha2/target/org.openhab.binding.appletv-2.4.0-SNAPSHOT.jar

The problem was a mixup of Python 3.5 and 3.6. Now using Python 3.5 on the Raspberry


During startup the binding creates log files in /tmp

  • ohpyatv-console.log - stdout output
  • ohpyatv-error.log - stderr output

check those if something gets wrong (beside openhab log)

make sure you complete the “atvremote pair” sequence

verified it with HABpanel and it works well (running on RPI):grinning:

I installed the latest jar, and the thing is showing “Online” in paper UI. (I previously paired with atv remote). I am using openhabian on rp3.

So, how do I send commands? I’ve been trying with a couple sample switches in an items file as below, but it doesn’t seem to be working.

  Switch Atv_Menu "ATV Menu" <Switchable> ["Switchable"]{channel="appletv:device:34fc39d8:menu"}
Switch Atv_Play "ATV Play" <Switchable> ["Switchable"] {channel="appletv:device:34fc39d8:play"}

I have it working!

Items

String Atv_Remote "ATV [%s]" {channel="appletv:device:34fc39d8:control#remoteKey"}

Sitemap

Switch item=Atv_Remote mappings=[up = "^" ]
Switch item=Atv_Remote mappings=[left = "<", select = "Sel", right = ">" ]
Switch item=Atv_Remote mappings=[menu = "Menu", down = "  v   ", play = "Play" ]
Switch item=Atv_Remote mappings=[previous='Prev', pause='Pause', next='Next']

Log on startup

2019-02-24 20:48:30.759 [DEBUG] [org.openhab.binding.appletv         ] - BundleEvent INSTALLED - org.openhab.binding.appletv
2019-02-24 20:48:31.027 [DEBUG] [org.openhab.binding.appletv         ] - BundleEvent RESOLVED - org.openhab.binding.appletv
2019-02-24 20:48:31.032 [DEBUG] [org.openhab.binding.appletv         ] - BundleEvent [unknown:512] - org.openhab.binding.appletv
2019-02-24 20:48:34.011 [DEBUG] [org.openhab.binding.appletv         ] - ServiceEvent REGISTERED - {org.eclipse.smarthome.core.thing.binding.ThingHandlerFactory}={service.id=83, service.bundleid=191, service.scope=bundle, component.name=org.openhab.binding.appletv.internal.AppleTVHandlerFactory, component.id=45} - org.openhab.binding.appletv
2019-02-24 20:48:39.486 [DEBUG] [org.openhab.binding.appletv         ] - BundleEvent STARTING - org.openhab.binding.appletv
2019-02-24 20:48:39.494 [DEBUG] [org.openhab.binding.appletv         ] - BundleEvent STARTED - org.openhab.binding.appletv
2019-02-24 20:48:39.517 [DEBUG] [pletv.internal.AppleTVHandlerFactory] - Apple-TV.Factory: Activate HandlerFactory
2019-02-24 20:49:00.145 [INFO ] [letv.internal.handler.AppleTVHandler] - Apple-TV.Handler: Initializing AppleTV
2019-02-24 20:49:00.219 [DEBUG] [pletv.internal.AppleTVHandlerFactory] - Apple-TV.PyATV: Initialize PyATV (current installation path: 'null')
2019-02-24 20:49:00.227 [INFO ] [pletv.internal.AppleTVHandlerFactory] - Apple-TV.PyATV: Modules will be installed in '/var/lib/openhab2/tmp/ohlib-683765653998905557'
2019-02-24 20:49:00.229 [DEBUG] [pletv.internal.AppleTVHandlerFactory] - Apple-TV.PyATV: Platform info: 'linux', architecture: 'arm'
2019-02-24 20:49:00.232 [DEBUG] [pletv.internal.AppleTVHandlerFactory] - Apple-TV.PyATV: jpyLib=lib/jpy/lib.linux-armv7l-3.5
2019-02-24 20:49:00.235 [DEBUG] [pletv.internal.AppleTVHandlerFactory] - Apple-TV.PyATV: jpy.pythonExecutable: /usr/bin/python3
2019-02-24 20:49:00.237 [DEBUG] [pletv.internal.AppleTVHandlerFactory] - Apple-TV.PyATV: jpy.pythonLib: /usr/lib/arm-linux-gnueabihf/libpython3.5m.so
2019-02-24 20:49:00.240 [DEBUG] [pletv.internal.AppleTVHandlerFactory] - Apple-TV.PyATV: jpy.jpyLib: /var/lib/openhab2/tmp/ohlib-683765653998905557/jpy.so
2019-02-24 20:49:00.242 [DEBUG] [pletv.internal.AppleTVHandlerFactory] - Apple-TV.PyATV: jpy.jdlLib: /var/lib/openhab2/tmp/ohlib-683765653998905557/jdl.so
2019-02-24 20:49:00.245 [DEBUG] [pletv.internal.AppleTVHandlerFactory] - Apple-TV.PyATV: jpy.pythonPrefix: /usr
2019-02-24 20:49:00.385 [DEBUG] [pletv.internal.AppleTVHandlerFactory] - Apple-TV.PyATV: Starting Python
2019-02-24 20:49:00.776 [INFO ] [pletv.internal.AppleTVHandlerFactory] - Apple-TV.PyATV: load PyATV
2019-02-24 20:49:04.862 [INFO ] [pletv.internal.AppleTVHandlerFactory] - Apple-TV.PyATV: Sending command top_menu to ip 192.168.0.72, lid 0x86AD23F7032474BC
2019-02-24 20:49:04.990 [DEBUG] [letv.internal.handler.AppleTVHandler] - Apple-TV.Handler: PyATV installation path: /var/lib/openhab2/tmp/ohlib-683765653998905557

sounds great! Raspberry, correct?

Did you had to install any Python modules etc. beside those mentioned?


With regards to the jpy platform modules: As I learned I can’t load directory the jpy platform modules, because they are already loaded (at least in my setup). So to have a initial approach as well as avoiding conflicts with other apps I got the following idea:

  • The installation is based on the python3-jpy module, which needs to be available/installed
  • During installation the binding creates a copy of both modules and
  • loads this “private” copy = different file name = will be accepted by the JVM (like I do it now with the embedded copy)

This means the bundle doesn’t need to bring the modules for any platform variation. The only disadvantage is that I can’t make sure, which version I load, which might cause conflicts, but that could also happen with other modules.

Just installed the latest jar and for me the ‘thing’ now also shows as online.
The log however shows:

2019-02-25 10:56:17.088 [INFO ] [letv.internal.handler.AppleTVHandler] - Apple-TV.Handler: Initializing AppleTV
2019-02-25 10:56:17.094 [INFO ] [pletv.internal.AppleTVHandlerFactory] - Apple-TV.PyATV: Modules will be installed in '/var/lib/openhab2/tmp/ohlib-4567354087173947365'
2019-02-25 10:56:17.098 [ERROR] [pletv.internal.AppleTVHandlerFactory] - Apple-TV.PyATV: Unable to start Python (jpy): Architecture not supported yet, please contact the author and provde platform information (class java.lang.Exception)

Not sure why its doing this
?

BTW. I started having issues with python 3.6.8 so I removed it and just used apt to install python3 and libpython3 (it’s version 3.5.3 to be exact)

Just had a thought:
In one of my previous error messages

2019-02-22 12:21:47.623 [DEBUG] [pletv.internal.AppleTVHandlerFactory] - Apple-TV.PyATV: Platform info: 'linux', architecture: 'amd64'

The architecture there is listed as amd64, whereas i’ve also seen it as x86_64
Perhaps the appropriate jpy and jdl can just be copied to support both of these architectures?

It feels a bit like Python calls it x86_64 and java is calling it amd64, but in reality it’s the same


Hi,

maybe Java detects that there with a AMD 64-bit processor rather than an Intel one.
I changed the code to match both:

if (os.contains("linux") && (platform.contains("x86_64") || platform.contains("amd64")))

next we will run into Ubunto runnuning on Intel/AMD
but for the moment - it’s alpha and early adoptors get priority :wink:

I still need the location of “libpython3.5m.so” for your setup

check this build: https://github.com/markus7017/org.openhab.binding.appletv/blob/alpha2/target/org.openhab.binding.appletv-2.4.0-SNAPSHOT.jar

Ah yes, sorry

I seem to have 2 copies of libpython3.5m.so
one in: /usr/lib/x86_64-linux-gnu/libpython3.5m.so
and also one in: /usr/lib/python3.5/config-3.5m-x86_64-linux-gnu/libpython3.5m.so

With the latest jar the ‘thing’ shows as unkown again.
The log shows:

2019-02-25 12:46:38.835 [INFO ] [letv.internal.handler.AppleTVHandler] - Apple-TV.Handler: Initializing AppleTV
2019-02-25 12:46:38.843 [INFO ] [pletv.internal.AppleTVHandlerFactory] - Apple-TV.PyATV: Modules will be installed in '/var/lib/openhab2/tmp/ohlib-4823276808541727152'
2019-02-25 12:46:38.914 [WARN ] [mmon.WrappedScheduledExecutorService] - Scheduled runnable ended with an exception:
java.lang.UnsatisfiedLinkError: /var/lib/openhab2/tmp/ohlib-4823276808541727152/jpy.so: /var/lib/openhab2/tmp/ohlib-4823276808541727152/jpy.so: undefined symbol: PyFloat_Type
        at java.lang.ClassLoader$NativeLibrary.load(Native Method) ~[?:?]
        at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1941) ~[?:?]
        at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1824) ~[?:?]
        at java.lang.Runtime.load0(Runtime.java:809) ~[?:?]
        at java.lang.System.load(System.java:1086) ~[?:?]
        at org.jpy.PyLib.loadLib(PyLib.java:416) ~[?:?]
        at org.jpy.PyLib.<clinit>(PyLib.java:465) ~[?:?]
        at org.openhab.binding.appletv.internal.jpy.LibPyATV.<init>(LibPyATV.java:157) ~[?:?]
        at org.openhab.binding.appletv.internal.handler.AppleTVHandler.lambda$0(AppleTVHandler.java:59) ~[?:?]
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) ~[?:?]
        at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[?:?]
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) ~[?:?]
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) ~[?:?]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:?]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:?]
        at java.lang.Thread.run(Thread.java:748) [?:?]

Hi everyone and thanks for all the tries regarding this binding.
Quick question, when you try to add the thing in UI asks for IP and Login ID, what’s the entry in Login ID? and Lib install path?
Thank you in advance.
Mike

Yes, Raspberry Pi, running openhabian.

I have several python modules from previous unsuccessful attempts to load pyatv. I also previously loaded jpy with apt-get.

ls /usr/bin | grep python

python
python2
python2.7
python2.7-config
python2-config
python3
python3.5
python3.5-config
python3.5m
python3.5m-config
python3-config
python3m
python3m-config
python-config

I noticed in the jpy documentation that they recommend using Oracle java for your jdk. I have a OpenJDK installed and it seems to be working.