Skip to content
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

USB drive not always mounted by the car #11

Open
wurmr opened this issue Jun 18, 2019 · 15 comments
Open

USB drive not always mounted by the car #11

wurmr opened this issue Jun 18, 2019 · 15 comments

Comments

@wurmr
Copy link
Contributor

wurmr commented Jun 18, 2019

Excellent, is there anything I can do to help test or assist in the code?

Model 3 here as a testbed.

You'd be making my life a 100x easier if you could check out the branch I mentioned above and burn that to a fast SDHC card and see what it does.

If you can poke around and see if any changed you make results in a different outcome that would be helpful. Currently I've been comparing a standard USB drive vs. the TeslaCam and I've struggled to see a difference - I did wonder if the USB serial number or other information was bleeding through and maybe Tesla blocked it for security reasons.

Given the car doesn't offer any diagnostics to us mere humans, it's somewhat trial and error.

The car has absolutely mounted the pi with the above branch mounted, but after some time it dropped out. (I've also seen this on standard USB flash drives, so it could be unrelated).

Any help would be appreciated, once this is up and running again it opens up some cool prospects

Originally posted by @milesburton in #9 (comment)

@wurmr
Copy link
Contributor Author

wurmr commented Jun 18, 2019

Created the issue to track this problem. Discussion can happen here.

I'm testing on a USA Model 3 currently on software version 2019.20.1

@wurmr wurmr changed the title USB Drive not always mounted by the car USB drive not always mounted by the car Jun 18, 2019
@milesburton
Copy link
Owner

milesburton commented Jun 19, 2019

For those who are interested in assisting, fundamentally this should be simple outside of the drive creation.

Unmount drives

sudo umount /mnt
sudo /sbin/modprobe -r g_mass_storage
sudo /sbin/losetup -d /dev/loop0

Mount locally the loopback device

sudo /sbin/losetup -o 1048576 /dev/loop0 /home/pi/teslacam/images/cam0
sudo /bin/mount -o gid=pi,uid=pi /dev/loop0 /mnt
ls -l /mnt/TeslaCam/

Mount to Tesla

sudo /sbin/modprobe g_mass_storage file=/home/pi/teslacam/images/cam1 removable=1 ro=0 stall=0 iSerialNumber=123456

The above assumes you've followed my rough guide in the readme.md file. The above works if you dd a working USB drive.

@wurmr
Copy link
Contributor Author

wurmr commented Jun 20, 2019

So far I have not been able to repo this problem on my m3. Code is now up to 2019.20.2.1 and it has mounted the drive every time after initial boot up. I did notice a problem where I wasn't getting the Tesla to mount the drive if I used a splitter. I've been running it plugged directly into a port.

I will mess with a splitter again and see if it makes a difference.

@milesburton
Copy link
Owner

Interesting. Dropbox upload all working?

@wurmr
Copy link
Contributor Author

wurmr commented Jun 20, 2019

I am not using Dropbox integration, I have that disabled. Currently am using scp to grab files off the pi by hand.

@milesburton
Copy link
Owner

Cool, if you get bored and wanted to add a SCP service to the codebase that would be great

@petervoe
Copy link

Hi,
i have a similar problem in my model 3. After reboot the raspi drive ist mountet correctly. Some times later the Camera-X Icon appears.
Possibly it is an Problem with the FAT32 Dirty Bit?
https://forums.tesla.com/forum/forums/dash-cam-feature-leaves-dirty-bit-fat32-usb-stick-when-going-sleep-mode-making-it

@milesburton
Copy link
Owner

milesburton commented Jul 23, 2019 via email

@petervoe
Copy link

Hi,
ok thank you, i will try it and let you know the results. :)

@petervoe
Copy link

Hi,
i deleted the teslacam folder, cloned the repo again and switched to the ext4 branch.
Now the following Errormessage appers after starting dashcam-monitor.js:

mount: /mnt: special device /dev/loop0p1 does not exist.
Failed: code [32]: mount: /mnt: special device /dev/loop0p1 does not exist.
(node:1710) UnhandledPromiseRejectionWarning: Error: Command failed: sudo /bin/mount /dev/loop0p1 /mnt
...

@milesburton
Copy link
Owner

milesburton commented Jul 29, 2019 via email

@petervoe
Copy link

Did you completely delete the original camera images? Either the image was not generated correctly, or it's not showing up as a partition.

On Mon, Jul 29, 2019 at 3:20 PM Peter Völkl @.***> wrote: Hi, i deleted the teslacam folder, cloned the repo again and switched to the ext4 branch. Now the following Errormessage appers after starting dashcam-monitor.js: mount: /mnt: special device /dev/loop0p1 does not exist. Failed: code [32]: mount: /mnt: special device /dev/loop0p1 does not exist. (node:1710) UnhandledPromiseRejectionWarning: Error: Command failed: sudo /bin/mount /dev/loop0p1 /mnt ... — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub <#11?email_source=notifications&email_token=AAJGHM2BNBVI4GFGTGTSLXTQB34CRA5CNFSM4HZEWSFKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD3A3PNI#issuecomment-516011957>, or mute the thread https://github.com/notifications/unsubscribe-auth/AAJGHM54D2AUHEW4VB2UYODQB34CRANCNFSM4HZEWSFA .

yes I deleted both cam files in the image directory. After running dashcam-monitor.js a new cam0 File was created an the mounting error occurs: The file /dev/loop1p1 does not exist and no size was specified.

@milesburton
Copy link
Owner

milesburton commented Jul 29, 2019 via email

@petervoe
Copy link

petervoe commented Jul 29, 2019

Can you run an ls -l /dev ? On Mon, Jul 29, 2019 at 7:53 PM Peter Völkl .

crw-r--r-- 1 root root 10, 235 Jul 29 20:17 autofs
drwxr-xr-x 2 root root 580 Jul 29 20:17 block
crw------- 1 root root 10, 234 Jul 29 20:17 btrfs-control
drwxr-xr-x 3 root root 60 Jul 29 20:17 bus
crw------- 1 root root 10, 63 Jul 29 20:17 cachefiles
drwxr-xr-x 2 root root 2560 Jul 29 20:17 char
crw------- 1 root root 5, 1 Jul 29 20:17 console
crw------- 1 root root 10, 62 Jul 29 20:17 cpu_dma_latency
crw------- 1 root root 10, 203 Jul 29 20:17 cuse
drwxr-xr-x 7 root root 140 Jul 29 20:17 disk
crw-rw---- 1 root video 29, 0 Jul 29 20:17 fb0
lrwxrwxrwx 1 root root 13 Feb 14 10:11 fd -> /proc/self/fd
crw-rw-rw- 1 root root 1, 7 Jul 29 20:17 full
crw-rw-rw- 1 root root 10, 229 Jul 29 20:17 fuse
crw-rw---- 1 root gpio 254, 0 Jul 29 20:17 gpiochip0
crw-rw---- 1 root gpio 247, 0 Jul 29 20:17 gpiomem
crw------- 1 root root 10, 183 Jul 29 20:17 hwrng
lrwxrwxrwx 1 root root 12 Feb 14 10:12 initctl -> /run/initctl
drwxr-xr-x 2 root root 60 J▒n 1 1970 input
crw-r--r-- 1 root root 1, 11 Jul 29 20:17 kmsg
lrwxrwxrwx 1 root root 28 Feb 14 10:12 log -> /run/systemd/journal/dev-log
brw-rw---- 1 root disk 7, 0 Jul 29 20:17 loop0
brw-rw---- 1 root disk 7, 1 Jul 29 20:17 loop1
brw-rw---- 1 root disk 7, 2 Jul 29 20:17 loop2
brw-rw---- 1 root disk 7, 3 Jul 29 20:17 loop3
brw-rw---- 1 root disk 7, 4 Jul 29 20:17 loop4
brw-rw---- 1 root disk 7, 5 Jul 29 20:17 loop5
brw-rw---- 1 root disk 7, 6 Jul 29 20:17 loop6
brw-rw---- 1 root disk 7, 7 Jul 29 20:17 loop7
crw-rw---- 1 root disk 10, 237 Jul 29 20:17 loop-control
drwxr-xr-x 2 root root 60 Jul 29 20:17 mapper
crw-r----- 1 root kmem 1, 1 Jul 29 20:17 mem
crw------- 1 root root 10, 59 Jul 29 20:17 memory_bandwidth
brw-rw---- 1 root disk 179, 0 Jul 29 20:17 mmcblk0
brw-rw---- 1 root disk 179, 1 Jul 29 20:17 mmcblk0p1
brw-rw---- 1 root disk 179, 2 Jul 29 20:17 mmcblk0p2
drwxrwxrwt 2 root root 40 J▒n 1 1970 mqueue
drwxr-xr-x 2 root root 60 Jul 29 20:17 net
crw------- 1 root root 10, 61 Jul 29 20:17 network_latency
crw------- 1 root root 10, 60 Jul 29 20:17 network_throughput
crw-rw-rw- 1 root root 1, 3 Jul 29 20:17 null
crw------- 1 root root 108, 0 Jul 29 20:17 ppp
crw-rw-rw- 1 root tty 5, 2 Jul 29 20:59 ptmx
drwxr-xr-x 2 root root 0 Feb 14 10:11 pts
brw-rw---- 1 root disk 1, 0 Jul 29 20:17 ram0
brw-rw---- 1 root disk 1, 1 Jul 29 20:17 ram1
brw-rw---- 1 root disk 1, 10 Jul 29 20:17 ram10
brw-rw---- 1 root disk 1, 11 Jul 29 20:17 ram11
brw-rw---- 1 root disk 1, 12 Jul 29 20:17 ram12
brw-rw---- 1 root disk 1, 13 Jul 29 20:17 ram13
brw-rw---- 1 root disk 1, 14 Jul 29 20:17 ram14
brw-rw---- 1 root disk 1, 15 Jul 29 20:17 ram15
brw-rw---- 1 root disk 1, 2 Jul 29 20:17 ram2
brw-rw---- 1 root disk 1, 3 Jul 29 20:17 ram3
brw-rw---- 1 root disk 1, 4 Jul 29 20:17 ram4
brw-rw---- 1 root disk 1, 5 Jul 29 20:17 ram5
brw-rw---- 1 root disk 1, 6 Jul 29 20:17 ram6
brw-rw---- 1 root disk 1, 7 Jul 29 20:17 ram7
brw-rw---- 1 root disk 1, 8 Jul 29 20:17 ram8
brw-rw---- 1 root disk 1, 9 Jul 29 20:17 ram9
crw-rw-rw- 1 root root 1, 8 Jul 29 20:17 random
drwxr-xr-x 2 root root 60 J▒n 1 1970 raw
crw-rw-r-- 1 root netdev 10, 57 Jul 29 20:17 rfkill
lrwxrwxrwx 1 root root 7 Jul 29 20:17 serial1 -> ttyAMA0
drwxrwxrwt 2 root root 40 Feb 14 10:11 shm
drwxr-xr-x 3 root root 160 Jul 29 20:17 snd
lrwxrwxrwx 1 root root 15 Feb 14 10:11 stderr -> /proc/self/fd/2
lrwxrwxrwx 1 root root 15 Feb 14 10:11 stdin -> /proc/self/fd/0
lrwxrwxrwx 1 root root 15 Feb 14 10:11 stdout -> /proc/self/fd/1
crw-rw-rw- 1 root tty 5, 0 Jul 29 20:17 tty
crw--w---- 1 root tty 4, 0 Jul 29 20:17 tty0
crw--w---- 1 root tty 4, 1 Jul 29 20:17 tty1
crw--w---- 1 root tty 4, 10 Jul 29 20:17 tty10
crw--w---- 1 root tty 4, 11 Jul 29 20:17 tty11
crw--w---- 1 root tty 4, 12 Jul 29 20:17 tty12
crw--w---- 1 root tty 4, 13 Jul 29 20:17 tty13
crw--w---- 1 root tty 4, 14 Jul 29 20:17 tty14
crw--w---- 1 root tty 4, 15 Jul 29 20:17 tty15
crw--w---- 1 root tty 4, 16 Jul 29 20:17 tty16
crw--w---- 1 root tty 4, 17 Jul 29 20:17 tty17
crw--w---- 1 root tty 4, 18 Jul 29 20:17 tty18
crw--w---- 1 root tty 4, 19 Jul 29 20:17 tty19
crw--w---- 1 root tty 4, 2 Jul 29 20:17 tty2
crw--w---- 1 root tty 4, 20 Jul 29 20:17 tty20
crw--w---- 1 root tty 4, 21 Jul 29 20:17 tty21
crw--w---- 1 root tty 4, 22 Jul 29 20:17 tty22
crw--w---- 1 root tty 4, 23 Jul 29 20:17 tty23
crw--w---- 1 root tty 4, 24 Jul 29 20:17 tty24
crw--w---- 1 root tty 4, 25 Jul 29 20:17 tty25
crw--w---- 1 root tty 4, 26 Jul 29 20:17 tty26
crw--w---- 1 root tty 4, 27 Jul 29 20:17 tty27
crw--w---- 1 root tty 4, 28 Jul 29 20:17 tty28
crw--w---- 1 root tty 4, 29 Jul 29 20:17 tty29
crw--w---- 1 root tty 4, 3 Jul 29 20:17 tty3
crw--w---- 1 root tty 4, 30 Jul 29 20:17 tty30
crw--w---- 1 root tty 4, 31 Jul 29 20:17 tty31
crw--w---- 1 root tty 4, 32 Jul 29 20:17 tty32
crw--w---- 1 root tty 4, 33 Jul 29 20:17 tty33
crw--w---- 1 root tty 4, 34 Jul 29 20:17 tty34
crw--w---- 1 root tty 4, 35 Jul 29 20:17 tty35
crw--w---- 1 root tty 4, 36 Jul 29 20:17 tty36
crw--w---- 1 root tty 4, 37 Jul 29 20:17 tty37
crw--w---- 1 root tty 4, 38 Jul 29 20:17 tty38
crw--w---- 1 root tty 4, 39 Jul 29 20:17 tty39
crw--w---- 1 root tty 4, 4 Jul 29 20:17 tty4
crw--w---- 1 root tty 4, 40 Jul 29 20:17 tty40
crw--w---- 1 root tty 4, 41 Jul 29 20:17 tty41
crw--w---- 1 root tty 4, 42 Jul 29 20:17 tty42
crw--w---- 1 root tty 4, 43 Jul 29 20:17 tty43
crw--w---- 1 root tty 4, 44 Jul 29 20:17 tty44
crw--w---- 1 root tty 4, 45 Jul 29 20:17 tty45
crw--w---- 1 root tty 4, 46 Jul 29 20:17 tty46
crw--w---- 1 root tty 4, 47 Jul 29 20:17 tty47
crw--w---- 1 root tty 4, 48 Jul 29 20:17 tty48
crw--w---- 1 root tty 4, 49 Jul 29 20:17 tty49
crw--w---- 1 root tty 4, 5 Jul 29 20:17 tty5
crw--w---- 1 root tty 4, 50 Jul 29 20:17 tty50
crw--w---- 1 root tty 4, 51 Jul 29 20:17 tty51
crw--w---- 1 root tty 4, 52 Jul 29 20:17 tty52
crw--w---- 1 root tty 4, 53 Jul 29 20:17 tty53
crw--w---- 1 root tty 4, 54 Jul 29 20:17 tty54
crw--w---- 1 root tty 4, 55 Jul 29 20:17 tty55
crw--w---- 1 root tty 4, 56 Jul 29 20:17 tty56
crw--w---- 1 root tty 4, 57 Jul 29 20:17 tty57
crw--w---- 1 root tty 4, 58 Jul 29 20:17 tty58
crw--w---- 1 root tty 4, 59 Jul 29 20:17 tty59
crw--w---- 1 root tty 4, 6 Jul 29 20:17 tty6
crw--w---- 1 root tty 4, 60 Jul 29 20:17 tty60
crw--w---- 1 root tty 4, 61 Jul 29 20:17 tty61
crw--w---- 1 root tty 4, 62 Jul 29 20:17 tty62
crw--w---- 1 root tty 4, 63 Jul 29 20:17 tty63
crw--w---- 1 root tty 4, 7 Jul 29 20:17 tty7
crw--w---- 1 root tty 4, 8 Jul 29 20:17 tty8
crw--w---- 1 root tty 4, 9 Jul 29 20:17 tty9
crw-rw---- 1 root dialout 204, 64 Jul 29 20:17 ttyAMA0
crw------- 1 root root 5, 3 Jul 29 20:17 ttyprintk
crw------- 1 root root 10, 239 Jul 29 20:17 uhid
crw------- 1 root root 10, 223 Jul 29 20:17 uinput
crw-rw-rw- 1 root root 1, 9 Jul 29 20:17 urandom
drwxr-xr-x 3 root root 60 Jul 29 20:17 v4l
crw-rw---- 1 root video 243, 0 Jul 29 20:17 vchiq
crw-rw---- 1 root video 248, 0 Jul 29 20:17 vcio
crw------- 1 root root 249, 0 Jul 29 20:17 vc-mem
crw-rw---- 1 root tty 7, 0 Jul 29 20:17 vcs
crw-rw---- 1 root tty 7, 1 Jul 29 20:17 vcs1
crw-rw---- 1 root tty 7, 2 Jul 29 20:17 vcs2
crw-rw---- 1 root tty 7, 3 Jul 29 20:17 vcs3
crw-rw---- 1 root tty 7, 4 Jul 29 20:17 vcs4
crw-rw---- 1 root tty 7, 5 Jul 29 20:17 vcs5
crw-rw---- 1 root tty 7, 6 Jul 29 20:17 vcs6
crw-rw---- 1 root tty 7, 128 Jul 29 20:17 vcsa
crw-rw---- 1 root tty 7, 129 Jul 29 20:17 vcsa1
crw-rw---- 1 root tty 7, 130 Jul 29 20:17 vcsa2
crw-rw---- 1 root tty 7, 131 Jul 29 20:17 vcsa3
crw-rw---- 1 root tty 7, 132 Jul 29 20:17 vcsa4
crw-rw---- 1 root tty 7, 133 Jul 29 20:17 vcsa5
crw-rw---- 1 root tty 7, 134 Jul 29 20:17 vcsa6
crw-rw---- 1 root video 244, 0 Jul 29 20:17 vcsm
crw-rw-rw- 1 root root 10, 58 Jul 29 20:17 vcsm-cma
crw-rw---- 1 root tty 7, 64 Jul 29 20:17 vcsu
crw-rw---- 1 root tty 7, 65 Jul 29 20:17 vcsu1
crw-rw---- 1 root tty 7, 66 Jul 29 20:17 vcsu2
crw-rw---- 1 root tty 7, 67 Jul 29 20:17 vcsu3
crw-rw---- 1 root tty 7, 68 Jul 29 20:17 vcsu4
crw-rw---- 1 root tty 7, 69 Jul 29 20:17 vcsu5
crw-rw---- 1 root tty 7, 70 Jul 29 20:17 vcsu6
crw------- 1 root root 10, 137 Jul 29 20:17 vhci
crw-rw---- 1 root video 81, 0 Jul 29 20:17 video10
crw-rw---- 1 root video 81, 1 Jul 29 20:17 video11
crw-rw---- 1 root video 81, 2 Jul 29 20:17 video12
crw------- 1 root root 10, 130 Jul 29 20:17 watchdog
crw------- 1 root root 251, 0 Jul 29 20:17 watchdog0
crw-rw-rw- 1 root root 1, 5 Jul 29 20:17 zero

@milesburton
Copy link
Owner

OK so for whatever reason either the image was not created correctly, and isn't showing up as a partition.

As an interim fix, what you could do is clone a known working ext4 usb stick then copy it to the images directly, duplicate the image file and rename one cam0, the other cam1.

I'm also seeing issues where sometimes it'll work, sometimes it wont. I'm testing the above approach now, then I'll compare the file systems to see if that helps

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants