feat: add config API endpoint and JSON schema draft

This commit is contained in:
2026-04-07 17:26:24 -04:00
parent 7005ae766d
commit a7ab6eaf7c
3 changed files with 438 additions and 113 deletions
+120
View File
@@ -0,0 +1,120 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://terra-mechanics.com/schemas/seismo-relay/device-config/v1",
"title": "MiniMate Plus Device Config",
"description": "Writable configuration fields for an Instantel MiniMate Plus seismograph, as exposed by the seismo-relay SFM API (POST /device/config). All fields are optional — only supplied fields are written; all others are round-tripped from the device.",
"type": "object",
"additionalProperties": false,
"properties": {
"sample_rate": {
"title": "Sample Rate",
"description": "ADC sample rate in samples per second. Must be one of the three supported rates.",
"type": "integer",
"enum": [1024, 2048, 4096],
"examples": [1024]
},
"record_time": {
"title": "Record Time",
"description": "Waveform record duration in seconds. Typical values are 1.015.0 s. The device stores this as a 32-bit IEEE 754 float.",
"type": "number",
"exclusiveMinimum": 0,
"maximum": 60.0,
"examples": [3.0]
},
"trigger_level_geo": {
"title": "Trigger Level (Geo)",
"description": "Geophone trigger threshold in in/s. Event recording begins when any geo channel exceeds this level.",
"type": "number",
"exclusiveMinimum": 0,
"examples": [0.5]
},
"alarm_level_geo": {
"title": "Alarm Level (Geo)",
"description": "Geophone alarm threshold in in/s. An alarm is flagged when any geo channel exceeds this level.",
"type": "number",
"exclusiveMinimum": 0,
"examples": [1.0]
},
"max_range_geo": {
"title": "Max Range (Geo)",
"description": "Full-scale calibration constant for geo channels in in/s. This is a factory-calibrated value — only modify if you have a calibration certificate. Default for MiniMate Plus is approximately 6.206 in/s.",
"type": "number",
"exclusiveMinimum": 0,
"examples": [6.206]
},
"project": {
"title": "Project",
"description": "Project name or description. Stored in the compliance config block and echoed on event reports. Max 41 ASCII characters.",
"type": "string",
"maxLength": 41,
"examples": ["Bridge Inspection 2026"]
},
"client_name": {
"title": "Client",
"description": "Client or company name. Max 41 ASCII characters.",
"type": "string",
"maxLength": 41,
"examples": ["City of Portland"]
},
"operator": {
"title": "Operator",
"description": "Operator or technician name. Stored as 'User Name:' in the device. Max 41 ASCII characters.",
"type": "string",
"maxLength": 41,
"examples": ["Brian Harrison"]
},
"seis_loc": {
"title": "Sensor Location",
"description": "Sensor location description. Stored as 'Seis Loc:' in the device. Max 41 ASCII characters.",
"type": "string",
"maxLength": 41,
"examples": ["South Abutment — 3 m from blast"]
},
"notes": {
"title": "Extended Notes",
"description": "Free-form notes. Stored as 'Extended Notes' in the device. Max 41 ASCII characters.",
"type": "string",
"maxLength": 41,
"examples": ["Pre-blast baseline, no charges"]
}
},
"examples": [
{
"project": "Bridge Inspection 2026",
"client_name": "City of Portland",
"operator": "Brian Harrison",
"seis_loc": "South Abutment",
"notes": "Pre-blast baseline"
},
{
"sample_rate": 1024,
"record_time": 3.0,
"trigger_level_geo": 0.5,
"alarm_level_geo": 1.0
},
{
"sample_rate": 2048,
"record_time": 5.0,
"trigger_level_geo": 0.25,
"alarm_level_geo": 0.75,
"project": "Quarry Blast Monitoring",
"client_name": "Acme Quarry LLC",
"operator": "Brian Harrison",
"seis_loc": "Nearest Structure — East Wall",
"notes": "Production blast series B"
}
]
}