Skip to content
rustychris edited this page Mar 12, 2015 · 2 revisions

Commands are all one line, and either single words or key=value. Keys never have a space, but values can have a space in some cases (like setting the clock). There is a help command which gives a one-line summary of the available commands. There is no support for backspace, you just have to hit return and try again.

On startup, if there is a file named "STARTUP.CMD" in the root directory of the SD card it will be read and interpreted as if the commands were typed directly in the serial terminal (OSX users: be aware that OSX often hides filename extensions. A file may appear in the Finder as STARTUP.CMD, but in fact be named STARTUP.CMD.txt, which will not be found by the logger). The simplest config file is one line:

sample

which would enter directly into sampling mode, writing out to the next available data file in sequence. A good starting point for a real config file is:

log_to_serial=0
log_imu=1
sample_monitor=1
sample_interval_us=2000
beep_interval_ms=5000
bluetooth_mode=2
sample

These settings reflect the defaults, so this is functionally equivalent to just having the last sample line. Interpretation of each setting:

  1. log_to_serial=0

    data will be written to the SD card (there is an option to stream raw data to the serial terminal for bench testing and compass calibration)

  2. log_imu=1

    Enable recording data from the IMU, which includes accelerometer, gyro and magnetometer readings. This makes data files 10 times larger, and the data is a pain to analyze, so if you don't anticipate using it change this to 0.

  3. serial_monitor=1

    Enables periodic messages printed to the serial terminal about sampling status. Mostly useful for checking to make sure it's getting reasonable readings. The messages are visible over bluetooth or the USB connection.

  4. sample_interval_us=2000

    The requested sample period in microseconds. "Requested" because the internal precision clock runs at 1024 Hz, and only integer divisors are supported. So 2000 would ostensibly mean 2ms, or 500Hz, but will instead end up being 512Hz. Use the info command to see what the actual sample rate will be (sample_rate_hz)

  5. beep_interval_ms=5000

    While sampling, it will beep this often, in this case every 5 seconds. Once it's inside the pressure case, the beeps are audible but not very loud. You'll probably have to hold your ear up to the case to hear it.

  6. bluetooth_mode=2

    There is a basic bluetooth serial interface. The bluetooth radio does draw some power, so if you don't need it this is best set to 0. A value of 1 will leave bluetooth on the whole time. A setting of 2 will enable bluetooth at startup and whenever activated by a magnet. In this configuration, the magnetometer senses when a magnet is brought nearby. A short, lower beep signifies that the magnet has been detected, after which the bluetooth radio is turned on for 60 seconds.

To exit sampling mode, hit escape or type !. Note that Arduino serial monitor can't send escape.

For programmatic access, all output lines during sample mode either start with '#' for text information, or '$' for hex-coded binary data. Sending a character other than escape or '!' will trigger a short response, but it will stay in sampling mode.

Clone this wiki locally