Skip to content

Stale cached camera config files cause incorrect camera detection and outdated UI behaviour #139

@Mraanderson

Description

@Mraanderson

If your request is for a new camera support
Diagnostics were run on a Raspberry Pi Global Shutter Camera (IMX296). Picamera2 correctly detects the sensor and reports the correct capabilities. However, CamUI continues to load outdated camera configuration data from cached files, even after camera‑module‑info.json is updated with the correct camera profile.

Is your feature request related to a problem? Please describe.
Yes. CamUI stores camera configuration data in files such as camera-last-config.json and connected_cameras_config.json. These files persist across runs and can contain outdated information from previous camera modules. When switching to a different camera or updating camera-module-info.json, CamUI may continue to use the stale cached data instead of the updated configuration.
This results in incorrect behaviour such as:
• UI showing the wrong camera profile
• Incorrect resolution lists
• Old sensor metadata being reused
• Backend and frontend becoming desynchronized
• Users believing their JSON edits are not being applied
The only workaround is to manually delete the cached config files before restarting the application.

Describe the solution you'd like
I would like CamUI to automatically refresh or invalidate cached camera configuration files when:
• A different camera is detected
• The camera-module-info.json file changes
• The user starts a new session
• The backend detects a mismatch between cached data and Picamera2’s reported sensor
Alternatively, CamUI could provide a “Clear Camera Cache” button in the UI or automatically regenerate the cache when the connected camera changes.

Describe alternatives you've considered
I manually deleted the cached JSON files before launching the application. This works but is not user‑friendly and is easy to overlook. Another option would be to disable caching entirely, but a smarter invalidation strategy would be preferable.

Additional context
This issue is especially noticeable when switching from the IMX477/HQ camera to the IMX296 Global Shutter Camera. Even after adding a correct IMX296 profile to camera-module-info.json, CamUI continued to load the old IMX477 data until the cached files were manually removed. This can lead to confusion and makes it appear as though the JSON configuration is being ignored

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions