Brandawg93 / homebridge-fordpass

Control your Ford vehicle in HomeKit using Homebridge.
GNU General Public License v3.0
62 stars 15 forks source link

[Bug]:[FordPass] Auth failed with status: 200 #168

Closed E46er closed 2 years ago

E46er commented 2 years ago

Describe the bug

[FordPass] Auth failed with status: 200.

Any tips on where to start with this error? I have never been able to get the plugin working due to this error. login details correct..

Tried uninstall / reinstall etc

Thank you..

Debug Output

Last login: Fri Feb 4 17:38:42 on ttys000 Deans-Mac-mini:~ deanherrick$ homebridge -D [4/02/2022, 5:45:05 pm] Loaded config.json with 1 accessories and 4 platforms. [4/02/2022, 5:45:06 pm] Loaded 1 cached accessories from cachedAccessories. [4/02/2022, 5:45:06 pm] --- [4/02/2022, 5:45:08 pm] Loaded plugin: homebridge-broadlink-rm-pro@4.4.8 [4/02/2022, 5:45:08 pm] Plugin 'homebridge-broadlink-rm-pro' tried to register with an incorrect plugin identifier: 'homebridge-broadlink-rm'. Please report this to the developer! [4/02/2022, 5:45:08 pm] Registering platform 'homebridge-broadlink-rm-pro.BroadlinkRM' [4/02/2022, 5:45:08 pm] --- [4/02/2022, 5:45:09 pm] Loaded plugin: homebridge-camera-ui@5.0.16 [4/02/2022, 5:45:09 pm] Registering platform 'homebridge-camera-ui.CameraUI' [4/02/2022, 5:45:09 pm] --- [4/02/2022, 5:45:09 pm] Loaded plugin: homebridge-config-ui-x@4.42.0 [4/02/2022, 5:45:09 pm] Registering platform 'homebridge-config-ui-x.config' [4/02/2022, 5:45:09 pm] --- [4/02/2022, 5:45:09 pm] Loaded plugin: homebridge-fordpass@1.5.3 [4/02/2022, 5:45:09 pm] Registering platform 'homebridge-fordpass.FordPass' [4/02/2022, 5:45:09 pm] --- [4/02/2022, 5:45:09 pm] Disabled plugin: homebridge-goldair-fan@0.0.23 [4/02/2022, 5:45:09 pm] --- [4/02/2022, 5:45:09 pm] Loading 4 platforms... [4/02/2022, 5:45:09 pm] [Broadlink RM] Initializing BroadlinkRM platform... [4/02/2022, 5:45:09 pm] [Broadlink RM] [INFO] Automatic Broadlink RM device discovery has been disabled as the "hosts" option has been set. [INFO] Adding RF Support to device a0:43:b0:2c:ae:73 with type 2227 [4/02/2022, 5:45:09 pm] [Broadlink RM] [INFO] Running Homebridge Broadlink RM Plugin version 4.4.8 [4/02/2022, 5:45:09 pm] [Broadlink RM] LivingRoom Humidity Accessory Ready [4/02/2022, 5:45:09 pm] [Broadlink RM] Fakegato-storage AddWriter : LivingRoom Humidity [4/02/2022, 5:45:09 pm] [Broadlink RM] Loading... [4/02/2022, 5:45:09 pm] [Broadlink RM] Fakegato-storage read FS file: /Users/deanherrick/.homebridge/RMPro_LivingRoom-Humidity_persist.json [4/02/2022, 5:45:09 pm] [Broadlink RM] Fakegato-timer Subscription : LivingRoom Humidity [4/02/2022, 5:45:09 pm] [Broadlink RM] Registring Events LivingRoom Humidity [4/02/2022, 5:45:09 pm] [Broadlink RM] Accessory LivingRoom Humidity [4/02/2022, 5:45:09 pm] [Broadlink RM] LivingRoom temperature Accessory Ready [4/02/2022, 5:45:09 pm] [Broadlink RM] Fakegato-storage AddWriter : LivingRoom temperature [4/02/2022, 5:45:09 pm] [Broadlink RM] Loading... [4/02/2022, 5:45:09 pm] [Broadlink RM] Fakegato-storage read FS file: /Users/deanherrick/.homebridge/RMPro_LivingRoom-temperature_persist.json [4/02/2022, 5:45:09 pm] [Broadlink RM] Fakegato-timer Subscription : LivingRoom temperature [4/02/2022, 5:45:09 pm] [Broadlink RM] Registring Events LivingRoom temperature [4/02/2022, 5:45:09 pm] [Broadlink RM] Accessory LivingRoom temperature [4/02/2022, 5:45:09 pm] [Broadlink RM] Living Room Sony TV Accessory Ready [4/02/2022, 5:45:09 pm] [Broadlink RM] [4/02/2022, 5:45:09 pm] [Broadlink RM] ** [4/02/2022, 5:45:09 pm] [Broadlink RM] You added TVs in your configuration! [4/02/2022, 5:45:09 pm] [Broadlink RM] Due to a HomeKit limitation you need to add any TVs to the Home app by using the Add Accessory function. [4/02/2022, 5:45:09 pm] [Broadlink RM] There you'll find your TVs and you can use the same PIN as you using for this HomeBridge instance. [4/02/2022, 5:45:09 pm] [Broadlink RM] ** [4/02/2022, 5:45:09 pm] [Broadlink RM] [4/02/2022, 5:45:09 pm] [Config] Initializing config platform... [4/02/2022, 5:45:09 pm] [Config] Spawning homebridge-config-ui-x with PID 93743 [4/02/2022, 5:45:09 pm] [CameraUI] Initializing CameraUI platform... [4/02/2022, 5:45:09 pm] [FordPass] Initializing FordPass platform... [4/02/2022, 5:45:09 pm] Loading 1 accessories... [4/02/2022, 5:45:09 pm] Ignoring config for the accessory "GoldairSleepSmart" in your config.json as the plugin "homebridge-goldair-fan" has been disabled. [4/02/2022, 5:45:09 pm] [CameraUI] Front: Configuring cached bridged accessory... [4/02/2022, 5:45:09 pm] [CameraUI] Front: Setting up accessory... [4/02/2022, 5:45:09 pm] [CameraUI] Config changed through interface, saving... [4/02/2022, 5:45:09 pm] [CameraUI] Initializing camera.ui with PID: 93739 [4/02/2022, 5:45:09 pm] [CameraUI] Configuring server... [4/02/2022, 5:45:09 pm] Publishing external accessory (name: Living Room Sony TV, publishInfo: { username: 'AD:77:E3:A1:F4:B7', pincode: '*-*-', category: 31, port: undefined, bind: undefined, mdns: undefined, addIdentifyingMaterial: true, advertiser: undefined }). [4/02/2022, 5:45:09 pm] Initializing platform accessory 'Learn'... [4/02/2022, 5:45:09 pm] Initializing platform accessory 'Scan Frequency'... [4/02/2022, 5:45:09 pm] Initializing platform accessory 'LivingRoom Humidity'... [4/02/2022, 5:45:09 pm] Initializing platform accessory 'LivingRoom temperature'... [4/02/2022, 5:45:09 pm] Publishing bridge accessory (name: Homebridge FBA6, publishInfo: { username: '0E:2E:9A:9F:FB:A6', port: 51975, pincode: '*-*-', category: 2, bind: undefined, mdns: undefined, addIdentifyingMaterial: true, advertiser: undefined }). Setup Payload: X-HM://0024J6S1Y6BEL Scan this code with your HomeKit app on your iOS device to pair with Homebridge:

Or enter this code with your HomeKit app on your iOS device to pair with Homebridge:

┌────────────┐     
│ 642-55-622 │     
└────────────┘     

[4/02/2022, 5:45:09 pm] Living Room Sony TV 6ABF is running on port 63217. [4/02/2022, 5:45:09 pm] Please add [Living Room Sony TV 6ABF] manually in Home app. Setup Code: 642-55-622 [4/02/2022, 5:45:09 pm] Error: listen EADDRINUSE: address already in use :::51975 at Server.setupListenHandle [as _listen2] (node:net:1334:16) at listenInCluster (node:net:1382:12) at Server.listen (node:net:1469:7) at EventedHTTPServer.listen (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/util/eventedhttp.ts:155:20) at HAPServer.listen (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/HAPServer.ts:332:21) at Bridge. (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Accessory.ts:1279:18) at step (/usr/local/lib/node_modules/homebridge/node_modules/tslib/tslib.js:143:27) at Object.next (/usr/local/lib/node_modules/homebridge/node_modules/tslib/tslib.js:124:57) at /usr/local/lib/node_modules/homebridge/node_modules/tslib/tslib.js:117:75 at new Promise () [4/02/2022, 5:45:09 pm] Error: Service name is already in use on the network at Registry._onProbeComplete (/usr/local/lib/node_modules/homebridge/node_modules/bonjour-hap/lib/Registry.js:108:27) at Prober.done (/usr/local/lib/node_modules/homebridge/node_modules/bonjour-hap/lib/Prober.js:67:10) at Prober.onMDNSresponse (/usr/local/lib/node_modules/homebridge/node_modules/bonjour-hap/lib/Prober.js:61:102) at EventEmitter.emit (node:events:390:28) at Socket. (/usr/local/lib/node_modules/homebridge/node_modules/multicast-dns/index.js:49:43) at Socket.emit (node:events:390:28) at UDP.onMessage (node:dgram:939:8) [4/02/2022, 5:45:09 pm] Got SIGTERM, shutting down Homebridge... [4/02/2022, 5:45:09 pm] [Broadlink RM] [INFO] Discovered Manual RM4 Pro Device (2227) at 192.168.8.94 (a0:43:b0:2c:ae:73) [4/02/2022, 5:45:10 pm] [CameraUI] Garage: Configuring unbridged accessory... [4/02/2022, 5:45:10 pm] [CameraUI] Garage: Setting up accessory... [4/02/2022, 5:45:10 pm] [CameraUI] Inside Garage: Configuring unbridged accessory... [4/02/2022, 5:45:10 pm] [CameraUI] Inside Garage: Setting up accessory... [4/02/2022, 5:45:10 pm] [CameraUI] Lower Garage: Configuring unbridged accessory... [4/02/2022, 5:45:10 pm] [CameraUI] Lower Garage: Setting up accessory... [4/02/2022, 5:45:10 pm] [CameraUI] Accessories refreshed and config.json saved! [4/02/2022, 5:45:10 pm] Publishing external accessory (name: Garage, publishInfo: { username: 'C5:1C:3B:4A:9D:0A', pincode: '*-*-', category: 17, port: undefined, bind: undefined, mdns: undefined, addIdentifyingMaterial: true, advertiser: undefined }). [4/02/2022, 5:45:10 pm] Publishing external accessory (name: Inside Garage, publishInfo: { username: '75:97:1A:1A:3A:03', pincode: '*-*-', category: 17, port: undefined, bind: undefined, mdns: undefined, addIdentifyingMaterial: true, advertiser: undefined }). [4/02/2022, 5:45:10 pm] Publishing external accessory (name: Lower Garage, publishInfo: { username: 'B7:91:94:2F:99:7E', pincode: '*-*-', category: 17, port: undefined, bind: undefined, mdns: undefined, addIdentifyingMaterial: true, advertiser: undefined }). [4/02/2022, 5:45:10 pm] Garage 7F73 is running on port 63219. [4/02/2022, 5:45:10 pm] Please add [Garage 7F73] manually in Home app. Setup Code: 642-55-622 [4/02/2022, 5:45:10 pm] Inside Garage 3A68 is running on port 63220. [4/02/2022, 5:45:10 pm] Please add [Inside Garage 3A68] manually in Home app. Setup Code: 642-55-622 [4/02/2022, 5:45:10 pm] Lower Garage 04CD is running on port 63221. [4/02/2022, 5:45:10 pm] Please add [Lower Garage 04CD] manually in Home app. Setup Code: 642-55-622 [4/02/2022, 5:45:10 pm] [Broadlink RM] read data from LivingRoom Humidity : {"firstEntry":6907,"lastEntry":10939,"usedMemory":4032,"refTime":657799958,"initialTime":1636107158,"history":{"temp":21.85,"humidity":57.87,"time":1641834041},{"temp":21.84,"humidity":57.71,"time":1641834642}]} [4/02/2022, 5:45:10 pm] [Broadlink RM] History Loaded from Persistant Storage [4/02/2022, 5:45:10 pm] Error: Service name is already in use on the network at Registry._onProbeComplete (/usr/local/lib/node_modules/homebridge/node_modules/bonjour-hap/lib/Registry.js:108:27) at Prober.done (/usr/local/lib/node_modules/homebridge/node_modules/bonjour-hap/lib/Prober.js:67:10) at Prober.onMDNSresponse (/usr/local/lib/node_modules/homebridge/node_modules/bonjour-hap/lib/Prober.js:61:102) at EventEmitter.emit (node:events:390:28) at Socket. (/usr/local/lib/node_modules/homebridge/node_modules/multicast-dns/index.js:49:43) at Socket.emit (node:events:390:28) at UDP.onMessage (node:dgram:939:8) [4/02/2022, 5:45:10 pm] Error: Service name is already in use on the network at Registry._onProbeComplete (/usr/local/lib/node_modules/homebridge/node_modules/bonjour-hap/lib/Registry.js:108:27) at Prober.done (/usr/local/lib/node_modules/homebridge/node_modules/bonjour-hap/lib/Prober.js:67:10) at Prober.onMDNSresponse (/usr/local/lib/node_modules/homebridge/node_modules/bonjour-hap/lib/Prober.js:61:102) at EventEmitter.emit (node:events:390:28) at Socket. (/usr/local/lib/node_modules/homebridge/node_modules/multicast-dns/index.js:49:43) at Socket.emit (node:events:390:28) at UDP.onMessage (node:dgram:939:8) [4/02/2022, 5:45:10 pm] Error: Service name is already in use on the network at Registry._onProbeComplete (/usr/local/lib/node_modules/homebridge/node_modules/bonjour-hap/lib/Registry.js:108:27) at Prober.done (/usr/local/lib/node_modules/homebridge/node_modules/bonjour-hap/lib/Prober.js:67:10) at Prober.onMDNSresponse (/usr/local/lib/node_modules/homebridge/node_modules/bonjour-hap/lib/Prober.js:61:102) at EventEmitter.emit (node:events:390:28) at Socket. (/usr/local/lib/node_modules/homebridge/node_modules/multicast-dns/index.js:49:43) at Socket.emit (node:events:390:28) at UDP.onMessage (node:dgram:939:8) [4/02/2022, 5:45:10 pm] [Broadlink RM] Fakegato-timer: addData LivingRoom Humidity { time: 1643949911, humidity: 45.73 } immediate: false [4/02/2022, 5:45:10 pm] [Broadlink RM] Start Global Fakegato-Timer - 10min [4/02/2022, 5:45:10 pm] [Broadlink RM] Fakegato-timer: addData LivingRoom temperature { time: 1643949911, temp: 28.67, humidity: 45.73 } immediate: false [4/02/2022, 5:45:15 pm] [CameraUI] Configuring socket... [4/02/2022, 5:45:15 pm] [CameraUI] Configuring database... Deans-Mac-mini:~ deanherrick$ [4/02/2022, 5:45:15 pm] [Homebridge UI] Homebridge Config UI X v4.42.0 is listening on :: port 8581 [4/02/2022, 5:45:16 pm] [Homebridge UI] Error: listen EADDRINUSE: address already in use :::8581 [4/02/2022, 5:45:16 pm] [Homebridge UI] Another process or service on this host is using port 8581. [4/02/2022, 5:45:16 pm] [Homebridge UI] Please stop the other service or change the port you have assigned to homebridge-config-ui-x. [4/02/2022, 5:45:16 pm] [Homebridge UI] Ending process now. Deans-Mac-mini:~ deanherrick$

Steps to reproduce

  1. consistant on every start

Device Type

Mac mini 3.1

iOS Version

10.14.6

Bug Persistence

Consistently

Last Working Version

No response

E46er commented 2 years ago

No help with this?

Brandawg93 commented 2 years ago

That's odd. 200 usually means that the request was successful. Are you using the latest version of the plugin?

E46er commented 2 years ago

lastest version installed.. "homebridge-fordpass v1.5.3"

github-actions[bot] commented 2 years ago

This issue is stale because it has been open 14 days with no activity. Remove stale label or comment or this will be closed in 3 days

E46er commented 2 years ago

any suggestions?

Brandawg93 commented 2 years ago

Just noticed your location. I think you're the first person I've found who is trying this outside the US 😀. I'm pretty sure there are different urls for other countries. When I get a chance, I'll try to test with NZ and see if it works for you then.

E46er commented 2 years ago

Just noticed your location. I think you're the first person I've found who is trying this outside the US 😀. I'm pretty sure there are different urls for other countries. When I get a chance, I'll try to test with NZ and see if it works for you then.

Hi, sorry to hassle you.. any luck with this. really keen to get it working.. Thanks

Brandawg93 commented 2 years ago

Whoops...This one slipped past me. Ok. I've published a new test version (v1.6.0-test.3). You can install it via the previous versions dropdown in the UI. Let me know if that works for you.

Brandawg93 commented 2 years ago

For clarification, I hard-coded the region to Australia. That was the closest to you.

E46er commented 2 years ago

Thanks - progress as such, now I get the vehicle to show in the home app, but now I get 401 errors: eg: 4/14/2022, 4:46:50 PM] Error: Request failed with status code 401 at createError (/usr/local/lib/node_modules/homebridge-fordpass/node_modules/axios/lib/core/createError.js:16:15) at settle (/usr/local/lib/node_modules/homebridge-fordpass/node_modules/axios/lib/core/settle.js:17:12) at IncomingMessage.handleStreamEnd (/usr/local/lib/node_modules/homebridge-fordpass/node_modules/axios/lib/adapters/http.js:293:11) at IncomingMessage.emit (node:events:402:35) at endReadableNT (node:internal/streams/readable:1343:12) at processTicksAndRejections (node:internal/process/task_queues:83:21) and: [4/14/2022, 4:51:06 PM] [FordPass] Status failed with error: 401 [4/14/2022, 4:51:06 PM] [FordPass] Cannot get information for Everest engine [4/14/2022, 4:51:07 PM] [FordPass] Status failed with error: 401 [4/14/2022, 4:51:07 PM] [FordPass] Cannot get information for Everest lock [4/14/2022, 4:51:17 PM] [FordPass] Status failed with error: 401 [4/14/2022, 4:52:19 PM] [FordPass] Status failed with error: 401 [4/14/2022, 4:53:17 PM] [FordPass] Status failed with error: 401 [4/14/2022, 4:54:18 PM] [FordPass] Status failed with error: 401 [4/14/2022, 4:55:18 PM] [FordPass] Status failed with error: 401 [4/14/2022, 4:56:18 PM] [FordPass] Status failed with error: 401

I tried removing and adding the vehicle again, no difference.

Brandawg93 commented 2 years ago

I've published a new version (v1.6.0). Try playing around with the region in the settings to see if any work for you.

E46er commented 2 years ago

Hi, with US & CA I get Error 200, With EU & AU I get error 401: [4/25/2022, 4:59:25 PM] [FordPass] Configuring accessory 2021 Everest [4/25/2022, 4:59:37 PM] [FordPass] Status failed with error: 401 [4/25/2022, 4:59:37 PM] [FordPass] Cannot get information for 2021 Everest engine [4/25/2022, 4:59:37 PM] [FordPass] Status failed with error: 401 [4/25/2022, 4:59:37 PM] [FordPass] Cannot get information for 2021 Everest engine [4/25/2022, 4:59:37 PM] [FordPass] Status failed with error: 401 [4/25/2022, 4:59:37 PM] [FordPass] Status failed with error: 401 [4/25/2022, 4:59:37 PM] [FordPass] Cannot get information for 2021 Everest lock

Token error? it must recognise the account, as its picks up the 2021 Everest.? - but no access to vehicle..

appreciate your time with this.

E46er commented 2 years ago

additional info: (causes home bridge to restart) [4/25/2022, 5:08:52 PM] [FordPass] Status failed with error: 401 [4/25/2022, 5:09:10 PM] [FordPass] Status failed with error: 401 [4/25/2022, 5:09:10 PM] [FordPass] Cannot get information for 2021 Everest lock [4/25/2022, 5:09:10 PM] [FordPass] Status failed with error: 401 [4/25/2022, 5:09:10 PM] [FordPass] Cannot get information for 2021 Everest engine [4/25/2022, 5:09:53 PM] [FordPass] Status failed with error: 401 [4/25/2022, 5:09:53 PM] [FordPass] Cannot get information for 2021 Everest engine [4/25/2022, 5:09:53 PM] [FordPass] Status failed with error: 401 [4/25/2022, 5:09:53 PM] [FordPass] Cannot get information for 2021 Everest lock [4/25/2022, 5:09:53 PM] Error: Request failed with status code 401 at createError (/usr/local/lib/node_modules/homebridge-fordpass/node_modules/axios/lib/core/createError.js:16:15) at settle (/usr/local/lib/node_modules/homebridge-fordpass/node_modules/axios/lib/core/settle.js:17:12) at IncomingMessage.handleStreamEnd (/usr/local/lib/node_modules/homebridge-fordpass/node_modules/axios/lib/adapters/http.js:293:11) at IncomingMessage.emit (node:events:402:35) at endReadableNT (node:internal/streams/readable:1343:12) at processTicksAndRejections (node:internal/process/task_queues:83:21) [4/25/2022, 5:09:53 PM] Got SIGTERM, shutting down Homebridge... [4/25/2022, 5:09:53 PM] [FordPass] Status failed with error: 401

Brandawg93 commented 2 years ago

Try deleting the accessory cache in the UI settings for FordPass. The refresh token may have been saved with US instead of AU.

E46er commented 2 years ago

Try deleting the accessory cache in the UI settings for FordPass. The refresh token may have been saved with US instead of AU.

just tried that.. still the same error.

E46er commented 2 years ago

any ideas?

Brandawg93 commented 2 years ago

I've been looking at other implementations of the Fordpass API and they use the same endpoint for all regions just like the plugin. So maybe those implementations don't actually work, but I have no way of testing it.

You may have luck testing the endpoint with wireshark or mitmproxy to see if it begins with something other than usapi. If you see something different, let me know and I can change it in the plugin.

E46er commented 2 years ago

fordpass.pcapng.zip

attached is the Wireshark capture

Brandawg93 commented 2 years ago

I'm not seeing any fordpass endpoints in there. Personally, I use mitmproxy for plugin development. It's much easier to disect.

Brandawg93 commented 2 years ago

https://proxyman.io/ may make it easier for you.

tornenen commented 2 years ago

Same error here. Status failed with error: 401 Based in Germany, Choose EU as Region.

Brandawg93 commented 2 years ago

@tornenen Did you try clearing your accessory cache? I am able to get EU working locally, but I had to clear my cache and let homebridge go through the entire authentication process again.

tornenen commented 2 years ago

yes, i did. Same error: https://i.imgur.com/QL3mgM6.jpg

Brandawg93 commented 2 years ago

It helps if the region isn't hardcoded in the status 🤦. Try v1.7.0-test.1 and let me know if it works for you.

tornenen commented 2 years ago

Yep, this one is running fine

Brandawg93 commented 2 years ago

The fix is now in v1.7.0.