-
Notifications
You must be signed in to change notification settings - Fork 80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TeslaUSB Archive New Folder Trigger #60
Comments
I would use a bash or PowerShell/Cmd script to do following 1) copy the footage to local drive; 2) process it(tesla_dashcam); archive it or destroy it.
Following #2, you can copy the resulting files to a Plex monitored folder or whatever else you prefer to do.
P.S. I typically don’t post, so hope this helps.
… On Aug 25, 2019, at 3:00 PM, afgoody ***@***.***> wrote:
I use a RPi to automatically archive my TeslaCam clips to my computer (https://github.com/marcone/teslausb).
What commands do I use to automatically start processing those clips? If it's "--monitor_trigger" what do I put for the file trigger when it's just monitoring a folder for newly added subfolders?
Thank you.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Currently it does not monitor for newly added subfolders. It monitors for existence of a file (or folder, or link) and when it exist starts processing based on source provided. Looking at how TeslaUSB works; I would say that in file archive-clips.sh (located in folders rsync_archive, ) you can then add something to copy (clone, rsync) a temp file to the location as well. This would be done after everything is copied over. |
@ehendrix23 Thanks, but I wouldn't know where to start with your recommendation. You couldn't build in a time delay option to the monitor function that would delay processing files in that folder until x seconds after the last file appeared (300 seconds would probably be a good default)? If not, no big deal, I'll just copy/paste the existing (non monitor) script each time I want to review a few days worth of clips. Hopefully, I can eventually review the 10 seconds in each of these I care about right on the display in the car...here's to hoping. |
Delay will not always work correctly. Been further looking into it and think I have something I can do. Hopefully next version. |
This is what i do. It is a Powershell script that runs on the server every 15 minutes via a windows scheduled task. It looks for folders in source that teslacam_usb writes, then waits until the last folder/file has a write time of more than 10 minutes ago, then it makes a backup of the raw files, then runs two tesla_dashcam conversion (one normal speed, one fast speed) and writes them to different locations. Plex then monitors this location and imports them, it then send me an email saying it is completed. If the scheduled task kicks off and a file is being actively copied (the write time on the folder will be newer than ~10 minutes ago), so the main code branch will not execute. Next time around if teslausb is completed transferring the write time would be more than 10 minutes ago and therefore the assumption is the transfer is finished and the script goes about processing. If you have slow wifi, or issues that make transfers take abnormally long you might need to tweak some of the below values. Yes it is ugly, yes it can be improved, but it was a great temporary solution i was able to throw together and has not failed me yet.
|
I’m looking forward to playing around with this! What’s the latest on watching for new subfolders? An alternative might be to use teslausb’s IFTTT function to run your program via triggercmd. |
I was thinking of doing something similar with a cron job and just run nightly.
IFTTT should work or could you add a file in the archive-clips.sh script that tesla_dashcam could detect and then delete it after import? |
That would be much cleaner than using IFTTT. The only catch is that I'm pretty far from a programmer. If anyone can help with the code I'd need to add to archive-clips.sh, that would be awesome. |
Here is an example I am using on a plex server, it's not perfect but maybe you can use it as a basis to start. Note that it calls my customer Dockerfile which runs on Centos. The Docker container is public on DockerHub so this should also work but this fork is really focused on running tesla_dashcam as a docker container. This script will run on linux but if you're running it on a Mac you'll need to fix it as the date program is more limited. |
Here is a copy of the output. You likely need to modify but hopefully it gives some ideas. If people want this included I can submit a pull request and maybe add an examples or contrib folder here.
|
has anyone written a script for mac? |
I use a RPi to automatically archive my TeslaCam clips to my computer (https://github.com/marcone/teslausb).
What commands do I use to automatically start processing those clips? If it's "--monitor_trigger" what do I put for the file trigger when it's just monitoring a folder for newly added subfolders?
Thank you.
The text was updated successfully, but these errors were encountered: