OK, got Python3.5 installed via https://www.cyberciti.biz/faq/debian-ubuntu-linux-python-h-file-not-found-error-solution/ and
sudo apt-get install python3.5-dev
Then pyatv could be installed with
sudo /usr/bin/python -m pip install pyatv
So upstart now is:
2019-04-02 12:43:51.928 [DEBUG] [pletv.internal.AppleTVHandlerFactory] - Apple-TV.PyATV: jpyLib=lib/jpy/lib.synology-x86-64-3.5
2019-04-02 12:43:51.934 [DEBUG] [pletv.internal.AppleTVHandlerFactory] - Apple-TV.PyATV: jpy.pythonExecutable: /usr/bin/python3
2019-04-02 12:43:51.938 [DEBUG] [pletv.internal.AppleTVHandlerFactory] - Apple-TV.PyATV: jpy.pythonLib: /usr/lib/x86_64-linux-gnu/libpython3.5m.so
2019-04-02 12:43:51.946 [DEBUG] [pletv.internal.AppleTVHandlerFactory] - Apple-TV.PyATV: jpy.jpyLib: /var/lib/openhab2/tmp/ohlib-8371605431178960950/jpy.so
2019-04-02 12:43:51.950 [DEBUG] [pletv.internal.AppleTVHandlerFactory] - Apple-TV.PyATV: jpy.jdlLib: /var/lib/openhab2/tmp/ohlib-8371605431178960950/jdl.so
2019-04-02 12:43:51.964 [DEBUG] [pletv.internal.AppleTVHandlerFactory] - Apple-TV.PyATV: jpy.pythonPrefix: /usr
2019-04-02 12:43:57.098 [DEBUG] [pletv.internal.AppleTVHandlerFactory] - Apple-TV.PyATV: jpyLib=lib/jpy/lib.synology-x86-64-3.5
2019-04-02 12:43:57.108 [DEBUG] [pletv.internal.AppleTVHandlerFactory] - Apple-TV.PyATV: jpy.pythonExecutable: /usr/bin/python3
2019-04-02 12:43:57.118 [DEBUG] [pletv.internal.AppleTVHandlerFactory] - Apple-TV.PyATV: jpy.pythonLib: /usr/lib/x86_64-linux-gnu/libpython3.5m.so
2019-04-02 12:43:57.123 [DEBUG] [pletv.internal.AppleTVHandlerFactory] - Apple-TV.PyATV: jpy.jpyLib: /var/lib/openhab2/tmp/ohlib-5864833516873744518/jpy.so
2019-04-02 12:43:57.124 [DEBUG] [pletv.internal.AppleTVHandlerFactory] - Apple-TV.PyATV: jpy.jdlLib: /var/lib/openhab2/tmp/ohlib-5864833516873744518/jdl.so
2019-04-02 12:43:57.129 [DEBUG] [pletv.internal.AppleTVHandlerFactory] - Apple-TV.PyATV: jpy.pythonPrefix: /usr
2019-04-02 12:43:58.415 [ERROR] [pletv.internal.AppleTVHandlerFactory] - Apple-TV.PyATV: Unable to start Python (jpy): Error in Python interpreter:
2019-04-02 12:43:58.417 [ERROR] [pletv.internal.AppleTVHandlerFactory] - Apple-TV.PyATV: Unable to start Python (jpy): Error in Python interpreter:
And
root@robin:/var/lib/openhab2/etc# tail -f /var/log/openhab2/openhab.log | grep appletv
2019-04-02 12:53:25.530 [DEBUG] [org.openhab.binding.appletv ] - BundleEvent [unknown:512] - org.openhab.binding.appletv
2019-04-02 12:53:25.547 [DEBUG] [org.openhab.binding.appletv ] - ServiceEvent REGISTERED - {org.eclipse.smarthome.core.thing.binding.ThingHandlerFactory}={service.id=154, service.bundleid=255, service.scope=bundle, component.name=org.openhab.binding.appletv.internal.AppleTVHandlerFactory, component.id=63} - org.openhab.binding.appletv
2019-04-02 12:53:27.600 [DEBUG] [org.openhab.binding.appletv ] - BundleEvent STARTING - org.openhab.binding.appletv
2019-04-02 12:53:27.603 [DEBUG] [org.openhab.binding.appletv ] - BundleEvent STARTED - org.openhab.binding.appletv
Sending Top_Menu:
2019-04-02 12:54:53.325 [INFO ] [letv.internal.handler.AppleTVHandler] - Apple-TV.Handler: Send command(s): top_menu
2019-04-02 12:54:53.327 [INFO ] [pletv.internal.AppleTVHandlerFactory] - Apple-TV.PyATV: Sending command top_menu to ip 10.0.0.157, lid *************************************
2019-04-02 12:54:53.331 [ERROR] [pletv.internal.AppleTVHandlerFactory] - Apple-TV.PyATV: Exception on PyATV call: null (class java.lang.NullPointerException)
2019-04-02 12:54:53.333 [INFO ] [letv.internal.handler.AppleTVHandler] - Apple-TV.Handler: SendKey failed!
DAH - SighâŠFix one issueâŠnext is awaiting around the corner
root@robin:/usr/bin# atvremote --address 10.0.0.157 --login_id ***************** top_menu
Traceback (most recent call last):
File "/usr/local/bin/atvremote", line 7, in <module>
from pyatv.__main__ import main
File "/usr/local/lib/python3.5/dist-packages/pyatv/__init__.py", line 12, in <module>
from pyatv.pairing import PairingHandler
File "/usr/local/lib/python3.5/dist-packages/pyatv/pairing.py", line 14, in <module>
import netifaces
ImportError: No module named 'netifaces'
root@robin:/usr/bin#
Try to fix:
root@robin:/usr/bin# sudo pip3.5 install netifaces
Collecting netifaces
Downloading https://files.pythonhosted.org/packages/6f/66/2df3d5cb0e18eccf0f798f7a31601678fc3578ce560fa5b897d791e3f835/netifaces-0.10.9-cp35-cp35m-manylinux1_x86_64.whl
Installing collected packages: netifaces
Successfully installed netifaces-0.10.9
root@robin:/usr/bin# find /usr -name netifaces*
/usr/local/lib/python3.5/site-packages/netifaces-0.10.9.dist-info
/usr/local/lib/python3.5/site-packages/netifaces.cpython-35m-x86_64-linux-gnu.so
/usr/lib/python3/dist-packages/netifaces.cpython-36m-x86_64-linux-gnu.so
/usr/lib/python3/dist-packages/netifaces-0.10.4.egg-info
Still fails thoughâŠ
And fix:
root@robin:/usr/bin# cp -R /usr/local/lib/python3.5/site-packages/netifaces* /usr/local/lib/python3.5/dist-packages/
root@robin:/usr/bin# atvremote --address 10.0.0.157 --login_id ******************** top_menu
root@robin:/usr/bin#
Now Openhab2 starts with no errors and I can send top_menu to the Apple TV4. Otherwise, nothing is shown in Paper UI, but:
b np@robin:~$ atvremote --address 10.0.0.157 --login_id ******************* playing
Media type: Unknown
Play state: Playing
Title: Arpegiateur (Arpegiator)
Artist: Jean-Michel Jarre
Album: Les concerts en Chine
Genre: Elektronisk
Position: 386/412s (93.7%)
Repeat: Off
Shuffle: False
bnp@robin:~$
Now, Paper UI looks like this (No data - not sure if they are supposed to be there?):