User Tools

Site Tools


misc:virtual

How to Virtually Run the OS on your Computer

This is a rough copy with information directly pasted from a forum post.

WARNING: BE VERY CAREFUL IF YOU ATTEMPT THIS - FOR EXPERIMENTAL AND DEVELOPMENT PURPOSES ONLY

PART 1

Guys, I spent some time this morning trying to get the infotainment app to run on my PC while connected to the car.

The way it works is you load the jci/gui/index.html file from a locally run webserver and enable some debugging flags in the GuiConfig.js. You also need to disable the firewall (iptables) on the car so that the app running in your browser can communicate with the websockets running on the car.

I've got as far as the background and the time loading but I'm stuck on an exception becuase of current context… i.e., load the app that was on last time the car was on…. but I have to run to the hockey rink with the kids…

Why is this important? Well, if we get this to work, we'll be able to run the infotainment javascript application on our PC… make changes, test, and retry without risking the boot loop that I ended up with this morning :)

I'll post if I get something concrete done…. fingers crossed!

Here's a snapshot of how far I got:

PART 2

And, after the rink, I got this to work!

Very cool. You can debug the GUI inside opera running on your PC.

Here are the steps:

1) copy the entire /jci directory from the car to your PC… it's about 250MB. I made a backup copy so I have a standard reference.

2) get a webserver instance configured and running with the document root at /jci/gui. I used a python simple http server: python -m SimpleHTTPServer 8080

3) login to the car and disable the firewall. I created a script to to this:

#!/bin/sh
 
iptables -F
iptables -X
iptables -t nat -F
iptables -t nat -X
iptables -t mangle -F
iptables -t mangle -X
iptables -P INPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -P OUTPUT ACCEPT

4) edit /jci/gui/index.html

Change the line that looks like this:

<script src="../../data/integration/developer_mode_GuiConfig.js" type="text/javascript"></script>

to look like this:

<script src="common/js/developer_mode_GuiConfig.js" type="text/javascript"></script>

5) Edit /jci/gui/common/js/GuiConfig.js

Change the following items to TRUE:

promptForIp debugPanelEnabled pcLogging

6) Open a browser on your PC and point to the local instance based on the webserver config… in my case, it was http://127.0.0.1:8080/.

You will be prompted for an IP address. Enter the IP address of the car here.

When not connected to the car, the main screen will freeze for a bit and then come up with a warning that it cannot connect to the webservices (MMUI, etc.).

But, when you're connected to the car, the JS app running in your browser opens websockets to the webservices running on the car…

At first, you may get an error, but I find that going into the settings app and then refreshing the screen makes it work.

Here's a snapshot: