headunit icon indicating copy to clipboard operation
headunit copied to clipboard

initial wifi autoconfig

Open silverchris opened this issue 5 years ago • 14 comments

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 avatar Nov 06 '20 07:11 silverchris

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 avatar Nov 07 '20 21:11 silverchris

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

silverchris avatar Nov 09 '20 02:11 silverchris

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

silverchris avatar Nov 13 '20 00:11 silverchris

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.

NeoXTC avatar Nov 13 '20 00:11 NeoXTC

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 avatar Nov 13 '20 02:11 silverchris

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

Spooky998 avatar Nov 13 '20 02:11 Spooky998

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?

silverchris avatar Nov 13 '20 02:11 silverchris

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.

Spooky998 avatar Nov 15 '20 12:11 Spooky998

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?

silverchris avatar Nov 15 '20 17:11 silverchris

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.

Spooky998 avatar Nov 16 '20 01:11 Spooky998

@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 avatar Nov 17 '20 03:11 silverchris

@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 avatar Nov 19 '20 03:11 silverchris

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

silverchris avatar Nov 19 '20 03:11 silverchris

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

silverchris avatar Nov 21 '20 03:11 silverchris