Welcome to Tesla Motors Club
Discuss Tesla's Model S, Model 3, Model X, Model Y, Cybertruck, Roadster and More.
Register

Anyone still rocking a Pi Zero W smart drive for TeslaCam on Sentry Mode?

This site may earn commission on affiliate links.
Anyone who has this working on a Mac care to share their config? I can't for the life of me get a CAM folder to mount in my shared directory using CIFS 3.0, 2.1, 2.0 and 1.0. Maybe I'm doing something wrong on the server side? Thanks.
 
Anyone who has this working on a Mac care to share their config? I can't for the life of me get a CAM folder to mount in my shared directory using CIFS 3.0, 2.1, 2.0 and 1.0. Maybe I'm doing something wrong on the server side? Thanks.
The CAM folder doesn't mount anywhere... the pi makes a connection to your shared folder and then transfers the files to the shared folder.

So on your mac, you share a folder, then in your teslausb config you give it the IP address of your mac, the username and password of a mac user that can access the shared folder.

What does the log say on the pi?
 
Well, specifically, I think you also have to drill into System Preferences and turn on (I think) File Sharing under the Network applet. I'll try to remember to dig out my Mac and get some screenshots for you to help with enabling CIFS shares.
 
The CAM folder doesn't mount anywhere... the pi makes a connection to your shared folder and then transfers the files to the shared folder.

So on your mac, you share a folder, then in your teslausb config you give it the IP address of your mac, the username and password of a mac user that can access the shared folder.

What does the log say on the pi?

Log doesn't throw any errors regarding mounting the share, so I'm assuming it's working okay? The only way to test if the system is working would be to record some events from the car and see if anything shows up on the shared drive?

Well, specifically, I think you also have to drill into System Preferences and turn on (I think) File Sharing under the Network applet. I'll try to remember to dig out my Mac and get some screenshots for you to help with enabling CIFS shares.

Already shared the folder, but in the teslausb setup instructions, it sounded like CAM and MUSIC folders would show up on the shared folder.
 
Anyone who has this working on a Mac care to share their config? I can't for the life of me get a CAM folder to mount in my shared directory using CIFS 3.0, 2.1, 2.0 and 1.0. Maybe I'm doing something wrong on the server side? Thanks.
That's not how it will work. You will need to set up the folder share on the Mac, then add the settings in the tesla config file on the Pi with all the details to point to the Mac folder.

On the Mac, go to System Preferences and the Sharing section. Make sure "File Sharing" is enabled. Then add a Shared Folder, and give a user access to the Shared Folder you create. If you want a separate user than one of the existing ones, you will need to go to the Users & Groups in System Preferences to create that user.

In the teslausb_setup_variables.conf file:

Code:
# Default variables for CIFS (Windows/Mac file sharing) setup
export ARCHIVE_SYSTEM=cifs
export archiveserver=[IP Address of Your Mac]
export sharename=[Name of the Shared Folder You Created]
export shareuser=[Mac User That You Gave Access to the Shared Folder]
export sharepassword=[Password of the Mac User]
# export cifs_version="3.0"

You probably don't need to uncomment the export cifs_version line, but pretty sure Macs have been on Samba v3 for awhile so it shouldn't hurt.

If the Pi is already set up, you will need to ssh into it then go into the /root/bin folder and rerun the setup script.

The Pi will upload the TeslaCam files whenever it joins the network and sees the Mac Shared Folder, then clear the files off the Pi. You won't see a CAM or MUSIC folder.
 
I think you answered my question, but just to confirm, the Pi will automatically clear out (delete) recordings once they have been archived to my network storage? Thus I don't really have to worry about running out of space on my Pi, assuming it connects to Wifi at home on a regular basis, and long enough to transfer the files?

I'm using a 128GB microSD, with 90% allocated to the cam, so hopefully my days of manually deleting old files are done!
 
I was using this setup for a while but like many, started getting the bandwidth error almost consistently (lucky to get 1 hour of use before the error). This was with a Samsung Endurance SD card and Buster on a Zero W. However, a few weeks ago I followed the recommendation of performing a firmware upgrade and configuring the cam and music partitions to still leave some unused space on the card and that fixed it! Not a single bandwidth error since then! Only issue is twice the pi appeared to have crashed during bootup as the dashcam never started recording (car never saw the drive appear). A quick unplug/plugin and it was back to normal. Overall, I'm very happy with this solution. Way better then the previous setup I had with a Verbatim WiFi dongle that I had to switch on at home and have a service running on my home network to detect and pull files. Having an automated solution is great!
 
  • Like
Reactions: DopeGhoti
I was using this setup for a while but like many, started getting the bandwidth error almost consistently (lucky to get 1 hour of use before the error). This was with a Samsung Endurance SD card and Buster on a Zero W. However, a few weeks ago I followed the recommendation of performing a firmware upgrade and configuring the cam and music partitions to still leave some unused space on the card and that fixed it! Not a single bandwidth error since then! Only issue is twice the pi appeared to have crashed during bootup as the dashcam never started recording (car never saw the drive appear). A quick unplug/plugin and it was back to normal. Overall, I'm very happy with this solution. Way better then the previous setup I had with a Verbatim WiFi dongle that I had to switch on at home and have a service running on my home network to detect and pull files. Having an automated solution is great!
The firmware update solved it for me as well.
 
So I've just installed Marcone-TeslaUSB20190615 (as I couldn't get the newest build to work on my Pi Zero W) and it's great, the backup is syncing well to my NAS drive and the DashCam footage seems to be working perfectly. The issue I'm having, and having searched the forums, Reddit and the Git repo, is that the SentryMode footage is all only about 1second long (150KB). Has anyone else seen this? Any suggestions?
 
Quick question (sorry if it has been asked and answered): Can I view these video files from the Pi Zero in Tesla's browser? i.e. load a list of the videos and instead of just offloading to a remote drive/computer/cloud - actually view them in the browser. I think that is more useful to many if you want to view your sentry videos when you see the notification in the car.
 
Quick question (sorry if it has been asked and answered): Can I view these video files from the Pi Zero in Tesla's browser? i.e. load a list of the videos and instead of just offloading to a remote drive/computer/cloud - actually view them in the browser. I think that is more useful to many if you want to view your sentry videos when you see the notification in the car.
Nobody has implemented that yet to my knowledge. You would have to do the following...
  1. Redirect the car to connect to your Pi Zero over wifi. And if you shift from Park to Drive you have to reconnect manually every time you drive. Bonus points if your Pi Zero has a mobile SIM and can still pass thru regular traffic.
  2. Install a local web server on the Pi Zero. And build a page that can see the local files.
  3. Use an HTTP layer on the Pi Zero that allows for remapping of a URL. And remap one URL to the local server. Essentially a man-in-the-middle attack.
 
Nobody has implemented that yet to my knowledge. You would have to do the following...
  1. Redirect the car to connect to your Pi Zero over wifi. And if you shift from Park to Drive you have to reconnect manually every time you drive. Bonus points if your Pi Zero has a mobile SIM and can still pass thru regular traffic.
  2. Install a local web server on the Pi Zero. And build a page that can see the local files.
  3. Use an HTTP layer on the Pi Zero that allows for remapping of a URL. And remap one URL to the local server. Essentially a man-in-the-middle attack.
There's one more thing. The car will not connect to a wireless network that does not provide Internet access.

The untested alternative is for both the car and the Pi to be on the same Internet enabled wireless network (like your phone's hotspot or a home network).

I suspect that the built in web browser doesn't support the codec needed to play the videos. I'm now curious so I might check this out later.
 
Seems someone has done it, sort of. On a non-Pi Pi-ish thing.

Little project by me (with TeslaCam Browser) to … - teslamotors - Reddit

Sounds like they just had to provide fake DNS results in addition to running an access point so that the test for internet connectivity succeeds.

Of course there's the hassle that probably this interrupts all network functionality in the car (since it would try to use this connection that isn't really connected), so you'd have to then disconnect when done, and ensure somehow that it doesn't automatically connect repeatedly due to seeing the AP there...

They haven't yet provided any details on their setup but it sounds like they intend to eventually release the code and/or image for the device.

This is something I wanted to test out myself but haven't gotten a chance to do so.
 
  • Like
Reactions: DopeGhoti
Seems someone has done it, sort of. On a non-Pi Pi-ish thing.

Little project by me (with TeslaCam Browser) to … - teslamotors - Reddit

Sounds like they just had to provide fake DNS results in addition to running an access point so that the test for internet connectivity succeeds.

Of course there's the hassle that probably this interrupts all network functionality in the car (since it would try to use this connection that isn't really connected), so you'd have to then disconnect when done, and ensure somehow that it doesn't automatically connect repeatedly due to seeing the AP there...

They haven't yet provided any details on their setup but it sounds like they intend to eventually release the code and/or image for the device.

This is something I wanted to test out myself but haven't gotten a chance to do so.

sounds promising, you can fake DNS on the Pi but it would be nice to know exactly how they did it
 
Here are the servers the car attempts to reach. Both the 3 and the X hit these addresses when coming online.

www.teslamotors.com
str01-prd.vn.tesla.services
maps-prd.go.tesla.services
telemetry-prd.vn.tesla.services
connman.vn.tesla.services
hermes-prd.vn.tesla.services
hermes-stream-prd.vn.tesla.services

I threw these into the Pi's hosts file as loopbacks (127.0.0.1) and the car still won't connect to a non-Internet enabled wireless network on the Pi.
 
Last edited:
It's easy enough to look those up and hard-code them in a DNS server such as bind. Or it might be as easy as throwing them into the hosts file, depending on how the system does the DNS check.
The car is likely doing more than just a DNS resolve check. The car could be using a hardcoded IP to check for connectivity. I'll wait to see how the person is doing it from the Reddit post.
 
  • Like
Reactions: chilman408
Here are the servers the car attempts to reach. Both the 3 and the X hit these addresses when coming online.

www.teslamotors.com
str01-prd.vn.tesla.services
maps-prd.go.tesla.services
telemetry-prd.vn.tesla.services
connman.vn.tesla.services
hermes-prd.vn.tesla.services
hermes-stream-prd.vn.tesla.services

I threw these into the Pi's hosts file as loopbacks (127.0.0.1) and the car still won't connect to a non-Internet enabled wireless network on the Pi.
You'll need to run your own DNS server on the Pi that the DHCP service tells the Tesla to use when it connects to the AP, and configure it to hand out pre-defined results (i.e., the Pi's address) for those queries, and then have whatever relevant service responding (likely simple ping, or perhaps HTTP - clearly not HTTPS as otherwise it wouldn't be spoofable).

Something like this is a good starting point to learn more (specifically the 2nd part is relevant) : 3 reasons to turn your Raspberry Pi into a DNS server with dnsmasq

After some brief googling, looks like as far as DNSMasq configuration goes (beyond what is necessary to get it to proxy DNS requests for any Wifi clients in the first place) you just need to add the following to /etc/dnsmasq.conf:

address=/teslamotors.com/192.168.0.1
address=/tesla.services/192.168.0.1

Where 192.168.0.1 is whatever you decide to configure your Pi's access point IP as. Apparently DNSMasq "conveniently" (you can't not do this, and sometimes you might not want to - but not here!) treats all entries as wildcards as far as subdomains go (i.e., all those listed *.tesla.services hosts will be caught by the one tesla.services entry), so you don't need to list every host by itself - which is handy if in the future different hosts are tried.

Similarly you could add an entry for whatever you want to call your Pi for browsing in the car's browser to access the videos and such

address=/teslacam.service/192.168.0.1 (or whatever you want to call it)
 
  • Informative
Reactions: Phlier and focher