teslausb icon indicating copy to clipboard operation
teslausb copied to clipboard

2021 Refresh: USB not detected in glovebox

Open chrispazz opened this issue 4 years ago • 179 comments

Hello, in new 2021 M3 with USB in glovebox and firmware 2020.45.25, there is always an alert that USB is not detected and that Sentry mode will use more power.

Looking in the teslausb storage it seems to store regularly every sentry detected despite the error message present in notifications.

Anyone with the same behaviour as mine?

chrispazz avatar Dec 06 '20 15:12 chrispazz

This is just a guess, but could it be that the USB port is normally unpowered, and turning on Sentry mode is what causes it to be powered? That would mean that when you turn on Sentry mode the drive is not yet available because the Pi still needs to start up, and so the car would complain about that. Then when the Pi is booted and makes the drive available to the car, the car starts recording to it.

marcone avatar Dec 06 '20 19:12 marcone

No it is always powered and also the PI Zero shows led activity...

chrispazz avatar Dec 07 '20 07:12 chrispazz

I also could not my zero to get recognized in my 2021 m3 with usb in glovebox.

Try to use another usb cable. I have 2 cables and both works when connected to my computer but for some reason only one works in the Tesla.

Both shows the same led activity when connected to the Tesla.

taro777 avatar Dec 10 '20 08:12 taro777

Yes but I noticed that the Raspberry is working correctly and recording everything.....

chrispazz avatar Dec 10 '20 08:12 chrispazz

Yes but I noticed that the Raspberry is working correctly and recording everything.....

Yes, I noticed that exact alert message as well. I have a malfunctioning camera so the warning triangle is always on for me.

taro777 avatar Dec 11 '20 16:12 taro777

If it helps, 2021 glovebox USB is a 3.0.

chrispazz avatar Dec 21 '20 08:12 chrispazz

@taro777 Re: your comment that "only one [cable] works in the Tesla", are you saying it's working for you after switching to another cable? The thing is, there's really nothing to be done on the Pi/teslausb side as far as I know. It uses standard linux functionality to emulate a USB drive, and if the car doesn't see that drive, then it's probably a hardware issue and there's nothing I can do.

The only time I've seen similar issues was when I used a Pi4 with an attached NVME drive that was drawing too much power for the USB port. The Pi would boot, but the car refused to see it as a drive and complained about "USB malfunction". I got it to work by using a power/data splitter and providing power separately.

marcone avatar Dec 21 '20 17:12 marcone

@marcone yes, np. I was just trying to help crispass since I had a similar issue and I found a way around it

taro777 avatar Dec 21 '20 18:12 taro777

With the latest 2020.48.12.1 the Tesla no longer recognizes the rasperry. Saw you closed a similar as duplicate. My Tesla is in service now so I can’t give more than that atm, just a heads up something happend in the last update.

taro777 avatar Dec 21 '20 18:12 taro777

With the latest 2020.48.12.1 the Tesla no longer recognizes the rasperry

I have 2020.48.12.1 and teslausb still works for me.

marcone avatar Dec 21 '20 18:12 marcone

I tried again with 2020.48.12.1. Tesla give the not recognized error and the small size (32gb) error but it seems to record. I have ordered a new microsd 128gb and v30 speed. I will try to be sure that the problem is not related to the sd size or speed and will let you know.

chrispazz avatar Dec 21 '20 19:12 chrispazz

Can confirm this is happening on my 2021 M3. I am currently on 2020.48.26 firmware, and using a Pi Zero W, with a 128GB Sandisk Ultra Plus SDXC card. The files record onto the Pi fine, and it uploads to my fileserver via SMB when WiFi is in range just fine. I am wondering if it has to do with the USB device class / parameters that are being presented to the MCU when plugged in. I haven't tried tweaking any of this, but I haven't looked much in the way of how the Pi presents itself as a USB mass storage device to the car.

bkolasin avatar Dec 28 '20 18:12 bkolasin

@kolasin2 can you clarify the actual, exact, symptoms and messages? It seems odd for the car to say that "USB is not detected", but then record to USB anyway. So is the only symptom that the car shows that message, but everything else works normally?

marcone avatar Dec 28 '20 19:12 marcone

@marcone take a look at these screenshots. You can see that the car UI is giving the "UI_a111" error. However, if I go to look at the footage, all is there on the in-car clip viewer. I also see the clips synchronizing to my fileserver over SMB. IMG_1003 IMG_1004

bkolasin avatar Dec 28 '20 21:12 bkolasin

Same behavior on my M3 also using new faster SD. We have to make the following test: start the car without any usb device connected (it should give the same error) and then connect the Tesla usb stick to see if it recognize the drive or if it do the same as with raspberry. If the error is not cancelled it could be a Tesla software bug...

chrispazz avatar Dec 28 '20 21:12 chrispazz

I suspect the new glovebox USB port isn't actively powered (guessing it comes directly out of the MCU without going through an active hub like the two in the center console). The standard USB 5V/500mA supply is adequate for a passive USB stick, but not enough for a Pi (especially when loaded). Until someone can do a teardown/wire trace on their 2021 Model 3, we won't know for sure.

In the meantime, try adding an active powered USB line to the power-only port of the Pi; keep the data-line plugged into he glovebox USB port.

THX723 avatar Dec 29 '20 00:12 THX723

Ok I've done some testing, and I believe I have determined what the issue is. tl;dr: The Pi Zero W is a USB2 device, and the car assumes that when it sees a USB2 device plugged into the glovebox, it is plugged into one of the center console USB-C ports. This is a bug on Tesla's MCU software, and they need to be smarter about USB device detection.

The error message is misleading. The MCU thinks the device is plugged into one of the other USB-C ports in the car when the device plugged into the glovebox USB port is a USB2 device. This doesn't stop the car from writing to the device, as it operates normally, which is why I am seeing the car write it's dashcam files to the Pi.

Here is what I did:

  • Started with a baseline of using the Tesla branded 128GB USB3 (Samsung brand) flash drive in the glove box. No errors.
  • Plugged in a 3rd party USB3 flash drive into the glove box port. No errors.
  • Plugged in the Pi Zero W into the glove box port. UI_a111 error appears in warnings. (expected)
  • Plugged in the Pi Zero W with an external power source in the power port. UI_a111 error appears in warnings.
  • Plugged in a USB2 flash drive into the glove box port. UI_a111 error appears in warnings. (ah ha! not expected!)
  • Used an Apple USB-C to USB-A adapter to plug the Tesla branded flash drive into a USB-C port in center console. UI_a111 error appears in warnings.

I do have a Pi4 sitting around I could attempt this with, since it has both USB2 and USB3 ports, and would be an easy confirmation of this behavior. So it appears that this error is specific to USB2 devices plugged into the glove box USB port on the Tesla Model 3 2021 refresh, and not a power issue with port and the Pi.

bkolasin avatar Dec 29 '20 04:12 bkolasin

As an update to my last comment, I put a USB3 hub in between the glovebox port and the Pi Zero W. No change in behavior, with the UI_a111 error still showing.

bkolasin avatar Dec 29 '20 04:12 bkolasin

Thanks for the tests and updates. I missed the part where TeslaUSB still worked as intended, despite the error message. Knowing that now, it's starting to look more like the issue is on Tesla's sw side.

THX723 avatar Dec 29 '20 05:12 THX723

I do have a Pi4 sitting around I could attempt this with, since it has both USB2 and USB3 ports, and would be an easy confirmation of this behavior

The Pi4 can only do USB gadget emulation on the USB-C port, which is USB2.

marcone avatar Dec 29 '20 06:12 marcone

When connecting PI zero to my mac with USB I noticed that the USB drive connect, disconnect and then reconnect again. Could it be that this first "reconnection" tricks Tesla software?

chrispazz avatar Dec 29 '20 09:12 chrispazz

@chrispazz I noticed that too, but it is unrelated. I put in a pull request (#593) to fix that. That behavior is due to some stuff in the archiveloop happening before networking is settled, because systemd does a parallel boot and brings up the teslausb service prior to WiFi being being fully up.

bkolasin avatar Dec 29 '20 14:12 bkolasin

Hi there. I posted this in the Discord server a few nights ago but realized it should really get posted here too...

Heyo. So I think that the 2021 Model 3s changed something with where the car thinks USB storage should be plugged into for dashcam.

After trying to run the pi for the past couple of weeks and ended up resorting to just using a usb drive again. Whenever I get in on the morning the dash will either throw up a ⚠️ about how USB storage isn't connected to the glovebox USB port and that might draw extra power (and the warning cannot be swiped away), or that just no storage is plugged in.

I've tried a bunch of different configurations of plugging the pi into the port directly, using a hub in the glove box, and plugging it into the center storage console. I couldn't figure out a configuration that worked better. I then used the OEM usb drive in similar configurations. Plugging in a hub into the glove box usb port, then plugging the drive into that also yields warnings that the drive not being plugged into the glove box port will drain battery faster. I grabbed a USB 3.0 90 degree angled adapter and used that between the OEM thumb drive and the glove box USB port, and that too caused the same warning, which is super interesting as there should be no circuitry inside that adapter.

Somethings like this... https://www.amazon.com/dp/B073GTBQ8V?ref=ppx_pop_mob_ap_share

Leaving the USB drive in that configuration over a few days again put the car into a state where it stopped recognizing that there's anything plugged in at all. So all this leads to me to believe that at least on my version of the car, if it doesn't see a very specific path on the USB tree, it'll get itself into a crap state. I've run out of time to investigate this more and have gone back to just a USB drive sitting in the glove box port, but wanted to circle around and share my findings here.

rubin110 avatar Feb 05 '21 17:02 rubin110

Got the same problem. Mine don't save the sentry events. It only saves the 10 last min after i enter the car. From the outside I see the zero that is blinking 2 blinks pr sec. It also saves the entire trip home (50 min drive).

radhoo2k10 avatar Feb 16 '21 20:02 radhoo2k10

It'a a bug in the Tesla software. It's the same problem with recording sentry clips as when I use the official usb from Tesla. Have to wait for a bug fix from Tesla.

radhoo2k10 avatar Feb 23 '21 16:02 radhoo2k10

A lot of great information here. Thanks for all the testing

kodeypatterson avatar Mar 20 '21 00:03 kodeypatterson

Mine has still the warning that the usb is not plugged in, but it is now recording in sentry mode and while driving.

radhoo2k10 avatar Mar 20 '21 05:03 radhoo2k10

Mine is as well

kodeypatterson avatar Mar 20 '21 12:03 kodeypatterson

Agreed, although getting the error on my M3LR with the TeslaUSB it appears to record OK, I've swapped back to the Tesla supplied USB for the moment as I have a previously logged issue with having Sentry mode alerts but no recordings, which I'm booked in for a Service Appointment so don't want to confuse the situation. If I get the opportunity when speaking with one of their engineers I see if they can shed any light on this issue.

boba51 avatar Mar 30 '21 20:03 boba51

Got the same problem. Mine don't save the sentry events. It only saves the 10 last min after i enter the car. From the outside I see the zero that is blinking 2 blinks pr sec. It also saves the entire trip home (50 min drive).

Are you by any chance running teslamate ?

cavit99 avatar Mar 31 '21 08:03 cavit99