Streaming external content buffering and caching

  • I have several RPi4 running the latest version of Libreelec v10.0.4 I think.

    Since September, I've been having issues with buffering and caching when streaming internet based content. I often get errors from tmdb saying it can't connect also from trakkit.com saying it can't connect. I use Sling as one of my streaming services and I get errors from it telling me to check my network settings.

    Here is an example of the sling error from the logs:

    Code
    requests.exceptions.ConnectionError: HTTPSConnectionPool(host='ums.p.sling.com', port=443): Max retries exceeded with url: /v2/user.json (
    Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0xd859a258>: Failed to establish a new connection: [Errno -2] Name or service not known'))

    If I turn on debugging, the log file quickly becomes to large for me to post to pastebin. I've tried more than once in the past, so, I currently do not have a log in pastbin. If I need to, I'll see what I can do to edit it down so it will fit.

    Back in September, I was having a larger networking issue, a lot of devices kept dropping, even one's on wire, after some back and forth with my ISP, I finally got them to come out and look at my outside connections and they found a bad moca filter. Once that cleared up, I expected more of my internal issue to clear up. Most have, but I am still having WIFI issues.

    About the same time, I put in a wireless security camera system. I started to suspect that is causing issue. This system has a different WIFI base station and I got to thinking that that might the cause. I discovered the networking tools addon and discovered that I can see what channel my pi is using with the iwlist command. The current frequency was something that my pi did not support, so I looked at the router and discovered that it was on channel 161. The pi only goes up to 149, so I adjusted, and for a while all seemed to work just fine.

    After a few days, I started getting buffering and caching again. What's really odd, is how inconstant this is across the network. The pi closest to the router will have download speeds of 1.5mbps, while the one on the other end of the house, with a lot more walls and structures in place, is at 75Mbps. If I change the channel, it may work for a few day's, but then I start getting buffering and caching again.

    I'm running out of idea's. I still suspect that it's the camera system, but it operates on 2.4 and all of my pi's are on 5Ghz, so it shouldn't be that causing the issue. My camera system does not have a single issue. I would think that if one was having an issue, the other would as well.

    I just changed the channel in my router from 149 to something else, rebooted the pi, changed it back to channel 149 (which is the highest channel the pi can use) rebooted checked the speed. I am now getting 72Mps and not a single error, or caching or buffering.

    Any thoughts on what to look at or is there something else that might be causing my WIFI issues? I can't just keep changing the channel every couple of day's when this starts acting up.

    Thanks

  • 5GHz is capable of being faster than 2.4GHz but requires a better signal to sustain the same data rates (esp. on an RPi which has a relatively rubbish antenna to start with and might have USB3 enabled too) so often you might find a "slower" 2.4GHz connection will achieve better throughput and reliability .. until you add a bunch of other 2.4GHz devices to the network. TL/DR: If you want a reliable connection, run a cable to the RPi, or build a proper WiFi network with multiple base-stations, each with Ethernet backhaul to the main switch/router.

    It's possible to fiddle with cache settings in Kodi, but while these can smooth minor peaks/toughs in bandwidth, they will never solve a lack of bandwidth or instability in the connection; which sounds more like the root cause.