Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

initial wifi autoconfig #188

Draft
wants to merge 39 commits into
base: master
Choose a base branch
from

Conversation

silverchris
Copy link

some rough code that allows android auto to discover the wifi settings over bluetooth.

Needs a lot of cleanup before merge, but wanted to get the ball rolling on this!

@silverchris silverchris force-pushed the wifi_autoconfig branch 2 times, most recently from 6a91cc4 to a511dac Compare November 7, 2020 21:20
@silverchris
Copy link
Author

IT WORKS.
It has problems, but it works.
First issue, is that it doesn't disconnect when the car is turned off.
Second issue, is it may start up too slow for android auto
Third issue, my code could use a lot of cleaning up, and making it not hacky :)

@silverchris
Copy link
Author

Mostly working... except for the crashing when we try to exit...

@silverchris
Copy link
Author

Ok, this is starting to feel usable.
Right now, I have...

  • Implemented the bluetooth interface for telling AA to connect to us

  • Implemented something to detect supported USB devices when they are plugged in, instead of relying on the shell scripts to handle that

  • Cleaned up some stuff, I think... we can now exit without crashing.

I do need to write something to check if a compatible phone has been connected by usb before headunit starts.

I have included a compiled binary on this post if anyone wants to try it. You will need to manually copy BdsConfiguration.xml overtop of /jci/bds/BdsConfiguration.xml because I haven't updated the tweaks.sh script.

You will also probably want to replace headunit-wrapper with the simplied version from here

headunit.zip

@NeoXTC
Copy link

NeoXTC commented Nov 13, 2020

Ok, this is starting to feel usable.
Right now, I have...

  • Implemented the bluetooth interface for telling AA to connect to us
  • Implemented something to detect supported USB devices when they are plugged in, instead of relying on the shell scripts to handle that
  • Cleaned up some stuff, I think... we can now exit without crashing.

I do need to write something to check if a compatible phone has been connected by usb before headunit starts.

I have included a compiled binary on this post if anyone wants to try it. You will need to manually copy BdsConfiguration.xml overtop of /jci/bds/BdsConfiguration.xml because I haven't updated the tweaks.sh script.

You will also probably want to replace headunit-wrapper with the simplied version from here

headunit.zip

Awesome will try it out. I haven't had any luck with my note10+ on anything after AA1.13 here. I'll try yours and see if it works with all the fixes.

@silverchris
Copy link
Author

silverchris commented Nov 13, 2020

when compiling headunit file: main.cpp below error occurred

main.cpp: In function ‘int run(int, DBus::Connection&, DBus::Connection&)’:
main.cpp:183:20: error: ‘class HUServer’ has no member named ‘running’
while(headunit.running()){

/* while(headunit.running()){
sleep(1);
} */

So I didn't use it, how did you get it to compiled with that code without errors? but I left is out and it compiled fine. going to test it out with my new headunit. will try to report back soon.

@Radarwild
That change should be included, can you check that it is there in hu_aap.h and hu_aap.c?

I also realized that I didn't try it out with the normal makefile, just my cmake environment, let me look into that

@Spooky998
Copy link

Spooky998 commented Nov 13, 2020

when compiling headunit file: main.cpp below error occurred
main.cpp: In function ‘int run(int, DBus::Connection&, DBus::Connection&)’:
main.cpp:183:20: error: ‘class HUServer’ has no member named ‘running’
while(headunit.running()){
/* while(headunit.running()){
sleep(1);
} */
So I didn't use it, how did you get it to compiled with that code without errors? but I left is out and it compiled fine. going to test it out with my new headunit. will try to report back soon.

@Radarwild
That change should be included, can you check that it is there in hu_aap.h and hu_aap.c?

I also realized that I didn't try it out with the normal makefile, just my cmake environment, let me look into that


@silverchris thanks they were missing in my hu_aap.h and hu_aap.cpp fixed. now I'm getting this error afterwards do you know what's missing or the issues here below? thanks.

main.arm.o: In function _Head_base<void (*)(std::promise<int>*, std::atomic<bool>*), void>': headunit/mazda/m3-toolchain/arm-cortexa9_neon-linux-gnueabi/include/c++/4.9.1/tuple:140: undefined reference to udev_thread_func(std::promise, std::atomic)'
headunit/mazda/m3-toolchain/arm-cortexa9_neon-linux-gnueabi/include/c++/4.9.1/tuple:140: undefined reference to `udev_thread_func(std::promise, std::atomic)'
collect2: error: ld returned 1 exit status
Makefile:64: recipe for target 'headunit' failed
make: *** [headunit] Error 1

updated Makefile all good now, just have to do tweaks.sh

from SRCS += usb/usb.c
to SRCS += usb/usb.cpp

@silverchris
Copy link
Author

when compiling headunit file: main.cpp below error occurred
main.cpp: In function ‘int run(int, DBus::Connection&, DBus::Connection&)’:
main.cpp:183:20: error: ‘class HUServer’ has no member named ‘running’
while(headunit.running()){
/* while(headunit.running()){
sleep(1);
} */
So I didn't use it, how did you get it to compiled with that code without errors? but I left is out and it compiled fine. going to test it out with my new headunit. will try to report back soon.

@Radarwild
That change should be included, can you check that it is there in hu_aap.h and hu_aap.c?
I also realized that I didn't try it out with the normal makefile, just my cmake environment, let me look into that

@silverchris thanks they were missing in my hu_aap.h and hu_aap.cpp fixed. now I'm getting this error afterwards do you know what's missing or the issues here below? thanks.

main.arm.o: In function _Head_base<void (*)(std::promise<int>*, std::atomic<bool>*), void>': headunit/mazda/m3-toolchain/arm-cortexa9_neon-linux-gnueabi/include/c++/4.9.1/tuple:140: undefined reference to udev_thread_func(std::promise_, std::atomic_)'
headunit/mazda/m3-toolchain/arm-cortexa9_neon-linux-gnueabi/include/c++/4.9.1/tuple:140: undefined reference to `udev_thread_func(std::promise_, std::atomic_)'
collect2: error: ld returned 1 exit status
Makefile:64: recipe for target 'headunit' failed
make: *** [headunit] Error 1

Did you clone my repository? I just did a clean build from cloning it, and it seems to work fine?

@Spooky998
Copy link

when compiling headunit file: main.cpp below error occurred
main.cpp: In function ‘int run(int, DBus::Connection&, DBus::Connection&)’:
main.cpp:183:20: error: ‘class HUServer’ has no member named ‘running’
while(headunit.running()){
/* while(headunit.running()){
sleep(1);
} */
So I didn't use it, how did you get it to compiled with that code without errors? but I left is out and it compiled fine. going to test it out with my new headunit. will try to report back soon.

@Radarwild
That change should be included, can you check that it is there in hu_aap.h and hu_aap.c?
I also realized that I didn't try it out with the normal makefile, just my cmake environment, let me look into that

@silverchris thanks they were missing in my hu_aap.h and hu_aap.cpp fixed. now I'm getting this error afterwards do you know what's missing or the issues here below? thanks.
main.arm.o: In function _Head_base<void (*)(std::promise<int>*, std::atomic<bool>*), void>': headunit/mazda/m3-toolchain/arm-cortexa9_neon-linux-gnueabi/include/c++/4.9.1/tuple:140: undefined reference to udev_thread_func(std::promise_, std::atomic_)'
headunit/mazda/m3-toolchain/arm-cortexa9_neon-linux-gnueabi/include/c++/4.9.1/tuple:140: undefined reference to `udev_thread_func(std::promise_, std::atomic_)'
collect2: error: ld returned 1 exit status
Makefile:64: recipe for target 'headunit' failed
make: *** [headunit] Error 1

Did you clone my repository? I just did a clean build from cloning it, and it seems to work fine?

Yes cloned latest from your repository. Did not work. Use my own with all your latest updates do not work either.

@silverchris
Copy link
Author

when compiling headunit file: main.cpp below error occurred
main.cpp: In function ‘int run(int, DBus::Connection&, DBus::Connection&)’:
main.cpp:183:20: error: ‘class HUServer’ has no member named ‘running’
while(headunit.running()){
/* while(headunit.running()){
sleep(1);
} */
So I didn't use it, how did you get it to compiled with that code without errors? but I left is out and it compiled fine. going to test it out with my new headunit. will try to report back soon.

@Radarwild
That change should be included, can you check that it is there in hu_aap.h and hu_aap.c?
I also realized that I didn't try it out with the normal makefile, just my cmake environment, let me look into that

@silverchris thanks they were missing in my hu_aap.h and hu_aap.cpp fixed. now I'm getting this error afterwards do you know what's missing or the issues here below? thanks.
main.arm.o: In function _Head_base<void (*)(std::promise<int>*, std::atomic<bool>*), void>': headunit/mazda/m3-toolchain/arm-cortexa9_neon-linux-gnueabi/include/c++/4.9.1/tuple:140: undefined reference to udev_thread_func(std::promise_, std::atomic_)'
headunit/mazda/m3-toolchain/arm-cortexa9_neon-linux-gnueabi/include/c++/4.9.1/tuple:140: undefined reference to `udev_thread_func(std::promise_, std::atomic_)'
collect2: error: ld returned 1 exit status
Makefile:64: recipe for target 'headunit' failed
make: *** [headunit] Error 1

Did you clone my repository? I just did a clean build from cloning it, and it seems to work fine?

Yes cloned latest from your repository. Did not work. Use my own with all your latest updates do not work either.

@Radarwild What part didn't work? Didn't build, or just nothing happened?
If it built but just didn't work, can you confirm that BdsConfiguration.xml got updated?
What version is your CMU?

@Spooky998
Copy link

Spooky998 commented Nov 16, 2020

when compiling headunit file: main.cpp below error occurred
main.cpp: In function ‘int run(int, DBus::Connection&, DBus::Connection&)’:
main.cpp:183:20: error: ‘class HUServer’ has no member named ‘running’
while(headunit.running()){
/* while(headunit.running()){
sleep(1);
} */
So I didn't use it, how did you get it to compiled with that code without errors? but I left is out and it compiled fine. going to test it out with my new headunit. will try to report back soon.

@Radarwild
That change should be included, can you check that it is there in hu_aap.h and hu_aap.c?
I also realized that I didn't try it out with the normal makefile, just my cmake environment, let me look into that

@silverchris thanks they were missing in my hu_aap.h and hu_aap.cpp fixed. now I'm getting this error afterwards do you know what's missing or the issues here below? thanks.
main.arm.o: In function _Head_base<void (*)(std::promise<int>*, std::atomic<bool>*), void>': headunit/mazda/m3-toolchain/arm-cortexa9_neon-linux-gnueabi/include/c++/4.9.1/tuple:140: undefined reference to udev_thread_func(std::promise_, std::atomic_)'
headunit/mazda/m3-toolchain/arm-cortexa9_neon-linux-gnueabi/include/c++/4.9.1/tuple:140: undefined reference to `udev_thread_func(std::promise_, std::atomic_)'
collect2: error: ld returned 1 exit status
Makefile:64: recipe for target 'headunit' failed
make: *** [headunit] Error 1

Did you clone my repository? I just did a clean build from cloning it, and it seems to work fine?

Yes cloned latest from your repository. Did not work. Use my own with all your latest updates do not work either.

@Radarwild What part didn't work? Didn't build, or just nothing happened?
If it built but just didn't work, can you confirm that BdsConfiguration.xml got updated?
What version is your CMU?

fw59.00.502. built headunit from your repository and confirmed with the latest updated BdsConfiguration.xml. Installed the headunit file into my car but once plugging the android device nothing happens as it either doesn't recongize the phone and keeps trying to reconnect or something wrong with the codes headunit-wrapper or tweak.sh? can you provide a zipped full installer files of yours including (headunit-wrapper, tweak.sh, headunit etc) that you got it working on your vehicle please? so I can test it. thanks.

@silverchris
Copy link
Author

@Radarwild
I am waiting for a display to come in for my test CMU, which should be tomorrow. I can then actually test out the full install, in case I missed a step in the install script, that I did manually on my units. Will try that, and get a for sure working installer packed up for you to try :)

@silverchris
Copy link
Author

@Radarwild I haven't had a chance to test properly yet... but if you don't have the tweak for the CMU to be a wireless AP, the wireless will not work at all!
I just thought of that now

@silverchris
Copy link
Author

Lots of changes... requires this toolchain to build now https://github.com/silverchris/mazda3-build-tools
Need to clean it up, as there will be a lot of manual adjustments to paths to build it right now, but wanted to get it uploaded in case anyone wanted to look

… list of surfaces are correct other than TV_TOUCH_SURFACE and JCI_OPERA_PRIMARY?
@silverchris
Copy link
Author

@Radarwild
Here is an updated installer, that works for me
headunit.zip

aselafernando added a commit to aselafernando/libheadunit that referenced this pull request Oct 19, 2023
Added WiFI definitions from gartnera/headunit#188
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants