Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
matthias-bs committed Apr 27, 2024
1 parent ac133e4 commit 74765c8
Showing 1 changed file with 42 additions and 38 deletions.
80 changes: 42 additions & 38 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,12 +103,36 @@ Meanwhile, refer to [BresserWeatherSensorTTN - README.md](https://github.com/mat

## Remote Configuration Commands / Status Requests via LoRaWAN

### Parameters

| Parameter | Description |
| --------------------- | --------------------------------------------------------------------------- |
| <ws_timeout> | Weather sensor receive timeout in seconds; 0...255 |
| <sleep_interval> | Sleep interval (regular) in seconds; 0...65535 |
| <sleep_interval_long> | Sleep interval (energy saving mode) in seconds; 0...65535 |
| \<epoch\> | Unix epoch time, see https://www.epochconverter.com/ ( \<integer\> / "0x....") |
| <reset_flags> | Raingauge reset flags; 0...15 (1: hourly / 2: daily / 4: weekly / 8: monthly) / "0x0"..."0xF" |
| <rtc_source> | Real time clock source; 0x00: GPS / 0x01: RTC / 0x02: LORA / 0x03: unsynched / 0x04: set (source unknown) |
| <sensors_incX> | Bresser sensor IDs include list; e.g. "0xDEADBEEF"; "0x00000000" => empty list => default values |
| <sensors_excX> | Bresser sensor IDs include list; e.g. "0xDEADBEEF"; "0x00000000" => empty list => default values |
| <ble_addrX> | BLE sensor MAC addresses; e.g. "DE:AD:BE:EF:12:23" |

> [!WARNING]
> Confirmed downlinks should not be used! (see [here](https://www.thethingsnetwork.org/forum/t/how-to-purge-a-scheduled-confirmed-downlink/56849/7) for an explanation.)
> [!IMPORTANT]
> To set sensors_inc / sensors_exc to the compile time default configuration, set the first ID in CMD_SET_SENSORS_INC / CMD_SET_SENSORS_EXC to 0x00000000.
> To set the BLE sensor addresses to the compile time default configuration, set the first address in CMD_SET_BLE_ADDR to 0x000000000000.
> [!NOTE]
> 'Default values'
### Using Raw Data

| Command | Port | Downlink | Uplink |
| ----------------------------- | ---------- | ------------------------------------------------------------------------- | -------------- |
| CMD_GET_DATETIME | 0x86 (134) | 0x00 | unixtime[31:24]<br>unixtime[23:16]<br>unixtime[15:8]<br>unixtime[7:0]<br>rtc_source[7:0] |
| CMD_SET_DATETIME | 0x88 (136) | unixtime[31:24]<br>unixtime[23:16]<br>unixtime[15:8] <br> unixtime[7:0] | n.a. |
| CMD_GET_DATETIME | 0x86 (134) | 0x00 | epoch[31:24]<br>epoch[23:16]<br>epoch[15:8]<br>epoch[7:0]<br>rtc_source[7:0] |
| CMD_SET_DATETIME | 0x88 (136) | epoch[31:24]<br>epoch[23:16]<br>epoch[15:8]<br>epoch[7:0] | n.a. |
| CMD_SET_SLEEP_INTERVAL | 0xA8 (168) | sleep_interval[15:8]<br>sleep_interval[7:0] | n.a. |
| CMD_SET_SLEEP_INTERVAL_LONG | 0xA9 (169) | sleep_interval_long[15:8]<br>sleep_interval_long[7:0] | n.a. |
| CMD_GET_LW_CONFIG | 0xB1 (177) | 0x00 | sleep_interval[15:8]<br>sleep_interval[7:0]<br>sleep_interval_long[15:8]<br>sleep_interval_long[7:0] |
Expand All @@ -124,40 +148,20 @@ Meanwhile, refer to [BresserWeatherSensorTTN - README.md](https://github.com/mat

### Using the Javascript Uplink/Downlink Formatters

| Command | Downlink | Uplink |
| ----------------------------- | ------------------------------------------------------------------------- | -------------- |
| CMD_GET_DATETIME | {"cmd": "CMD_GET_DATETIME"} | unixtime[31:24]<br>unixtime[23:16]<br>unixtime[15:8]<br>unixtime[7:0]<br>rtc_source[7:0] |
| CMD_SET_DATETIME | unixtime[31:24]<br>unixtime[23:16]<br>unixtime[15:8] <br> unixtime[7:0] | n.a. |
| CMD_SET_SLEEP_INTERVAL | sleep_interval[15:8]<br>sleep_interval[7:0] | n.a. |
| CMD_SET_SLEEP_INTERVAL_LONG | sleep_interval_long[15:8]<br>sleep_interval_long[7:0] | n.a. |
| CMD_GET_LW_CONFIG | {"cmd": "CMD_GET_LW_CONFIG"} | sleep_interval[15:8]<br>sleep_interval[7:0]<br>sleep_interval_long[15:8]<br>sleep_interval_long[7:0] |
| CMD_GET_WS_TIMEOUT | {"cmd": "CMD_GET_WS_TIMEOUT"} | ws_timeout[7:0] |
| CMD_SET_WS_TIMEOUT | ws_timeout[7:0] | n.a. |
| CMD_RESET_RAINGAUGE | flags[7:0] | n.a. |
| CMD_GET_SENSORS_INC | {"cmd": "CMD_GET_SENSORS_INC"} | sensors_inc0[31:24]<br>sensors_inc0[23:15]<br>sensors_inc0[16:8]<br>sensors_inc0[7:0]<br>... |
| CMD_SET_SENSORS_INC | sensors_inc0[31:24]<br>sensors_inc0[23:15]<br>sensors_inc0[16:8]<br>sensors_inc0[7:0]<br>... | n.a. |
| CMD_GET_SENSORS_EXC | {"cmd": "CMD_GET_SENSORS_EXC"} | sensors_exc0[31:24]<br>sensors_exc0[23:15]<br>sensors_exc0[16:8]<br>sensors_exc0[7:0]<br>... |
| CMD_SET_SENSORS_EXC | sensors_exc0[31:24]<br>sensors_exc0[23:15]<br>sensors_exc0[16:8]<br>sensors_exc0[7:0]<br>... | n.a. |
| CMD_GET_BLE_ADDR | {"cmd": "CMD_GET_BLE_ADDR"} | ble_addr0[47:40]<br>ble_addr0[39:32]<br>ble_addr0[31:24]<br>ble_addr0[23:15]<br>ble_addr0[16:8]<br>ble_addr0[7:0]<br>... |
| CMD_SET_BLE_ADDR | ble_addr0[47:40]<br>ble_addr0[39:32]<br>ble_addr0[31:24]<br>ble_addr0[23:15]<br>ble_addr0[16:8]<br>ble_addr0[7:0]<br>... | n.a. |
| Command | Downlink | Uplink |
| ----------------------------- | ------------------------------------------------------------------------- | ---------------------------- |
| CMD_GET_DATETIME | {"cmd": "CMD_GET_DATETIME"} | {"epoch": \<epoch\>} |
| CMD_SET_DATETIME | {"epoch": \<epoch\>} | n.a. |
| CMD_SET_SLEEP_INTERVAL | {"sleep_interval": <sleep_interval>" | n.a. |
| CMD_SET_SLEEP_INTERVAL_LONG | {"sleep_interval_long": <sleep_interval_long>} | n.a. |
| CMD_GET_LW_CONFIG | {"cmd": "CMD_GET_LW_CONFIG"} | {"sleep_interval": <sleep_interval>, "sleep_interval_long": <sleep_interval_longC>} |
| CMD_GET_WS_TIMEOUT | {"cmd": "CMD_GET_WS_TIMEOUT"} | {"ws_timeout": <ws_timeout>} |
| CMD_SET_WS_TIMEOUT | {"ws_timeout": <ws_timeout>} | n.a. |
| CMD_RESET_RAINGAUGE | {"reset_flags": <reset_flags>} | n.a. |
| CMD_GET_SENSORS_INC | {"cmd": "CMD_GET_SENSORS_INC"} | {"sensors_inc": [<sensors_inc0>, ..., <sensors_incN>]} |
| CMD_SET_SENSORS_INC | {"sensors_inc": [<sensors_inc0>, ..., <sensors_incN>]} | n.a. |
| CMD_GET_SENSORS_EXC | {"cmd": "CMD_GET_SENSORS_EXC"} | {"sensors_exc": [<sensors_exc0>, ..., <sensors_excN>]} |
| CMD_SET_SENSORS_EXC | {"sensors_exc": [<sensors_exc0>, ..., <sensors_excN>]} | n.a. |
| CMD_GET_BLE_ADDR | {"cmd": "CMD_GET_BLE_ADDR"} | {"ble_addr": [<ble_addr0>, ..., <ble_addrN>]} |
| CMD_SET_BLE_ADDR | {"ble_addr": [<ble_addr0>, ..., <ble_addrN>]} | n.a. |


| Parameter | Description |
| --------------------- | --------------------------------------------------------------------------- |
| <ws_timeout> | Weather sensor receive timeout in seconds; 0...255 |
| <sleep_interval> | Sleep interval (regular) in seconds; 0...65535 |
| <sleep_interval_long> | Sleep interval (energy saving mode) in seconds; 0...65535 |
| \<epoch\> | Unix epoch time, see https://www.epochconverter.com/ ( \<integer\> / "0x....") |
| <reset_flags> | Raingauge reset flags; 0...15 (1: hourly / 2: daily / 4: weekly / 8: monthly) / "0x0"..."0xF" |
| <rtc_source> | Real time clock source; 0x00: GPS / 0x01: RTC / 0x02: LORA / 0x03: unsynched / 0x04: set (source unknown) |
| <sensors_incN> | Bresser sensor IDs include list; e.g. "0xDEADBEEF"; may be empty; empty list => all IDs |
| <sensors_excN> | Bresser sensor IDs include list; e.g. "0xDEADBEEF"; may be empty |
| <ble_addrN> | BLE sensor MAC addresses; e.g. "DE:AD:BE:EF:12:23" |

> [!WARNING]
> Confirmed downlinks should not be used! (see [here](https://www.thethingsnetwork.org/forum/t/how-to-purge-a-scheduled-confirmed-downlink/56849/7) for an explanation.)

> [!IMPORTANT]
> To set sensors_inc / sensors_exc to the compile time default configuration, set the first ID in CMD_SET_SENSORS_INC / CMD_SET_SENSORS_EXC to 0x00000000.
> To set the BLE sensor addresses to the compile time default configuration, set the first address in CMD_SET_BLE_ADDR to 0x000000000000.

0 comments on commit 74765c8

Please sign in to comment.