Closed itairaz1 closed 2 years ago
dlna_dmr documentation dlna_dmr source (message by IssueLinks)
Hey there @stevenlooman, @chishm, mind taking a look at this issue as it has been labeled with an integration (dlna_dmr
) you are listed as a code owner for? Thanks!
(message by CodeOwnersMention)
Thank you for the bug report. The other issue you linked was a bit tricky to diagnose, I was only able to do it from packet captures. Are you able to provide a packet capture for when the error occurs?
Thanks @chishm for responding, Is there a convenient way to do that (build-in in HA?) to capture packets? or should I use my own sniffer? if I have to provide my own sniffer, do you have any recommendation how to do it, so I wouldn't miss any important data? If it will be easier, I can try perform manual requests to see the responses
I'm not aware of any sniffers built into HA, so in this case I'd recommend using Wireshark, or tcpdump if HA is running on a headless machine.
Running the capture on your HA machine, and capturing all traffic to/from the YAS-209, should be the best way to do this. I think you can use:
sudo tcpdump -i any -w /tmp/capture.pcap host 192.168.1.155
Where 192.168.1.155
is the IP address of your YAS-209 and /tmp/capture.pcap
is the file that will be written.
While that is running, try getting HA to show the same problem (device becoming unavailable) using whatever steps you have previously. Perhaps try to play some media, or repeatedly change the volume.
I'm not aware of any sniffers built into HA, so in this case I'd recommend using Wireshark, or tcpdump if HA is running on a headless machine.
Running the capture on your HA machine, and capturing all traffic to/from the YAS-209, should be the best way to do this. I think you can use:
sudo tcpdump -i any -w /tmp/capture.pcap host 192.168.1.155
Where
192.168.1.155
is the IP address of your YAS-209 and/tmp/capture.pcap
is the file that will be written.While that is running, try getting HA to show the same problem (device becoming unavailable) using whatever steps you have previously. Perhaps try to play some media, or repeatedly change the volume.
Thanks for the details I'm using Home Assistant OS, and I've tried to tcpdump in couple of method and it didn't capture the soundbar packages. I've looked on the web and didn't found a way to do that. Do you have any idea how to tcpdump in Home Assistant OS? Or maybe find another way? like put new logs, or use custom integration? I'm developer, I can try and help with that Here is the history showing the unavailability status change over the time (it happened independently of using the soundbar)
Thank you for all the effort
Sorry, I'm not familiar with Home Assistant OS. You may be able to install tcpdump on there following these instructions, then attach to the hassio Docker container's network in a similar way to the instructions here.
I found a solution, I'm using SSH add on, but this add on uses hassio network, and I needed host network. I used Portainer in order to re-create the container with host network, and that solve the issue.
Attaching here the pcap file capture2.pcap.zip
Thanks!
This looks to be the same timing issue as before; the device is closing the TCP connection while HA is busy sending the next request on the same connection. I have an idea of something that should fix it, hopefully for good.
This looks to be the same timing issue as before; the device is closing the TCP connection while HA is busy sending the next request on the same connection. I have an idea of something that should fix it, hopefully for good.
Thank you! Feel free to ask for assistant, I can test the fix when available, if needed.
I've made a fix to the async-upnp-client that should resolve this for you. Could you please test version 0.31.0 by pip installing async-upnp-client==0.31.0 inside your HA Docker container, then running HA with --skip-pip
? It might be a bit tricky to do (I've never tried it within Docker before), but that should test the fix.
If all goes well, I'll submit a library bump pull request.
I don't find a way to upgrade async-upnp-client. Stoping/restarting hass is killing the container
Hi, thank you for the fix! it's seemed better now, here is a picture of the YAS history, and you can see clearly when HA was updated:
But now I have other, but, non-critical issue: every 10m the device become unavailable for a moment, with this debug log:
2022-06-15 21:16:31 DEBUG (MainThread) [homeassistant.components.dlna_dmr] SSDP SsdpChange.BYEBYE notification of device uuid:FFB8F002-B159-CD52-EBE5-CDCBFFB8F002::upnp:rootdevice at http://192.168.1.155:49152/description.xml
2022-06-15 21:16:31 DEBUG (MainThread) [homeassistant.components.dlna_dmr] Disconnecting from YAS_209
2022-06-15 21:16:32 DEBUG (MainThread) [homeassistant.components.dlna_dmr] SSDP SsdpChange.ALIVE notification of device uuid:FFB8F002-B159-CD52-EBE5-CDCBFFB8F002::urn:schemas-upnp-org:device:MediaRenderer:1 at http://192.168.1.155:49152/description.xml
2022-06-15 21:16:32 DEBUG (MainThread) [homeassistant.components.dlna_dmr] Connecting to device at http://192.168.1.155:49152/description.xml
2022-06-15 21:16:32 DEBUG (MainThread) [homeassistant.components.dlna_dmr] Getting event handler for EventListenAddr(host='192.168.1.102', port=0, callback_url=None)
2022-06-15 21:16:32 DEBUG (MainThread) [homeassistant.components.dlna_dmr] Started event handler at http://192.168.1.102:45759/notify
Any idea?
Your device is sending a notification that it will become unavailable with the SsdpChange.BYEBYE notification
. This is what the UPnP Device Architecture says about it:
When a device and its services are going to be removed from the network, the device should multicast a ssdp:byebye message corresponding to each of the ssdp:alive messages it multicasted that have not already expired.
The next second it announces it is available/alive again with the SsdpChange.ALIVE notification
. Is there any action you are doing which causes this?
Sorry for the late answer - I re-checked and it seemed to be solved (not sure about the reason) Thank you for taking care!
I'm glad it's resolved, but a little worried it might happen again. If this should recur, please open a new issue and we might be able to get to the bottom of it.
The problem
Similar to https://github.com/home-assistant/core/issues/57240 Sometime my DLNA integration with my Yamaha YAS-209 become unavailable. Tuned on the debug log and before it become unavailable I see this line
Device unavailable: UpnpConnectionError('[Errno None] Can not write request body for http://192.168.1.155:49152/upnp/control/rendertransport1', None)
The IP replaced, and seemed correct.Tried to remove and add back, but it didn't solve the issue
Thanks!
What version of Home Assistant Core has the issue?
core-2022.4.4
What was the last working version of Home Assistant Core?
No response
What type of installation are you running?
Home Assistant OS
Integration causing the issue
DLNA Digital Media Renderer
Link to integration documentation on our website
https://www.home-assistant.io/integrations/dlna_dmr/
Diagnostics information
No response
Example YAML snippet
No response
Anything in the logs that might be useful for us?
No response
Additional information
No response