Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues once devices found #2

Closed
pssc opened this issue Jan 4, 2020 · 12 comments
Closed

Issues once devices found #2

pssc opened this issue Jan 4, 2020 · 12 comments

Comments

@pssc
Copy link

pssc commented Jan 4, 2020

2020-01-04 19:20:40 DEBUG (MainThread) [custom_components.hdhomerun.sensor] Scanning network for HDHomeRun devices
2020-01-04 19:20:41 DEBUG (MainThread) [custom_components.hdhomerun.sensor] Detected 4 tuners for device: 1251E8E2
2020-01-04 19:20:41 DEBUG (MainThread) [custom_components.hdhomerun.sensor] Fetching status for tuner: 1251E8E2-1
2020-01-04 19:20:41 ERROR (MainThread) [hdhr.adapter] Could not get tuner vstatus (0).
2020-01-04 19:20:41 ERROR (MainThread) [homeassistant.components.sensor] hdhomerun: Error on device update!
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 292, in _async_add_entity
    await entity.async_device_update(warning=False)
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 459, in async_device_update
    await self.async_update()
  File "/config/custom_components/hdhomerun/sensor.py", line 69, in async_update
    (vstatus, raw_data) = self._adapter.get_tuner_vstatus()
  File "/usr/local/lib/python3.7/site-packages/hdhr/adapter.py", line 191, in get_tuner_vstatus
    raise Exception(message)
Exception: Could not get tuner vstatus (0).
2020-01-04 19:20:41 DEBUG (MainThread) [custom_components.hdhomerun.sensor] Fetching status for tuner: 1251E8E2-3
2020-01-04 19:20:41 ERROR (MainThread) [hdhr.adapter] Could not get tuner vstatus (0).
2020-01-04 19:20:41 ERROR (MainThread) [homeassistant.components.sensor] hdhomerun: Error on device update!
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 292, in _async_add_entity
    await entity.async_device_update(warning=False)
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 459, in async_device_update
    await self.async_update()
  File "/config/custom_components/hdhomerun/sensor.py", line 69, in async_update
    (vstatus, raw_data) = self._adapter.get_tuner_vstatus()
  File "/usr/local/lib/python3.7/site-packages/hdhr/adapter.py", line 191, in get_tuner_vstatus
    raise Exception(message)
Exception: Could not get tuner vstatus (0).
2020-01-04 19:20:41 DEBUG (MainThread) [custom_components.hdhomerun.sensor] Fetching status for tuner: 1251E8E2-0
2020-01-04 19:20:41 ERROR (MainThread) [hdhr.adapter] Could not get tuner vstatus (0).
2020-01-04 19:20:41 ERROR (MainThread) [homeassistant.components.sensor] hdhomerun: Error on device update!
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 292, in _async_add_entity
    await entity.async_device_update(warning=False)
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 459, in async_device_update
    await self.async_update()
  File "/config/custom_components/hdhomerun/sensor.py", line 69, in async_update
    (vstatus, raw_data) = self._adapter.get_tuner_vstatus()
  File "/usr/local/lib/python3.7/site-packages/hdhr/adapter.py", line 191, in get_tuner_vstatus
    raise Exception(message)
Exception: Could not get tuner vstatus (0).
2020-01-04 19:20:41 DEBUG (MainThread) [custom_components.hdhomerun.sensor] Fetching status for tuner: 1251E8E2-2
2020-01-04 19:20:41 ERROR (MainThread) [hdhr.adapter] Could not get tuner vstatus (0).
2020-01-04 19:20:41 ERROR (MainThread) [homeassistant.components.sensor] hdhomerun: Error on device update!
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 292, in _async_add_entity
    await entity.async_device_update(warning=False)
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 459, in async_device_update
    await self.async_update()
  File "/config/custom_components/hdhomerun/sensor.py", line 69, in async_update
    (vstatus, raw_data) = self._adapter.get_tuner_vstatus()
  File "/usr/local/lib/python3.7/site-packages/hdhr/adapter.py", line 191, in get_tuner_vstatus
    raise Exception(message)
Exception: Could not get tuner vstatus (0).
@burnnat
Copy link
Owner

burnnat commented Jan 5, 2020

Thanks for the report. According to the underlying library provided by Silicondust, it looks like a 0 result means "the operation was rejected" but there's no indication what could lead to that. I'll try to do a little digging and see if I can come up with any ideas. If you have the hdhomerun_config command-line utility are you able to query the tuner status that way?

@burnnat
Copy link
Owner

burnnat commented Jan 5, 2020

Also, could you provide some info about what HDHomeRun device you have? The library documentation is pretty sparse but I'm wondering if the vstatus API is only supported on certain models (in which case we'd need to fall back to a different API as appropriate).

@burnnat
Copy link
Owner

burnnat commented Jan 5, 2020

On further reading, it looks like the output of hdhomerun_config <device-id> get help lists the APIs supported by that device. If you are able to run that and post the results, that would be great.

@pssc
Copy link
Author

pssc commented Jan 5, 2020

All looks ok from the cli

hdhomerun_config 1251E8E2 get /sys/version
➜  ~ hdhomerun_config 1251E8E2 get /sys/version
20190621
➜  ~ hdhomerun_config 1251E8E2 get /sys/hwmodel
HDHR5-4DT
➜  ~ hdhomerun_config 1251E8E2 get /sys/features
channelmap: eu-bcast au-bcast tw-bcast
modulation: tt8qam256 tt8qam64 tt8qam16 tt8qpsk tt7qam256 tt7qam64 tt7qam16 tt7psk tt6qam256 tt6qam64 tt6qam16 tt6qpsk t8qam64 t8qam16 t8qpsk t7qam64 t7qam16 t7qpsk t6qam64 t6qam16 t6qpsk
auto-modulation: auto auto8t auto7t auto6t

➜  ~ hdhomerun_config 1251E8E2 get /tuner0/status
ch=none lock=none ss=0 snq=0 seq=0 bps=0 pps=0
➜  ~ hdhomerun_config 1251E8E2 get /sys/debug
mem: nbk=2 dmk=374 fet=0
loop: pkt=0
t0: pt=11 cal=-5540
t1: pt=11 cal=-5518
t2: pt=11 cal=-5540
t3: pt=11 cal=-5540
eth: link=100f

➜  ~ hdhomerun_config 1251E8E2 get help /
Supported configuration options:
/lineup/scan
/sys/copyright
/sys/debug
/sys/features
/sys/hwmodel
/sys/model
/sys/restart <resource>
/sys/version
/tuner<n>/channel <modulation>:<freq|ch>
/tuner<n>/channelmap <channelmap>
/tuner<n>/debug
/tuner<n>/filter "0x<nnnn>-0x<nnnn> [...]"
/tuner<n>/lockkey
/tuner<n>/program <program number>
/tuner<n>/status
/tuner<n>/streaminfo
/tuner<n>/target <ip>:<port>
/tuner<n>/vchannel <vchannel>

➜  ~ hdhomerun_config discover
hdhomerun device 1251E8E2 found at 192.168.78.145
➜  ~ hdhomerun_config 1251E8E2 get /tuner1/status
ch=none lock=none ss=0 snq=0 seq=0 bps=0 pps=0
➜  ~ hdhomerun_config 1251E8E2 get /tuner2/status
ch=none lock=none ss=0 snq=0 seq=0 bps=0 pps=0
➜  ~ hdhomerun_config 1251E8E2 get /tuner3/status
ch=none lock=none ss=0 snq=0 seq=0 bps=0 pps=0

@florafrisia
Copy link

(homeassistant) ➜ libhdhomerun git:(master) ✗ ./hdhomerun_config discover
hdhomerun device 14104765 found at 192.168.xxx.xxx

(homeassistant) ➜ libhdhomerun git:(master) ✗ ./hdhomerun_config discover get /sys/version
invalid ip address: get

(homeassistant) ➜ libhdhomerun git:(master) ✗ ./hdhomerun_config 14104765 get /sys/version
20190621

(homeassistant) ➜ libhdhomerun git:(master) ✗ ./hdhomerun_config 14104765 get /sys/model
hdhomerun3_dvbc

(homeassistant) ➜ libhdhomerun git:(master) ✗ ./hdhomerun_config 14104765 get /sys/features
channelmap: eu-cable au-cable tw-cable
modulation: a8qam256-* a8qam128-* a8qam64-* a7qam256-* a7qam128-* a7qam64-* a6qam256-* a6qam128-* a6qam64-*
auto-modulation: auto auto8c auto7c auto6c

(homeassistant) ➜ libhdhomerun git:(master) ✗ ./hdhomerun_config 14104765 get /tuner0/status
ch=none lock=none ss=0 snq=0 seq=0 bps=0 pps=0

(homeassistant) ➜ libhdhomerun git:(master) ✗ ./hdhomerun_config 14104765 get /sys/debug
mem: nbm=622811/13653 npf=81918 dmf=1236781
loop: pkt=0
t0: pt=11 cal=-532
t1: pt=11 cal=-529
t2: pt=11 cal=-531
t3: pt=11 cal=-536
eth: link=1000f

@florafrisia
Copy link

I've the same issue.

with kind regards,

Peter

@burnnat
Copy link
Owner

burnnat commented Jan 6, 2020

Thanks, according to the get help output it looks like these devices don't support the /tuner/vstatus API so will need to add a fallback to /tuner/status in that case. Will work on an update for this.

@burnnat
Copy link
Owner

burnnat commented Jan 12, 2020

I've pushed a change in version 0.0.4 that should hopefully resolve this. I don't have any actual hardware to test it with though, so if you continue to have issues after updating please let me know.

@aptonline
Copy link

aptonline commented Jan 12, 2020

I've pushed a change in version 0.0.4 that should hopefully resolve this. I don't have any actual hardware to test it with though, so if you continue to have issues after updating please let me know.

That seems to be working now for me, showing both my tuners. However the state changes to something random when viewing a channel:

t8qam64:714000000

Is this expected behaviour?

EDIT: After a quick google search I see that this is the modulation t8qam64 and frequency 714000000 for the channel the tuner is tuned to. How can this be made more meaningful in HA if at all?

@burnnat
Copy link
Owner

burnnat commented Jan 12, 2020

Yes, when the tuner is active the state will be the raw QAM channel in use. The vstatus API is what provides the user-friendly "virtual" channel number, but since your device apparently doesn't support it, the raw channel number is used instead. If you can find a way to get a friendly number using the hdhomerun_config CLI, post the command(s) and I should be able to figure out the corresponding API.

@burnnat
Copy link
Owner

burnnat commented Jan 12, 2020

On closer reading of the documentation, it looks like it may be possible to determine the virtual channel number using a combination of the streaminfo and program APIs (assuming this info is populated by your TV provider). Could you run the following commands on an active tuner and paste the output here?

hdhomerun_config <device> get /tuner<n>/streaminfo
hdhomerun_config <device> get /tuner<n>/program

Thanks!

@pssc
Copy link
Author

pssc commented Jan 13, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants