fetcher 0.0.0
A command line utility for reading sensor data over I2C and providing it over stdout.
fetcher

A process for fetching data from sensors using the I2C protocol.

Usage

See the help documentation with the command: use fetcher.

The output of fetcher looks like:

Time: 1295 ms
Temperature: 25.02 C
Pressure: 99.94 kPa
...

Sensor data output can either be printed in plain-text, or it can be read from the named message queue fetcher/sensors.

Messages on the message queue start with a one-byte type specifier which is one of the following:

typedef enum {
TAG_TIME = 3,
SensorTag
Definition: sensor_api.h:44
@ TAG_TEMPERATURE
Definition: sensor_api.h:45
@ TAG_LINEAR_ACCEL_REL
Definition: sensor_api.h:52
@ TAG_ALTITUDE_SEA
Definition: sensor_api.h:49
@ TAG_LINEAR_ACCEL_ABS
Definition: sensor_api.h:53
@ TAG_TIME
Definition: sensor_api.h:48
@ TAG_ANGULAR_VEL
Definition: sensor_api.h:51
@ TAG_ALTITUDE_REL
Definition: sensor_api.h:50
@ TAG_PRESSURE
Definition: sensor_api.h:46
@ TAG_HUMIDITY
Definition: sensor_api.h:47

Followed by data representing the measurement.

Temperature, pressure, humidity and altitude are floats. Time is a 32 bit integer. Linear acceleration and angular velocity are 3D vectors (vec3d_t) of 3 floats.

Board ID EEPROM Encoding

In order for fetcher to recognize the sensors on the board, the EEPROM must encode the ID in this format:

CU InSpace <board name>
REV <x>: <manufacture date>
<sensor 1 id> <address>
<sensor 2 id> <address> <address2>

Fields:

  • <board name>: The name of the board. Ex: Sensor board
  • REV <x>: The revision of the board. Ex: REV B
  • <sensor id>: The identifier of the sensor. Ex: MS5611
  • <address>: The 7 bit I2C address of the sensor in hexadecimal (without the leading 0x). Ex: 77
    • It is possible to have more than one address per sensor type for boards with duplicates