Closed ghost closed 4 years ago
Ok, I can look at adding that snippet
Any plans to merge this into master? My MQTT broker requires authentication. I'll be happy to fork and open a PR if you can approve it.
I've added this. It's in the image-playback branch, Any chance @oblogic7 can try it? Though this branch did jump to python 3.7.2 as well....so unsure if that will impact - I don't know how you run it.
I was trying to run via docker image. I'll manually checkout that branch and give it a test. Do you have an ETA on when that branch may be merged and available on the docker image?
What architecture of an image? Arm32, arm64 or amd64? I can push a dev one for you you try (there's some other code in there as well, which is why I don't want to merge to master yet).
amd64
docker pull psyciknz/cameraevents:0.2.0-dev. @oblogic7
Pulled the image, but am running into the following error:
2020-01-09 17:45:10,161 - __main__ - ERROR - Error starting:Failed to open/find all files
Any ideas on that? Volume is bound according to the screenshot below and config.ini
file exists with full permissions. Not sure why it isn't working.
Does it bomb out entirely, or does the container stay running? If it stays running, exec into it and check the volumes. But I don't think I played with anything there (though the python version was increased).
Did you note the change to the user name in the config file? cp.get("MQTT Broker","user",fallback=None) user - not username
I did notice that key changed, but I don't think it is a format issue. It seems that it isn't finding the file at all. I don't see any reason in the code why it wouldn't be working, so has to be a permission or binding issue.
There are exceptions when it doens't like the format of the .ini....but if it was that I think you'd have a bigger crash.
I think you migh right on permissions/binding. Execing into the container should be able to point you in the right direction.
I've been able to get further along by removing the user specific lines from the dockerfile and rebuilding the image. Still poking at it on the image-playback branch. Will report back once I have it fully working with the changes that I made.
I was finally able to get things running on the image-playback branch with the greatly simplified dockerfile below. I also needed to run the container with host network mode to allow connection to my broker. Not sure if this dockerfile is compatible with all architectures you build for, but feel free to use it if it does.
FROM amd64/python:2.7.15-jessie
WORKDIR /opt/cameraevents
COPY . /opt/cameraevents
RUN pip install -r requirements.txt
# run process
CMD python CameraEvents.py
And that works? I thought I’d updated the code for python 3.7 which means it would fail in 2.7
On Fri, 10 Jan 2020 at 16:41, Matt Snyder notifications@github.com wrote:
I was finally able to get things running on the image-playback branch with the greatly simplified dockerfile below. I also needed to run the container with host network mode to allow connection to my broker. Not sure if this dockerfile is compatible with all architectures you build for, but feel free to use it if it does.
FROM amd64/python:2.7.15-jessie
WORKDIR /opt/cameraevents
COPY . /opt/cameraevents
RUN pip install -r requirements.txt
run process
CMD python CameraEvents.py
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/psyciknz/CameraEvents/issues/4?email_source=notifications&email_token=ABI2I4YGHWAUNYHK73WELLDQ47U6FA5CNFSM4HD4VSB2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEISSI3I#issuecomment-572859501, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABI2I455MDEWAT5UA4IGSS3Q47U6FANCNFSM4HD4VSBQ .
I haven't seen any issues yet. Just setup my IVS rules last night, so planning to test and start using the events today. Will let you know if I run into any issues, but there weren't any complaints about syntax. The container has been running for 11 hours now without issue.
Hi, I'd like to use this script as docker image on a Synology Nas with DSM 6.x. Because my MQTT broker requires authentication can I use this image as it is?
This dev one yes. Then if you confirm it’s ok, I’ll pr the code to master
Sorry for the delay but I'm busy with my family. In next days I will try it. Only one question: since my cameras are in a different subnet, they aren't accessible from your docker image but NVR it is (its IP is in the main lan). Does it report tripwire and intrusion alerts from cameras?
Sorry for the delay but I'm busy with my family. In next days I will try it. Only one question: since my cameras are in a different subnet, they aren't accessible from your docker image but NVR it is (its IP is in the main lan). Does it report tripwire and intrusion alerts from cameras?
Yes, you point camera events at your NVR, and tell it it's an nvr (in the config).
[NVR]
host=192.168.1.108
protocol=http
name=NVR
**isNVR=True**
port=80
user=<nvruser>
pass=<nvrpassword>
auth=digest
events=VideoMotion,CrossLineDetection,AlarmLocal,VideoLoss,VideoBlind,CrossRegionDetection,FaceDetection
#channels=0:Garage|1:Backdoor|2:Backyard|3:Frontdoor|4:Ludlam
snapshotoffset=1
And there's an optional (I think it still works) channels, to name and number channels. But the default is it will figure out all the attached cameras.
Pushed to master #10
This should add support for broker authentication. Make sure 'user' and 'password' are present in the right section for the config.ini file.
No error checking added, err=5 or so when auth fails. Quick hack that works for me.