Skip to content

Commit

Permalink
merge gh-pages
Browse files Browse the repository at this point in the history
  • Loading branch information
emarsman committed Jan 4, 2018
2 parents 864713f + 1bd99ba commit c4b6368
Show file tree
Hide file tree
Showing 11 changed files with 134 additions and 48 deletions.
1 change: 0 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,3 @@ gem 'github-pages', "134"
gem "rake"
gem 'wdm', '>= 0.1.0'
gem 'html-proofer'

1 change: 0 additions & 1 deletion about/data-set.mkd
Original file line number Diff line number Diff line change
Expand Up @@ -142,4 +142,3 @@ unofficial mirror.
vehicle, but if it's supported, try the steering wheel buttons.)
<p><strong>Frequency:</strong> Sent only if value changes</p>
</dd>
</dl>
71 changes: 62 additions & 9 deletions android/tutorial.mkd
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ documentation and tutorials - we won't repeat them here. The best place to start
is [Android Studio's User Guide](https://developer.android.com/studio/intro/index.html).

Once you're comfortable with creating an Android app, continue on with this
tutorial to enrich it with data from your vehicle.
tutorial to enrich it with data from your vehicle.

<div class="alert alert-danger"> We'll mention this again at the end of the
tutorial, but you will need to install the
Expand All @@ -33,7 +33,7 @@ before your application will work.</div>
1. Open the project with Android Studio.
1. This project is ready to go, so if you want to quickly see something running
jump ahead to the [testing section](#testing). To know more about how this
application works or to add the necessary code to a different app, continue
application works or to add the necessary code to a different app, continue
reading.

<div class="page-header">
Expand All @@ -46,23 +46,23 @@ we've specified that the Starter app will use the OpenXC library as a
dependency.

This is already done in the Starter project and no changes have to be made. But to make your own app from scratch, go
to the `app/build.gradle` file and add the `openxc` library to the build
to the `app/build.gradle` file and add the `openxc` library to the build
dependencies. This is mentioned in the [Android Library Setup][library project]
page:

dependencies {
compile 'com.openxcplatform:library:6.1.6+'
}

You can now proceed to the next steps to start using the library in your
You can now proceed to the next steps to start using the library in your
project.

<div class="page-header">
<h2>Android Manifest</h2>
</div>

The `AndroidManifest.xml` is the core of every Android application - it tells
the Android OS what views are available, which servies and used and what sensors
the Android OS what views are available, which services are used and what sensors
your app needs.

Every OpenXC application, the Starter app included, needs to use the
Expand Down Expand Up @@ -101,7 +101,7 @@ This should go between the `<application>` tags, like this:

The next changes are all in Java code - for the Starter app, it's in
`StarterActivity.java` in the `src` folder. In order to use the `VehicleManager`
in Java code, we have to initiate the our `mVehicleManager` variable and then
in Java code, we have to initiate the our `mVehicleManager` variable and then
bind with it when the application starts.

Initiate our Starter App variables as shown here:
Expand All @@ -117,14 +117,14 @@ Initiate our Starter App variables as shown here:
protected void onCreate(Bundle savedInstanceState) {
{% endhighlight %}

Then add the ServiceConnection in the `StarterActivity` to bind with the
Then add the ServiceConnection in the `StarterActivity` to bind with the
VehicleManager:

{% highlight java %}
private ServiceConnection mConnection = new ServiceConnection() {
// Called when the connection with the VehicleManager service is established
public void onServiceConnected(ComponentName className, IBinder service) {
Log.i("openxc", "Bound to VehicleManager");
Log.i(TAG, "Bound to VehicleManager");
// When the VehicleManager starts up, we store a reference to it
// here in "mVehicleManager" so we can call functions on it
// elsewhere in our code.
Expand All @@ -140,7 +140,7 @@ VehicleManager:

// Called when the connection with the service disconnects unexpectedly
public void onServiceDisconnected(ComponentName className) {
Log.w("openxc", "VehicleManager Service disconnected unexpectedly");
Log.w(TAG, "VehicleManager Service disconnected unexpectedly");
mVehicleManager = null;
}
};
Expand Down Expand Up @@ -203,6 +203,59 @@ to the `VehicleManager` for future updates. Every time a new value for
`EngineSpeed` is received by the `VehicleManager`, the `receive(Measurement)`
method of the new `Listener` will be called with the data.

<h3>Custom Message Listener</h3>

In order to listen to a custom message from the vehicle, follow these steps:

1. Generate a firmware that can send custom message.
2. Create a custom message listener and add it to the VehicleManager

{% highlight java %}

private ServiceConnection mConnection = new ServiceConnection() {
// Called when the connection with the VehicleManager service is
// established, i.e. bound.
public void onServiceConnected(ComponentName className,
IBinder service) {
Log.i(TAG, "Bound to VehicleManager");
// When the VehicleManager starts up, we store a reference to it
// here in "mVehicleManager" so we can call functions on it
// elsewhere in our code.
mVehicleManager = ((VehicleManager.VehicleBinder) service)
.getService();

// We want to receive updates whenever our Message changes.
// We have customVehicleMessageListener and here we request that the VehicleManager
// call its receive() method whenever the custom simpleVehicleMsg changes
mVehicleManager.addListener(SimpleVehicleMessage.class, customVehicleMessageListener);

}
{% endhighlight %}

{% highlight java %}

private VehicleMessage.Listener customVehicleMessageListener = new VehicleMessage.Listener() {
// When we receive a new SimpleVehicleMessage value from the car, we want to update the
// UI to display the new value. First we create a new SimpleVehicleMessage from the
// received VehicleMessage and if the name of message is as specified (custom), we set
// the text of the customMessageView view to the latest value
@Override
public void receive(final VehicleMessage message) {
StarterActivity.this.runOnUiThread(new Runnable() {
public void run() {
SimpleVehicleMessage simpleVehicleMsg = new SimpleVehicleMessage(message.getTimestamp(),
((SimpleVehicleMessage) message).getName(),
((SimpleVehicleMessage) message).getValue());
if (simpleVehicleMsg.getName().equalsIgnoreCase("custom_message")) {
customMessageView.setText(simpleVehicleMsg.getName() +": "+ simpleVehicleMsg.getValue());
}
}
});
}
};

{% endhighlight %}

<div class="page-header">
<h2>Measurement Data</h2>
</div>
Expand Down
12 changes: 8 additions & 4 deletions hardware/vehicles.mkd
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,18 @@ title: Supported Vehicles - OpenXC
To read standard OBD-II diagnostics data from a car with OBD-II on CAN, use the
open source OBD-II OpenXC firmware. You can download the latest compiled
version of that firmware from the [vi-firmware releases
page](https://github.com/openxc/vi-firmware/releases){:target="_blank"}.
page](https://github.com/openxc/vi-firmware/releases).

Grab the `openxc-obd2-firmware-*.zip` file for the latest version, which
Grab the `vi-translated_obd2-firmware-*.hex` file for the latest version, which
contains the OBD-II firmware for each of the supported vehicle interfaces.

If you do not want the VI to translate the OBD-II messages for you and you want
to send your own requests, grab the `vi-obd2-firmware-*.hex` instead.

Next, look up the instructions for uploading the firmware to your vehicle
interface on the [supported VI hardware page](/vehicle-interface/hardware.html)
- it's different for each.
interface on the
[supported VI hardware page](/vehicle-interface/hardware.html) - it's different for each
type of VI.

## Ford

Expand Down
5 changes: 1 addition & 4 deletions overview/faq.mkd
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ first stop.
<p>If you wish to use Ford's expanded data set,
you will need to sign a developer agreement to get access to the <a
href="/hardware/vehicles.html">binary vehicle interface firmware</a>.
</p></dd>
</p>

<dt>Why not just use one of the many commercial OBD-II scanners instead of
OpenXC?</dt>
Expand Down Expand Up @@ -130,6 +130,3 @@ applications, it could be more vulnerable to reverse engineering. The strict
physical separation of translation from user code provides stronger assurance
that the message definitions will remain private, and the CAN bus will be
protected from malicious writes from bad applications.</dd>


</dl>
10 changes: 5 additions & 5 deletions privacy.mkd
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ terms of this privacy statement.
### 2. Information About Our Organization and Website:

This Privacy Statement applies to openxcplatform.com. openxcplatform.com is
owned by Ford Motor Company, Suite 225, 400 Hamilton Ave., Palo Alto, CA 94301.
owned by Ford Motor Company, 3200 Hillview Avenue, Palo Alto CA 94304.

The business purpose of this website is to provide developers reference
materials and documentation, and the ability to download source code and the
Expand Down Expand Up @@ -209,8 +209,8 @@ [email protected]
**Mailing Address:**

Ford Motor Company
400 Hamilton Ave, Suite 225
Palo Alto, CA 94301
3200 Hillview Avenue
Palo Alto CA 94304

so that we may be able to process your changes. openxcplatform.com will use
reasonable efforts to correct any factual inaccuracies in your information.
Expand Down Expand Up @@ -278,8 +278,8 @@ [email protected]
**Mailing Address**
<address>
Ford Motor Company
400 Hamilton Ave, Suite 225
Palo Alto, CA 94301
3200 Hillview Avenue
Palo Alto CA 94304
</address>

openxcplatform.com is committed to working with consumers to obtain a fair and
Expand Down
10 changes: 5 additions & 5 deletions python/getting-started.mkd
Original file line number Diff line number Diff line change
Expand Up @@ -27,21 +27,21 @@ can use a laptop to test.

1. [Install the OpenXC Python
library](http://python.openxcplatform.com/#installation) - don't forget the
[USB backend](http://python.openxcplatform.com/en/latest/#usb) if you want to
[USB backend](http://python.openxcplatform.com/en/latest/installation.html#usb-backend) if you want to
connect to the VI via USB and not Bluetooth.
1. Attach the programmed VI to your computer with a USB cable, or pair with it
2. Attach the programmed VI to your computer with a USB cable, or pair with it
via Bluetooth and open a serial terminal (the Bluetooth pairing process
depends on your platform, so we leave that as an exercise for the user). On
Windows, install the driver from the [vi-firmware
repository](https://github.com/openxc/vi-windows-driver).
1. Run `openxc-control version` from the command line - it should print out the
3. Run `openxc-control version` from the command line - it should print out the
current version of the attached vehicle interface. If you instead get an
error about not being able to find the USB device, make sure the VI has
power (look for an LED).
1. Did you get an error that there is `no backend available`? Go back to the
Python library docs and make sure you [installed a USB
backend](http://python.openxcplatform.com/#usb).
1. If the version check was successful, plug your VI into a running car and run
backend](http://python.openxcplatform.com/en/latest/installation.html#usb-backend).
4. If the version check was successful, plug your VI into a running car and run
`openxc-dump` to test that data can be streamed from the vehicle interface.
It should return a stream of live vehicle data, and `openxc-dashboard` will
show the vehicle parameters in a useful windowed display.
2 changes: 1 addition & 1 deletion python/utilities.mkd
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ $ openxc-dump
...

# Send an OBD-II diagnostic request
$ openxc-diag --message-id 0x7df --mode 0x3
$ openxc-diag --message 0x7df --mode 0x3
...
{% endhighlight %}

Expand Down
4 changes: 2 additions & 2 deletions vehicle-interface/concepts.mkd
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ title: Vehicle Interface Concepts - OpenXC
<h1>VI Concepts</h1>
</div>

The <a href="/vehicle-interface/index.html">**vehicle interface (VI)**</a> is a
The <a href="/vehicle-interface/index.html">vehicle interface (VI)</a> is a
device that plugs into the OBD-II port (and thus to the CAN bus), reads and
translates OBD-II requests and CAN messages into a [standard cross-vehicle
format](https://github.com/openxc/openxc-message-format). The translated
Expand All @@ -24,7 +24,7 @@ or smartphone.
</div>
</div>

The <a href="/host-devices/index.html">**host device**</a> connects to the
The <a href="/host-devices/index.html">host device</a> connects to the
vehicle interface and reads the translated vehicle data (e.g. an Android tablet
or Python environment on a laptop). OpenXC developers can write applications on
this device using the data.
Expand Down
53 changes: 39 additions & 14 deletions vehicle-interface/firmware.mkd
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,36 @@ title: VI Firmware - OpenXC
<h1>Vehicle Interface Firmware</h1>
</div>

Before you can use a vehicle interface (VI), it has to be programmed with a
firmware that understands data sent by your car. You have a few options:
Before you can use a vehicle interface (VI), it <strong>must be programmed</strong>
with a firmware that understands the data sent by your car. All of the below are
available from the [vi-firmware releases page](https://github.com/openxc/vi-firmware/releases)
or can be built on your own by following the
[build configurations](http://vi-firmware.openxcplatform.com/en/master/compile/example-builds.html#default-build).

The following are the standard build configurations:

**Default**

Named "vi-<i>default</i>-firmware-PLATFORM-version.hex" in releases.

These are built with the default compile options. It likely will not get
data from your vehicle, but are used for some testing. It is a good check
of your build environment.

**On-board Diagnostics (OBD-II) Data from CAN**

To read *standard OBD-II diagnostics data from a CAN bus*, use the open source
OBD-II OpenXC firmware. You can download the latest compiled version of that
firmware from the [vi-firmware releases
page](https://github.com/openxc/vi-firmware/releases){:target="_blank"}. The OBD-II build will
output a [subset of OBD-II
data](https://github.com/openxc/vi-firmware/blob/next/src/obd2.cpp#L41){:target="_blank"} that
Named "vi-<i>obd2</i>-firmware-PLATFORM-version.hex" in releases.

This firmware is ready to received OBD2 requests over USB or Bluetooth (see the
[message format](https://github.com/openxc/openxc-message-format/blob/master/JSON.mkd#diagnostic-message))
but does *not* have any pre-defined recurring requests. You probably want
this build if you are sending your own, custom diagnostic requests.

**Translated OBD-II data from CAN**

Named "vi-<i>translated-obd2</i>-firmware-PLATFORM-version.hex" in releases.

The OBD-II build will output a [subset of OBD-II data](https://github.com/openxc/vi-firmware/blob/master/src/obd2.cpp#L39) that
your car supports over USB and Bluetooth just like normal OpenXC data. Note that
it's not much data - most likely only RPM, vehicle speed and intake manifold
pressure. Your car must also support OBD-II via CAN, which is only required
Expand All @@ -26,27 +45,33 @@ your congressman if you want more!

**Emulated Data**

Named "vi-<i>emulator</i>-firmware-PLATFORM-version.hex" in releases.

If you don't have access to a car and you want to verify the connection to the
VI from your host device (or it's winter in Michigan and you'd just rather stay
inside), you can use a simple emulator firmware. The emulator firmware will be a part of the firmware zip file that you will find on the [vi-firmware release
page](https://github.com/openxc/vi-firmware/releases){:target="_blank"}. It generates
inside), you can use a simple emulator firmware. It generates
fake vehicle data and continuously sends it over USB and Bluetooth as if it were
live data. It's completely random data, so don't try and build an app against
it.
it. Also, the VI will NOT go to sleep with this firmware so don't leave it
plugged into your vehicle, unless you want to drain the battery.

**Expanded Proprietary Data**

Available via download from [https://developer.ford.com](https://developer.ford.com),
these provide vehicle specific CAN data.

To read expanded data from a particular car, look for firmware distributed as
pre-compiled binaries by your car's manufacturer. Check the [list of supported
vehicles](/hardware/vehicles.html) for your car's make and model and for links
to download the firmware.

**Flash the Firmware**

If you have a Ford Reference VI, then follow these [instructions](http://vi.openxcplatform.com/firmware/programming/usb.html) to upload the firmware. For other versions of VIs, look up the instructions for uploading the
If you have a Ford Reference VI, then follow these
[instructions](http://vi.openxcplatform.com/firmware/programming/usb.html)
to upload the firmware. For other versions of VIs, look up the instructions for uploading the
firmware to your VI on the [supported VI hardware
page](/vehicle-interface/hardware.html)
- it's different for each.
page](/vehicle-interface/hardware.html) - it's different for each.


<div class="page-header">
Expand Down
13 changes: 11 additions & 2 deletions vehicle-interface/hardware.mkd
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ automakers expose other buses on additional, non-standard pin pairs. For this
documentation, we'll use this nomenclature:

<div class="well">
<table>
<table cellpadding="5">
<thead>
<tr><th>OBD-II Pin Pair</th><th>OpenXC Bus Name</th><th>Other common name</th></tr>
</thead>
Expand All @@ -39,10 +39,13 @@ documentation, we'll use this nomenclature:
<td>Ford secondary, Chrysler CCD</td>
</tr>
<tr>
<td>1 (+) and 8 (-)</td>
<td>1 (+) and 8/9 (-)*</td>
<td>CAN2-2</td>
<td>Ford: infotainment, GM: J2411</td>
</tr>
<tr>
<td colspan="3">* If available, Pin 8 on Ford B, C platforms and Pin 9 on Ford D platforms. This is typically not available. </td>
</tr>
</tbody>
</table>
</div>
Expand All @@ -56,6 +59,12 @@ vehicle manufacturer.

<h2 class="anchored" id="obtaining-a-vehicle-interface"><a href="#obtaining-a-vehicle-interface">Obtaining a Vehicle Interface</a></h2>

<div class="alert alert-danger">
<strong>Note:</strong> Unless you have a specific need for Cellular (C5 Cellular), iOS (C5 BLE), or SD Card logging (C5 BT, C5 Cellular)
it is recommended that you use the <a href="#ford-reference-design"><strong>Ford Reference VI</strong></a>. It is most reliable platform.
The C5 devices are available to provide the specific new functionality.
</div>

There are two ways you can obtain a vehicle interface.

* Purchase a Pre-Made VI: The <a href="#ford-reference-design">Ford Reference VI</a>
Expand Down

0 comments on commit c4b6368

Please sign in to comment.