khpylon / MachEWidget

Android Widget for Ford Mustang Mach-E
GNU General Public License v3.0
34 stars 10 forks source link

Widget isn't displaying OTA info #15

Closed khpylon closed 2 years ago

Atorborg commented 2 years ago

Let's see if this works. I'm new to this, and on mobile.

khpylon commented 2 years ago

Just a hunch.  Eithe wipe app data or uninstall/reinstall, then enable logging, then log into your account.

On May 18, 2022, 08:34, at 08:34, Atorborg @.***> wrote:

Let's see if this works. I'm new to this, and on mobile.

fsw_logfile-05-18-11_28_08.txt

-- Reply to this email directly or view it on GitHub: https://github.com/khpylon/MachEWidget/issues/15#issuecomment-1130175890 You are receiving this because you authored the thread.

Message ID: @.***>

Atorborg commented 2 years ago

Okay this last time I uninstalled the app, restarted my phone, reinstalled. After the reinstall I noticed the app already knew my vin. Is there a setting file I should be deleting somewhere when I uninstalled?

khpylon commented 2 years ago

The latest version of the app gets the VIN for all vehicles associated with the FordPass account when you first log in. If it knew the VIN before you logged in, then I can't explain. To the best of my knowledge, when you uninstall an app it wipes all the app's data, so there isn't anywhere else I'm storing VIN information.

khpylon commented 2 years ago

The log file goes back to May 16th, so if you uninstalled the app something definitely didn't work. Maybe just try going into settings and deleting storage/cache, then reopen the app and enable logging again.

Atorborg commented 2 years ago

That one did it. I've uninstalled and reinstalled 5 times probably, but clearing cache and storage did the trick. Sorry to be a pain.

FazeThree71 commented 2 years ago

I've used this app in the past with my 2020 Escape, but I'm seeing the same. I just reinstalled it after nuking my phone.

It says it's logged in and refreshed the data, but the widget shows nothing and my VIN isn't shown

Would love an Escape version btw :)

EDIT: I looked at the logfile and do see my VIN...

khpylon commented 2 years ago

So the Escape supports OTA updates?

I'm planning to push a bug fix tomorrow but it will only work for supported vehicles. I was working on "generic support" for all other vehicles; I'll try to get that in as well.

FazeThree71 commented 2 years ago

Apparently the Escape did/does. I used to be able to get vehicle details, including tire pressure, current mileage, etc

I'll keep an eye out for updates.

khpylon commented 2 years ago

2022.05.25 just released. It should let you see the Escape too. If so, enable logging and then once you're refreshed the data sane and upload the fsw_logfile so I can see what it looks like.

FazeThree71 commented 2 years ago

Just installed the update. It's working again for my Escape. Thank you!

Edited: The location did show up on the next refresh

FazeThree71 commented 2 years ago

This is the log file that was initially created when I installed the update. I've tried toggling the logfile off/on but maybe I need to wait for another refresh. EDIT: I tried manually refreshing but it's not generating another logfile from what I can tell.

--------- beginning of crash 05-25 09:39:47.196 5520 5557 E AndroidRuntime: FATAL EXCEPTION: Thread-2 05-25 09:39:47.196 5520 5557 E AndroidRuntime: Process: com.example.khughes.machewidget, PID: 5520 05-25 09:39:47.196 5520 5557 E AndroidRuntime: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String com.example.khughes.machewidget.VehicleInfo.getUserId()' on a null object reference 05-25 09:39:47.196 5520 5557 E AndroidRuntime: at com.example.khughes.machewidget.MainActivity.lambda$performUpdates$1(MainActivity.java:200) 05-25 09:39:47.196 5520 5557 E AndroidRuntime: at com.example.khughes.machewidget.MainActivity$$ExternalSyntheticLambda1.run(Unknown Source:6) 05-25 09:39:47.196 5520 5557 E AndroidRuntime: at java.lang.Thread.run(Thread.java:920)

khpylon commented 2 years ago

Jus t

Ok, here's what I tried:

  1. Manual refresh - no new logfile generated
  2. Uninstalled the app & reinstalled using the latest APK (as opposed to letting the app update itself) - no new logfile generated
  3. Restoring the settings from when they started working - doesn't update the widget (but does show the VIN, so it kinda worked; although it doesn't show any data on the widget and the shortcuts weren't restored)
  4. Disabled battery optimization & forced refresh - nothing new.

I set the refresh back to 5 min and am waiting to see if it does it again and if it generates a logfile.

I have all of the options set to on except transparent background, linking any app to the charger widget and multi-profile

Just to clarify:

  1. You enabled "Enable logging" under "Settings"
  2. After doing a manual refresh, you then select "Save Logfile" in the three-dot menu.
khpylon commented 2 years ago

The prior logcat file indicates things that from the prior version were really messed up with your databases, possibly because the Escape's wasn't recognized and was discarded. The logfile shows that on May 23rd it when you logged in the app could see the Escape listed in your vehicles, but when it tried refreshing today it got an error: 05/25 10:19:53 D OkHttp3: {"requestStatus":"UNAVAILABLE","error":{"statusContext":"FIG","statusCode":200,"message":"Auth token validation failed"},"lastRequested":"Wed, 25 May 2022 15:19:50 GMT","status":200} 05/25 10:19:53 D OkHttp3: <-- END HTTP (182-byte body) 05/25 10:19:53 I 934TXS: getVehicles UNSUCCESSFUL. Try logging in to Ford again without wiping data, and if that still doesn't work try wiping and logging in. What you want to see in the logfile is a line like this:

05/22 19:27:42 D OkHttp3: {"userVehicles":{"vehicleDetails":[{"VIN":"1FMCU0G65LUC31724","nickName":"My Escape","tcuEnabled":true,"isASDN":false}],"status":{"cache-control":"max-age=86400","last_modified":"Mon, 23 May 2022 00:27:40 GMT","statusCode":"200"}}}

khpylon commented 2 years ago

Thanks, I grabbed the car status info. It doesn't look like all the data was cleared, because it didn't request the OTA status. It would only do that if it thought it had seen that before.

One way to fix this would be to save settings, and in the fsw_settings*.json file replace the text "supportsOTA":false with "supportsOTA":true, then restore settings and refresh.

FazeThree71 commented 2 years ago

Odd that it's behaving like the data wasn't cleared. I went to Settings > Apps > Ford Status Widget & clicked Clear storage. I did notice that even if I cleared both cache and storage, the widget looked like it still had the data until I deleted and re-created it. Not sure what, if anything, that means.

Once I cleared both and saved the logfile, I didn't see anything regarding the OTA either way. Once I went and re-linked the apps and saved the logfile again, I see the same about that not being supported in addition to the IOExceptions in my last logfile. Again, no idea what, if anything, this means.

I can try monkeying with the .json if you want. I'm just not sure where it is. Searching my phone for fsw didn't find it (rooted Pixel 6 Pro)

khpylon commented 2 years ago

The widget will display old data after you clear settings; that's normal.

When you choose "Save Settings" in the three-dot menu, it puts the JSON file in the Download folder.

FazeThree71 commented 2 years ago

Ahh ok, I did that in VSC (changed both supportsOTA to true), restored and pulled another logfile. It still shows like this:

05/25 11:49:29 I 934TXS: OTA not supported: skipping check

I'm not sure what this is referring to. I get what OTA means and do know that the car will connect to my home wifi to do software updates. I'm just unsure what its referring to in this instance.

khpylon commented 2 years ago

There's a specific HTTPS GET request used to get the status of OTA updates. Right now the only vehicle the app supports which doesn't get OTA updates is the Explorer and it returns this response: {"displayOTAStatusReport":"Unavailable","ccsStatus":null,"error":null,"fuseResponse":null,"tappsResponse":null,"updatePendingState":null,"otaAlertStatus":"vehicle doesn't support mmota"} If the app detects that response it doesn't ask for OTA info in the future and displays the "OTA not supported: skipping check" message instead. In previous versions of the app it would also decide there was no OTA support in cases where there actually was, so I was assuming yours was set false because of this.

khpylon commented 2 years ago

I should have mentioned that when the app restores settings, it will not overwrite vehicle data if it already exists. You'd need to wipe the data, then restart the app and restore settings. My bad.

khpylon commented 2 years ago

By the way, it would be helpful to know the first 11 digits of your VIN so I can match it in the app.

FazeThree71 commented 2 years ago

1FMCU0G65LU

khpylon commented 2 years ago

Do me a favor... save your settings, and send me a DM on the forums including the JSON file as an attachment. Then I can better see what you're seeing.

khpylon commented 2 years ago

I'm also wondering if you are aware of any active Escape forums where I could announce support? If there's enough interest I can purchase an SVG drawing of the car for the widget.

FazeThree71 commented 2 years ago

Sorry, just saw your last two messages. Which forums should I DM you through?

As far as more Escapes, you could try reddit's /r/fordescape or https://fordescapeforum.com/

khpylon commented 2 years ago

Either https://macheforum.com or https://www.f150gen14.com or https://www.bronco6g.com ; I didn't recall which one you were on.

FazeThree71 commented 2 years ago

I joined the Mach E forums and sent the .json via PM there in a zip

khpylon commented 2 years ago

Unless someone is still seeing the OTA info not updating, I'm going to close this.