Using remote via tcp

This commit is contained in:
Ard Kuijpers
2023-02-12 16:10:03 +01:00
parent 5a9d08a611
commit 53022aebb8
3 changed files with 37 additions and 19 deletions

View File

@@ -7,7 +7,7 @@ This bridigng component reads Dutch Smart Meter Requirements (DSMR) telegrams an
* [DSMR Parser](https://github.com/ndokter/dsmr_parser)
* [Homie4](https://github.com/mjcumming/homie4)
## Configuration
## Configuring the bridge
Create some environment variables (e.g. with a .env file) to specify the required settings:
@@ -18,10 +18,10 @@ DSMR_PORT=/dev/ttyUSB0
DSMR_PROTOCOL=V5
```
If you have forwared the raw serial signal through ser2net, you should use `DSMR_PORT=remote://<hostname>:<port>`, e.g.:
If you have forwared the raw serial signal through ser2net, you should use `DSMR_PORT=tcp://<hostname>:<port>`, e.g.:
```bash
DSMR_PORT=remote://forwarding-pi.local:3333
DSMR_PORT=tcp://forwarding-pi.local:3334
```
If you use credentials to access the MQTT broker, then alsp specify:
@@ -33,4 +33,22 @@ MQTT_PASSWORD=<mqtt-password>
Inspect the source [`app_settings.py`](app_settings.py) to find out about the other less frequently used settings.
## Configuring ser2net
On the forwarding computer (e.g a Raspberry Pi) you need to install ser2net:
```bash
sudo apt upgrade && sudo apt install ser2net
```
Then edit the configurion file `/etc/ser2net.yaml` and add
```yaml
connection: &Dsmr
accepter: tcp,3334
connector: serialdev,
/dev/ttyUSB0,
115200n81, local
```
![Works with Homie](https://homieiot.github.io/img/works-with-homie.png)