node-red-contrib-ibeacon-kalman
Version:
Kalman filter for iBeacon RSSI distance estimation
87 lines (64 loc) • 2.28 kB
Markdown
# node-red-contrib-ibeacon-kalman
A Node-RED node for iBeacon distance estimation using Kalman filtering.
## Installation
```bash
npm install node-red-contrib-ibeacon-kalman
```
Or install via the Node-RED Palette Manager.
## Features
- Converts RSSI to distance using log-distance path loss model
- Implements Kalman filtering for smooth distance estimates
- Configurable parameters:
- TX Power (RSSI at 1m)
- Path loss exponent (n)
- Process noise
- Measurement noise
## Usage
1. Add the node to your flow
2. Configure the parameters:
- **TX Power**: RSSI value at 1 meter distance (typically -59 dBm)
- **Path Loss Exponent**: Environment factor (2.0 for free space)
- **Process Noise**: How quickly the filter adapts (default 0.1)
- **Measurement Noise**: RSSI measurement variance (default 1.0)
## Input
- `msg.payload`: RSSI value in dBm (number)
## Output
```javascript
{
rssi: -70, // Input RSSI value
rawDistance: 3.16, // Unfiltered distance estimate
filteredDistance: 2.87 // Kalman-filtered distance
}
```
## Dynamic TX Power Configuration
You can override the configured TX Power per-message:
```javascript
msg.txPower = -62; // dBm
```
When TX Power changes:
1. Kalman filter will automatically reset
2. New value will be used for distance calculation
3. Applied TX Power included in output message
## Dynamic Parameters
You can override these parameters per-message:
| Parameter | Type | Default | Description |
|--------------|--------|---------|----------------------------------|
| `txPower` | number | -59 | RSSI at 1m distance (dBm) |
| `nValue` | number | 2.0 | Path loss exponent (1.0-5.0) |
```javascript
// Пример динамического изменения
msg.txPower = -62; // Для конкретного маяка
msg.nValue = 2.3; // Для среды с препятствиями
```
When parameters change:
1. Kalman filter automatically resets
2. New values are used for calculations
3. All parameters included in output message
{
"payload": -65,
"txPower": -58,
"nValue": 3.0,
"topic": "beacon/kitchen"
}
## License
MIT