So for the past few days I’ve been working on a scrape sensor which scrapes the BBC Sounds website for ‘what’s playing’ and returns text sensors for six channels along with an image URL for the associated currently playing DJ.
This has all gone swimmingly with help.
HOWEVER, I’ve found today when I’m trying to put these six sensors into a lovelace page on my Pi 2B that the Pi is creaking under the strain - it seems to continually freeze. Is this consistent with me reaching the limitations of the hardware? If I’m accessing the Pi from the local IP and it freezes, if I switch to the DuckDNS IP, it’s happy to serve up pages for a minute again. Then it freezes. By that point if I go back to the local IP, I again have access.
The processor usage seems to peak at 50% but swap use is at 98 or 100% - but then swap use is ALWAYS at 98 or 100% - it seems to be a bug with Hass? If I do a host restart for a few hours it’ll be absolutely fine then suddenly (spontaneously!) rocket up to 100%.
Any help welcome. I don’t really have the cash to splurge on a new Pi…
Not exactly sure what is happening with your Lovelace page, but…
You really, really don’t want to be using swap when running on a pi. (Maybe if you’re swap is located on SSD, but I’d still recommend against it.) Highly suggest picking up a Pi4 (be sure to get some active cooling) or, if necessary, a Pi3( ram is same as pi2, but much better proc). You’re gonna see immediate, dramatic improvement.
Then you could use the Pi2 for another HA related function like gpio-based data presented over MQTT or a camera via MotionEyeOS.
Thank you. I am using an SSD. The 100% swap usage thing appeared out of the blue a few version of HA back. I posted about it at the time. Problem is, I’m stuck on my current version of Home Assistant 0.92.1 and I can’t update any further due to various errors so I’m just going to have to bite the bullet I s’pose and buy a Pi3 and reload my config painstakingly bit by bit. Thanks for your insights!
I am still running my Pi 2B with no problems on the latest HA 0.103.6 with RAM sitting at 35% and CPU idling at 3% most of the time, only peaking around 40% when I am recording a TV show and running commercial detection software at the same time (comskip). However - I have had to be judicious about what else I am running on the 2B besides HA, for example the Chromium web browser uses a ton of memory so I no longer use the 2B for browsing. I also don’t try to live-stream my 4 security cams - I use the ‘push’ camera and just send stills detected by the cams - much gentler on the network as well as the Pi since the cams are doing all the motion detection. I probably won’t ever upgrade to a Pi4, but that’s just because I (weirdly I know) like the challenge of being efficient
@jambalaya I think you’ve sort of solved the mystery I think!
If what I’m doing my using the camera entity on a picture card is continually trying to download the same image from the remote URL x 6 then that is almost certainly why the thing is locking up after a minute or so!
I don’t want to do this, I merely want to get occasional changes of the picture…
Huge performance saving by switching camera to stills instead of stream. Usually just a different url for your camera.
ah but I’m not actually using a camera, I’m using the settings for a camera because I’m pulling in images from the web for an internet radio sensor. I’ll probably have to convert to this