Skip to content

Commit baee238

Browse files
committed
Remove legacy test code, add a licence and a readme file.
1 parent f7aaedc commit baee238

8 files changed

+95
-105
lines changed

Diff for: LICENCE

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
Copyright 2020 Erwan Martin
2+
3+
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
4+
5+
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
6+
7+
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
8+
9+
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
10+
11+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Diff for: Makefile

-3
This file was deleted.

Diff for: README.md

+84
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
# IZAR I R4 PRIOS meter collector
2+
3+
![izar_rc_i_r4](doc/IZAR_RC_I_R4.jpg "A IZAR counter") ![STEVAL-FKI868V2](doc/steval-fki868v2.jpg "STEVAL-FKI868V2")
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+
Erwan Martin <[email protected]>
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.

Diff for: doc/212612-FR-EN-IZAR-RC-i-R4.pdf

280 KB
Binary file not shown.

Diff for: doc/IZAR_RC_I_R4.jpg

37 KB
Loading

Diff for: doc/steval-fki868v2.jpg

60.1 KB
Loading

Diff for: doc/steval-fki868v2.pdf

7.21 MB
Binary file not shown.

Diff for: tests.c

-102
This file was deleted.

0 commit comments

Comments
 (0)