Description
When attempting to add a camera to the Cloudvue Gateway an error message appears “Camera Already Exists”. Typically, this happens when the local database is out of sync with the cloud database. Removing the camera from the local database then re-adding triggers a new sync which resolve the issue. Below are instructions for removing the camera from the local Cloudvue database.
Product
- Cloudvue Gateway
Solution
Overview
The following steps should be used to remove the duplicate camera from the Cloudvue Gateways database.
- SSH to the Cloudvue Gateway
- Launch MariaDB Monitor
- Display Camera Table Contents
- Use the MAC address to Identify the Camera
- Delete the Camera
- Display Camera Table Contents
- Check the changes
- Delete associated Camera Settings
- Close MariaDB Monitor
SSH to the Cloudvue Gateway
sudo ssh -p 7627 smartvue@[IPADDRS]
- Where [IPADDRS] is the IP address of the Cloudvue Gateway
Launch MariaDB monitor and Access The Smartvue Database
mysql -u root smartvuedb
Display Camera Table Contents
select * from camera;
Identify The Camera
- Use the MAC to find the camera which needs to be deleted
- Make note of the id and deleted_at fields
- NULL in deleted_at indicates that camera is active
Delete The Camera
update camera set deleted_at = created_at where id = [id];
- Where [id] is the cameras id
Check Your Work
- List the cameras
select * from camera;
- Verify that the deleted_at field is no longer NULL but is the same as the created_at field
Delete the Cameras Settings
delete from camera_setting where camera_id = [id];
- Where [id] is the cameras id
Close MariaDB monitor
- \q
Pro Tip: To restore a camera change the deleted_at field to NULL
update camera set deleted_at = NULL where id = [id];
- Where [id] is the cameras id