To archive all files from your Blackvue cloud-enabled dashcam to your Synology NAS without removing your SD card, simply do the following:

1. Connect your Blackvue dashcam to your local network using its cloud feature.
2. Find the IP of your Blackvue dashcam by checking the dhcp settings from your router, or by using an app like Fing for iPhone (look for network adapter with brand Pittasoft). It might be handy to use a dhcp reservation in your router to make sure the camera always has the same IP.
3. Open a good text editor like Notepad++ (Windows) or TextWrangler (Mac) and paste the code below in a new file.

#!/bin/bash
cd "$(dirname "$0")"
for file in `curl http://192.168.1.53/blackvue_vod.cgi | sed 's/^n://' | sed 's/F.mp4//' | sed 's/R.mp4//' | sed 's/,s:1000000//' | sed $'s/\r//'`; do wget -c http://192.168.1.53$file\F.mp4; wget -c http://192.168.1.53$file\R.mp4; wget -nc http://192.168.1.53$file\F.thm; wget -nc http://192.168.1.53$file\R.thm; wget -nc http://192.168.1.53$file.gps; wget -nc http://192.168.1.53$file.3gf; done

*Please note that the line “for file in” goes all the way to “done”. This needs to be one line!

Update: You can also download the script above here, but you will still need to edit the IP address using a decent texteditor like the ones mentioned above. No Word, Wordpad or any rich text editor.

4. Change the IP in the script to your Blackvue Dashcam IP.

5. Save this file to a (new)share on your Synology and call it blackvue.sh

6. Go to Synology DSM, Configuration, Task scheduler

7. Choose “User defined script” and enter
sh /volume1/name_of_your_blackvue_archive_share/blackvue.sh
and set the schedule to run every day at a time your Blackvue will be connected to your local network for a while.

The procedure above will let your NAS download all files on the Blackvue dashcam, it will skip files already downloaded, and it will resume partially downloaded .mp4 files.

If you want the Synology NAS to only download the files of that day, use this version of the script in stead:

#!/bin/bash
cd "$(dirname "$0")"
export BVDATE=`date +%Y%m%d`
echo $BVDATE
for file in `curl http://192.168.1.53/blackvue_vod.cgi | sed 's/^n://' | sed 's/F.mp4//' | sed 's/R.mp4//' | sed 's/,s:1000000//' | sed $'s/\r//' | grep $BVDATE`; do wget -c http://192.168.1.53$file\F.mp4; wget -c http://192.168.1.53$file\R.mp4; wget -nc http://192.168.1.53$file\F.thm; wget -nc http://192.168.1.53$file\R.thm; wget -nc http://192.168.1.53$file.gps; wget -nc http://192.168.1.53$file.3gf; done

*Please note that the line “for file in” goes all the way to “done”. This needs to be one line! This version is also included in the download above.

This script also skips all files that are already downloaded, so you can start it multiple times the same day without redownloading all files.

Note: The upload speed of the camera is very slow. In my case, I need one minute to download a one minute file. I take no responsibility for anything. Use at your own risk.

Full credits for the original script to Gadgetblogist


Björn

Gadgedgeek, father of 2, Tesla model S 90D driver.

37 Comments

Edward · 8 January, 2017 at 02:47

This works great. I’m using Mint Linux 18. I also made adjustments to the script to download “yesterday only” files in case I had no time to download “today only” files. I called it blackvue_yesterday.sh.
The difference in the code is just this:
export BVDATE=`date -d yesterday +%Y%m%d`

See full code below
——————————————

#!/bin/bash
cd “$(dirname “$0″)”
export BVDATE=`date -d yesterday +%Y%m%d`
echo $BVDATE
for file in `curl http://10.99.77.1/blackvue_vod.cgi | sed ‘s/^n://’ | sed ‘s/F.mp4//’ | sed ‘s/R.mp4//’ | sed ‘s/,s:1000000//’ | sed $’s/\r//’ | grep $BVDATE`; do wget -c http:$

—————————————————————–

Arno · 9 January, 2017 at 22:08

I implemented this on my QNAP nas. Works great!
Needed some extra handling to schedule the script in the crontab since QNAP does not have a graphical scheduling option. For who is interested in the crontab command, let me know.
Now I want to figure out why the download script does does not work (access denied) when I disable the BlackVue’s own AP mode (change wifimode in config.ini). Idea’s are welcome.
I want to disable the own AP so it automatically connects to my home WiFi once in reach

    Broda · 7 May, 2017 at 08:58

    Can you share with me the setup for the Qnap?
    Thanks

    Ferdball · 15 April, 2018 at 01:52

    Can you post the snap version? Also, what is the fix for the permission denied error?

Edward · 10 January, 2017 at 00:44

Looking for a modification on this script to download “today only from 4:00pm – current time” – not sure how to tweak it now.
The reason why I wanted this is so if I know something happened commuting home after work (usually after 4:00pm) I can download just that block on files. Better yet, I would love to set a timeframe in the script say from 5:00pm – 5:45pm – any ideas?

Edward · 5 March, 2017 at 06:17

This mod allows one to enter a specific date of which the script will download all files. Date format is always YYYYMMDD

————————-

#!/bin/bash
bold=$(tput bold)
normal=$(tput sgr0)
cd “$(dirname “$0″)”
echo PLEASE ENTER DATE YYYYMMDD:
read userdate
export BVDATE=`date +$userdate`
echo ${bold}NOW DOWLOANDING FILES FOR:${normal} $BVDATE
for file in `curl http://10.99.77.1/blackvue_vod.cgi | sed ‘s/^n://’ | sed ‘s/F.mp4//’ | sed ‘s/R.mp4//’ | sed ‘s/,s:1000000//’ | sed $’s/\r//’ | grep $BVDATE`; do wget -c http://10.99.77.1$file\F.mp4; wget -c http://10.99.77.1$file\R.mp4; wget -nc http://10.99.77.1$file\F.thm; wget -nc http://10.99.77.1$file\R.thm; wget -nc http://10.99.77.1$file.gps; wget -nc http://10.99.77.1$file.3gf; done

———————————-
Modify the IP if you need to.

E

Marc · 7 March, 2017 at 21:14

Works like a charm! Thanks for the good work Bjorn! 🙂

Alex · 28 March, 2017 at 23:02

Hi,
How can the script to:
1) create a directory of today’s date
2) copy all files for today into that newly created directory?

Many thanks.

Alex

Alex · 30 March, 2017 at 18:24

following up on my above post, I’ve tried to make a new directory using the mkdir command (mkdir $BVDATE) and no directory was created but neither was there any error. I’m baffled… Any help is appreciated. thanks.

    Edward · 30 March, 2017 at 18:38

    Run it with sudo ?
    I don’t know. I can try a solution with my VM and see if what you suggest works.
    I seen no one replying here … seems this blog is abandoned by the owner

      Björn · 30 March, 2017 at 18:44

      Ha no it’s not abandoned. I just don’t know the answer to everything 😉

        Edward · 30 March, 2017 at 18:46

        Good to know you are there!!!

Aschwin Rutgers · 29 April, 2017 at 22:13

Finally, found something that can work for me! Thanks in advance.
I also own a DR650-2channel, and want to upload the video`s instantly. The car has wifi and internet, is it possible to upload every frame automatic to NAS?
I use the system for security instead as of dashcam, so i want every video in the cloud, in case the steal the dashcam.
Because the wifi of the Blackvue shuts off, and its not clear to me when or how the Blackvue is transporting the video`s to the cloud?
And can it handle 2 camera systems at the time, i`m planning to buy a one channel system for the rear.

Best regards,
Aschwin

EDWARD · 30 April, 2017 at 00:04

Aschwin,
I have the DR650S-2CH (main cam facing front and 2nd small cam facing rear) and a DR650S-1CH mounted on the front but facing the interior (driver / passenger).
Currently I manually download files when I know there are videos of interest. Neither cams will automatically upload to the cloud. They don’t do that.
Our car also has its own WiFi and allows for us to Live View it when so desired.
To do what you want to do, you would need to have “perhaps” a Raspberry Pi in the vehicle running some sort of “Linux” OS. There you would want to set some kind of cron job to run every 2-3 minutes that would download the files into a dropbox folder that would then, sync with dropbox and you could then, retrieve files from your computer anywhere you have internet. There is a challenge there tho. If the Raspberry Pi is connecting to the camera, it means its not connected to the internet. Solution would be to connect to the same WiFi and hopefully “through the same network” find your camera(s) and download the files as I described.
I have never done that before and I dont know if that would work actually. I wouldnt know of the top of my head how to set up the Raspberry Pi either.
What you will have to figure out too is, battery power for both cameras and the Raspberry Pi.
So have a good power scheme there. Power planning is everything! If your cameras, WiFi hotspot or Raspberry Pi have no power, you have a fancy useless system. Plan to have all batteries charging while the vehicle is running. Also figure out how long they will last when the vehicle shutdown / stops.
If you have Mac at home you can setup some pretty sick automation that will move files from dropbox automatically all day so you dont have to buy dropbox premium space. Files would safely sit in your computer or NAS at home depending on how you set that automation.

Good luck.
I would love to try something like that but I have no time currently to build a raspberry pi and figure out a good script for the cron.

Edward

Aschwin Rutgers · 7 May, 2017 at 22:55

Thanks Edward for your reply.

Whats the script of Bjorn doing then? I believed it would upload the images when connected to his local network( i assume at his home).
I have a network 24/7 in the car. Only thing i want to upload automaticly is gshock and motion detect in parking mode. I have to say im a noob about computer electronics, and i dont understand how the DR650 is transmitting his images. I think you download the images thru the router in the car? So if the images running thru the router, is it possible to redirect it to a nas?

Best regards,
Aschwin

Edward · 7 May, 2017 at 23:29

Aschwin
Hi –
What is the goal here? I thought you wanted to have files uploaded all the time even while driving… if thats the case, you can try what I previously suggested. If not, and you only want things to be downloaded when you park your car back home, you dont even need WiFi in your car. Just set the camera to connect to your home WiFi and it will connect automatically once in range. Then you can use the NAS script in this page with the particular NAS hardware mentioned here.
Note the script will download all files, not just event files.

    Aschwin Rutgers · 8 May, 2017 at 23:19

    Dear Edward,

    Thanks again for your reply. When im driving and something happens, im there to get the records, those doesnt have to be uploaded all the time.
    What im interrested in is the records while in parking mode. when someone hits the car,scratch or entering the car. Those records i want to have in a cloud(which i believed this system was) or on a NAS(what i like more, because i dont like cloud computing). So when they brake into the car and steel the dashcam, i have the records who did it.

    Best regards,
    Aschwin

Edward · 8 May, 2017 at 23:37

These cameras do not automatically upload anything to the cloud. For what you are trying to accomplish your option is an on-board WiFi and a raspberry pi running Bjorn’s script kicking in every few minutes automatically and copying your files into a dropbox sync folder.

    Aschwin Rutgers · 9 May, 2017 at 22:42

    Thanks Edward,

    The on-board wifi i have. I`m using a wifi router in the car. So if i find a technician that can put the Raspberry PI into my router, i can run scripts to upload.

    Best regards,
    Aschwin

      Edward · 11 May, 2017 at 03:04

      Cool… first work the script to your needs. You will need to findout what IP address the camera has in your vehicle network (not the direct camera WiFi IP but the IP the assigned to the camera in your network). The script will have to be looking for that particular IP. Once you a manual script run is successful and you verify it downloaded the files from the camera then its time to create a cron job that will automatically start that script every few minutes. You might also want to tweak the script to download only your parking and event videos. If it downloads everything at one point and the cron job kicks the script again, I believe it will just say files already exist.
      As long as your script is downloading the files into a dropbox folder that syncs automatically you should have all your files in your dropbox even if your camera is stolen or disabled by someone. Good luck!

      Johnny · 2 October, 2017 at 15:29

      Hi Aschwin,

      Did you manage to build the setup you were looking for, with videos automatically uploaded over wifi to a Raspberry Pi? I am looking for something similar, for the same use-case: when somebody breaks into your car and stoles the camera with SD card on it, to have a backup of the recordings in a separate location (cloud based or hidden location in the car).

      Regards,
      Johnny

Joris · 1 June, 2017 at 13:10

Thanks! Below my version, based on your script.
– It checks for the cam on two locations; home and office.
– It checks if the dashcam is online, first at home and, if it is not, at the office.
– If the dashcam cannot be found on one of the locations, the script will terminate.
– The script will check if it is already running, to avoid duplicate runs.

– The dashcam should get a fixed IP at home and at the office (MAC address is in the dhcp server)
– The office IP should be accessible through VPN from the Synology at home
– The script runs every 15 minutes
– If the script is not running as root, you might want to make the ping command available by running this one time: sudo chmod u+s /bin/ping

When I park my car at home, or at the office, the new dashcam files will be downloaded within 15 minutes if the dashcam connects to the wireless network.
If it terminates (dashcam has no connection anymore) it will resume the next time the dashcam is connected at home or office.

#!/bin/bash

# IP addresses to check

# Home
DASHCAM_IP1=x.x.x.x.x
# Office (accessable through VPN)
DASHCAM_IP2=x.x.x.x.x

# Location of dashcam files and PID file

FILELOCATION=/volume1/dashcam/blackvue
PIDFILE=/volume1/dashcam/scripts/blackvue.pid

# check for running instances, to avoid duplicate runs

if [ -f $PIDFILE ]
then
PID=$(cat $PIDFILE)
ps -p $PID > /dev/null 2>&1
if [ $? -eq 0 ]
then
echo “Process already running”
exit 1
else
## Process not found assume not running
echo $$ > $PIDFILE
if [ $? -ne 0 ]
then
echo “Could not create PID file”
exit 1
fi
fi
else
echo $$ > $PIDFILE
if [ $? -ne 0 ]
then
echo “Could not create PID file”
exit 1
fi
fi

# check if the dashcam can be found on one of the two ip addresses

ping -c 3 $DASHCAM_IP1 > /dev/null 2>&1
if [ $? -ne 0 ]
then
echo “✗ Dashcam not found on $DASHCAM_IP1”
ping -c 3 $DASHCAM_IP2 > /dev/null 2>&1
if [ $? -ne 0 ]
then
echo “✗ Dashcam not found on $DASHCAM_IP2”
exit 1
else
DASHCAM_IP=$DASHCAM_IP2
fi
else
DASHCAM_IP=$DASHCAM_IP1
fi

echo “✓ Dashcam found on $DASHCAM_IP”

# Download all files

cd $FILELOCATION
for file in `curl –connect-timeout 10 http://$DASHCAM_IP/blackvue_vod.cgi | sed ‘s/^n://’ | sed ‘s/F.mp4//’ | sed ‘s/R.mp4//’ | sed ‘s/,s:1000000//’ | sed $’s/\r//’ | grep ‘Record’ | sort -u`;
do
wget -T 10 -t 2 -c http://$DASHCAM_IP$file\F.mp4;
wget -T 10 -t 2 -c http://$DASHCAM_IP$file\R.mp4;
wget -T 10 -t 2 -nc http://$DASHCAM_IP$file\F.thm;
wget -T 10 -t 2 -nc http://$DASHCAM_IP$file\R.thm;
wget -T 10 -t 2 -nc http://$DASHCAM_IP$file.gps;
wget -T 10 -t 2 -nc http://$DASHCAM_IP$file.3gf;
done

# remove PID

rm $PIDFILE

    Sellers · 22 August, 2018 at 06:22

    Joris, your script was very helpful, thank you. A note to other’s copying and pasting: you must fix the apostrophes and parentheses (the website formats them into qurly quotes and such).

    Cees · 2 February, 2019 at 12:18

    Hi,
    Despite all the positive reactions / experiences I can not get the script to work. Who can help me?
    I have a Blackvue DR-750S-1CH and a Synology 215j NAS with the latest DSM version. I did the following:

    1. Fixed IP on the router for the 750S. I checked that the 750S is indeed connected to that IP. Ping works fine. Also the blackvue_vod.cgi and blackvue_live.cgi work great in my browser on the laptop.
    2. Script downloaded and edited in UltraEdit. I only changed the IP address (replace-command). The rule is still in 1 long sentence as stated in the instruction.
    3. Saved file as blackvue.sh
    4. On the NAS I made a new Shared folder in Volume1 created with all default rights (nothing changed to the folder rights) and created a folder scripts.
    5. uploaded blackvue.sh to the sub folder scripts.
    6. On the NAS I have installed the package: PHP 7.0 (which packages are required as a minimum? Web Station or WebDAV Server or Tom Cat or Apache Sever or PHP Pear perhaps?) I only use VPN Server and Surveillance Station
    7. In Taks Scheduler created a Task (Scheduled Task, User-defined script) for owner Root and under Run command i typed: sh / volume1/blackvue/scripts/blackvue.sh
    8. The script will never stop running and no files are uploaded. I wait for 30 minutes each time I try… Then I reset the NAS because I do not get the task to stop.

    I have tried everything but no result… :((

    Who can help me out?

Edward · 1 June, 2017 at 16:14

Very fancy! I like it. Mine looks for the camera IP only at home and it kicks off at a time I’m normally at home through a simple crontab.
It downloads only today files.

What I have been trying to do is tweaking the script to download only file within a timeframe.

Anyway, great script!
E

Jason · 9 September, 2017 at 14:14

This is simply fantastic. Thank you!

One would definitely need the power pack that keeps the device online for a bit as the maximum transfer rate seems to be about 3mb/s. But this sure beats trying to pry out the SD card or download via the App.

In case anyone is interested I tweaked this a bit for Windows. I’m sure it could be compressed a bit but it’s functional.

for /f %%A in (‘curl http://172.17.18.67/blackvue_vod.cgi‘) do call :loop %%A

goto :eof

:loop
set temp=%1
set temp=%temp:n:/Record/=%
set temp=%temp:F.mp4=%

wget -c http://172.17.18.67/Record/%temp%.gps
wget -c http://172.17.18.67/Record/%temp%.3gf
wget -c http://172.17.18.67/Record/%temp%F.mp4
wget -c http://172.17.18.67/Record/%temp%F.thm

luke briggs · 17 November, 2017 at 14:00

Hi there,

Is there a way this could work on a buffalo terra station?

Many thanks

Luke

Sofiane · 13 June, 2018 at 19:29

Hey!
The script works like a charm. Thanks for that
I only wonder, would it also work when i put a mifi in my car en set the NAS to retrieve every hour? Would it work or do i need to connect the dashcam to the local wifi for working?
Greetings

Sellers · 22 August, 2018 at 03:53

This is fantastic. Big thank you. This is the first script I have ever run on my synology. Is it ok to run every 15 minutes?

Jeff · 29 August, 2018 at 21:05

Thanks for this! Managed to get this working with windows schedules tasks after installing cygwin and creating a .bat pointing to this script

Carli · 22 September, 2018 at 14:15

I have try your workaround, but is dosnt work. Why? i have the 750S 2cams and i cannot connect on the Dashcam. The Dashcam connects to my homewifi (i can see the mac-adress and ip to my dhcp server). i have try to do a portscann on this ip but all is closed?!
the only way to connect so the dashcam is if i connect to the dashcams wifi (dashcam is accesspoint). then i can get the videofiles. but its easyer if the dashcam connect to the home wifi so it has the same ip-range and he connects automaticly when i come home.
it is possible that the newest firmware blocks all connects from outside over the cloud wifi?!?

david · 23 October, 2018 at 10:29

hi this is not working for me, it says no directory found. please help
cheers

Eugeniousone · 6 January, 2019 at 20:30

I have the same issue as David, it says “no directory found”. But, it seems like this is a dead thread now.

Wheatman · 16 January, 2019 at 01:47

Great script, works with the new Blackvue DR900S-2CH. If you use Windows, you definitely want notepad++ or other editor that will let you save the file as “Unix script file”. I used notepad++. Windows notepad will not work. After I did this, script worked like it should on my Synology NAS with latest DSM updated per directions above.

Mark · 10 February, 2019 at 04:47

I wanted to add a point of information. I am using FW v1.010 on a DR900S-2CH and I believe that the camera has to be registered with the Over The Cloud service or the wifi connectivity the home wifi will disconnect after a few minutes.

I had a camera for a couple months and had the scripts all working, downloading the files each night to my server. I bought a second camera for our other vehicle and used the same BlackVue account to set it up. I didn’t want to pay the extra money for the service, so I unregistered the first camera and added the new one. I got everything working with the new camera and was happy.

I had never planned to monitor the new camera vehicle Over the Cloud, so I removed that one and went registered the old camera again. The old camera vehicle gets driven a lot more and the downloads were all working fine.

I noticed that the new camera vehicle was not downloading files and would not stay connected to my home wifi for more than a few minutes. I troubleshot what I thought could be the issues and then started to think that the camera may disconnect from the wifi if not connected to the service.

I created a second BlackVue account for the new camera and registered it with that account. Now both cameras download nightly to my server reliably.

I don’t really use the Over the Cloud service for anything, but it is needed to keep the camera active on the cloud service wifi that is configured.

    Michael · 16 May, 2019 at 19:38

    Thank you for this script. It works well on a DR900S.

    Would you happen to have a script which does not require an IP reservation on the router?
    I have found a lot of other scripts online but none of them seem to work for me. they always end up “interrupted” with errors in them.

    thanks,

    Michael

Nick · 2 June, 2019 at 07:42

I love this script
Is their a way to make it save the files in a specific directory?
Currently they’re all being dumped on to the root directory.
Would like them to be saved in eg ./Blackvue

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.