|
|
A display and a script to show the data of the different sensors were already added as part of the first follow up. You can find the documentation here. Displaying the values was realized with a python script and a system service and no Basyx implementation existed for the LCD. Therefore, it was not possible to show a custom text. The display now is fully integrated into the Basyx environment and has its own AAS with invokable operations to do so.
|
|
|
A display and a script to show the data of the different sensors were already added as part of the first follow up. You can find the documentation [here](follow-up/Display). Displaying the values was realized with a python script and a system service and no Basyx implementation existed for the LCD. Therefore, it was not possible to show a custom text. The display now is fully integrated into the Basyx environment and has its own AAS with invokable operations to do so.
|
|
|
|
|
|
## Setup
|
|
|
|
... | ... | @@ -14,7 +14,7 @@ While the Basyx part is written in Java, python scripts are used to access the L |
|
|
|
|
|
### IDisplay
|
|
|
|
|
|
The file can be found here. The interface includes these methods:
|
|
|
The file can be found [here](https://gitlab.hrz.tu-chemnitz.de/vws-demo/vws-spielwiese/-/blob/rfidReader/basyx.lichterkette/src/main/java/de/olipar/basyx/lichterkette/IDisplay.java). The interface includes these methods:
|
|
|
|
|
|
| Method | Purpose |
|
|
|
|-----|-----------|
|
... | ... | @@ -23,7 +23,7 @@ The file can be found here. The interface includes these methods: |
|
|
|
|
|
### LcdDisplay
|
|
|
|
|
|
The file can be found here. The class implements the interface `IDisplay`.
|
|
|
The file can be found [here](https://gitlab.hrz.tu-chemnitz.de/vws-demo/vws-spielwiese/-/blob/rfidReader/basyx.lichterkette/src/main/java/de/olipar/basyx/lichterkette/LcdDisplay.java). The class implements the interface `IDisplay`.
|
|
|
|
|
|
```java
|
|
|
@Override
|
... | ... | @@ -77,7 +77,7 @@ This method enables to publish MQTT messages. A MQTT client is initialized and t |
|
|
|
|
|
### LcdDisplayController
|
|
|
|
|
|
The file can be found here.
|
|
|
The file can be found [here](https://gitlab.hrz.tu-chemnitz.de/vws-demo/vws-spielwiese/-/blob/rfidReader/basyx.lichterkette/src/main/java/de/olipar/basyx/lichterkette/LcdDisplayController.java).
|
|
|
|
|
|
```java
|
|
|
public static void main(String[] args) {
|
... | ... | @@ -97,7 +97,7 @@ The amount of displays which need to be created is retrieved from the environmen |
|
|
|
|
|
### DisplaySubmodelProvider
|
|
|
|
|
|
The file can be found here. Like in the other submodel provider in the project a method for creating a submodel is defined and the operations are added.
|
|
|
The file can be found [here](https://gitlab.hrz.tu-chemnitz.de/vws-demo/vws-spielwiese/-/blob/rfidReader/basyx.lichterkette/src/main/java/de/olipar/basyx/lichterkette/DisplaySubmodelProvider.java). Like in the other submodel provider in the project a method for creating a submodel is defined and the operations are added.
|
|
|
|
|
|
```java
|
|
|
Function<Object[], Object> cycleFunction = (args) -> display.cycleSensorValues();
|
... | ... | @@ -138,7 +138,7 @@ Because the `hostUploadAndRegister()` method is almost the same for all submodel |
|
|
|
|
|
### mqtt_handler.py
|
|
|
|
|
|
In this script, a paho MQTT client is implemented. Depending on the received message a corresponding python script for displaying something is started.
|
|
|
In [this script](https://gitlab.hrz.tu-chemnitz.de/vws-demo/vws-spielwiese/-/blob/rfidReader/basyx.lichterkette/resources/sensors/mqtt_handler_lcd.py), a paho MQTT client is implemented. Depending on the received message a corresponding python script for displaying something is started.
|
|
|
|
|
|
```python
|
|
|
brokerAddress = environ.get('MQTTBROKERHOST')
|
... | ... | @@ -208,7 +208,7 @@ A MQTT client is initialized and the previous functions are assigned as on_conne |
|
|
|
|
|
### display_text_lcd.py
|
|
|
|
|
|
The script can be found here. After setting all the pins and the settings for the LCD, text an be displayed.
|
|
|
The script can be found [here](https://gitlab.hrz.tu-chemnitz.de/vws-demo/vws-spielwiese/-/blob/rfidReader/basyx.lichterkette/resources/sensors/display_text_lcd.py). After setting all the pins and the settings for the LCD, text an be displayed.
|
|
|
|
|
|
```python
|
|
|
lines = sys.argv[1].split(',')
|
... | ... | @@ -262,4 +262,3 @@ The json body should look like this: |
|
|
```
|
|
|
|
|
|
The second value parameter should contain the text to display. To show multiple lines of text, separate the parts by commas. |
|
|
|