|
| 1 | +# IZAR I R4 PRIOS meter collector |
| 2 | + |
| 3 | +  |
| 4 | + |
| 5 | +## Introduction |
| 6 | + |
| 7 | +This project contains the implementation of a Wireless M-Bus (WMBus) collector for DIEHL IZAR I R4 smart meters, running |
| 8 | +on a ST-Micro [STEVAL-FKI868V2](https://www.st.com/en/evaluation-tools/steval-fki868v2.html) kit (a [NUCLEO-L053R8](https://www.st.com/content/st_com/en/products/evaluation-tools/product-evaluation-tools/mcu-mpu-eval-tools/stm32-mcu-mpu-eval-tools/stm32-nucleo-boards/nucleo-l053r8.html) board with a [S2-LP](https://www.st.com/content/st_com/en/products/wireless-transceivers-mcus-and-modules/sub-1ghz-rf/s2-lp.html) 868MHz transceiver). |
| 9 | + |
| 10 | +### Supported smart meters |
| 11 | + |
| 12 | +- DIEHL Metering (ex SAPPEL) IZAR 868 I R4 LIGHT |
| 13 | + |
| 14 | +Many more devices should be supported (probably most if not all DIEHL PRIOS smart water meters). |
| 15 | + |
| 16 | +Please report yours if you tested them. |
| 17 | + |
| 18 | +## Usage |
| 19 | + |
| 20 | +### General |
| 21 | + |
| 22 | +Build the application using your favorite IDE (an IAR/EWARM workspace is provided). |
| 23 | + |
| 24 | +Flash the firmware into the Cortex M0 microcontroller. |
| 25 | + |
| 26 | +Plug the board into a computer using a USB connector. |
| 27 | + |
| 28 | +Open the USB virtual COM port provided by the board, with speed 115200. |
| 29 | + |
| 30 | +The device outputs every smart meter readings in real time: |
| 31 | + |
| 32 | + # socat open:/dev/cuaU0,raw,echo=0,ispeed=115200,ospeed=115200 - |
| 33 | + 20d51a73,100750,99935 |
| 34 | + 20d52c1a,330604,329942 |
| 35 | + 20d53a72,65299,64680 |
| 36 | + 20d54c16,92546,92277 |
| 37 | + 20d55c1e,102543,101646 |
| 38 | + 20d56c1d,91966,90586 |
| 39 | + 20d577ca,80416,77826 |
| 40 | + |
| 41 | +The format is: `[device identifier],[current_reading],[last_month_reading]`, with both readings in cubic meters (m3). |
| 42 | + |
| 43 | +### Shell |
| 44 | + |
| 45 | +Logging the values for a specific meter in a file, prepending each line with the current timestamp can be done with some |
| 46 | +shell scripting: |
| 47 | + |
| 48 | + socat open:/dev/cuaU0,raw,echo=0,ispeed=115200,ospeed=115200 - | grep 20d78c1e | awk '{cmd="date +%s"; (cmd | getline date); close(cmd); print date "," $1}' >> /var/log/izar_local.log |
| 49 | + |
| 50 | +### Python |
| 51 | + |
| 52 | +Reading the values in Python is trivial as well: |
| 53 | + |
| 54 | +``` |
| 55 | +import serial |
| 56 | +with serial.Serial('/dev/cuaU0', 115200, timeout=60) as ser: |
| 57 | + while True: |
| 58 | + line = ser.readline() |
| 59 | + if not line: |
| 60 | + continue |
| 61 | + data = line.split(',') |
| 62 | + print('Meter {}: current={}m3, last_month={}m3'.format(data[0], float(data[1]) / 1000, float(data[2]) / 1000)) |
| 63 | +``` |
| 64 | + |
| 65 | +``` |
| 66 | +Meter 20d51c16: current=92.546m3, last_month=92.277m3 |
| 67 | +Meter 20d52c1d: current=91.966m3, last_month=90.586m3 |
| 68 | +Meter 20d53c1e: current=102.543m3, last_month=101.646m3 |
| 69 | +Meter 20d547c6: current=77.408m3, last_month=76.001m3 |
| 70 | +Meter 20d55a73: current=100.75m3, last_month=99.935m3 |
| 71 | +Meter 20d56c1c: current=301.664m3, last_month=300.839m3 |
| 72 | +``` |
| 73 | + |
| 74 | +## Authors |
| 75 | + |
| 76 | + |
| 77 | + |
| 78 | +The logic to decrypt and decode the PRIOS protocol is originally from Jacek Tomasiak. |
| 79 | + |
| 80 | +## Licence |
| 81 | + |
| 82 | +The application code is protected by licence [BSD-3-Clause](https://opensource.org/licenses/BSD-3-Clause). |
| 83 | + |
| 84 | +The project uses C libraries provided by STMicroelectronics, which are protected by their own licences. |
0 commit comments