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 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
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
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.
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…
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
Have your AppleTV on and go to the menu where you can pair additional remotes.
It should show up as pyatv and the pin code is 1234 (as indicated by the -p option above)
When pairing is complete you’ll get the Login ID given to you in the command line of the Pi