# Smartphone dashcam howto/discussion



## McNugget (Mar 25, 2016)

Hey guys I was told I should start a thread about my Intergalactic Planetary Smartphone Dashcam. The idea is to repurpose a smartphone to make a dashcam that has good quality video, for less than the price of an equivalent dashcam. 

My Android dashcam is a Samsung Galaxy S5. I bought a 2 pack of 10 ft long micro USB charging cables for $6 on Ebay. I plugged one into a normal car charger but I hard wired the charger to battery +12. You don't have to do that, I've been using the accessory power port for months. The USB cable is routed through the headliner, under the A-pillar trim and into the dashboard. Then I got this camera lens kit off of Amazon for a wide angle effect. This part is also optional but some people prefer a wider angle as it's actually stronger in court. It more accurately represents what the actual human eye sees when driving so if there was something you should've seen but didn't, the camera won't see it either. 










I use Dailyroads as the app to record. The setting is 1080p 18 Mbps @ 30 fps.

Here's a little sample video:





Here's what the camera looks like mounted from the outside of the car. Look closely. The thing to the right of center is the alarm's antenna. The rear view mirror is stuck in the middle and the white thing to the left of center is the double sided tape for the phone's mount with the phone right behind it. Can't see the camera can you? It actually blends in perfectly under the tinted part of the windshield and looks like a part of the mirror. Why here? First of all, you want the camera up high for the best camera angle. Secondly, this dashcam is designed to run automatically without me having to push a button. Finally, I want it out of view and inconspicuous. It could be hidden a little better which might be a good idea in case a thief notices it and decides to steal a free smartphone. More on this later.












This is the smartphone mount I'm using. Be careful, this magnet is super strong. I pry the phone off at an angle or hold the mount down while I pull on the phone because I'm afraid of just prying the whole thing off the windshield. It definitely holds the phone very steadily. My only complaint would be using white double sided tape instead of black. Why did they do that?









Next is the software part. 

Enable Airplane mode. This will save battery. You probably don't have a Simcard in this phone if you're like me so mobile data is out of the question anyway. You can optionally disable the sim card warnings using BuildProp Editor.
If you need it, re-enable Wifi while still in Airplane mode. This will allow you to connect to your home wifi while the car is parked in the driveway. 

Install the Dailyroads app. If you're using the accessory power port that is connected to switched +12v (turns on with acc), setup automatic mode. On my S5, the automatic mode only works if I leave the screen lock to off. If I even have swipe enabled, the recording won't start. 
Under the 'Automatic Mode' menu, check 'Start when charger is connected: _Vertical landscape or portrait_' This way the recording will start with your phone tilted to the side.
Under 'Exit when charger is disconnected' select _'After 5 seconds'._
Select 'Start in Background' This is important or else your screen won't turn off.
Select 'Start Video Recording'
Go back and select the "Background Mode Menu. Now check 'Background operation' Unselect all the other boxes.
Go back. Under file storage, slide the slider all the way over but leave 1 GB or so for other apps. I don't recommend 'Use Maximum' because you will get messages about being low on space.

Those are the basic settings you need. Now when you start the car, the app will launch, a notification will say 'Charger connected, starting recording', it will go to the background and you'll see a red REC icon in the status bar at the top. Launch Dailyroads Voyager and you'll find the camera is already recording. 

When you turn the ignition off, a notification will say "Charger disconnected. Stopping recording in 5 seconds..." Then the app will close and the red REC icon will disappear.


----------



## McNugget (Mar 25, 2016)

*Chapte 2*

For the second chapter, I'll show you how to upload the videos to your home PC. 


Setup your PC to use a static IP address. 
Download and install Core FTP Server.
Create a new domain under that IP address. 
Setup your base directory and user
Check 'Auto Start (Service)'
Next, go to the dashcam. Make sure it's connected to the same wifi network as your PC. Install the FolderSync app.
In FolderSync, click on accounts and then click the greenn + box. Scroll down to FTP. Add the details of the connectin address, the username/password, then disable compression under advanced. Click 'Test' the connection should be successful. If not, you probably have to troubleshoot your router settings. Try connecting to the FTP port on your home PC's browser by typing in ftp:// the IP address and port. If you can connect there, the server is working.
Go back in FolderSync and tap Folder Pairs. Setup a new folder pair and call it dailyroads. Set the account to the one you just created. Select the sync type as "To remote folder". In the remote folder field, I just typed '/' so it uploads to the root of my FTP server.
Under schedule, make it sync every 30 minutes.
Under sync options select Sync subfolders, syn hidden files, retry sync if failed, only resync source file if modified, overwrite old files: always, if conflicting modifications: use local file.
Under Connection, check use Wifi and uncheck everything else.
Under notifications, select only 'Show notifications on sync error'
Under advanced, uncheck 'Use temporary file scheme' and your done.
Hit sync and all your videos will be uploaded to your FTP server!

My connection runs at about 6 MB/sec. It takes 30-45 minutes to download all the videos on the Dashcam because of the data rate I use. This does use a lot of battery and cam bring the dashcam down to 75%. Luckily, my phone will charge back up while I'm driving. I've gone for months like this and it's never ran out of battery.


----------



## McNugget (Mar 25, 2016)

*Chapter 3: Tasker and Teamviewer*

By now you've decided you want to be able to see the dashcam live. The Android camera can only be used by one app at a time so what you have to do is download Teamviewer to share the whole screen. Download the Teamviewer host app, setup the phone for unattended access, install Teamviewer on your PC, login and then you have access to the phone. Cool. 
You can use this to control everything on the phone and this keeps you from having to sit in the car to mess with it. 

Next is Tasker!

Tasker is a paid only app. It's just $3 last time I looked but it's very useful and buying it actually helps the developer make it better.

I'll show you how to run a tasker task every time a video starts/stops or when you get within range of Wifi.

Install Tasker
Click on Tasks. Create a new task and name it 'Dailyroads Sync'
I started off with a 2 minutes and 1 second wait task. This is because my video files are 2 minutes long and FolderSync won't be able to Sync if they are still being written to.
Next I made a "If %WIFII = mywifihere" ---> Foldersync, dailyroads:sync" task. That's quite a mouthful. Anyway, you can figure it out. This task just means that it will only try to sync if I'm connected to wifi. 
Setup a profile with a 'File modified' event. Point to the dailyroads temp videos folder. You might have to just type it in 'dailyroads/Tempvideos/' is how I have it. Any dailyroads video file file that is modified or created will activate this profile now.

Now, whenever you get home and park your car, the sync process will start automatically. You can make a batch file on your home PC and run it as a scheduled task to delete the old videos after a week.


----------



## McNugget (Mar 25, 2016)

*Chapter 4 and beyond*

I can also write a guide on using voltage sensing in tasker to turn the recording on and off if anyone is interested. This way, you can leave the phone hardwired so it's always charged, but it won't drain your battery. I calculated that I could run Dailyroads for a week straight before draining the battery, but the battery won't last as long during the winter and I don't want to stress it. The voltage sensing works just like it does for the Viper, you get 14.5v while the car is running and 12.5v when it's off. You don't see that voltage in Android. You just see the charging milliamps. I tend to get 1200ma while the car is on and 1100ma when the car is off. It's not perfect but I can tweak the task more.

I also plan to connect the Viper 5900 remote start/alarm to the dashcam so that the motion sensor turns on the camera. This is where it gets interesting. With this feature, you've now got a fully functional security camera. If your car is stolen, you'll have video of it until they get out of wifi range.

In the future, I plan to connect the camera to a laptop hard drive in the car to act as a black box. This will protect me in a crash if the phone is destroyed. It'll also protect me if the phone is stolen. Ultimately, the idea is to keep adding more of these Android phones until I have 4. For the rear camera, I may revert to a Android USB camera and then just slide the phone in between the roof and headliner or inside the C-pillar. 

The Samsung Galaxy S5 is supposed to have code for simultaneous front and rear recording which would take care of a lot for me, but nobody has written an app for it yet. Hopefully they will some day. Any questions?


----------



## BassMechanic308 (Feb 15, 2015)

Very well thought out recording setup. This is a viable option for people looking for cheaper solutions. 

Nice write up as well.


----------

