Let’s start with a bit of context: I host Gladys and Frigate on a Rock64 (ROCK64 - PINE64), which is a rather basic CPU backed by 4GB of memory. For Gladys, it « does the job. » For Frigate, on the other hand, it seems rather compromised. Here is the load status when Frigate is in « detection » mode:
Additionally, Frigate doesn’t detect anything, and that’s where I wonder if my Frigate configuration is correct. The instructions for installing and configuring the integration are very precise (but I admit they are a bit complex for a beginner), however, I followed Claude’s basic instructions to configure a test camera…
I’ll start by trying to find a Coral USB, configure it, and reduce the CPU load before going any further…
One thing is certain, the Coral will greatly relieve your CPU!!
It’s still important, especially since you already have Gladys on it, which suffers from this high load during Frigate detections
If it can help you, here is my Frigate config, on a server without a TPU.
The trick is to perform detection on a lower quality image and on a limited number of images per second. I didn’t invent anything, Claude did it for me.
Amazing! Thanks for the integration, I was really looking forward to it
Installation and configuration remain quite simple. Device detection works well.
Here are a few oddities I encountered while testing for a few minutes:
Once detected, devices can no longer be modified (assignment to rooms or name change), there is an error message on the UI.
Detection worked well on my living room camera, but on the one in the garden, it didn’t report the info to Gladys (see capture): log ok, frigate ok, log ok. EDIT: However, I just rechecked Gladys and there is a car event that has been reported since (except it’s not the one I « captured », I need to do more tests)
Thanks @ProtZ for this very complete feedback! Here’s what I found:
Devices that can’t be modified: a bug on Gladys’s side. The Devices screen returns the full device, including the camera image, and Gladys refuses anything over 100 KB. Version 0.3.2 keeps the image under 60 KB. After the update, wait a minute (time for the small image to replace the old one), then try again.
Car not re-detected, frozen states, presence that never resets: your logs show Frigate connecting to the broker, getting disconnected 0.4 seconds later, and repeating every 10 seconds. It’s offline almost all the time, so most of its messages (including the “0” that resets the presence) are lost. This is almost always another MQTT client using the same client_id as Frigate (frigate by default): a second Frigate, an old container still running, another tool… You should see MQTT disconnected in a loop in Frigate’s logs. Give each one its own mqtt.client_id and everything should work.
Version 0.3.2 makes the integration more robust in this case: it clearly signals this in the status, and it re-reads the present objects when Frigate comes back, so a presence won’t stay stuck.
Let me know if this also fixes the display that only updated when refreshing the page?
Good question, for me the idea was to propose the integration of a connector to Frigate, but I’m working on the subject to see what’s possible and the limits.
I’ve looked into the subject a bit more, and it won’t be possible.
If I take the example of Zigbee2MQTT, it’s a « core » module of Gladys, which removes a number of limitations.
External modules have very limited capabilities and possibilities, for good reason, to ensure the stability and security of Gladys.
So planning to install Frigate in Gladys isn’t possible with these limitations. Moreover, it’s not Gladys’s purpose to be a « self-hosting » box either. Other solutions do this very well and it would be complementary and interesting for you, I imagine.
mqtt is weird I didn’t find any other client connected to my mqtt so in doubt I migrated mosquitto from 1.6.5 to 2.x: no idea if it’s related but it works well now (and I’ll stay vigilant),
the presence detection update works and updates correctly
however: the motion feature remains at « Motion detected » and no longer turns off. I think it’s more a misunderstanding on my part than a real issue. I’ll look into it.
Yes it’s possible, but the CPU and RAM limit is a first problem. Then, including Frigate increases the image from a few Mb to 4Gb for everyone, even those who don’t want Frigate.
This ultimately results in a heavier container and reduced capabilities in Frigate. I find that the benefit is not amazing.
I just received an email about your exchanges on this topic, so I’m here to help quickly. I’m so sorry to be so unavailable lately…
So @lmilcent, if I’m not mistaken, there’s no question of including anything in the image.
The download and installation of Frigate is done on demand. There’s no question of including such a heavy image ^^
I’m a bit more optimistic than @mutmut though the development was in core Gladys integration. I hadn’t yet developed any external integration, and I hadn’t yet tested @pierre-gilles’ development. However, the link that @mutmut provided is good, and @pierre-gilles’ development was supposed to provide the same possibilities. So it should definitely be possible. We’ll see if a piece is missing when testing the code.
That’s exactly what I was saying in the end: impossible via an external installation, as it stands.
If I understand your approach, it was to propose a button in the « Frigate connector » module that would deploy a sub-container on demand with Frigate? After digging into the subject, it still seemed quite limited, as the Linux capabilities are very restrictive. It would therefore be impossible to perform certain processes, and the hardware limitations (CPU + RAM) imposed on containers are also very restrictive.
Now I can test it, and we’ll see how it goes in practice. It could very well be a first step for a first camera, by explaining the model’s limitations in the integration itself!
PidsLimit: 100 (including threads) → probably the first blocker for Frigate
/tmp in tmpfs 64 MB → too tight for /tmp/cache if recording
CapDrop ALL → to test with s6-overlay
3 ports max (Frigate needs 4)
the image is downloaded at installation even in manual (install.js L76-79)
My advice: a quick test with frigate in manual, read_only: false, memory_mb: 2048, shm_mb: 256, 1 camera without recording → we’ll quickly know if the pids/capabilities block.
The rest can be addressed with one or two small core PRs to propose to @pierre-gilles (pids_limit / tmpfs size / 4 ports in the manifest, and image download on first start for manual only).
Let me know if you need help with that, even if with AI I shouldn’t be much more useful
I did the study but I didn’t have time to post and you did it for me
It does indeed require at least 2 core changes: allowing an additional Linux capability and increasing the pids.
What bothers me about all this is that we’re debating a request that, in my opinion, isn’t really home automation. We’ll have to decide with @pierre-gilles whether we move forward with specific exceptions for this service or whether we officially say no.
Thanks for the study! I agree we need to make a decision with @pierre-gilles, but I don’t see Frigate as an exception:
There is precedent: The core already installs Mosquitto, Zigbee2MQTT, Node-RED, and Matterbridge in containers for a plug-and-play experience. Frigate fits the same logic (just as complex to install as an MQTT broker for a beginner).
That was the purpose of sub-containers: Pierre-Gilles presented them with Frigate + Mosquitto as an example, and the spec already mentions Frigate for read_only: false.
It’s home automation: detection → scene triggers → notifications, which is exactly what your integration already does very well
Rather than an exception, I would propose generic, bounded, and user-displayed fields, like memory_mb / devices today: pids_limit, a closed list of capabilities granted by the user (same principle as hardware classes), tmpfs size. This serves Frigate, but also any future heavy integration.
And to be clear: the two modes are complementary, not opposed. The remote instance remains essential (Pi, NAS, Frigate already installed elsewhere). But someone with a suitable machine should be able to do everything in Gladys, without being limited by fixed ceilings (4 GB / 2 CPU today, regardless of the machine).
For that, the core would need to know the machine (Gladys already reads host RAM/CPU for the System screen), with limits relative to the host, a recommended value calculated by the integration (number of cameras, resolution, detected Coral/GPU), and a user setting with a warning beyond the recommended value.
That’s what I had planned in the original core integration, and I don’t think the fact of moving to an external integration diverges on this point, right?