Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/AngelAmoSanchez/TFG-RaspberryPi-BLE/llms.txt

Use this file to discover all available pages before exploring further.

The settings routes expose the RSSI threshold configuration that determines how raw BLE signal strength values are classified into the three proximity zones: near, medium, and far. Thresholds are stored in the system_settings database table and can be updated at runtime without restarting the server. Proximity zones are defined as follows:
ZoneRSSI range
nearRSSI ≥ near_threshold
mediummedium_threshold ≤ RSSI < near_threshold
farRSSI < medium_threshold
The default values are near_threshold = -60 dBm and medium_threshold = -75 dBm.
Updating thresholds via PUT /thresholds triggers an immediate retroactive reclassification of all historical detection records in the database. On large datasets this operation may take several seconds.
All endpoints are mounted under /api/v1/settings.

GET /api/v1/settings/thresholds

Return the current RSSI threshold values and a human-readable description of each zone’s range. Response
near_threshold
number
RSSI cutoff (in dBm) above which a detection is classified as near. Example: -60.
medium_threshold
number
RSSI cutoff (in dBm) above which a detection is classified as medium (and below near_threshold). Example: -75.
description
object
Human-readable zone boundary strings.
curl "http://localhost:8000/api/v1/settings/thresholds"
{
  "near_threshold": -60,
  "medium_threshold": -75,
  "description": {
    "near": "RSSI ≥ -60 dBm",
    "medium": "-75 dBm ≤ RSSI < -60 dBm",
    "far": "RSSI < -75 dBm"
  }
}

PUT /api/v1/settings/thresholds

Update the RSSI zone thresholds. After saving the new values, the server immediately reclassifies all existing detection records and returns counts of how many records were moved to each zone. Request body
near_threshold
number
required
New RSSI cutoff for the near zone, in dBm. Must be in the range [-127, -1]. Must be strictly greater than medium_threshold.
medium_threshold
number
required
New RSSI cutoff for the medium zone, in dBm. Must be in the range [-127, -1]. Must be strictly less than near_threshold.
Both thresholds are required and must satisfy near_threshold > medium_threshold. Supplying equal values returns HTTP 400.
Response
message
string
Confirmation string, e.g. "Umbrales actualizados correctamente".
thresholds
object
The threshold values that were saved.
recalculated
object
Statistics from the retroactive reclassification pass.
curl -X PUT "http://localhost:8000/api/v1/settings/thresholds" \
  -H "Content-Type: application/json" \
  -d '{"near_threshold": -55, "medium_threshold": -70}'
{
  "message": "Umbrales actualizados correctamente",
  "thresholds": {
    "near_threshold": -55,
    "medium_threshold": -70
  },
  "recalculated": {
    "total_detections": 48230,
    "updated_to_near": 14500,
    "updated_to_medium": 18900,
    "updated_to_far": 14830
  }
}

POST /api/v1/settings/thresholds/reset

Reset both thresholds to the factory defaults: near_threshold = -60, medium_threshold = -75. This triggers the same retroactive reclassification as PUT /thresholds, but returns a simpler confirmation body without reclassification counts. Response
message
string
Confirmation string, e.g. "Umbrales reseteados a valores por defecto".
thresholds
object
The restored default values.
curl -X POST "http://localhost:8000/api/v1/settings/thresholds/reset"
{
  "message": "Umbrales reseteados a valores por defecto",
  "thresholds": {
    "near_threshold": -60,
    "medium_threshold": -75
  }
}

Build docs developers (and LLMs) love