Firmware

Rebuilding the firmware for the openaltimeter is really easy. On this page you'll learn how to set up the Arduino development environment and how to hack the firmware code. If you don't believe me when I say it's easy then check out the following video where I customise the firmware in minutes.

Getting set up

You need to do two things before you can start hacking the firmware: connect to the openaltimeter with the serial dongle, and install/setup the arduino enviroment.

Follow the procedure on the instructions page to connect the serial dongle. The same dongle is used for both downloading the data and updating the firmware.

You can download the Arduino environment from here. Currently the OA firmware needs an old version of the Arduino software to build - version 22 is best. Grab that and unzip it somewhere convenient. Make sure that the openaltimeter is connected to the serial dongle and powered before you start the Arduino environment. There are a couple of settings that you'll need to get right in the Arduino software in order to work with the openaltimeter. First, you'll need to set the board type. Do this under the "Tools:Board" menu. Openaltimeter has been designed to be compatible with the "Arduino Pro or Pro Mini (3.3V, 8MHz) w/ ATmega328" setting. Second, you need to select the correct serial port in the "Tools:Serial Port" menu. Choose the port number that corresponds to your serial dongle (this should appear when you first plug the dongle in). If you don't know the number it does no harm to try all the alternatives and see which one works.

Getting the latest code

The firmware source code can be downloaded from the download page. Unless you have a good reason not to, you should grab the latest version of the firmware code. Unzip the code somewhere convenient and open the file "Firmware.pde" from within the Arduino enviroment.

If you want to work on the bleeding-edge then the source code can also be obtained direct from the Mercurial repository at https://bitbucket.org/JonyEpsilon/openaltimeter-firmware. Note though, that the latest version in the repository is often a work-in-progress and may not always work as expected. The source code for the downloader is also available at https://bitbucket.org/JonyEpsilon/openaltimeter-downloader.

Anyone can clone the source code repositories, and make their own customised fork. These repositories can be found at https://bitbucket.org/JonyEpsilon/openaltimeter-downloader/descendants and https://bitbucket.org/JonyEpsilon/openaltimeter-firmware/descendants. A number of people have reported that the SmallJoeMan fork of the donwloader has some useful enhancements for power users.

Building and flashing the firmware

Now that you've done the hard work the rest is easy. Just press the "Upload" button in the Arduino environment. After a short delay while Arduino compiles the code it should print out a message and then the lights on the serial dongle should start flashing. When these lights stop flashing the firmware upload is complete. You can now click the "Serial Monitor" button to communicate with the board and make sure everything went well.

Configuring the firmware

After re-flashing the firmware you should always connect with the downloader app and run "Altimeter->Settings" to update the settings. You can leave most of them alone for now, but you should check the battery settings to make sure that you've selected the right battery chemistry. Without this, the low-voltage alarm will not work properly.

Tutorial

For a step-by-step walkthrough of implementing a new feature, check out the great post by Joe Smallman here.

Filing bugs, requesting features

If you find a bug in the firmware, or would like to see a feature added, then please file an issue here.