Aller au contenu principal

config.txt Reference

The config.txt file is a plain-text configuration file stored on the FGA Logger SD card. It lets you apply sensor calibration parameters and adjust operating settings without reflashing firmware.

Configuration is loaded once at startup when you power on the device while holding the multifunction button.

remarque

config.txt configuration requires firmware v1.0.4 or later. Configurable output rate requires v1.0.5 or later.


File Location

Place config.txt in the root directory of the FAT32-formatted SD card.


File Format

  • One parameter per line
  • Format: PARAMETER=value
  • No spaces around the = sign
  • Lines beginning with # are treated as comments and ignored
  • Parameters are case-sensitive

Example:

# FGA Logger configuration
S1_X_OFFSET=128.5
S1_X_GAIN=1.0
S1_Y_OFFSET=-45.0
S1_Y_GAIN=1.0
S1_Z_OFFSET=0
S1_Z_GAIN=1.0

Parameter Reference

Sensor 1 Calibration

ParameterTypeDefaultDescription
S1_X_OFFSETfloat0X-axis offset correction for sensor 1 (nT)
S1_Y_OFFSETfloat0Y-axis offset correction for sensor 1 (nT)
S1_Z_OFFSETfloat0Z-axis offset correction for sensor 1 (nT)
S1_X_GAINfloat1.0X-axis gain multiplier for sensor 1
S1_Y_GAINfloat1.0Y-axis gain multiplier for sensor 1
S1_Z_GAINfloat1.0Z-axis gain multiplier for sensor 1

Sensor 2 Calibration

ParameterTypeDefaultDescription
S2_X_OFFSETfloat0X-axis offset correction for sensor 2 (nT)
S2_Y_OFFSETfloat0Y-axis offset correction for sensor 2 (nT)
S2_Z_OFFSETfloat0Z-axis offset correction for sensor 2 (nT)
S2_X_GAINfloat1.0X-axis gain multiplier for sensor 2
S2_Y_GAINfloat1.0Y-axis gain multiplier for sensor 2
S2_Z_GAINfloat1.0Z-axis gain multiplier for sensor 2

Sensor 2 parameters only apply when a second sensor is connected to the B2 input.


How Calibration Is Applied

The firmware applies calibration to each axis value using:

corrected = (raw_value - OFFSET) * GAIN

For example, for the X axis of sensor 1:

B1x_corrected = (B1x_raw - S1_X_OFFSET) * S1_X_GAIN

This applies before the value is written to CSV or streamed over serial.


Loading Configuration

  1. Write your config.txt to the root of the SD card
  2. Insert the SD card into the FGA Logger
  3. Hold the multifunction button and power the device ON
  4. The LEDs will light on/off in sequence to confirm the file was read
  5. Connect via USB serial to verify — the console will output the loaded parameter values:
Config: reading from SD card
config.txt found.

Input 1: Offset(x,y,z): 128.5, -45.0, 0.0
Gain(x,y,z): 1.00000000, 1.00000000, 1.00000000
astuce

Calibration parameters are stored permanently inside the logger. You do not need to keep config.txt on the SD card after loading — the values persist across power cycles and firmware updates.


Full Example config.txt

# FGA Logger configuration file
# Requires firmware v1.0.4 or later

# --- Sensor 1 calibration ---
S1_X_OFFSET=128.5
S1_X_GAIN=1.0
S1_Y_OFFSET=-45.0
S1_Y_GAIN=1.0
S1_Z_OFFSET=22.0
S1_Z_GAIN=1.0

# --- Sensor 2 calibration (if connected) ---
S2_X_OFFSET=40
S2_X_GAIN=1.0
S2_Y_OFFSET=50
S2_Y_GAIN=1.0
S2_Z_OFFSET=60
S2_Z_GAIN=1.0

Troubleshooting

Parameters not loading

  • Verify the file is named exactly config.txt (lowercase) in the root of the SD card
  • Ensure the SD card is FAT32-formatted
  • Confirm you are holding the multifunction button before powering on — releasing it too early will skip config loading
  • Check the serial console output to see which values were loaded

Unexpected measurement values after loading

  • Reset calibration by setting all OFFSETs to 0 and all GAINs to 1.0, reload the config
  • If the problem persists, re-flash the firmware and reload