nisargjhaveri / WirelessAndroidAutoDongle

Use Wireless Android Auto with a car that supports only wired Android Auto using a Raspberry Pi.
MIT License
320 stars 43 forks source link

Handle Lost Connection/Re-connection #70

Closed admiralspeedy closed 4 months ago

admiralspeedy commented 4 months ago

Currently it appears as though there is absolutely no handling of when the phone is disconnected and reconnected.

There are situations where I may leave my car running and walk out of range of the Pi's Wi-Fi network, and when I return to the car the phone makes no attempt to re-connect to the Pi because it does not ever handle the phone being disconnected.

We also need to handle situations where a connection to the car is lost, but the Pi still has power. This can happen in some vehicles (like most Fords) where when you shut the vehicle off and the head unit powers down, the USB ports remain powered for a certain amount of time. Sometimes this amount of time is long enough (5-10 minutes in some cases) to where I may leave the vehicle and come back, and as a result the dongle does not work until the Pi is power cycled because it never shut down and still thinks it is connected to the phone.

I am currently doing some testing to find a way to handle this, but even a simple reboot on either connection being lost would be enough, albeit probably not the safest way.

nisargjhaveri commented 4 months ago

Same as #26. Let's discuss there.