|
|
|
The [ESP32 Controller](TODO) acts as a gateway, integrating ESP32 #0, #1 and #2 (["ProprietaryLight0" through 2](TODO)) into the BaSyx environment.
|
|
|
|
|
|
|
|
Each one of these ESP32 is connected to one Red/Green LED. The ESP32 Controller creates and uploads two AAS per ESP32, one for each light color. It also hosts the active Submodels used to talk to the ESP32 over the proprietary protocol outlined below. The implementation of the ESP32 Controller can be found [here](https://gitlab.hrz.tu-chemnitz.de/s6869070--tu-dresden.de/vws-spielwiese/-/blob/b1802bdd98650bdb666f03483f1e13c7f99bf4b8/basyx.lichterkette/src/main/java/de/olipar/basyx/lichterkette/ProprietaryLightstrand.java), the implementation of the Proprietary lights themself [here](https://gitlab.hrz.tu-chemnitz.de/s6869070--tu-dresden.de/vws-spielwiese/-/blob/b1802bdd98650bdb666f03483f1e13c7f99bf4b8/esp/ProprietaryLight/ProprietaryLight.ino).
|
|
|
|
Please also note the instructions on [how to setup a Proprietary light](Setting-up-an-ESP32).
|
|
|
|
|
|
|
|
## Network outline
|
|
|
|
|
|
|
|
*TODO*
|
|
|
|
|
|
|
|
The above graphic shows the components involved with the proprietary protocol. The [MQTT](https://mqtt.org/)-Broker is hosted on the ESP32 Controller inside a docker container, more specifically an instance of [Eclipse-mosquitto](https://hub.docker.com/_/eclipse-mosquitto). Alongside the MQTT-Broker are the three Red and Green light submodels, so six in total, doing the actual translation.
|
|
|
|
|
|
|
|
## The protocol
|
|
|
|
|
|
|
|
The Protocol defines two MQTT topics for each light:
|
|
|
|
```
|
|
|
|
proprietaryProtocol/<ID>/<COLOR>/on
|
|
|
|
```
|
|
|
|
and
|
|
|
|
```
|
|
|
|
proprietaryProtocol/<ID>/<COLOR>/off
|
|
|
|
```
|
|
|
|
A message to either of the topics (regardless of content) will either switch the light in question on or off. Ie. in order to switch the red LED on ProprietaryLight0 (ESP32 #0) on, one would need to send a message to
|
|
|
|
```
|
|
|
|
proprietaryProtocol/0/red/on
|
|
|
|
```
|
|
|
|
Per default configuration, valid values for `<ID>` are `0`, `1`, and `2`, valid values for `<COLOR>` are `red` and `green`. |