Open Radeon24 opened 4 years ago
Thanks for the report. A status of -1
from the libhdhomerun library indicates a general "connection failure" so unfortunately there's not of lot of info to go on. If you have the hdhomerun_config
command-line utility wherever HA is running I would check whether you are able to connect that way - and if not, that would seem to point to an issue at the network level, maybe a firewall or something.
It would be possible to make some changes and keep going with an empty firmware version if the API call fails, but I have a feeling that the same connection errors will come up again later when querying the actual tuner status.
I've just install hdhomerun_config on my HA host and all seems to be fine :
alfred@alfred:~/hdhomerun/libhdhomerun$ ./hdhomerun_config 10.42.20.216 get /lineup/scan
state=complete progress=100% found=40
alfred@alfred:~/hdhomerun/libhdhomerun$ ./hdhomerun_config 10.42.20.216 get /sys/hwmodel
HDHR5-4DT
alfred@alfred:~/hdhomerun/libhdhomerun$ ./hdhomerun_config 10.42.20.216 get /sys/model
hdhomerun5_dvbt
alfred@alfred:~/hdhomerun/libhdhomerun$ ./hdhomerun_config 10.42.20.216 get /sys/version
20200225
From the HassIO container it's okay too :+1:
config $ hdhomerun_config 10.42.20.216 get /sys/version
20200225
config $ ifconfig
eth0 Link encap:Ethernet HWaddr 02:42:AC:1E:21:04
inet addr:172.30.33.4 Bcast:172.30.33.255 Mask:255.255.254.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:32495 errors:0 dropped:0 overruns:0 frame:0
TX packets:1158 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:4718688 (4.5 MiB) TX bytes:758107 (740.3 KiB)
And this is my configuration in Home Assistant :
hdhomerun:
sensor:
- host: 10.42.20.216
So, I don't understand why there is this error...
Well that is puzzling. 🤔 I'll take a look at the libhdhomerun source to look for some other ideas, otherwise I guess we can make the firmware version optional and see what happens.
I'm not very good with ctypes and couldn't really understand the hdhr
library, but I've narrowed down why this is happening (maybe?) - not sure if this helps or not:
that gives a list of <hdhr.types.TYPE_hdhomerun_discover_device_t>
objects which is used to create the adapter:
the error described in this issue is encountered with that adapter. But things seem to work fine if I create the adapter from the IP address directly, using nice_ip
instead of nice_device_id
:
>>> device = HdhrUtility.discover_find_devices_custom(ip='192.168.1.100')
>>> ip_adapter = HdhrDeviceQuery(HdhrUtility.device_create_from_str(device.nice_ip)) # instead of device.nice_device_id
>>> ip_adapter.get_version()
'20200907'
>>> ip_adapter.get_model_str()
'hdhomerun4_atsc'
>>> ip_adapter.get_tuner_streaminfo()
[]
>>> ip_adapter.get_tuner_program()
'0'
>>> status, raw_data = ip_adapter.get_tuner_status()
(<hdhr.types.TYPE_hdhomerun_tuner_status_t object at 0x801a16bc0>, b'ch=none lock=none ss=0 snq=0 seq=0 bps=0 pps=0')
>>> status.nice_channel
'none'
to confirm, using the nice_device_id
instead:
>>> id_adapter = HdhrDeviceQuery(HdhrUtility.device_create_from_str(device.nice_device_id))
>>> id_adapter.get_version()
Could not get firmware version (-1).
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/home/hass/env/lib/python3.8/site-packages/hdhr/adapter.py", line 335, in get_version
raise error_for_result(result, message)
ConnectionError: Could not get firmware version (-1).
>>> id_adapter.get_model_str() # returns None
>>> id_adapter.get_tuner_streaminfo()
Could not get tuner streaminfo (-1).
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/home/hass/env/lib/python3.8/site-packages/hdhr/adapter.py", line 257, in get_tuner_streaminfo
raise error_for_result(result, message)
ConnectionError: Could not get tuner streaminfo (-1).
>>> id_adapter.get_tuner_program()
Could not get tuner program (-1).
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/home/hass/env/lib/python3.8/site-packages/hdhr/adapter.py", line 288, in get_tuner_program
raise error_for_result(result, message)
ConnectionError: Could not get tuner program (-1).
Hello, I have an issue with my HDHR5-4DT wich has the latest firmware 20200225 :
I am using the master branch via HACS on HassIO.
Thank you.