TMC is an independent, primarily volunteer organization that relies on ad revenue to cover its operating costs. Please consider whitelisting TMC on your ad blocker and becoming a Supporting Member. For more info: Support TMC

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

Discussion in 'Model 3: User Interface' started by chilman408, Feb 22, 2019.

  1. BioSehnsucht

    BioSehnsucht Model 3 LR

    Joined:
    Apr 1, 2016
    Messages:
    1,750
    Location:
    DFW, TX
    USB writes won't ever be fast with a Raspberry Pi Zero. They're a bit faster on an Orange Pi Zero (I don't have the newer flavors of Orange Pi Zero at hand to test but they might be tad faster still).

    The problem is that instead of writing directly to the storage, like with a regular USB drive, it's going through disk emulation software running on the Pi Zero, and it's not a particularly fast device to begin with. A combination of the slowdown due to g_mass_storage software emulation of a USB drive, and slow actual IO to the underlying storage, and various internal data paths that are slower than full USB speed, means that write speeds will always be mediocre at best on these lower powered Pi devices.

    Hopefully a Raspberry Pi 4B will be much faster since it's not a lower power device. I plan to pick one up soon to play with.

    Perhaps you can set up a Samba ("Windows") network share on your device and transfer the music via WiFi instead, this might be faster (or might not, for similar reasons these small Pi devices tend to have slow WiFi)
     
  2. Pmcfad

    Pmcfad New Member

    Joined:
    Jul 8, 2019
    Messages:
    1
    Location:
    Columbus, NJ
    My USB seems to remain powered (2019.20.4). Any concerns with heat in the car and the running PI? When parked during the day in the sun, even with overheat protection, the inside of the car will easy hit 100F.
     
  3. CuriousG

    CuriousG Active Member

    Joined:
    Dec 1, 2015
    Messages:
    1,518
    Location:
    Elk Grove, CA
    I was hoping the separate images (video and music) could be written to directly. Similarly to writing the img file to SD.
    Got one but nothing interesting is even out to do anything with it at this point unless you just want to run Raspian.
    It is already setup to sync music through SMB share and tested. Am I missing something? How is this to make it faster than directly copying which still uses disk emulation?
     
  4. BioSehnsucht

    BioSehnsucht Model 3 LR

    Joined:
    Apr 1, 2016
    Messages:
    1,750
    Location:
    DFW, TX
    The only way to really write "directly" would be to remove the SD card from the Pi, connect that directly to the PC, and copy that way (and it assumes they're regular partitions Windows can read and not disk images on a Linux partition or in LVM etc - which I think most of the Tesla USB projects use regular partitions, but I don't know if they all do). Then your only limitation is the speed of the SD card or SD card adapter.

    I believe someone else said they'd already installed some flavor of Tesla USB software onto a 4 - thought I may be mistaken. While there may be no one step installs available yet, you can likely still install some of them the manual way on top of Raspbian.

    The WiFi connection on the zero isn't great so it wouldn't surprise me if it was essentially just as slow as USB disk emulation. I had suggested it because there's less software / hardware overhead in going through WiFi and SMB versus disk emulation. Though as I said it might not matter since the WiFi isn't particularly fast on the Zero...
     
  5. CuriousG

    CuriousG Active Member

    Joined:
    Dec 1, 2015
    Messages:
    1,518
    Location:
    Elk Grove, CA
    I didn't notice any directories where it was obvious where it was stored. From the logs, I thought it created a single image file for music and for video. If you know where it's located, I would gladly test it and would have gone that route.
     
  6. BioSehnsucht

    BioSehnsucht Model 3 LR

    Joined:
    Apr 1, 2016
    Messages:
    1,750
    Location:
    DFW, TX
    The first versions were all manual installs (at best you ran a few commands to download a setup script to the Pi and execute it). Lately they've been conveniently offered as ready-made images to put on SD card. If any of them still have manual steps available to try, you can try to follow them starting from the vanilla Raspbian installation, but naturally they'll require a bit more knowledge of Linux / etc versus just using the "one step" images. But doing so would let you try it out on a 4B now without waiting on 4B compatible one step images.

    Since nobody who has tried it has chimed in, I assume that everything "just works" if you go through the manual installation.

    I don't have a 4 yet to do any testing. Didn't expect them to sell out so fast and so didn't pick one up right away, almost everywhere is sold out now. I ordered one via one of the online retailers and hopefully it'll be here this weekend ... normally I'd just stop by Microcenter and pick one up any day of the week, but the 4's are selling like hotcakes.
     
  7. CuriousG

    CuriousG Active Member

    Joined:
    Dec 1, 2015
    Messages:
    1,518
    Location:
    Elk Grove, CA
    Don't forget this iteration has the wonky USB-C charger.
     
  8. Tz00

    Tz00 3 LR AWD

    Joined:
    Jan 5, 2019
    Messages:
    242
    Location:
    Saint John, NB, Canada
    It does, but it still works fine when plugged into the 3's USB port.
     
  9. BioSehnsucht

    BioSehnsucht Model 3 LR

    Joined:
    Apr 1, 2016
    Messages:
    1,750
    Location:
    DFW, TX
    Yeah, and that's where they added the USB OTG functionality is on the USB-C port. Just means you need different cables and/or adapters.
     
  10. CuriousG

    CuriousG Active Member

    Joined:
    Dec 1, 2015
    Messages:
    1,518
    Location:
    Elk Grove, CA
    Just noticed a minor bug today using Pushover notifications. Previously it would report the time correctly when archiving. However, this time it had the time November 3, 2016 in the archiving message. Since Pushover already logs time in the notification, it is redundant to have it in the message.

    Most likely what happens is the car is asleep and it can take up to a couple of minutes before you regain video and music capabilities. So if you leave the garage before it has a chance to NTP sync, it reports that default date. So the solution is to change the archive message and/or have it do an NTP sync before archiving begins.

    I'm using the marcone fork, BTW.

    edit: I see he is aware of the problem already
    NTP sync? · Issue #93 · marcone/teslausb
     
  11. BioSehnsucht

    BioSehnsucht Model 3 LR

    Joined:
    Apr 1, 2016
    Messages:
    1,750
    Location:
    DFW, TX
    My Pi 4 came in. some quick tests have me getting around 10MB/s through USB to the Pi.

    I got about the same speed (10~12MB/s) over Samba via WiFi AC 5GHz (but as always with WiFi your mileage may vary)

    I tested both writing to the SD card itself and also to USB attached storage (SSD via USB3 sata adapter). The speeds were about the same regardless, so the bottlenecks are USB OTG and WiFi still, but at least they're quite a bit faster on the Pi 4.

    So, quite the improvement over the Pi Zero W and the Orange Pi Zero. Of course, it'll run hotter and take up more space...
     
  12. CuriousG

    CuriousG Active Member

    Joined:
    Dec 1, 2015
    Messages:
    1,518
    Location:
    Elk Grove, CA
    Thanks for the update. If you're not aware, there is a newer firmware that will make it run a bit cooler. Form factor is quite a bit bigger and I still don't have a case for my Zero yet. I should just print one out as I'm just using the antistatic bag for the time being while it is in the car. Not sure if this is related but when it got hot in the car, noticed that some cameras tend to pixelate. Noticed the file differentiation in size so that is a dead giveaway on how file will be viewed and synced.
     
  13. BioSehnsucht

    BioSehnsucht Model 3 LR

    Joined:
    Apr 1, 2016
    Messages:
    1,750
    Location:
    DFW, TX
    #113 BioSehnsucht, Jul 14, 2019
    Last edited: Jul 14, 2019
    I haven't actually put anything in the car yet (using regular USB drives still), but my plan is to both put heatsinks on it and also use the Pi Power Hat which will both provide power from 12V and also has a fan to cool the Pi. Currently using the HighPi case and I'm using standoffs and GPIO stacking headers to raise the hat off the Pi (otherwise no room for heatsinks, plus also would have to cut a hole in case vs just break out one of the break away sections). Might end up with a different case eventually, the pickins was slim. Possibly could use a lower profile case and no standoffs / stacking headers by moving the fan on the Pi Power Hat to the top side of the board, but would depend on the case and so forth.

    I did some longer tests and found the write speed to the SD card, after the first 30 seconds or so, varies a lot (even though it's a sandisk A1 rated card) between 6-12MB/s. Seems that sustained writes are not so great to that card. However, no such behavior (constantly at max USB g_mass_storage or WiFi speed) with the external SSD via USB.
     
  14. b0n3z

    b0n3z Supporting Member

    Joined:
    Aug 2, 2018
    Messages:
    108
    Location:
    Orange, CA
  15. BioSehnsucht

    BioSehnsucht Model 3 LR

    Joined:
    Apr 1, 2016
    Messages:
    1,750
    Location:
    DFW, TX
    I want the extra horsepower and USB ports of the 4 over the Zero for reasons :)

    But if I ever finish my little project it should still run on a Zero, just slower and less fancy.
     
  16. dsgerbc

    dsgerbc Member

    Joined:
    Jun 4, 2019
    Messages:
    195
    Location:
    Ann Arbor
    Wondering if anyone knows how to fix the issue I have: music playback cuts out the moment the Pi catches my home wifi with the car still in motion. Is there a way to code in a delay of the archiving script?
     
  17. japhule

    japhule Member

    Joined:
    Jul 24, 2018
    Messages:
    177
    Location:
    Dallas, TX
    I believe there was a setting for this in the setup variable config file.

    # By default there is a 20 second delay between connecting to wifi and
    # starting the archiving of recorded clips. Uncomment this to change
    # the duration of that delay
    # export archivedelay=20
     
    • Informative x 1
  18. dsgerbc

    dsgerbc Member

    Joined:
    Jun 4, 2019
    Messages:
    195
    Location:
    Ann Arbor
    Found it, thanks!
     
  19. lairdp

    lairdp New Member

    Joined:
    Jul 21, 2019
    Messages:
    2
    Location:
    Atlanta
    The Pi Zero W works great as a USB stick that pushes files to another computer. The build with the prebuilt image from marcone/teslausb is very easy to set up - you just have to configure your WiFi network credentials and your file share credentials, and (optionally) split the drive into two partitions, one for music and one for video from the car.

    I wouldn't expect that the Pi 4 would work for this, since it can't be programmed to be a USB device, only as a USB controller. I'd love to be wrong, since the Pi4 is a nifty device, but both Raspberry Pi and the TeslaUSB documentation is pretty emphatic on this point.
     
  20. Tz00

    Tz00 3 LR AWD

    Joined:
    Jan 5, 2019
    Messages:
    242
    Location:
    Saint John, NB, Canada
    Yup, you are... I've been using the Pi4 for a couple weeks. Works great. See #98 above.
     
    • Informative x 2

Share This Page

  • About Us

    Formed in 2006, Tesla Motors Club (TMC) was the first independent online Tesla community. Today it remains the largest and most dynamic community of Tesla enthusiasts. Learn more.
  • Do you value your experience at TMC? Consider becoming a Supporting Member of Tesla Motors Club. As a thank you for your contribution, you'll get nearly no ads in the Community and Groups sections. Additional perks are available depending on the level of contribution. Please visit the Account Upgrades page for more details.


    SUPPORT TMC