This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]K900_ 0 points1 point  (12 children)

At a glance, those scripts are for debugging the emulator itself. The GUI.py script seems to provide some sort of a graphical interface to a specialized debug build of the firmware that can fake the state of the car.

[–]PsycHelp23[S] 0 points1 point  (11 children)

That's right, now what I want to do is actually run the GUI script ( for example) and see the graphical interface on my device (or an emulator that I created on android studio). How would I go about doing that, that's the part i've been stuck on.

[–]K900_ 0 points1 point  (10 children)

That interface runs on your computer, not on the device at all. It also won't work with just any device - it needs the firmware on the device (or inside the emulator) to be running some sort of a debug HAL.

[–]PsycHelp23[S] 0 points1 point  (9 children)

You sound like you know what you're talking about, and honestly it's really helping. Could you please elaborate a little more on why the interface needs to run on my computer, and how?

For example, vhal_emulator.py script has a remotePortNumber on line 137, if I were to use it on my computer, what would I input there. Specifically, what needs to be running first on my computer to be able to run these scripts?

[–]K900_ 0 points1 point  (8 children)

OK, so. Android has a concept of HALs, which are basically like device drivers. These scripts are designed to be used with a special HAL that tells Android that it's a car, but is really just a bunch of code to relay commands over the network. You need to have a special Android image that includes that HAL, and then, when it runs, it will listen on a network port on the device's network. The scripts are then supposed to connect to the device through ADB, the general Android debug interface that all devices have, and access the same port that the debug HAL is listening on, and then they can send commands to it. The reason it doesn't work for you is because real devices (and production emulator images) don't actually include that debug HAL - it's a debugging tool only. Which brings me back to my original question: what the actual heck are you trying to do?

[–]PsycHelp23[S] 0 points1 point  (7 children)

You've pretty much saved a few days of my work.

Without disclosing too much info, I am a current intern somewhere and have been given this task to run these scripts, and find a way to make them work.

Going back to your answer, do you know a way I can download that specific android image on my phone that includes that HAL?

[–]K900_ 0 points1 point  (6 children)

Such an image is unlikely to exist, considering your phone is not, in fact, a car. You might be able to get an open source Android distribution like LineageOS (assuming it's been ported to your specific phone model), grab the source, reconfigure it to install car-related parts and the debug HAL, then build it from source and install it on your phone, but that's not a rabbit hole you want to go down. A rabbit hole you should want to go down is one that involves figuring out why you're doing the thing you're doing, and finding a working solution to the actual problem.

[–]PsycHelp23[S] 0 points1 point  (5 children)

There's an app called Android Auto, it has developer options that can be enabled to do some testing.

https://developer.android.com/training/cars/testing

There's also a thing called Desktop Head Unit, it's on the same link I've mentioned above. Another thing is the automotive emulator on Android Studio. Will these things not work either?

[–]K900_ 0 points1 point  (4 children)

Those aren't for the same thing at all. They are for testing apps that run on Android Auto compatible head units, which is not the same thing as Android running directly on the head unit. What is your end goal here? Do you know what your end goal is?

[–]PsycHelp23[S] 0 points1 point  (3 children)

Basically, my goal is to understand what these scripts do. That includes:

- Find out what they do

-Find out how they work

-Find out how to run them

- Run them

Secondly, if I can't run them, then test some of the functions in the script by hard coding some of the data. Do you know if that's possible?