# phone key troubleshooting: any rooted android users out there?



## crackers8199 (Jun 7, 2018)

so, @garsh and i have been trying via PM to get my phone key to work reliably...and we have unlock just close to perfect now. however, walk away lock is still having issues.

i've done some troubleshooting with my rooted oneplus 5, and here's what i have found: when walk away lock fails, i go into terminal manager and run the following command as root:


```
dumpsys bluetooth_manager
```
that will produce output similar to the following:


```
1 BLE App registered:
com.google.android.gms

Bonded devices:
xx:xx:xx:xx:xx:xx [BR/EDR] Tesla Model 3

Profile: BtGatt.GattService
mAdvertisingServiceUuids:
mMaxScanFilters: 0

GATT Scanner Map
Entries: 5

com.doghaus.doghaus.android.app (Registered)
LE scans (started/stopped) : 0 / 0
Scan time in ms (min/max/avg/total): 0 / 0 / 0 / 0
Total number of results : 0
Application ID : 7
UUID : xxx
Connections: 0

com.fitbit.FitbitMobile (Filtered)
LE scans (started/stopped) : 1 / 1
Scan time in ms (min/max/avg/total): 0 / 20041 / 20041 / 20041
Total number of results : 0
Last 1 scans :
2018/12/12 15:10:01 - 20041ms Filter 0 results (9)

com.google.uid.shared:10020 (Registered) (Filtered)
LE scans (started/stopped) : 74 / 72
Scan time in ms (min/max/avg/total): 1970 / 1159799 / 118852 / 8795096
Total number of results : 8224
Last 5 scans :
2018/12/12 17:31:38 - 149933ms Opp Filter 194 results (5)
2018/12/12 17:34:08 - 5995ms Filter 25 results (5)
2018/12/12 17:34:08 - 26315ms Filter 0 results (14)
2018/12/12 17:34:14 - 61092ms Opp Filter 20 results (5)
2018/12/12 17:35:15 - 5991ms Filter 11 results (5)
Ongoing scans :
2018/12/12 17:35:21 - 16599ms Opp Filter 0 results (5)
2018/12/12 17:35:15 - 22628ms Filter 0 results (8)
Application ID : 8
UUID : xxx
Connections: 0

com.allpoint (Registered)
LE scans (started/stopped) : 0 / 0
Scan time in ms (min/max/avg/total): 0 / 0 / 0 / 0
Total number of results : 0
Application ID : 6
UUID : xxx
Connections: 0

com.bridou_n.beaconscanner (Filtered)
LE scans (started/stopped) : 10 / 10
Scan time in ms (min/max/avg/total): 0 / 823095 / 614455 / 6144554
Total number of results : 0
Last 5 scans :
2018/12/12 16:25:01 - 600375ms Filter 0 results (8)
2018/12/12 16:40:02 - 607421ms Filter 0 results (8)
2018/12/12 16:55:09 - 600409ms Filter 0 results (8)
2018/12/12 17:06:48 - 805374ms Filter 0 results (8)
2018/12/12 17:24:59 - 610936ms Filter 0 results (8)

GATT Client Map
Entries: 1

com.teslamotors.tesla (Registered)
LE scans (started/stopped) : 0 / 0
Scan time in ms (min/max/avg/total): 0 / 0 / 0 / 0
Total number of results : 0
Application ID : 9
UUID : xxx
Connections: 1
521: xx:xx:xx:xx:xx:xx -1544656022632ms

GATT Server Map
Entries: 1

com.fitbit.FitbitMobile
LE scans (started/stopped) : 0 / 0
Scan time in ms (min/max/avg/total): 0 / 0 / 0 / 0
Total number of results : 0

GATT Handle Map
Entries: 0
Requests: 0
```
there will be a ton more output from that command, but the above is the section i think relates to the phone key.

what i've found is that when walk away lock fails, the section under GATT Client (where the tesla app is listed) will still indicate a connection...even when i'm way too far from the car for it to possibly be connected. it's as if the phone and/or car (or some combination thereof) are unable to drop the connection, and that is what is preventing the car from locking.

that being said, it does not seem like it is a necessity for the car to drop the connection from the phone in order to lock...pretty much every day when i'm standing next to my car winding up the charge cord after unlocking it, the car locks itself while i'm standing right next to it. it's possible that the car is dropping the connection and then reconnecting in order to lock there, but i can't say for sure. every time by the time i get my phone back out and into the terminal, there's a connection listed (so i don't know if it was connected the whole time or if it dropped and reconnected).

i'm also curious to see if anyone else has different output from dumpsys...namely if the started/stopped scan number for the tesla app is reporting actual numbers, or if the tesla app is registered as a BLE app at the top of this block of output.

also of potential interest (to anyone who understands bluetooth and android well): twice in the past few days, walk away lock has failed in the same exact physical location. outside our local best buy, while going in to do christmas shopping. i'm wondering if other bluetooth devices around in the area have something to do with this as well...

thoughts? questions? concerns?


----------



## whitslack (Dec 20, 2018)

I finally registered on this forum just to respond to your post. 

I have a rooted OnePlus 5T (running OxygenOS 5.1.7 / Android 8.1.0) and an unrooted Tesla Model 3. (I'd love to root that thing, but I think I'll wait until it's out of warranty and OTA updates have dried up.)

I have had almost no issues with the Bluetooth key in the ~2 months I've owned the car. The only minor complaint I've had is that, if I approach the car rather rapidly from a distance and immediately push on a door handle, the car doesn't always unlock. Sometimes I have to wait 5-10 seconds, and then the door will open when I push the handle. I chalk this up to both the phone's and the car's being in low-power sleep modes, in which they aren't frequently polling for nearby Bluetooth devices. It takes a short while for them to "notice" each other. I find these occasional short delays preferable to carrying around a bulky fob and am quite pleased with the Model 3's use of my phone as its key.

Here's a OnePlus tip of which you might not be aware: the OS sometimes is a bit overly aggressive about killing background services, but you can prevent a service from being killed by "pinning" an activity belonging to the same application in your recent activities switcher. In other words, tap that little lock icon in the title bar of the Tesla app card in your recent activities switcher so that the lock is closed (locked). While ostensibly this has the effect of preventing the "dismiss all activities" button from dismissing the Tesla activity, it also prevents the OS from forcibly killing the app's background services. OnePlus does not advertise this fact very well, and that's really a shame because it could save a lot of people a lot of grief.

The other tip I'd have for you is a little more obvious: in the Battery settings applet, go to "Battery optimization" and make sure the Tesla app is set to "Don't optimize." (Check this setting again after a reboot because sometimes those optimization settings don't stick.) This has the effect of not reducing the accuracy of the Tesla app's timers when the phone is asleep. The reason you would want such reduced accuracy is so that many apps' timers can all fire simultaneously with one brief wakeup of the CPU, even if those apps had not scheduled their timers to fire at exactly the same time. Effectively the wakeup of some apps is delayed so that many apps can all do their background work at the same time. The downside of this optimization is that an application's periodic timers, such as those that send out pings over Bluetooth, may not fire as often. If you want a fast response from your Tesla, then you should tell Android not to optimize the Tesla app's power usage. I personally have not noticed that the Tesla app uses a significant amount of power at all, despite its being set to "Don't optimize."

As for "Walk Away Lock," the best I can tell is that the car does it automatically whenever the Bluetooth signal from the phone gets weak enough or disappears. You do NOT have to walk out of Bluetooth range of the vehicle. In fact, the car/phone Bluetooth range is quite lengthy. I routinely see the Tesla app's persistent notification saying "Connected" even when I'm roughly 30 meters away with a sliding glass door between me and the car. The car will NOT unlock for anyone pushing on a door handle in this condition. Signal strength is key. You pretty much need to be right next to the car for the unlock to work. As for locking, I will say that I have on a couple of occasions walked quite far away from my car before it locks, but I have never found my car unlocked upon returning to it, so I have come to trust that it will lock itself even if I don't observe it. One thing to note is that the headlights will remain on at night for quite a while after the car has already locked itself. You can tell at a glance whether the car has locked itself yet because the Tesla app's persistent notification will show an "Unlock" button rather than a "Lock" button. Tip: if you don't see the buttons on the persistent notification, drag down with two fingers on the notification to expand it.


----------



## crackers8199 (Jun 7, 2018)

first, thanks for the feedback! let me address a few of your points...



> Here's a OnePlus tip of which you might not be aware: the OS sometimes is a bit overly aggressive about killing background services, but you can prevent a service from being killed by "pinning" an activity belonging to the same application in your recent activities switcher. In other words, tap that little lock icon in the title bar of the Tesla app card in your recent activities switcher so that the lock is closed (locked). While ostensibly this has the effect of preventing the "dismiss all activities" button from dismissing the Tesla activity, it also prevents the OS from forcibly killing the app's background services. OnePlus does not advertise this fact very well, and that's really a shame because it could save a lot of people a lot of grief.


i knew about this...to combat it i set up a tasker profile to launch the app every two minutes, in an attempt to make sure it's always open and active. that helped a little with unlocking in particular, but still hasn't helped make walk away lock 100% effective.



whitslack said:


> The other tip I'd have for you is a little more obvious: in the Battery settings applet, go to "Battery optimization" and make sure the Tesla app is set to "Don't optimize." (Check this setting again after a reboot because sometimes those optimization settings don't stick.) This has the effect of not reducing the accuracy of the Tesla app's timers when the phone is asleep. The reason you would want such reduced accuracy is so that many apps' timers can all fire simultaneously with one brief wakeup of the CPU, even if those apps had not scheduled their timers to fire at exactly the same time. Effectively the wakeup of some apps is delayed so that many apps can all do their background work at the same time. The downside of this optimization is that an application's periodic timers, such as those that send out pings over Bluetooth, may not fire as often. If you want a fast response from your Tesla, then you should tell Android not to optimize the Tesla app's power usage. I personally have not noticed that the Tesla app uses a significant amount of power at all, despite its being set to "Don't optimize."


same thing here, i did that from the get go. i even went to a custom ROM because oxygenOS wouldn't let me turn off optimization for bluetooth itself...even that hasn't seemed to help.



whitslack said:


> As for locking, I will say that I have on a couple of occasions walked quite far away from my car before it locks, but I have never found my car unlocked upon returning to it, so I have come to trust that it will lock itself even if I don't observe it. One thing to note is that the headlights will remain on at night for quite a while after the car has already locked itself. You can tell at a glance whether the car has locked itself yet because the Tesla app's persistent notification will show an "Unlock" button rather than a "Lock" button. Tip: if you don't see the buttons on the persistent notification, drag down with two fingers on the notification to expand it.


the thing is though that i know it's not locking - i have grown used to listening for it to beep when i walk away just because it has failed me so often...and when it doesn't lock, i continue walking a bit further into the store and then check the app. sure enough, it's not locked (i can then lock it from the app). if it's going to work, it will lock itself within a few seconds of closing the door...while i'm close enough to still hear it beep. if it hasn't beeped by the time i walk out of audible range, it's not going to work in my experience. i did know about the lock vs unlock on the notification, but thank you for posting that in case anyone else wasn't aware.



> The car will NOT unlock for anyone pushing on a door handle in this condition.


this also has been the opposite of my experience - if i'm walking up to the car and around the back of the car, my wife can push the door handle and open the door before i get near the drivers door.

in the end, the things we've tried (most notably making sure nothing else is scanning BLE other than the tesla app) seems to have made unlock nearly 100% effective...but nothing i've tried has made walk away lock work every time, short of setting up a tasker profile to lock it via the API when my phone bluetooth disconnects. the obvious flaw with that is that it doesn't work if you're in an area where the phone or the car have no LTE connection...

since you're rooted and on a similar phone (aside from you being on the 5T vs my 5), can you run the dumpsys command and post your output here so we can see how it compares to mine?


----------



## garsh (Apr 4, 2016)

crackers8199 said:


> since you're rooted and on a similar phone (aside from you being on the 5T vs my 5), can you run the dumpsys command and post your output here so we can see how it compares to mine?


In fact, if anybody else has a rooted android phone of any type, it would be really helpful if you could run this command and capture logs during walk-away lock.


----------



## Lgkahn (Nov 21, 2018)

I have rooted lg v20. Had problems now run beacon scanner and much better. Still 1-2 out if ten tries have to go to airplane and back to unlock. never had walkaway lock fail however


----------



## garsh (Apr 4, 2016)

Lgkahn said:


> I have rooted lg v20. Had problems now run beacon scanner and much better. Still 1-2 out if ten tries have to go to airplane and back to unlock. never had walkaway lock fail however


Do you think you can run the "dumpsys bluetooth_manager" command right after walkaway lock happens?
We'd like to see what other phones do successfully and compare it to his phone.


----------



## Lgkahn (Nov 21, 2018)

When I get back home.


----------



## whitslack (Dec 20, 2018)

crackers8199 said:


> i set up a tasker profile to launch the app every two minutes, in an attempt to make sure it's always open and active.


That shouldn't be necessary if you've done the pinning thing by locking the Tesla app's card in the recent activities switcher. You can check that the Tesla app's background service (named "BLEService") is in the list of "Running services" in Android's Developer Options. If you're seeing that service get killed, then that's your problem right there. I've had no issues with keeping it running. It only gets killed when the Play Store updates the Tesla app, but it seems to restart automatically after a little while.

Launching the app every two minutes sounds like a sure way to keep your car awake all the time, which will severely increase your car's idle power drain.



crackers8199 said:


> when it doesn't lock, i continue walking a bit further into the store and then check the app. sure enough, it's not locked (i can then lock it from the app).


Do you manually toggle the lock state of your car often? The number of times I have ever hit a lock or unlock button anywhere (in the car or in the app) I can count on the fingers of one hand. Maybe your car is trying to respect your "manual override" of its lock state?



crackers8199 said:


> if i'm walking up to the car and around the back of the car, my wife can push the door handle and open the door before i get near the drivers door.


The driver's door might not be the focus. The AP2 Model S/X have Bluetooth antennas in both side mirrors. Perhaps the Model 3 is similar?

Try placing your phone like 20 meters away from your locked car and walk up to your car without your phone and push on a door handle. It won't unlock, even though the phone app says "Connected." This was one of the first tests I did when I saw that my phone is always connected to my car whenever I'm at home.



crackers8199 said:


> since you're rooted and on a similar phone (aside from you being on the 5T vs my 5), can you run the dumpsys command and post your output here so we can see how it compares to mine?


Sure. I'll go play with it right now and post back here in a bit.


----------



## whitslack (Dec 20, 2018)

I took four samples of "dumpsys bluetooth_manager" output:

Sample 1: At a distance from the car. I had not approached the car or opened the Tesla app for a few hours.
Sample 2: After standing next to the driver's door for 60 seconds but without having touched the door handle.
Sample 3: Immediately after pushing the door handle to unlock and open the door.
Sample 4: Immediately after the car locked itself as I walked away from it.
These samples were collected with the phone in my pocket, its screen off, connected to my laptop by USB cable. I never opened the Tesla app (or even turned on the phone screen) throughout my sampling.

I have redacted the last three bytes of anything in these samples that looked like a MAC address, and I have removed the Base64-encoded "BTSNOOP" dumps at the end, as I could not tell whether they contain sensitive/private information.



crackers8199 said:


> what i've found is that when walk away lock fails, the section under GATT Client (where the tesla app is listed) will still indicate a connection...even when i'm way too far from the car for it to possibly be connected. it's as if the phone and/or car (or some combination thereof) are unable to drop the connection, and that is what is preventing the car from locking.


I still see a connection listed there even after the car has auto-locked when I walked away from it. This stands to reason, as the phone and the car are still connected at this point. Note that this connection is listed also in sample 2 after just standing near the car for a minute, even before I touched the car.


----------



## crackers8199 (Jun 7, 2018)

whitslack said:


> That shouldn't be necessary if you've done the pinning thing by locking the Tesla app's card in the recent activities switcher. You can check that the Tesla app's background service (named "BLEService") is in the list of "Running services" in Android's Developer Options. If you're seeing that service get killed, then that's your problem right there. I've had no issues with keeping it running. It only gets killed when the Play Store updates the Tesla app, but it seems to restart automatically after a little while.


i'll try pinning it again, but i know i have tried this in the past and it didn't work. the app still eventually gets killed after some period of time.



> Launching the app every two minutes sounds like a sure way to keep your car awake all the time, which will severely increase your car's idle power drain.


surprisingly, it did not. the car still was able to sleep. i'm guessing it does't start waking the car until the screen comes on (and even then, if i were to back out of the app before it finished the car was still asleep when i went back to it).



> Do you manually toggle the lock state of your car often? The number of times I have ever hit a lock or unlock button anywhere (in the car or in the app) I can count on the fingers of one hand. Maybe your car is trying to respect your "manual override" of its lock state?


that's an interesting thought...i wouldn't say i do it "often," but if my wife sits in the car while i run into a store for something she will usually lock the doors from the screen. i can't imagine that would be causing issues, though...especially considering the issues with walk away lock have often happened while i'm by myself. the only time i ever lock/unlock from the app is if walk away lock fails, or if i get sick of waiting for the phone to unlock it and i have forgotten my card (the second scenario happens far less often than the first).



> The driver's door might not be the focus. The AP2 Model S/X have Bluetooth antennas in both side mirrors. Perhaps the Model 3 is similar?
> 
> Try placing your phone like 20 meters away from your locked car and walk up to your car without your phone and push on a door handle. It won't unlock, even though the phone app says "Connected." This was one of the first tests I did when I saw that my phone is always connected to my car whenever I'm at home.


yes, this is accurate. i also tested this a while back and it functions as you say...the car won't unlock unless the phone is nearby (and by nearby i mean within touching distance of the car).


----------



## crackers8199 (Jun 7, 2018)

whitslack said:


> I still see a connection listed there even after the car has auto-locked when I walked away from it. This stands to reason, as the phone and the car are still connected at this point. Note that this connection is listed also in sample 2 after just standing near the car for a minute, even before I touched the car.


thanks for the dumpsys logs! i may not have been clear on the connection i'm seeing when walk away lock fails...you are correct, it stands to reason that the connection would show when standing next to the car, since the phone and car are still connected. what i've seen though is that when walk away lock fails, the phone reports as being connected to the car even when i've entered the store / restaurant / mall / etc and am quite definitely far enough away that there's no possible way the phone and car can still be connected...yet even though it's literally impossible for the phone and car to be connected, the dumpsys output still reports them as being connected every time when walk away lock fails.

i'm thinking that has to have something to do with my issues, it's the only consistent thing i've noticed in all of my tests on this. if walk away lock succeeds, when i enter the store and check my phone, dumpsys reports no connections. if walk away lock has failed (i.e. i walked away and have not heard a beep, check the app and see the car is still unlocked) after i've gotten far enough away from the car, dumpsys STILL reports being connected. it's as if the phone and/or car (or both) are refusing to drop the active connection, and that's why walk away lock doesn't work...because the car still thinks the phone is there.

it would make sense to me that the car locks when it is no longer connected to the phone...but for some reason the phone thinks it is still connected to the car at that point. i don't have any way of knowing if the car thinks the same, other than that i'm guessing it does since walk away lock isn't working (which seems to indicate the car also thinks the phone/car connection is still active, and this is why it doesn't lock). i hope that made sense, i'm doing my best to explain what is happening in my case even though the logic is kinda circular...

also, i'm curious...i see you have llama automations set up? what are your conditions for those?


----------



## crackers8199 (Jun 7, 2018)

also, in case anyone was curious, making the tesla app a system priv-app definitely does NOT fix anything. in fact, it made things worse. walk away lock failed every single time after i converted the tesla app to a system privileged app (via magisk app systemizer module). even reverting this from the module didn't fix this, i had to uninstall and reinstall from the market to fix it (and get back to where i've been all along - unlock seems to be solid now, but i can't for the life of me get walk away lock to work 100% of the time).


----------



## whitslack (Dec 20, 2018)

crackers8199 said:


> even though it's literally impossible for the phone and car to be connected, the dumpsys output still reports them as being connected every time when walk away lock fails.


What does the Tesla app's persistent notification show in that condition? You're in the store, far away from your car. Does the notification show "Connected" or "Disconnected" while dumpsys still lists the connection?



crackers8199 said:


> it would make sense to me that the car locks when it is no longer connected to the phone...but for some reason the phone thinks it is still connected to the car at that point. i don't have any way of knowing if the car thinks the same, other than that i'm guessing it does since walk away lock isn't working (which seems to indicate the car also thinks the phone/car connection is still active, and this is why it doesn't lock). i hope that made sense, i'm doing my best to explain what is happening in my case even though the logic is kinda circular...


I definitely understand what you're saying, but it seems unlikely that _both_ your phone _and_ the car would be suffering from what would have to be a bug in their Bluetooth Low Energy implementations. It could be a deficiency in the design of BLE itself, but then why aren't many more people seeing the symptoms?



crackers8199 said:


> also, i'm curious...i see you have llama automations set up? what are your conditions for those?


I do use Llama to implement some automation.

When my phone connects to my home Wi-Fi network, Llama turns off the cellular radio by enabling Airplane Mode, which I've set up to only control the cellular radio and to leave the other radios alone. I use VoWiFi at home, so I don't need the cellular radio sucking up battery power.
When my phone disconnects from my home Wi-Fi network (presumably because I've driven away from home), Llama turns on the cellular radio by disabling Airplane Mode.
When I go to sleep, I turn off all the radios in my phone. I can't simply toggle off the Wi-Fi radio in the usual way, as this would trigger the previous automation. Instead, I have a shortcut on my home screen that temporarily disables my "Auto-airplane" behavior long enough to shut down all the radios, including Wi-Fi and Bluetooth. That's the Llama action that you see disabling the Bluetooth radio in the log.
When I'm at home, I typically will turn off the Bluetooth radio myself, as I have no need to be wasting battery.
When my Wi-Fi connectivity status changes, Llama turns on the Bluetooth radio. This is to handle the case where I'm driving away from home in my Prius but forgot to re-enable my phone's Bluetooth radio. I have an Automatic dongle in the Prius, and I want my phone to connect to it.


----------



## crackers8199 (Jun 7, 2018)

whitslack said:


> What does the Tesla app's persistent notification show in that condition? You're in the store, far away from your car. Does the notification show "Connected" or "Disconnected" while dumpsys still lists the connection?


i've seen it say both. normally if the car is going to lock itself, it does so while i'm still within earshot. if i haven't heard it beep before i get inside the store, it's not working (for the most part). while i'm still outside, it usually says connected. once i'm inside, it says disconnected even though the dumpsys output still reports a connection.



> I definitely understand what you're saying, but it seems unlikely that _both_ your phone _and_ the car would be suffering from what would have to be a bug in their Bluetooth Low Energy implementations. It could be a deficiency in the design of BLE itself, but then why aren't many more people seeing the symptoms?


no clue. that's the most frustrating part of this whole ordeal, the no rhyme or reason / different symptoms experienced by different people.



> I do use Llama to implement some automation.
> 
> When my phone connects to my home Wi-Fi network, Llama turns off the cellular radio by enabling Airplane Mode, which I've set up to only control the cellular radio and to leave the other radios alone. I use VoWiFi at home, so I don't need the cellular radio sucking up battery power.
> When my phone disconnects from my home Wi-Fi network (presumably because I've driven away from home), Llama turns on the cellular radio by disabling Airplane Mode.
> ...


i'm wondering if maybe your automations are causing the bluetooth stack to be reset often enough that your phone key always works...


----------



## whitslack (Dec 20, 2018)

crackers8199 said:


> i'm wondering if maybe your automations are causing the bluetooth stack to be reset often enough that your phone key always works...


An interesting theory, but I'll offer a piece of contrary evidence. I took the Model 3 on a road trip that was ~1250 miles one way and the same distance back. My phone's Bluetooth radio was on the entire time each way, although I did toggle it off while I was at my destination. I stopped at seven Superchargers going each way, and I had zero problems with the car not locking before I got out of sight of it.

[Tangential aside:] I did discover what I perceive to be a defect in Tesla's implementation of the car alarm in the Model 3. I had parked the car and had gotten out but then got back in and closed the door. I turned off my phone's Bluetooth radio, and the car locked itself as though I had walked away from it. (Makes sense.) Then I waited for a while, long enough for the car to go to sleep. Then I pushed the button to open the driver's door, and the door did open, but the car alarm started going off! And this was at like 3 AM in a hotel's parking lot. Flustered and embarrassed, I did the first plausible thing that popped into my head: I pulled the Tesla key card out of my wallet and placed it on the center console. That shut up the alarm. But come on, Tesla. When the door open button on the _inside_ of the vehicle is pushed while the seat weight sensor reads that a full-grown adult is sitting in the seat, it makes no sense to sound the alarm. Durrrr.


----------



## crackers8199 (Jun 7, 2018)

whitslack said:


> An interesting theory, but I'll offer a piece of contrary evidence. I took the Model 3 on a road trip that was ~1250 miles one way and the same distance back. My phone's Bluetooth radio was on the entire time each way, although I did toggle it off while I was at my destination. I stopped at seven Superchargers going each way, and I had zero problems with the car not locking before I got out of sight of it.
> 
> [Tangential aside:] I did discover what I perceive to be a defect in Tesla's implementation of the car alarm in the Model 3. I had parked the car and had gotten out but then got back in and closed the door. I turned off my phone's Bluetooth radio, and the car locked itself as though I had walked away from it. (Makes sense.) Then I waited for a while, long enough for the car to go to sleep. Then I pushed the button to open the driver's door, and the door did open, but the car alarm started going off! And this was at like 3 AM in a hotel's parking lot. Flustered and embarrassed, I did the first plausible thing that popped into my head: I pulled the Tesla key card out of my wallet and placed it on the center console. That shut up the alarm. But come on, Tesla. When the door open button on the _inside_ of the vehicle is pushed while the seat weight sensor reads that a full-grown adult is sitting in the seat, it makes no sense to sound the alarm. Durrrr.


add that to the list of frustrations (no rhyme or reason as to when it works vs when it doesn't). unless there just really is that much of a difference between the 5 and 5T that yours works consistently and mine doesn't...


----------



## whitslack (Dec 20, 2018)

crackers8199 said:


> unless there just really is that much of a difference between the 5 and 5T that yours works consistently and mine doesn't...


The hardware differences between the 5 and the 5T are so minor that aftermarket ROMs for the 5T have been mostly successfully used on the 5, with only the fingerprint sensor and the secondary rear-facing camera not working.

That said, OnePlus have deployed some "stability fixes" for Bluetooth in recent OTA updates to the 5T. Perhaps they have not been backporting those to the 5. Your OnePlus 5 will be receiving an Android Pie update in the next few days, so maybe that'll fix your issues. Fingers crossed!


----------



## whitslack (Dec 20, 2018)

whitslack said:


> Your OnePlus 5 will be receiving an Android Pie update in the next few days


Actually, you can get the update right now if you want to.


----------



## crackers8199 (Jun 7, 2018)

crackers8199 said:


> i'll try pinning it again, but i know i have tried this in the past and it didn't work. the app still eventually gets killed after some period of time.


Yup, it still keeps killing it even when pinned. When I woke up this morning, the Tesla app was no longer in my recents list...reopening it brings it back and the pin is still there (so it remembered that part), but the damn phone still kills the app at some point. It wasn't updated overnight either, I checked.

This is why I was trying to keep it active with Tasker instead...


----------



## crackers8199 (Jun 7, 2018)

whitslack said:


> Actually, you can get the update right now if you want to.


I've been waiting for one of the custom pie roms I've been wanting to use to update to the new OP firmware...I might have to try the oos pie stable though. The problem is that in my experience, while the phone hardware is great oxygenos is buggy and laggy as hell...custom roms really unleash the phone.


----------



## whitslack (Dec 20, 2018)

For what it's worth, my experience with OxygenOS on the OnePlus 5T has not concurred with your description of "buggy and laggy as hell."



crackers8199 said:


> Yup, it still keeps killing it even when pinned. When I woke up this morning, the Tesla app was no longer in my recents list...


Did you happen to check the "Running services" list in "Developer options" when the Tesla app was gone from your recents switcher? It is possible that the OS could clean up the Tesla app's activity without killing its background service.

If you go into the "Memory" screen under the Tesla app details, what does it say for "Frequency"? Mine says "Always running (100%)".

What setting do you have under "Recent app management"? The options are "Normal clear" and "Deep clear." I'm on "Normal clear."

Have you changed the setting for "Background process limit" in "Developer options"? I'm on "Standard limit."

Have you enabled the "Don't keep activities" option in "Developer options"? That option is off for me.

Do you have a "Standby apps" screen under "Developer options"? The Tesla app shows "App standby state: EXEMPTED" for me.


----------



## crackers8199 (Jun 7, 2018)

whitslack said:


> Did you happen to check the "Running services" list in "Developer options" when the Tesla app was gone from your recents switcher? It is possible that the OS could clean up the Tesla app's activity without killing its background service.


I did not, but checking it now indicates it stayed running. It's going on 64 hours now...so I guess that's good.



whitslack said:


> If you go into the "Memory" screen under the Tesla app details, what does it say for "Frequency"? Mine says "Always running (100%)".


Same.



whitslack said:


> What setting do you have "Recent app management"? The options are "Normal clear" and "Deep clear." I'm on "Normal clear."


I know I've seen this setting before, but I can't find it now.



whitslack said:


> Have you changed the setting for "Background process limit" in "Developer options"? I'm on "Standard limit."
> 
> Have you enabled the "Don't keep activities" option in "Developer options"? That option is off for me.


Same for both.



whitslack said:


> Do you have a "Standby apps" screen under "Developer options"? The Tesla app shows "App standby state: EXEMPTED" for me.


I don't see this option...



whitslack said:


> For what it's worth, my experience with OxygenOS on the OnePlus 5T has not concurred with your description of "buggy and laggy as hell."


Maybe they have gotten better with it...but I do like the additional customization options AOSP gives me. I came from a Nexus when they switched nexus to the pixel line, so it's what I'm used to. Perhaps I'll give it another shot now that Pie is available...


----------



## crackers8199 (Jun 7, 2018)

My concern has always been when restarting the app, if it starts on the Tesla logo rather than going right to the car, that's when I seem to have issues. That's based solely on the eye test though, I don't have any hard data (like dumpsys output) to corroborate that...


----------



## whitslack (Dec 20, 2018)

crackers8199 said:


> whitslack said:
> 
> 
> > Do you have a "Standby apps" screen under "Developer options"? The Tesla app shows "App standby state: EXEMPTED" for me.
> ...


Yeah, I think that's a new UI in Pie. I don't recall seeing it before I upgraded. I think you can get the same information through the command line by running "dumpsys deviceidle". See if "com.teslamotors.tesla" is listed under "Whitelist user apps".


----------



## crackers8199 (Jun 7, 2018)

whitslack said:


> Yeah, I think that's a new UI in Pie. I don't recall seeing it before I upgraded. I think you can get the same information through the command line by running "dumpsys deviceidle". See if "com.teslamotors.tesla" is listed under "Whitelist user apps".


It wasn't, it is now. I must have forgotten to turn off battery optimization back off when I wiped my phone last week...I know I had it off previously.


----------



## Jay79 (Aug 18, 2018)

Mine used to be flawless, now every once in a while I have to wait like 5 seconds before the door will unlock. Other than that its on point. Samsung S9+


----------



## crackers8199 (Jun 7, 2018)

It just failed AGAIN. This is by far the most frustrating piece of technology I've ever had to deal with... :/


----------



## garsh (Apr 4, 2016)

Jay79 said:


> Mine used to be flawless, now every once in a while I have to wait like 5 seconds before the door will unlock. Other than that its on point. Samsung S9+


I think that's just a car issue. If it's in a deeper sleep, it will take a while to wake up.

The issue crackers8199 is having is that walk-away lock sometimes fails to lock. In this case, the care is definitely not in a sleep mode. Most people seem to have no problem getting this to work, so I tend to think that it's a problem with his phone. We've been trying all sorts of settings changes, as well as removing/disabling various apps, and other options, but it continues to sometimes fail for him.


----------



## crackers8199 (Jun 7, 2018)

garsh said:


> so I tend to think that it's a problem with his phone.


I don't see any way to conclude anything else at this point. I wish we had someone else with an OP5 who had it working all the time...but it seems the 5T is as close as we've gotten.


----------



## Jay79 (Aug 18, 2018)

garsh said:


> I think that's just a car issue. If it's in a deeper sleep, it will take a while to wake up.
> 
> The issue crackers8199 is having is that walk-away lock sometimes fails to lock. In this case, the care is definitely not in a sleep mode. Most people seem to have no problem getting this to work, so I tend to think that it's a problem with his phone. We've been trying all sorts of settings changes, as well as removing/disabling various apps, and other options, but it continues to sometimes fail for him.


My set up on my Samsung is I go into to the Apps setting and find the Tesla App. Give it permission for everything and also allow it to make changes as it deems necessary (That is an actual option) Then I go to my optimization area in my phone and tell the phone to ignore the Tesla app no matter what. Has worked 100 percent of the time. If he has done all that than perhaps his phone is a bit dated or just glitchy?


----------



## crackers8199 (Jun 7, 2018)

Jay79 said:


> If he has done all that than perhaps his phone is a bit dated or just glitchy?


glitchy perhaps, but it's only a year and a half old. with the way OP specs their phones it should be good for many years to come.

it's definitely not dated. plus we have other posters in this thread with the 5T (which is the mid-year refresh of my 5) that seem to have no issues. my phone was released in june, the 5T i believe came out just 5 months later (november IIRC).

i'm hopeful that the pie update will fix this, but if not this may be the kick i need to go get a 6T and give my wife this one. she has a 3T right now, so the 5 would be a nice upgrade for her.


----------



## whitslack (Dec 20, 2018)

crackers8199 said:


> plus we have other posters in this thread with the 5T (which is the mid-year refresh of my 5) that seem to have no issues.


Keep in mind, I'm running the OEM firmware (OxygenOS). That's a more significant difference versus your setup than the 5 vs the 5T.


----------



## crackers8199 (Jun 7, 2018)

whitslack said:


> Keep in mind, I'm running the OEM firmware (OxygenOS). That's a more significant difference versus your setup than the 5 vs the 5T.


yeah, but i went to a custom ROM specifically because i couldn't ever get it working with OOS. i tried all of the same stuff we've been trying here with OOS as well, and it still didn't work.

TBH, the custom ROM at least made unlock tolerable. with OOS unlocking failed even more than walk away lock has been failing on me now...at least now i'm at the point where i'm at nearly 100% on unlock.

at this point i don't know if there's anything left to try other than set my tasker profile back up to just lock the car via API when the bluetooth disconnects.


----------



## garsh (Apr 4, 2016)

crackers8199 said:


> yeah, but i went to a custom ROM specifically because i couldn't ever get it working with OOS.


Would you be willing to try again with the OEM firmware?


----------



## crackers8199 (Jun 7, 2018)

Now that pie is out, absolutely. I'll install it this afternoon and see what happens...


----------



## crackers8199 (Jun 7, 2018)

Twice in the past two days the car has taken 30-60 seconds to come online once I sat down in the seat. Makes me wonder if there is something wrong with the car and not just my phone...


----------



## whitslack (Dec 20, 2018)

crackers8199 said:


> Twice in the past two days the car has taken 30-60 seconds to come online once I sat down in the seat. Makes me wonder if there is something wrong with the car and not just my phone...


What exactly do you mean by "come online"? Are you talking about the transition from what could be considered the car's "accessory" state to what could be considered its "running" state? The latter is when the car has "authenticated" you and will allow you to shift out of "P". Prior to authentication, attempts to shift elicit a message about tapping a key card on the center console.


----------



## crackers8199 (Jun 7, 2018)

whitslack said:


> What exactly do you mean by "come online"? Are you talking about the transition from what could be considered the car's "accessory" state to what could be considered its "running" state? The latter is when the car has "authenticated" you and will allow you to shift out of "P". Prior to authentication, attempts to shift elicit a message about tapping a key card on the center console.


I mean time it takes for the screen to turn on. Normally the screen is on before I even sit down (immediately on opening the door), but the extended time I'm talking about seems to be happening more often lately.


----------



## whitslack (Dec 20, 2018)

crackers8199 said:


> I mean time it takes for the screen to turn on. Normally the screen is on before I even sit down (immediately on opening the door), but the extended time I'm talking about seems to be happening more often lately.


Wow. I've never been able to open a door without the screen coming on immediately. If you can reliably reproduce your delay, you definitely should show Tesla. If it's only intermittent, then maybe get into a habit of video recording every time you get into your car. It'll be a pain, but it could pay off because you'll eventually obtain video evidence to show Tesla that the car isn't behaving correctly.


----------



## crackers8199 (Jun 7, 2018)

whitslack said:


> Wow. I've never been able to open a door without the screen coming on immediately. If you can reliably reproduce your delay, you definitely should show Tesla. If it's only intermittent, then maybe get into a habit of video recording every time you get into your car. It'll be a pain, but it could pay off because you'll eventually obtain video evidence to show Tesla that the car isn't behaving correctly.


It's not reliably reproducible in that I can follow a certain set of steps to make it happen every time, but it definitely happens a lot...more often than it should based on what I've seen here. The car works during this time and I can drive it, just takes a while for me to have full functionality...video is a good idea, I think I'll start doing that.


----------



## crackers8199 (Jun 7, 2018)

finally installed pie this morning, and now wifi calling keeps dropping out every few seconds. UGH. this is what i was talking about with how buggy oxygenOS is...i'm about ready to smash this damn phone.


----------



## crackers8199 (Jun 7, 2018)

@garsh @whitslack

so much for that. bone stock rooted op5, walk away lock just failed. didn't even make it thru day one.

I hate this stupid thing.  in all honesty though, if a less than 1.5 year old phone can't be made to work, they shouldn't have used phone key. this isn't some ancient phone we're talking about here...

maybe it's time to ask the question: is there ANYONE with a oneplus 5 (not 5T) that actually has this working? i'm out of ideas...


----------



## garsh (Apr 4, 2016)

crackers8199 said:


> I hate this stupid thing.  in all honesty though, if a less than 1.5 year old phone can't be made to work, they shouldn't have used phone key. this isn't some ancient phone we're talking about here...


It's not an old phone, but OnePlus hasn't been a mainstream phone manufacturer until recently.

As you point out, the OS and drivers that it comes with has enough issues that people often root them and install an alternate OS.


----------



## whitslack (Dec 20, 2018)

crackers8199 said:


> finally installed pie this morning, and now wifi calling keeps dropping out every few seconds. UGH. this is what i was talking about with how buggy oxygenOS is...i'm about ready to smash this damn phone.


Strange! VoWiFi is rock solid for me. I don't even keep the cell radio powered up whenever I'm on a decent Wi-Fi network, as Wi-Fi calling has such superior quality.

Maybe you have a lemon? Sure would be interesting to get feedback from another OnePlus 5 owner.

I suspect that Bluetooth applications similar to the Model 3 will become increasingly common and will reveal long-standing bugs in vendors' Bluetooth implementations that hopefully will be fixed as a result of market pressure.


----------



## crackers8199 (Jun 7, 2018)

garsh said:


> It's not an old phone, but OnePlus hasn't been a mainstream phone manufacturer until recently.
> 
> As you point out, the OS and drivers that it comes with has enough issues that people often root them and install an alternate OS.


yes, but as @whitslack has said, the 5 and 5T are basically the same phone hardware-wise.

at this point, I'm thinking there is an issue with my phone (because i'm out of ideas) or potentially still an issue with the car - here's why: everything I've seen indicates the screen should come on instantly when opening a door...and that hasn't been the case.

also, I can't see why unlock would work 100% of the time now but locking does not. clearly the phone and car can sense when i'm nearby because unlocking the door is working nearly flawlessly (i honestly can't remember the last time it failed)...yet there is still something weird going on here preventing it from realizing i have left the car and locking it. the other strange thing is that it seems to be a temporary thing, with no airplane mode or bluetooth cycling in play....last night when it failed, i locked the car via the app. i then came back out to the car, it unlocked as it has been for weeks now, and then drove home. when i got home, it locked just fine. i did not cycle bluetooth or airplane mode or do anything to reset the bluetooth stack...it just suddenly started working again. it's so incredibly frustrating.

I'm hesitant to spend $600+ on a new phone with no guarantee it will solve the problem, if there is in fact something wrong with my car. i sent an e-mail to tesla last night with escalation in the hopes of getting them to look at it again, now that the circumstances have changed...the last time i had them do troubleshooting, even unlock would almost never work. at the risk of jinxing myself, this is now exclusively a problem with walk away lock, it seems. unlock seems resolved.

edit: added a bunch of additional stuff since i'm at a computer now vs on my phone.


----------



## garsh (Apr 4, 2016)

crackers8199 said:


> at this point, I'm thinking there is an issue with my phone (because i'm out of ideas) or potentially still an issue with the car ...
> 
> I'm hesitant to spend $600+ on a new phone....


Can you borrow someone's older phone, like a Nexus 5x or 6p, or a Samsung, and just try it for a while just as a key to see if it behaves any better?


----------



## crackers8199 (Jun 7, 2018)

garsh said:


> Can you borrow someone's older phone, like a Nexus 5x or 6p, or a Samsung, and just try it for a while just as a key to see if it behaves any better?


i have an old nexus 6 i can try, but i could have sworn i read that the nexus 6 especially was particularly bad at this...if i'm wrong let me know and i'll give that a shot.


----------



## Bernard (Aug 3, 2017)

whitslack said:


> An interesting theory, but I'll offer a piece of contrary evidence. I took the Model 3 on a road trip that was ~1250 miles one way and the same distance back. My phone's Bluetooth radio was on the entire time each way, although I did toggle it off while I was at my destination. I stopped at seven Superchargers going each way, and I had zero problems with the car not locking before I got out of sight of it.
> 
> [Tangential aside:] I did discover what I perceive to be a defect in Tesla's implementation of the car alarm in the Model 3. I had parked the car and had gotten out but then got back in and closed the door. I turned off my phone's Bluetooth radio, and the car locked itself as though I had walked away from it. (Makes sense.) Then I waited for a while, long enough for the car to go to sleep. Then I pushed the button to open the driver's door, and the door did open, but the car alarm started going off! And this was at like 3 AM in a hotel's parking lot. Flustered and embarrassed, I did the first plausible thing that popped into my head: I pulled the Tesla key card out of my wallet and placed it on the center console. That shut up the alarm. But come on, Tesla. When the door open button on the _inside_ of the vehicle is pushed while the seat weight sensor reads that a full-grown adult is sitting in the seat, it makes no sense to sound the alarm. Durrrr.


About your tangential aside:
I had a similar alarm experience 5 months ago on a much older firmware, due to poor interactions between Bluetooth locking and door opening. I was at an EV event and, since I had the first Model 3 on this island, everyone coming to the event wanted to sit in it. (Not a crowd: such events are attended by perhaps 10-15 people max at any given time.) I unlocked the car; a couple of people sat in it, including one in the driver's seat; I walked into the cafe to order an espresso and this triggered the lock-on-walking-away; when the person in the driver's seat opened the door to exit, the alarm went off... Embarrassing for me, somewhat frightening for the people in and around the car, not such good publicity for Tesla ;-) 
In later EV events I disabled the automatic locking feature for the duration of the event, but that also meant that locking/unlocking had to be done with the card or the app (and the app is always slow to load and connect, at least round these parts)
There should be a way to disable the walking-away locking feature while keeping the unlock-on-approach feature active.
The other issue I had in this vein with the lock on walking away was with valet service -- the valet left my key card inside the car before moving it, and closed the door to attend to another car just arriving; at the same time I was walking into the venue at the hotel, so the car locked... Valet service never found me, so my car sat in park mode, locked, in front the hotel entrance for the next 3 hours, with my keycard on the front seat ;-) Valet mode should automatically turn off the walk-away locking feature (but naturally keep the unlock-on-approach feature active).
These are all very minor issues, easily fixable in software.


----------



## garsh (Apr 4, 2016)

crackers8199 said:


> i have an old nexus 6 i can try, but i could have sworn i read that the nexus 6 especially was particularly bad at this...if i'm wrong let me know and i'll give that a shot.


A 6 might be too old, but if that's what you have handy then it might be worth trying it. If it works, then it's an indication that the problem is with your phone. But if it doesn't work, it could just be a buggy bluetooth implementation in that old version of android, so you couldn't make any conclusions.


----------



## crackers8199 (Jun 7, 2018)

i'm trying a few other things that came to mind as potential solutions at the moment...one has already failed: i set up a tasker profile (two actually) to toggle airplane mode on and then back off a few seconds later every time i sit down in the car. basically, it would watch for a connection to the car's bluetooth (for media/phone calls), and check to see if a reset had already been performed (to prevent an infinite loop). if it needed a reset, it would turn airplane mode on, clear the variable that tells it to reset, then turn airplane mode back off. when the second profile exited, it would set the variable for needing a reset so that it would start the loop all over again the next time i enter the car. this failed me already this afternoon, but it did lead me to some more info - dumpsys bluetooth_manager reported a bluetooth crash this time rather than just the usual off/on due to airplane mode. so, i'm trying some other things now to figure out why it crashed and how to prevent it...i'll go into more detail as i figure out more.

if this all fails me, i'll give the nexus 6 a shot for a few days. if that fails (as i suspect it would), then i'm out of ideas. still waiting to hear back from tesla as well to see if they can check or might have any idea why unlock is working all the time now but walk away lock still fails on a regular basis...


----------



## crackers8199 (Jun 7, 2018)

well, that didn't take long. another attempt failed. my latest attempt was to clear the cache for bluetooth and bluetooth midi service in the middle of flipping airplane mode off and back on. that apparently doesn't work, and has increased the failure rate (although it still works occasionally, so it hasn't completely killed it).

this is by far the most frustrating piece of tech I've ever had to deal with in my 38 years on this planet. ugh. I have no clue what else to do.


----------



## garsh (Apr 4, 2016)

crackers8199 said:


> this is by far the most frustrating piece of tech I've ever had to deal with in my 38 years on this planet. ugh. I have no clue what else to do.


If another phone exhibits similar issues (even if it's an old Nexus 6), then at that point I'd take the car to a Tesla Service Center and ask them to look into it. There could be some issue with the bluetooth antenna. I think other's have found that their antennas were never connected correctly.

It might be worthwhile buying a more popular phone where people have mostly reported no issues, like one of the newer Samsungs.
I've had zero issues with a Moto g6. You can get them for under $200.
Check the "used & new" options on Amazon. Amazon Warehouse is currently showing one for $168.


----------



## crackers8199 (Jun 7, 2018)

i was able to speak with a support rep via chat (awesome, btw, no wait time)...they want me to watch it over the new few days and send them timestamps for each time i notice walk away lock failing so they can pull logs and try to figure out what's going on. so, that's where we are...going to hold off on switching phones for now til i can get them timestamps/logs and see what happens.


----------



## garsh (Apr 4, 2016)

Evidence that OnePlus is the culprit.

Top Android Phone Makers Are Killing Useful Background Processes and Breaking 3rd-Party Apps To 'Superficially Improve' Battery Life, Developers Allege

_Among the worst offenders are, per developers (in descending order): Nokia, *OnePlus*, Xiaomi, Huawei, Meizu, Sony, Samsung, and HTC._​​​Details available here: Don't kill my app!


----------



## crackers8199 (Jun 7, 2018)

garsh said:


> Evidence that OnePlus is the culprit.
> 
> Top Android Phone Makers Are Killing Useful Background Processes and Breaking 3rd-Party Apps To 'Superficially Improve' Battery Life, Developers Allege
> 
> _Among the worst offenders are, per developers (in descending order): Nokia, *OnePlus*, Xiaomi, Huawei, Meizu, Sony, Samsung, and HTC._​​​Details available here: Don't kill my app!


yes, but we have people with the 5t, 6 and 6t all reporting no issues. makes it kinda tough to say it's op's fault the 5 isn't working when their most recent 3 phones are all fine. not saying it's not their fault, just saying that's not really a solid indicator...


----------



## crackers8199 (Jun 7, 2018)

update: just spent about 25 minutes on the phone with support (after looking at the logs, email support asked me to call in). they had me power the car off for 3 minutes and then turn back on, and now we wait to see if that fixes it. if not, they want me to schedule a service appt so they can take a look.

I will post further updates as I have them.

edit: that didn't take long. failed.

I guess I'll be scheduling a service appt.

edit 2: powering off for 3 minutes has made things worse, not better. now it's failing every single time. awesome.


----------



## tipton (May 21, 2018)

why not also try running different custom roms? i've used a rooted Galaxy Note 8 and now a rooted Mi Mix 3 and have never had issues with the phone as key and neither of these phones has even close to the dev support your phone does.

i can tell anyone with a rooted phone DO NOT reinsall the tesla app + data with Titanium backup. the 3 does not like that at all to say the least. it wouldn't even let me in with either keycard. eventually could unlock with the app and set things back up but i was worried for a bit i had really messed things up.


----------



## crackers8199 (Jun 7, 2018)

tipton said:


> why not also try running different custom roms? i've used a rooted Galaxy Note 8 and now a rooted Mi Mix 3 and have never had issues with the phone as key and neither of these phones has even close to the dev support your phone does.
> 
> i can tell anyone with a rooted phone DO NOT reinsall the tesla app + data with Titanium backup. the 3 does not like that at all to say the least. it wouldn't even let me in with either keycard. eventually could unlock with the app and set things back up but i was worried for a bit i had really messed things up.


I've tried that (at least on Oreo). no luck. haven't tried a custom pie rom yet...


----------



## whitslack (Dec 20, 2018)

tipton said:


> i can tell anyone with a rooted phone DO NOT reinsall the tesla app + data with Titanium backup.


I would guess that the app places data in the phone's secure enclave / hardware keystore. Titanium Backup cannot back up and restore data there.



> the 3 does not like that at all to say the least. it wouldn't even let me in with either keycard.


I find that hard to believe at face value, given that keycards are registered with the car independent of phone keys. Why would your keycards suddenly stop working just because your phone key got messed up? That would be contrary to the design goal of the keycards, which is to be a backup in case your phone key gets messed up (or battery dead, broken, lost, etc.).


----------



## garsh (Apr 4, 2016)

@Nikoman, I noticed that you mentioned owning a OnePlus 6t in another thread.

Can you take a look at this thread and see if there's anything you can suggest that might be useful for getting crackers8199's OnePlus phone to work correctly?


----------



## crackers8199 (Jun 7, 2018)

so, revisiting this now a few months later - tesla support is STILL trying to figure this out. i've had them out to look at my car (mobile service) twice and here's what we know so far...

* based on me sending them timestamps on exactly when walk away lock has failed, they can see the phone dropping the connection but then it quickly reconnects...which is why the walk away lock isn't working (the car thinks the phone is still connected).

* what i've noticed more recently is that if i walk away from the car quickly (i.e. if i park with my drivers side door facing a store and get out and walk immedately towards the store), this seems to happen more often. if i walk around the back of the car and either open the trunk or stay nearby for a second or two after closing the drivers door, it seems to be more reliable.

* the tech thinks the left bluetooth antenna may be bad, and is ordering a new one to see if replacing it solves the issue. i asked him to hold off a few weeks, as i'm planning to get a new phone before then anyway (see below).

that's all i have so far, we're still in the process of trying to figure this out. within a few weeks i should have a new phone (planning on picking up the 6T when the 7 is released), so at the very least then we'll have a definitive answer as to whether or not it's the phone or the car. if the 6T still doesn't work 100% of the time, we know it's an issue with the car itself...since multiple people here and on other forums have reported no issues with the 6T.


----------



## whitslack (Dec 20, 2018)

Hey, crackers. It's been a while. I just wanted to let you know that I've been having the same problems as you for the last 3 months or so. It was precipitated by an OS update of my OnePlus 5T, not a car update. (I didn't update the car software between November and March, and my troubles with Walk-Away Lock started in January.) I observe the same behavior as you: if I linger around the car after getting out, then the car will lock, but if I make a quick getaway, then there's a very good chance (like 50%) that the car will not lock.

Another hypothesis I've had and have been meaning to test is whether the reliability is dependent on how recently my phone has been awake (screen on). I have a suspicion that the times when the car does not lock are the times when I've had my phone in my pocket for a while and it's gone into a deep sleep. If this is the culprit, then it screams of a bad implementation on the car side, as the car should just be locking itself whenever it no longer gets a response from the phone to its hails via Bluetooth. It's almost as though the design is that the phone has to send a lock command to the car when the signal gets weak, but that's obviously a stupid design that I would hope the programmers at Tesla would have better sense than to implement.


----------



## Bernard (Aug 3, 2017)

whitslack said:


> Hey, crackers. It's been a while. I just wanted to let you know that I've been having the same problems as you for the last 3 months or so. It was precipitated by an OS update of my OnePlus 5T, not a car update. (I didn't update the car software between November and March, and my troubles with Walk-Away Lock started in January.) I observe the same behavior as you: if I linger around the car after getting out, then the car will lock, but if I make a quick getaway, then there's a very good chance (like 50%) that the car will not lock.
> 
> Another hypothesis I've had and have been meaning to test is whether the reliability is dependent on how recently my phone has been awake (screen on). I have a suspicion that the times when the car does not lock are the times when I've had my phone in my pocket for a while and it's gone into a deep sleep. If this is the culprit, then it screams of a bad implementation on the car side, as the car should just be locking itself whenever it no longer gets a response from the phone to its hails via Bluetooth. It's almost as though the design is that the phone has to send a lock command to the car when the signal gets weak, but that's obviously a stupid design that I would hope the programmers at Tesla would have better sense than to implement.


I've had the car for a year now; my phone is an older Galaxy S5 Neo, rooted, with various firmwares over the last year, including both Samsung firmwares and Lineage firmwares. The car itself has gone through a dozen or more firmwares, plus some beta ones (I am in the early access program). It's hard to find any kind of pattern. Over 90% of the time things work fine, no delay; perhaps 8% of the time, I get a delay of 2-3s, rarely 4-5s; and perhaps 0.5% % of the time, it just does not work (I have to use the card) -- but if my wife approaches the car with her phone, it works fine.
In the early days, the car would "forget" my phone as a key -- I had to make it forget the phone entirely, then re-initiate bluetooth pairing, then set it up as a key again. This has not occurred in the last 4-5mos, even with beta firmwares. So why this 0.5-1% of cases where the car refuses to acknowledge I am around (but does fine with my wife's phone and does fine next time with mine, with nothing changed in-between), I don't know. I cannot find a clear link to phone firmware, to car firmware, to pattern of approach to the car, or anything of that kind. Since it's bluetooth, the area in which this occurs should be irrelevant -- but just in case I tried to track whether this was likely to occur more often in my garage (away from any other bluetooth) or in a crowded supermarket parking lot -- no difference... In the same day, one of these rare failures to unlock may occur and the next three times in the same day will be fine, so no temporal clustering either.
It's rare enough I decided not to worry about it and to ascribe it to pure chance... ;-)

PS. The one thing I'll note that's consistent (and quite logical) is this: if my phone did not unlock the car (I had to use the key or my wife's phone did it), then my walking away from the car will not lock it. (This is as should be, but since it occurs in what is, in effect, a failure case, it was not obvious it would work as intended.)


----------



## whitslack (Dec 20, 2018)

Bernard said:


> I tried to track whether this was likely to occur more often in my garage (away from any other bluetooth) or in a crowded supermarket parking lot -- no difference...


I definitely see the failure to lock much less often in my garage than I do out in public, but there are confounding variables there. For instance, when I pull into my garage, my phone connects to my home Wi-Fi network, and that likely wakes it up for all sorts of background app activity that I have disabled on mobile data. Also I tend to spend a few extra seconds in the immediate vicinity of my car after I've pulled into my garage, as I'm connecting the charging cable.

Basically I can no longer rely on my car to lock itself as I walk out of Bluetooth range, so I always have to remember to pull out my phone and check the lock status as I'm walking away from my car. It's times like these that I want to apply for a software engineering job at Tesla just so I can fix these annoyances. (Also the damn turn signal lever, which is way too hard to cancel without activating the signal in the opposite direction, but that's an issue for another thread.)


----------



## crackers8199 (Jun 7, 2018)

i don't think my car has ever failed to lock inside the garage. not once that i can recall.

i may have to go back to setting up tasker to send a lock command via the API when the phone bluetooth disconnects, although it would be interesting to see if setting something up to just wake the phone when bluetooth disconnects and see if that resolves anything. maybe i'll try messing around with that tonight...


----------



## whitslack (Dec 20, 2018)

crackers8199 said:


> maybe i'll try messing around with that tonight...


Have you found any way to reliably cause the failure to lock? Like you, I nearly always (or possibly always) have a successful walk-away lock in my own garage at home, so testing hypotheses is very ad hoc and uncontrolled.


----------



## crackers8199 (Jun 7, 2018)

whitslack said:


> Have you found any way to reliably cause the failure to lock? Like you, I nearly always (or possibly always) have a successful walk-away lock in my own garage at home, so testing hypotheses is very ad hoc and uncontrolled.


nope, other than noticing that when it fails it's usually when i quickly walk away from the car without lingering around anywhere near it...but even that's not 100% sure.


----------



## crackers8199 (Jun 7, 2018)

it definitely doesn't seem to be the phone going to sleep... I completely disabled doze, and it's still failing.


----------



## crackers8199 (Jun 7, 2018)

@whitslack random question for you: do you ever have issues opening the rear drivers side door? i haven't had any problems opening the trunk or front door lately, but almost always the back door on the drivers side will fail to open unless i open the front door first...

strangely enough, at the same time this happens, my wife can open the passenger side even while i'm standing just in the vicinity of the car on the drivers side...so it doesn't seem to be an issue with the car not picking up the phone.


----------



## whitslack (Dec 20, 2018)

crackers8199 said:


> @whitslack random question for you: do you ever have issues opening the rear drivers side door?


I rarely ever open the rear doors, but I'll try to remember to try the rear driver's-side door before the driver's door and report back here after a few trials.

I will point out that I do occasionally have to try a few times to open the driver's door. I think it happens when I've approached the car quickly and immediately push the door handle. My guess is that pushing the handle doesn't actively ping the phone for a signal strength check, relying instead on the last passive signal strength reading collected. There are just so many apparent design flaws with this whole system. Makes me wonder if any programmers at Tesla actually understand Bluetooth.


----------



## crackers8199 (Jun 7, 2018)

whitslack said:


> I rarely ever open the rear doors, but I'll try to remember to try the rear driver's-side door before the driver's door and report back here after a few trials.
> 
> I will point out that I do occasionally have to try a few times to open the driver's door. I think it happens when I've approached the car quickly and immediately push the door handle. My guess is that pushing the handle doesn't actively ping the phone for a signal strength check, relying instead on the last passive signal strength reading collected. There are just so many apparent design flaws with this whole system. Makes me wonder if any programmers at Tesla actually understand Bluetooth.


i'm planning on picking up a 6T once the 7 is released, so i'm hopeful that it will be better...we'll see though, i guess. i could have sworn i had seen people say the 6T works much better, but if that's not the case i may consider trying to pick up a cheap pixel 3 instead.


----------



## crackers8199 (Jun 7, 2018)

i just set up something interesting in tasker to try to combat this / make phone key as reliable as possible. disclaimer, this will only work if rooted, since toggling airplane mode programmatically can't be done without root.

i set up four variables:
- one that tracks the last time airplane mode was toggled (to allow for changing how often you want this to run)
- one that tracks the last time bluetooth disconnected from the car (to allow for having it toggle when leaving the car for just a little while, or when leaving but needing to open the rear door where the bluetooth may disconnect and reconnect again very quickly in succession)
- one for the number of seconds to wait between airplane mode toggles
- one for the number of seconds to wait after a bluetooth disconnect

then, i set up the following task:

```
if(current time > (last bt disconnect + bt disconnect bypass interval)) {

    if(current time > (last airplane mode toggle + airplane mode toggle bypass interval)) {

        - airplane mode on
   
        - set airplane mode toggle time to current time
   
        - wait 1 second
   
        - airplane mode off


    }

}
```
then, i have a profile set for when the bluetooth connects to my car. on entry (i.e. when it connects), it runs the above task. on exit (when it disconnects), it simply saves the current time in the last bluetooth disconnect variable mentioned above.

as long as the variables are set correctly, you should never have this running in an infinite loop (i.e. don't set the variables to 1 and 1, or by the time it reconnects it will see that the current time is ahead of your interval and will just keep running the task over and over again). for right now (without testing as of yet), i have the airplane mode bypass set to 900 seconds (15 minutes) and the bt disconnect bypass set to 300 seconds (5 minutes). this means that at most, this will run every 15 minutes (even if it has been 10 minutes since bt disconnect, the inside loop won't fire because it hasn't been at least 15 minutes since the last time airplane mode was toggled). at the same time, if it has been 20 minutes since the last time this was run (on a long drive, for example), the 5 minute bt disconnect toggle will prevent it from running if you stop and simply step out of the car for a moment and then get back in and proceed within 5 minutes. the two-tiered loop is probably overkill, but i wanted to make this as configurable as possible to try to nail down a solution.

we'll see how well it works. i haven't gotten to test it yet...theoretically though, it should help at least a little. whenever i have toggled airplane mode, it always seems to make the key work really well for a period of a few hours to a few days, even a few weeks once or twice. this will just automate the toggling of airplane mode to try to find the sweet spot where it's not doing it too often, but often enough to make the key more reliable.

edit: nevermind, it already failed. UGH. trying it with an airplane mode bypass of 180 sec (3 min) and a bt bypass of 150 sec (2.5 min), but i won't get to test it again til tomorrow...obviously though 15 min and 5 min wasn't good enough (if this is even ever going to work at all). this is so annoying.


----------



## crackers8199 (Jun 7, 2018)

too many other issues with the tasker profile the way i had it set up, so i had to scrap it. i'll keep working at it i guess.


----------



## crackers8199 (Jun 7, 2018)

ok, it has been about a week now and i haven't had a single walk away lock failure - i'm going to post this at the risk of jinxing myself and screwing this up...if my thoughts are correct, this IS an issue with the car and NOT with our phones.

the key is...wait at least a few seconds after putting the car in park before opening the door. what i noticed was that it was failing more often when i would pull into the parking spot, put the car in park and then very quickly (if not immediately) get out and walk away. when i put the car in park and take a second to wait (i control this in my mind by taking a second to look up at the dome lights and see if they have come on yet), and then open the door to leave - it has locked every time. so, it seems there is an issue with the car where it doesn't do the walk away lock unless you wait at least a second or two after putting the car in park.

if anyone else would be willing to test this (in both directions, both with the pause and also with opening the door immediately after pressing the button to put the car in park), maybe we can finally lock this down as to the root cause and hopefully get tesla to fix it.


----------



## crackers8199 (Jun 7, 2018)

lol, can't make this stuff up. I knew I should have kept my mouth shut.

after a solid week of literally not having it fail once (not an exaggeration, it didn't fail a single time before today)...today I've exited the car five times. same procedure as all week, wait til the dome lights come on before exiting. it has failed to lock four of the five times.

I give up. this is madness.


----------



## crackers8199 (Jun 7, 2018)

it is literally failing every single time now, and absolutely nothing has changed in software either on car or phone. it just randomly decided to stop working.

this is the most frustrating piece of tech I have ever owned, bar none.


----------



## garsh (Apr 4, 2016)

crackers8199 said:


> it is literally failing every single time now, and absolutely nothing has changed in software either on car or phone. it just randomly decided to stop working.
> 
> this is the most frustrating piece of tech I have ever owned, bar none.


Regardless of where the actual problem may lay, it's probably time to consider switching to a different phone. Most mainstream phones aren't having these issues.


----------



## crackers8199 (Jun 7, 2018)

garsh said:


> Regardless of where the actual problem may lay, it's probably time to consider switching to a different phone. Most mainstream phones aren't having these issues.


if it's actually a problem with the car (which my experience from last week seemed to suggest), getting a new phone isn't going to change anything. if the problem is with my phone, sure...but you can't really say "regardless of where the actual problem may lay."

at this point, i don't really know what other option i have other than to turn my tasker profile back on that automatically locks the doors via the API every time bluetooth disconnects. mobile service is supposed to be ordering me a new bluetooth antenna to see if that fixes it.


----------



## garsh (Apr 4, 2016)

crackers8199 said:


> if it's actually a problem with the car (which my experience from last week seemed to suggest), getting a new phone isn't going to change anything.


Considering that your phone is the only one (or one of two) having this sort of issue, I think it's likely that a different, more mainstream brand of phone would probably solve the problem. That doesn't necessarily mean that Tesla's bluetooth implmentation is flawless and not to blame, but it does appear to work with most other phones.

It could also be that your particular car has a hardware issue. It might be easier to convince service that this is the case if you were able to test with a second, more mainstream phone as well.


----------



## crackers8199 (Jun 7, 2018)

garsh said:


> Considering that your phone is the only one (or one of two) having this sort of issue, I think it's likely that a different, more mainstream brand of phone would probably solve the problem. That doesn't necessarily mean that Tesla's bluetooth implmentation is flawless and not to blame, but it does appear to work with most other phones.
> 
> It could also be that your particular car has a hardware issue. It might be easier to convince service that this is the case if you were able to test with a second, more mainstream phone as well.


yeah, i know. i'm hesitant to go spend $500-$1000 on a new phone though with no guarantee it'll fix the issue. it might, sure, but if it doesn't then i've wasted $1000 (i don't need a new phone, my current phone works just fine except for this one particular problem) and still have the same issue.


----------



## garsh (Apr 4, 2016)

crackers8199 said:


> yeah, i know. i'm hesitant to go spend $500-$1000 on a new phone though with no guarantee it'll fix the issue. it might, sure, but if it doesn't then i've wasted $1000 (i don't need a new phone, my current phone works just fine except for this one particular problem) and still have the same issue.


Maybe get something like a Moto e5?
I bought a "used" one (looks new) from Amazon Warehouse for my son for $86.


----------



## MelindaV (Apr 2, 2016)

crackers8199 said:


> yeah, i know. i'm hesitant to go spend $500-$1000 on a new phone though with no guarantee it'll fix the issue. it might, sure, but if it doesn't then i've wasted $1000 (i don't need a new phone, my current phone works just fine except for this one particular problem) and still have the same issue.


do you not know someone with a spare phone laying around you could borrow for a few days? the phone key does not need to be one a phone on a current phone plan, just needs to have the app installed and logged into your account.


----------



## crackers8199 (Jun 7, 2018)

MelindaV said:


> do you not know someone with a spare phone laying around you could borrow for a few days? the phone key does not need to be one a phone on a current phone plan, just needs to have the app installed and logged into your account.


a spare newer phone? no. i have plenty of old phones and i'm sure friends do too, but i don't know of anyone that just has a new phone laying around that i can use.

anyway, i gave up and downloaded autonotification for tasker. i set it up to intercept the phone key notification and lock the car via the notification (i.e. via the phone key and not the API which could present network issues), and it will do this every time the bluetooth disconnects.

i'm hoping this will be an acceptable workaround until i decide it's time for a new phone. i may still tweak this a bit, we'll see how it works...i literally just set it up now. i originally had a tasker profile set up to do the locking via the API, but i wasn't a complete fan of that because if in an area with a sketchy network connection, it could potentially not work. using autonotification and the phone key should theoretically work all the time, as the instant the bluetooth disconnects i should always still be within range of the phone key.


----------

