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

Troubles with Raspberry Pi

This site may earn commission on affiliate links.
Calling all Raspberry Pi users. Looking for help on connecting a Raspberry Pi Zero W to Tesla Model 3. Full disclosure, this is my first exposure with Raspberry Pi (it was recommended to me by Tesla Service after many complaints about intermittent problems with my USB ports and constant corrupted video; they replaced the on-board USB HUB... yes, apparently the two physical ports you have in your dash are a HUB which connects to your main board).

At any rate, flashing a 64G Samsung Pro Endurance mSD using balenaEtcher, then updating teslausb_setup_variables.conf file with my parameters following GitHub/marcone one-step headless setup, was straight forward. I used Raspbian image marcone v1.3 teslausb-20190615. Reviewing the teslausb-headless-setup.log file, it appears setup completed. TESLAUSB_SETUP_FINISHED and WIFI_ENABLED files are there.

Note that my setup for mounting a CFIS drive uses a Share on my Synology DS-415+ NAS. I verified that the 'TeslaCam' and 'TeslaMusic' shares were mounting properly on the Pi. I left the Pi run for a bit to allow audio files in the 'TeslaMusic' share to sync. Sync was successful.

The only thing left was to plug it into Artax (Model 3). Unfortunately, Artax doesn't seem to like it. The camera/recording icon does not appear in the top right of the screen (left it in for an hour; tried both USB ports).

Any advice would be appreciated. Following is the un-hashed teslausb_setup_variables.conf file content (some 'xxx' for privacy); full file and teslausb-headless-setup.log file attached for your viewing pleasure.

#####################################################################
# ArtaxUSB CONFIGURATION FILE FOR TESLAUSB Pi Setup
#####################################################################

# Default variables for CIFS setup - Connect to BnMe15 Synology NAS
export ARCHIVE_SYSTEM=cifs
export archiveserver=10.16.0.xxx
export sharename=TeslaCam
export shareuser=ArtaxPi
export sharepassword=xxxxxxxxxxxxx
# export cifs_version="3.0"

export camsize=80%
#export musicsize=20%

export musicsharename=TeslaMusic

# Pi Wifi Connect setup information
export SSID='FnMeR'
export WIFIPASS='xxxxxxxxxxxxx'

# If doing a headless (i.e. automatic) setup
export HEADLESS_SETUP=true

# uncomment to enable teslausb to act as a wifi access point with the given
# SSID, so you can access it while on the road.
export AP_SSID='ArtaxPiAP'
# AP wifi password must be at least 8 characters.
export AP_PASS='xxxxxxxxxxxx'
# AP Gateway IP
export AP_IP='192.168.xxx.1'

# default timezone 'BST' / "auto" to attempt automatic timezone detection
export timezone="America/Vancouver"

# By default there is a 20 second delay between connecting to wifi and
# starting the archiving of recorded clips
# export archivedelay=20

# Uncomment if you want to override the default hostname of "teslausb"
export TESLAUSB_HOSTNAME=ArtaxUSB
 

Attachments

  • teslausb_setup_variables.conf.copy.txt
    3.2 KB · Views: 80
  • teslausb-headless-setup.log.txt
    17.2 KB · Views: 69
Do the sd card drives mount when the pi is connected to your pc? Make sure you are using the correct micro USB port on the pi zero, only one of them carries data, as well as a cable that you know works for data as some are power only.
 
  • Like
Reactions: jigjug
A couple of additional notes:
  • yes, I am connecting to the 'data' port on the Pi (not the 'power only' port)
  • neither the camera/record icon nor USB audio device appear on Artax's screen (see screenshot below)
  • while plugged into Artax, I checked my router clients list and see the Pi is indeed connected
  • I see the Pi's Access Point 'ArtaxPiAP' and can connect
Artax.jpg
 
Do the sd card drives mount when the pi is connected to your pc? Make sure you are using the correct micro USB port on the pi zero, only one of them carries data, as well as a cable that you know works for data as some are power only.
Yes, SD card mounts when plugged into Mac (but only 'boot'; the TeslaCam and TeslaMusic mnt does not... nor do I think they should; but I can definitely see them when I ssh)
Yes, middle 'data' port being used
You have a point on the cable... need to check to see if it supports data (if this is the problem, then doh (like forgetting to see if the fuse is ok!!).
 
Yes, SD card mounts when plugged into Mac (but only 'boot'; the TeslaCam and TeslaMusic mnt does not... nor do I think they should; but I can definitely see them when I ssh)
Yes, middle 'data' port being used
You have a point on the cable... need to check to see if it supports data (if this is the problem, then doh (like forgetting to see if the fuse is ok!!).
You should see them both mount on the Mac. I’d reimage and just plug into the Mac, then let it finish its setup. If you don’t see the volumes mount on the Mac, then setup has failed. You can also try the following:

1. ssh to the Pi.
2. Do a “sudo -i”
3. cd /root/bin
4. Run the script with “./setup_teslausb”
 
You should see them both mount on the Mac. I’d reimage and just plug into the Mac, then let it finish its setup. If you don’t see the volumes mount on the Mac, then setup has failed. You can also try the following:

1. ssh to the Pi.
2. Do a “sudo -i”
3. cd /root/bin
4. Run the script with “./setup_teslausb”
I picked up a new mUSB cable from London Drugs (Canadian version of Target); made sure it supported both Power and Sync. Voila... that appears to have been the issue (original cable I was using was power only). Pi booted; Camera and USB Media icons appeared. Download after pressing Camera icon appear to be working. Music playing.

When I pulled into my garage after a short jaunt, seemed to connect to home WiFi. However, it seemed to stop abruptly (music stopped and icons disappeared from screen) after a minute or two... not sure if that is expected... did it shut itself down..? I checked the TeslaCam share on the Synology NAS and it did transfer a number of files to the share.

I will play with it per your suggestions above. But at least I am over my FacePalm moment..!!

FacePalm.jpg
 
It disconnects the drives when it first connects to your WiFi each time you return home, and reconnects them when done transferring.
Personally I gave up on mine after a few days though as i found the WiFi transfer rate the pi zero is capable of is too slow and the process takes too long when there are a large number of files, while generally most of the sentry files are uninteresting anyway and there is no reason to view or store them.
 
I will play with it per your suggestions above. But at least I am over my FacePalm moment..!!
Glad you found the cause. No need to follow those previous suggestions. Those steps just re-run the setup script, which you obviously don't need now. In the future, it is somewhat useful to install the latest version of the software though.
 
Glad you found the cause. No need to follow those previous suggestions. Those steps just re-run the setup script, which you obviously don't need now. In the future, it is somewhat useful to install the latest version of the software though.
I toyed with using the 'Buster' beta version, but decided to follow marcone's advice; "You may want to continue using the Stretch-based v1.3 image until the Buster-based version has been more thoroughly tested." I will definitely migrate to it once it goes mainstream.

By the way, I woke the car up using the iPhone app and turned 'climate' on. The Pi finished the uploads to the Synology shares and the screen icons came back up. I do agree that it is not very power efficient to do this. I am looking at adding PiSugar to the mix so that the unit has power to complete it's sync cycle (could also use the API to keep power on but don't like the idea of having my Tesla password so accessible; also, not a power efficient alternative).
 
I woke the car up using the iPhone app and turned 'climate' on. The Pi finished the uploads

You say that it finished the uploads, however in my experience, it is uploading new videos from when it was parked. The car normally is awake a lot longer than the Pi upload takes. So then the Pi makes the USB drive available to the car, and the car starts recording again, until it goes to sleep. Once the car wakes, the Pi boots, and it immediately starts transferring the files that were written before the car went to sleep.
 
You say that it finished the uploads, however in my experience, it is uploading new videos from when it was parked. The car normally is awake a lot longer than the Pi upload takes. So then the Pi makes the USB drive available to the car, and the car starts recording again, until it goes to sleep. Once the car wakes, the Pi boots, and it immediately starts transferring the files that were written before the car went to sleep.
Do you have your car set to disable Sentry when at home? I do not experience the scenario you describe. I'm using a Pi 4. When I arrive home, it disconnects the local drive mounts, uploads the videos to my NAS, and shuts down the Pi. I do have the Tesla account and VIN details to allow the Pi to use the API to keep the car awake until uploads are completed.
 
Hi All,

I am having an issue with my teslausb but haven't seen anybody with the same thing... So, I set it all up, I can see it's recording properly, and I can ssh into it and manually create files on my shared drive, but it does not seem to be sending any of the videos to the shared drive. There are sentry clips, saved clips, and recent clips all on the raspberry pi. My understanding is all but recent clips are supposed to automatically start transferring when it connects to wifi. I'm not much of a Linux guy so not sure which logs I should check or how to troubleshoot. Can anybody help me out?
 
Yes, Roadie is a Raspberry Pi zero W packaged in a branded case. However, the s/w is different; you don't need to be a tech head to make it work... just plug it in, and it comes w/ that all important mobile app (iPhone and Android supported). The only draw back is that it ships with a low quality mSD that probably won't stand up to the surveillance video environment. I sent them a suggestion asking that they offer an option to purchase with a better mSD (like Samsung Pro Endurance); yes, one could clone the image to a better mSD but that defeats the 'no need to be a tech head'. The other feature I would like to see is the ability to auto-archive videos to a cfis drive on the home network (e.g. Synology NAS).
 
In my case, I get this error on checking the logs
"STOP: no working combination of vers and sec mount options worked"
While it is connected to the car, I can SHH, ping my ip address, unfortunately nothing uploads to my share. Any ideas?

I am ok extracting the recordings from my PC, does anyone know of Putty commands, that will help me copy the files to my PC from the Pi while it is connected to the car?