Skip to content
This repository has been archived by the owner on Dec 14, 2022. It is now read-only.

Fails to parse Camera on update to UVC 3.10.0 #5

Open
wralb opened this issue Feb 1, 2019 · 2 comments
Open

Fails to parse Camera on update to UVC 3.10.0 #5

wralb opened this issue Feb 1, 2019 · 2 comments

Comments

@wralb
Copy link

wralb commented Feb 1, 2019

Thanks for a great simple solution to generating Unifi camera motion snapshots. Worked flawlessly for me for months.

I just upgraded to unifi video 3.10.0 and the unifi-video-mqtt.sh script stopped doing what it should. A quick inspection shows that Ubiquiti added an extra field to motion.log, which breaks the line which extracts the camera ID from the log line. I got it to work again by updating the line which extracts LAST_CAM variable to be:

LAST_CAM=`echo $LAST_MESSAGE | awk -F 'Camera[][]' '{print $2}'`

Basically, I changed "[" to "Camera[" in the awk command.

There may be a better way to fix this, I'm no expert.

@mzac
Copy link
Owner

mzac commented Feb 1, 2019

Thanks, it would be good if we could find a way to check the version of unifi video running or, we run a grep to see what format the file is in then we decide which way to grep it. I'll take a look at it soon.

If you figure out a good way to do the above feel free to create a PR

@mzac
Copy link
Owner

mzac commented Feb 1, 2019

Try 5bbcc01 and see if it works for you

chelming pushed a commit to chelming/unifi-video-mqtt that referenced this issue Mar 23, 2019
Fixes mzac#2 mzac#5 mzac#6 

based on your Dockerfile, `grep -n1` isn't supported so I removed the -n1. I commented out all the variables at the top so they can be passed in with docker env vars instead.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants