SMx00 Command Line Interface

The smx00-cli tool is provided with pyflind and may be used to control scalar magnetometers and record data. The source code may also be used as an example of how to create pyflind.smx00.SMx00 objects and use them.

Usage

See Device Communication for details on the device URI format.

usage: smx00-cli [-h] [-v] [-b {115200,230400,460800,921600,1843200}] [-i] [-f [FS]] [-r REGISTER] [-e ENABLE [ENABLE ...]]
                 [-d DISABLE [DISABLE ...]] [-a] [-s] [--reset_schedule] [--ls_registers] [--ls_streams] [--start] [--stop] [--record RECORD]
                 device [device ...]

FieldLine Industries SMx00 command line interface

positional arguments:
  device                Device URI: e.g. uart:/dev/ttyUSB0:921600 or tcp:HOST:PORT

options:
  -h, --help            show this help message and exit
  -v, --verbose         Enable DEBUG logging (default: False)
  -b {115200,230400,460800,921600,1843200}, --baud {115200,230400,460800,921600,1843200}
                        Change baud rate to this value after connecting to the device (default: None)
  -i, --ident           Identify the device (default: False)
  -f [FS], --fs [FS]    get/set the samplerate in Hz (default: None)
  -r REGISTER, --register REGISTER
                        Get/set a register, supply addr[:value] (default: None)
  -e ENABLE [ENABLE ...], --enable ENABLE [ENABLE ...]
                        Enable stream(s) (default: [])
  -d DISABLE [DISABLE ...], --disable DISABLE [DISABLE ...]
                        Disable stream(s) (default: [])
  -a, --active_streams  List active streams (default: False)
  -s, --stream_sync     Perform stream sync (default: False)
  --reset_schedule      Reset the streaming schedule (default: False)
  --ls_registers        List available device registers (default: False)
  --ls_streams          List available device streams (default: False)
  --start               Start the sensor (default: False)
  --stop                Stop the sensor (default: False)
  --record RECORD       Record active streams to specified csv file (only supports single device) (default: None)

Example Session

Identify a device:

user@host:~ $ smx00-cli uart:/dev/ttyUSB0 -i
[2025-12-18 12:15:24.476|INFO|FliDevice[uart:/dev/ttyUSB0]] stream added: n
[2025-12-18 12:15:24.476|INFO|FliDevice[uart:/dev/ttyUSB0]] stream added: rtt
[2025-12-18 12:15:24.476|INFO|FliDevice[uart:/dev/ttyUSB0]] stream added: rx_t
[2025-12-18 12:15:24.638|INFO|smx00-cli] Connected to device SM300[JP3FYD]
[2025-12-18 12:15:24.638|INFO|smx00-cli] Identity:
[2025-12-18 12:15:24.679|INFO|smx00-cli]   model: SM300
[2025-12-18 12:15:24.679|INFO|smx00-cli]   fw_version: v2.0.0
[2025-12-18 12:15:24.679|INFO|smx00-cli]   sensor_serial: JP3FYD
[2025-12-18 12:15:24.679|INFO|smx00-cli]   electronics_serial: 0xdf0000008cd2a13b

Change the baudrate:

user@host:~ $ smx00-cli uart:/dev/ttyUSB0 -b 1843200
[2025-12-18 12:15:41.995|INFO|FliDevice[uart:/dev/ttyUSB0]] stream added: n
[2025-12-18 12:15:41.995|INFO|FliDevice[uart:/dev/ttyUSB0]] stream added: rtt
[2025-12-18 12:15:41.995|INFO|FliDevice[uart:/dev/ttyUSB0]] stream added: rx_t
[2025-12-18 12:15:42.158|INFO|smx00-cli] Connected to device SM300[JP3FYD]
[2025-12-18 12:15:42.168|INFO|smx00-cli] set baud rate to 1843200

List available data streams (using new baudrate):

user@host:~ $ smx00-cli uart:/dev/ttyUSB0:1843200 --ls_streams
[2025-12-18 12:16:20.330|INFO|FliDevice[uart:/dev/ttyUSB0:1843200]] stream added: rtt
[2025-12-18 12:16:20.330|INFO|FliDevice[uart:/dev/ttyUSB0:1843200]] stream added: rx_t
[2025-12-18 12:16:20.330|INFO|FliDevice[uart:/dev/ttyUSB0:1843200]] stream added: n
[2025-12-18 12:16:20.493|INFO|smx00-cli] Connected to device SM300[JP3FYD]
[2025-12-18 12:16:20.493|INFO|smx00-cli] SM300StreamMap: {
    6 (0x06): fw_version
    7 (0x07): sensor_serial_lo
    8 (0x08): sensor_serial_hi
   13 (0x0d): electronics_rev
   18 (0x12): larmor_freq
   23 (0x17): mag
   35 (0x23): logic_module_state
   53 (0x35): electronics_2_serial_lo
   54 (0x36): electronics_2_serial_hi
   55 (0x37): electronics_serial_lo
   56 (0x38): electronics_serial_hi
   61 (0x3d): pps_clock_count
   67 (0x43): pps_raw_output
   68 (0x44): pps_raw_input
}

Enable some streams:

user@host:~ $ smx00-cli uart:/dev/ttyUSB0:1843200 -e larmor_freq pps_clock_count
[2025-12-18 12:16:49.297|INFO|FliDevice[uart:/dev/ttyUSB0:1843200]] stream added: rx_t
[2025-12-18 12:16:49.297|INFO|FliDevice[uart:/dev/ttyUSB0:1843200]] stream added: rtt
[2025-12-18 12:16:49.297|INFO|FliDevice[uart:/dev/ttyUSB0:1843200]] stream added: n
[2025-12-18 12:16:49.460|INFO|smx00-cli] Connected to device SM300[JP3FYD]
[2025-12-18 12:16:49.481|INFO|SM300[JP3FYD]] stream added: larmor_freq
[2025-12-18 12:16:49.501|INFO|SM300[JP3FYD]] stream added: pps_clock_count

Get the current samplerate:

user@host:~ $ smx00-cli uart:/dev/ttyUSB0:1843200 -f
[2025-12-18 12:16:54.759|INFO|FliDevice[uart:/dev/ttyUSB0:1843200]] stream added: larmor_freq
[2025-12-18 12:16:54.759|INFO|FliDevice[uart:/dev/ttyUSB0:1843200]] stream added: n
[2025-12-18 12:16:54.759|INFO|FliDevice[uart:/dev/ttyUSB0:1843200]] stream added: rtt
[2025-12-18 12:16:54.759|INFO|FliDevice[uart:/dev/ttyUSB0:1843200]] stream added: rx_t
[2025-12-18 12:16:54.759|INFO|FliDevice[uart:/dev/ttyUSB0:1843200]] stream added: pps_clock_count
[2025-12-18 12:16:54.931|INFO|smx00-cli] Connected to device SM300[JP3FYD]
[2025-12-18 12:16:54.932|INFO|smx00-cli] samplerate: 1000.0 Hz

Change the samplerate:

user@host:~ $ smx00-cli uart:/dev/ttyUSB0:1843200 -f 2500
[2025-12-18 12:16:58.329|INFO|FliDevice[uart:/dev/ttyUSB0:1843200]] stream added: larmor_freq
[2025-12-18 12:16:58.329|INFO|FliDevice[uart:/dev/ttyUSB0:1843200]] stream added: rx_t
[2025-12-18 12:16:58.329|INFO|FliDevice[uart:/dev/ttyUSB0:1843200]] stream added: n
[2025-12-18 12:16:58.329|INFO|FliDevice[uart:/dev/ttyUSB0:1843200]] stream added: rtt
[2025-12-18 12:16:58.329|INFO|FliDevice[uart:/dev/ttyUSB0:1843200]] stream added: pps_clock_count
[2025-12-18 12:16:58.501|INFO|smx00-cli] Connected to device SM300[JP3FYD]
[2025-12-18 12:16:59.336|INFO|SM300[JP3FYD]] streams synced
[2025-12-18 12:16:59.337|INFO|smx00-cli] samplerate: 2500.0 Hz

Perform a stream sync (must be done at least once per power cycle before starting the sensor):

user@host:~ $ smx00-cli uart:/dev/ttyUSB0:1843200 -s
[2025-12-18 15:58:43.322|INFO|FliDevice[uart:/dev/ttyUSB0:1843200]] stream added: 18
[2025-12-18 15:58:43.322|INFO|FliDevice[uart:/dev/ttyUSB0:1843200]] stream added: n
[2025-12-18 15:58:43.322|INFO|FliDevice[uart:/dev/ttyUSB0:1843200]] stream added: rtt
[2025-12-18 15:58:43.322|INFO|FliDevice[uart:/dev/ttyUSB0:1843200]] stream added: rx_t
[2025-12-18 15:58:43.322|INFO|FliDevice[uart:/dev/ttyUSB0:1843200]] stream added: pps_clock_count
[2025-12-18 15:58:43.505|INFO|smx00-cli] Connected to device SM300[JP3FYD]
[2025-12-18 15:58:44.343|INFO|SM300[JP3FYD]] streams synced

Start the sensor:

user@host:~ $ smx00-cli uart:/dev/ttyUSB0:1843200 --start
[2025-12-18 12:17:07.173|INFO|FliDevice[uart:/dev/ttyUSB0:1843200]] stream added: rx_t
[2025-12-18 12:17:07.173|INFO|FliDevice[uart:/dev/ttyUSB0:1843200]] stream added: larmor_freq
[2025-12-18 12:17:07.173|INFO|FliDevice[uart:/dev/ttyUSB0:1843200]] stream added: n
[2025-12-18 12:17:07.173|INFO|FliDevice[uart:/dev/ttyUSB0:1843200]] stream added: rtt
[2025-12-18 12:17:07.173|INFO|FliDevice[uart:/dev/ttyUSB0:1843200]] stream added: pps_clock_count
[2025-12-18 12:17:07.359|INFO|smx00-cli] Connected to device SM300[JP3FYD]
[2025-12-18 12:17:07.359|INFO|SM300[JP3FYD]] starting sensor

Access device registers:

user@host:~ $ smx00-cli uart:/dev/ttyUSB0:1843200 --ls_registers
[2025-12-18 16:16:09.810|INFO|FliDevice[uart:/dev/ttyUSB0:1843200]] stream added: larmor_freq
[2025-12-18 16:16:09.810|INFO|FliDevice[uart:/dev/ttyUSB0:1843200]] stream added: rx_t
[2025-12-18 16:16:09.810|INFO|FliDevice[uart:/dev/ttyUSB0:1843200]] stream added: rtt
[2025-12-18 16:16:09.811|INFO|FliDevice[uart:/dev/ttyUSB0:1843200]] stream added: n
[2025-12-18 16:16:09.811|INFO|FliDevice[uart:/dev/ttyUSB0:1843200]] stream added: pps_clock_count
[2025-12-18 16:16:09.983|INFO|smx00-cli] Connected to device SM300[JP3FYD]
[2025-12-18 16:16:09.983|INFO|smx00-cli] SM300RegisterMap: {
    0 (0x00): csr
    2 (0x02): pcb_id
    3 (0x03): read_reg
    4 (0x04): scratch
   23 (0x17): schedule_freq
   67 (0x43): checksum_and_state_mon
   68 (0x44): uart_rate
   77 (0x4d): logic_module_ctrl
  101 (0x65): autogain_enable
  110 (0x6e): led_ctrl
  124 (0x7c): sensor_serial_0
  125 (0x7d): sensor_serial_1
  126 (0x7e): sensor_serial_2
  127 (0x7f): sensor_serial_3
  128 (0x80): fw_version_lo
  129 (0x81): fw_version_hi
  130 (0x82): electronics_serial_0
  131 (0x83): electronics_serial_1
  132 (0x84): electronics_serial_2
  133 (0x85): electronics_serial_3
}
user@host:~ $ smx00-cli uart:/dev/ttyUSB0:1843200 -r scratch
[2025-12-18 16:16:15.488|INFO|FliDevice[uart:/dev/ttyUSB0:1843200]] stream added: rtt
[2025-12-18 16:16:15.488|INFO|FliDevice[uart:/dev/ttyUSB0:1843200]] stream added: larmor_freq
[2025-12-18 16:16:15.488|INFO|FliDevice[uart:/dev/ttyUSB0:1843200]] stream added: n
[2025-12-18 16:16:15.488|INFO|FliDevice[uart:/dev/ttyUSB0:1843200]] stream added: rx_t
[2025-12-18 16:16:15.488|INFO|FliDevice[uart:/dev/ttyUSB0:1843200]] stream added: pps_clock_count
[2025-12-18 16:16:15.661|INFO|smx00-cli] Connected to device SM300[JP3FYD]
[2025-12-18 16:16:15.682|INFO|smx00-cli] scratch = 0x0
user@host:~ $ smx00-cli uart:/dev/ttyUSB0:1843200 -r scratch:0xdeaf
[2025-12-18 16:16:21.919|INFO|FliDevice[uart:/dev/ttyUSB0:1843200]] stream added: larmor_freq
[2025-12-18 16:16:21.919|INFO|FliDevice[uart:/dev/ttyUSB0:1843200]] stream added: rtt
[2025-12-18 16:16:21.919|INFO|FliDevice[uart:/dev/ttyUSB0:1843200]] stream added: n
[2025-12-18 16:16:21.919|INFO|FliDevice[uart:/dev/ttyUSB0:1843200]] stream added: pps_clock_count
[2025-12-18 16:16:21.920|INFO|FliDevice[uart:/dev/ttyUSB0:1843200]] stream added: rx_t
[2025-12-18 16:16:22.092|INFO|smx00-cli] Connected to device SM300[JP3FYD]
[2025-12-18 16:16:22.113|INFO|smx00-cli] scratch = 0xdeaf

Record active streams to a CSV file:

user@host:~ $ smx00-cli uart:/dev/ttyUSB0:1843200 --record smx00_ex.csv
[2025-12-18 12:17:45.464|INFO|FliDevice[uart:/dev/ttyUSB0:1843200]] stream added: rx_t
[2025-12-18 12:17:45.464|INFO|FliDevice[uart:/dev/ttyUSB0:1843200]] stream added: 18
[2025-12-18 12:17:45.464|INFO|FliDevice[uart:/dev/ttyUSB0:1843200]] stream added: 61
[2025-12-18 12:17:45.464|INFO|FliDevice[uart:/dev/ttyUSB0:1843200]] stream added: rtt
[2025-12-18 12:17:45.464|INFO|FliDevice[uart:/dev/ttyUSB0:1843200]] stream added: n
[2025-12-18 12:17:45.648|INFO|smx00-cli] Connected to device SM300[JP3FYD]
[2025-12-18 12:17:45.648|INFO|smx00-cli] recording to smx00_ex.csv until interrupted...
^CSignal received: 2
[2025-12-18 12:18:02.010|INFO|smx00-cli] recorded 41320 samples
user@host:~ $ head smx00_ex.csv
rx_t,larmor_freq,pps_clock_count,rtt,n
1766085465.463916,339568419,931969323,0,0
1766085465.474021,339571642,931969323,0,1
1766085465.474021,339572930,931969323,0,2
1766085465.474021,339570224,931969323,0,3
1766085465.474021,339568231,931969323,0,4
1766085465.474021,339570722,931969323,0,5
1766085465.474021,339578429,931969323,0,6
1766085465.474021,339586803,931969323,0,7
1766085465.474021,339599675,931969323,0,8

Stop the sensor:

user@host:~ $ smx00-cli uart:/dev/ttyUSB0:1843200 --stop
[2025-12-18 12:28:47.808|INFO|FliDevice[uart:/dev/ttyUSB0:1843200]] stream added: rtt
[2025-12-18 12:28:47.808|INFO|FliDevice[uart:/dev/ttyUSB0:1843200]] stream added: larmor_freq
[2025-12-18 12:28:47.808|INFO|FliDevice[uart:/dev/ttyUSB0:1843200]] stream added: rx_t
[2025-12-18 12:28:47.809|INFO|FliDevice[uart:/dev/ttyUSB0:1843200]] stream added: n
[2025-12-18 12:28:47.809|INFO|FliDevice[uart:/dev/ttyUSB0:1843200]] stream added: pps_clock_count
[2025-12-18 12:28:47.984|INFO|smx00-cli] Connected to device SM300[JP3FYD]
[2025-12-18 12:28:47.984|INFO|SM300[JP3FYD]] sensor stopped