gartnera / headunit

Headunit for Android Auto
GNU Affero General Public License v3.0
344 stars 89 forks source link

Wireless AA over CMU hosted access point #172

Open RobsonMi opened 4 years ago

RobsonMi commented 4 years ago

Not entirely sure if it's an issue or intended behaviour but while wireless AA works with hotspot provided by phone it won't connect if hotspot is provided by CMU using AIO AP settings. I was able to successfully connect my phone to this AP but using "Start server..." in AA application on phone yielded no result. Can this be implemented in future?

RobsonMi commented 4 years ago

Okay, I see that last year auto detection of phone IP was added with netstat function and some regex. It overwrites the IP in headunit.json which I assume is later used to connect to phone. Is there any clean way to hardcode phone IP at this moment?

RobsonMi commented 4 years ago

Okay. I tried replacing PHONE_IP_ADDRESS=\netstat -rn|awk '$2~/192.168.43.[0-9]{1,3}/ {print $2}'` with PHONE_IP_ADDRESS=`arp -an|awk '$2~/192.168.53.[0-9]{1,3}/ {print $2}'` inmazda/installer/config/androidauto/data_persist/dev/bin/headunit-wrapper`

But it didn't seem to do the trick although arp -an returns proper list of devices connected to wifi AP. Ideas anyone?

Altern1ty commented 4 years ago

Would love to see this feature as putting your phone into wifi hotspot every time is a pain and having it automatically connect to the car AP would be great.

silverchris commented 3 years ago

I am looking into this, as https://github.com/opencardev/openauto/blob/crankshaft-ng/src/btservice/ looks like they have managed to implement it, so the Android Auto communication part has been solved.

I have some code in testing that sets up the needed bluetooth service, and I am working on getting it to the part of actually communicating the access point name and settings to AA on the phone.

The other major change is I believe the way AA works is it will open a connection to the head unit, which is the opposite of the way we do it now.

silverchris commented 3 years ago

I have a proof of concept of this working, I think :D

puma3 commented 3 years ago

@silverchris can you share some of the steps you followed?