Skip to content

Commit

Permalink
CHESTER & CLOUD: Update CHESTER Control
Browse files Browse the repository at this point in the history
Signed-off-by: hubmartin <[email protected]>
  • Loading branch information
hubmartin committed Jan 22, 2024
1 parent ac02094 commit d1af6de
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 15 deletions.
43 changes: 29 additions & 14 deletions chester/catalog-applications/chester-control.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,28 +18,23 @@ Some of the basics are not provided, as they are common for all **CHESTER** cata

**CHESTER Control** is based on [**CHESTER Input**](chester-input.md), but adds dynamic input type reconfiguration and remote control functionality of 4 transistor outputs.

Because CHESTER Control uses [**CHESTER-X0**](../extension-modules/chester-x0.md) input/output module, it is possible to change input behaviour just by the configuration. This way you can assign any of four inputs one of the functionality:
Because **CHESTER Control** uses [**CHESTER-X0**](../extension-modules/chester-x0.md) input/output module, it is possible to change input behavior just by the configuration. This way you can assign any of four inputs to one of the functionalities:

- trigger (button, door contact)
- counter (count events, energy meters with S0 output)
- voltage (measure 0-28 V)
- current (measure 4-20mA current loop)

## Output Control
This device only supports the newer **LTEv2** stack and **HARDWARIO Cloud v2**.

Please see the Cloud documentation, specifically [Downlink data](../../cloud/cloud-v2/downlink#data) and [API examples](../../cloud/cloud-v2/downlink#api-examples).
## Terminal Blocks

You control outputs by sending this JSON to the cloud API endpoint (`https://api.prod.hardwario.cloud/v2/messages`) or in the HARDWARIO Cloud by going to the device's messages and clicking on "Create new downlink message"
| CHESTER-X0 in left slot A- signals A1 - A8 | CHESTER-X4 in right slot B - signals B1 - B8 |
| ------------------------------------------- | -------------------------------------------------------------------------------------------- |
| Use inputs **CH1** to **CH4** and **GND** | Use **VIN** and **GND** to supply external power. |
| | Use **CH1** to **CH4** outputs, which supply voltage from **VIN** when the output is enabled |
| ![](../extension-modules/tb-chester-x0.png) | ![](../extension-modules/tb-chester-x4.png) |

```
{
"output_1_state": 0,
"output_2_state": 0,
"output_3_state": 0,
"output_4_state": 0
}
```
Device is polling the Cloud in an interval set by `interval-poll` parameter and if new downlink control message is in the Cloud queue, it is send to the device and output or multiple outputs are changed.


## Default Configuration
Expand Down Expand Up @@ -84,7 +79,7 @@ To apply a new configuration, you need to call `config save`, which applies the

:::

Commands are explained in [**CHESTER Input**](chester-input.md#specific-commands) article.
Commands are explained in the [**CHESTER Input**](chester-input.md#specific-commands) article.

**CHESTER Control** adds these commands to configure the function of each of the four inputs:

Expand All @@ -95,6 +90,26 @@ app config channel-mode-3 voltage
app config channel-mode-4 current
```

## Output Control

Please see the Cloud documentation, specifically [Downlink data](../../cloud/cloud-v2/downlink) and [API examples](../../cloud/cloud-v2/downlink#api-examples).

You control outputs by sending this JSON to the cloud API endpoint (`https://api.prod.hardwario.cloud/v2/messages`) or in the HARDWARIO Cloud by going to the device's messages and clicking on "Create new downlink message"

```
{
"output_1_state": 1,
"output_2_state": 1,
"output_3_state": 0,
"output_4_state": 0
}
```

The JSON doesn't have to contain the output state of all four outputs. You send only `output_X_state` for outputs to be changed.

The device is polling the Cloud in an interval set by `interval-poll` parameter and if a new downlink control message is in the Cloud queue, it is sent to the device and output or multiple outputs are changed.


## Example JSON Message

```json
Expand Down
6 changes: 5 additions & 1 deletion cloud/cloud-v2/downlink.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ In the web interface or over API you can send downlink messages:

- Data
- Config
- Commands (in the future)
- Shell Commands (in the future)

If you would like to send config or data from the web interface. Go to the device messages, in the top right corner click on **Create new downlink message**.

## Data

Expand All @@ -24,6 +26,8 @@ You can configure the device the same way as you configure it over BLE or J-Link

## API Examples

You can send downlink commands and configuration also over API. Please create an API key first in the HARDWARIO Cloud **Keys** section.

### Data

```bash
Expand Down

0 comments on commit d1af6de

Please sign in to comment.