Skip to content

aschulm/battor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Table of Contents generated with DocToc

BattOr: Mobile device power monitor

Directory structure

  • sw - PC software for collecting power measurements from the BattOr
  • fw - Atmel XMega192A3 firmware for the BattOr hardware

Installation

Software

Dependencies

  • automake
  • autoconf
  • make

The software should build and run on most variants of Linux, Mac, as well as Windows (in Cygwin). The build and install instructions are as follows:

$ ./bootstrap
$ ./configure
$ make
$ sudo make install

To run BattOr without root on Linux you will need to add your user to the "dialout" group. You need to logout and login for these settings to take effect.

$ sudo usermod -a -G dialout <userName>

Firmware

Dependencies

The firmware currently only builds on Linux. The BattOr software must be in $PATH to flash the firmware.

$ make
$ make flash

Usage

Desktop operation mode

LED status codes:

  • Blinking YELLOW: Idle, waiting to start next trace.
  • Blinking RED: Recording trace.
  • Solid RED: Downloading trace.
  • Blinking GREEN: Streaming trace.

Usage

To stream samples from the BattOr over USB, run the following on the command line. You will need to specify the tty file for the BattOr (e.g., /dev/ttyUSB* for Linux /dev/cu.usbserial* for Mac and /dev/ttyS* for Cygwin). Likely you will want to redirect the output to a file.

$ battor -s <tty>

To start buffering power measurements, run the following on the command line. Once the BattOr has a blinking RED LED, it can be disconnected from USB so power can be measured while on the move.

$ battor -b <tty>

To end buffering and download the trace, run the following on the command line. Often you will want to redirect the output to a file. The BattOr will have a solid RED LED until the download is completed. Note that currently downloading buffered power measurements takes approximately 1/4 of time that the samples were buffered.

$ battor -d <tty>

Portable operation mode

LED status codes:

  • Solid GREEN: Portable mode enabled.
  • Blinking YELLOW: Idle, waiting to start next trace. Number of strobes indicates the next file number to write (e.g., two strobes indicates the next file is file #2).
  • Blinking RED Recording trace. Number of strobes indicates file currently being written.
  • Solid RED: Downloading trace.

To enter portable operation mode, hold the Rec button for 5 seconds. The green LED will stay on indicating that the BattOr is in portable mode. You can then tap the Rec button to start and stop recording traces. As described above, the strobes of the YELLOW LED indicates the number of the next file that will be written, and the strobes of the RED LED indicates the number of the file currently being written. When there are too many strobes for your keep a good count, you can reset to file #1 by holding the Rec button for 5 seconds.

To download a trace file, run the following on the command line and fill in the file number. The BattOr will have a solid RED LED until the download is completed.

$ battor -d <file number> <tty>

About

BattOr - Power monitor for smartphones and tablets

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published