teslausb icon indicating copy to clipboard operation
teslausb copied to clipboard

Sync?

Open mg-chen opened this issue 5 years ago • 26 comments

I've gone through all the steps and now have footage on my rpi. I originally thought the footage would automatically save to Google Drive but my drive is still empty and I haven't received a notification. Am I supposed to do something for the rpi to save the footage to Google Drive?

mg-chen avatar Mar 05 '19 06:03 mg-chen

Did you manually save the clips (by pressing the button on the screen) ? By default the archive script only backs up the manually saved clips, not the 1-minute continuously recorded clips.

Did you check /mutable/archiveloop.log ?

marcone avatar Mar 05 '19 17:03 marcone

Can you check to make sure rclone is configured correctly? You should see something like this if it is correct.

root@teslausb:/home/pi# rclone lsd gdrive:
            -1 2018-10-23 00:17:26        -1 TeslaCam

rtanaka avatar Mar 06 '19 00:03 rtanaka

@therealmarcone Yea I've been manually pressing the button on the screen and have saved footage on the rpi. See attached for my logs

Logs.txt

@rtanaka Below is what I'm getting after running that command but this worked during the setup process and created/displayed my TeslaCam folder. So I'm guessing it stops working after I run './setup-teslausb' in the final steps

root@teslausb:/home/pi# rclone lsd gdrive: 2019/03/06 01:04:33 NOTICE: Config file "/root/.rclone.conf" not found - using defaults 2019/03/06 01:04:33 Failed to create file system for "gdrive:": didn't find section in config file

mg-chen avatar Mar 06 '19 01:03 mg-chen

Update- I am now able to receive notifications. I was notified my files were uploaded by Pushover but I still do not see the files in my Google Drive folder.

mg-chen avatar Mar 06 '19 20:03 mg-chen

@mg-chen - oops. sorry it's been a while since i looked at this... can you first confirm the config is set up correctly by running this command?

root@teslausb:~# ls -l /root/.config
total 0
lrwxrwxrwx 1 root root 23 Oct 31 10:25 rclone -> /mutable/configs/rclone
root@teslausb:~# 

and then run this command if the above works.

root@teslausb:~/bin# rclone --config /root/.config/rclone/rclone.conf lsd gdrive:
          -1 2018-10-23 00:17:26        -1 TeslaCam
root@teslausb:~/bin# 

rtanaka avatar Mar 06 '19 21:03 rtanaka

@rtanaka the first command worked but not the second one. See below

screen shot 2019-03-06 at 3 11 35 pm

mg-chen avatar Mar 06 '19 23:03 mg-chen

@mg-chen - so it looks like your rclone drive configuration is not correct. you'll have to re-do it.

create the file as root with this command:

rclone --config  /root/.config/rclone/rclone.conf config
  1. select "n" for new remotes
  2. use "gdrive" for name
  3. select google drive for type (should be 12)
  4. leave client_id and client_secret blank
  5. use drive.file as the scope (option 3)
  6. leave root_folder_id and service_account_file blank
  7. skip advanced config (n)
  8. select "N" for autoconfig
  9. copy the link to create a token
  10. copy that verification code
  11. say no to team drive
  12. y to confirm

try the command again and hopefully it'll work

rtanaka avatar Mar 06 '19 23:03 rtanaka

@rtanaka I'm going through the setup process but I'm receiving this notice. I was thinking I can just create the file but I'm not sure if there is supposed to be code in it to begin with.

screen shot 2019-03-06 at 4 04 40 pm

mg-chen avatar Mar 07 '19 00:03 mg-chen

@mg-chen - not sure exactly what happened but it's clear the config file got removed, deleted or was never created. without it, there's no way it will work.

rtanaka avatar Mar 07 '19 00:03 rtanaka

@rtanaka That's a bummer. Thank for your help though!

mg-chen avatar Mar 08 '19 01:03 mg-chen

no problem @mg-chen - were you able to get it to work after you restored the config?

rtanaka avatar Mar 08 '19 20:03 rtanaka

@rtanaka Sorry for the late response, I've been pretty busy the last few days so I haven't been able to work on it as much. When I was last working on it my rclone.conf file would get removed by running ./ setup-teslausb even when I manually created the file.

I believe my next option would be to create the rclone.conf file in the .config directory and find out how to change the path to /root/.config/rclone.conf instead of /root/.config/rclone/rclone.conf

mg-chen avatar Mar 12 '19 21:03 mg-chen

the set up scrips do not delete the rclone.conf file, it only just moves it.

you can see how to specify the config file location in one of my previous comments above. if the file is not there, it will create it after you successfully complete the config process.

rtanaka avatar Mar 13 '19 18:03 rtanaka

@rtanaka Where does the script move rclone.conf to? Because I'm still getting the following in my logs. Screen Shot 2019-03-14 at 2 51 36 PM

mg-chen avatar Mar 14 '19 21:03 mg-chen

@mg-chen - the command that moves the configs is part of configure-archive.sh and does the following:

    mv /root/.config/rclone /mutable/configs
    ln -s /mutable/configs/rclone /root/.config/rclone

rtanaka avatar Mar 15 '19 00:03 rtanaka

Did you manually save the clips (by pressing the button on the screen) ? By default the archive script only backs up the manually saved clips, not the 1-minute continuously recorded clips.

Did you check /mutable/archiveloop.log ?

I think I am having this issue as well but I do not have a /mutable/archiveloop.log

rclone lsd tesla3: works when I am mounted as read/write, I have files in TeslaCam and SavedClips but I don't believe the scripts are running.

schmug avatar Mar 20 '19 21:03 schmug

@schmug did you do headless setup from the prebuilt images from rtgoodwin by any chance? I found the included sample conf file is missing the export ARCHIVE_SYSTEM=... line, and without that it won't install the proper scripts for your chosen backup method.

marcone avatar Mar 20 '19 21:03 marcone

@therealmarcone

@schmug did you do headless setup from the prebuilt images from rtgoodwin by any chance? I found the included sample conf file is missing the export ARCHIVE_SYSTEM=... line, and without that it won't install the proper scripts for your chosen backup method.

I may have crippled myself but I have rebuilt so many times I cannot remember my last steps, should have documented. I tried to follow jspv's advice and I think I have everything working but no rclone script running

I will look there. I believe #128 is happening for me as well but running sudo modprobe -r g_mass_storage and sudo modprobe g_mass_storage seems to flip from Dashcam icon with gray dot to red dot (and working)

schmug avatar Mar 20 '19 21:03 schmug

If these pull requests don't get merged soon, we may need to make @therealmarcone fork the new master.

Rykemapo avatar Mar 20 '19 21:03 Rykemapo

@schmug Did you try running configure.sh to configure the scripts (last section on my advice) I've had times that I needed to run that manually.

Also if you are using s3, you may want to double check your s3 policies to ensure you're allowing write. Trying a a manual 'rclone copy' to your bucket would be a good test.

jspv avatar Mar 20 '19 22:03 jspv

@jspv thanks for the reply. I had in one iteration but I think I hadn't since I got it working better. I manually edited configure.sh since it had reference to cimryan to jspv and just ran it and rebooted but it isn't back yet so I'm headed to my car to take a peek and see what's wrong. Also am I reading it right that it will only occur on power on?

edit: It is working now. Just trying to figure out if it is working properly or not or if I need to manually get it to show up in the car with modprobe. Also I monitor my car with Zabbix so it never sleeps.. could throw a wrench.

schmug avatar Mar 20 '19 22:03 schmug

You don’t need to edit configure.sh to change REPO or BRANCH, the hard coded cimryan only takes effect if you aren’t setting the BRANCH and REPO environment variables. If you set the variables, it will pull the script from the repo you specify.

Only need to run configure.sh once, it downloads the scrips to automate the device.

jspv avatar Mar 20 '19 23:03 jspv

@jspv makes sense I think I was just being dense because it took me around 6 tries to get working haha. Does rclone only trigger automatically on boot or is it on wireless connect?

schmug avatar Mar 20 '19 23:03 schmug

When you boot, archiveloop gets automatically run and keeps running forever. Archiveloop will check for a network connection, if it finds one it will sync the files. When done, it will turn the device into a usb drive and wait for a network disconnect and a later reconnect, at which time it will sync the new files and repeat the process.

You can fake a connection or disconnect by touching /tmp/archive_is_reachable and /tmp/archive_is_unreachable respectively for testing.

jspv avatar Mar 20 '19 23:03 jspv

@jspv so I can say that your advice also worked for me on 2019.5.15. thanks!

schmug avatar Mar 21 '19 01:03 schmug

Has anyone been able to find a solution for the config issues? I'm having the same issue that @mg-chen was having.

Should there be a .config directory? The contents of root are bin rpi-sync teslausb.conf

I've run through the config setup repeatedly and this happens each time.

rochec avatar Jun 15 '19 02:06 rochec