Skip to content
This repository was archived by the owner on Dec 24, 2021. It is now read-only.

Commit 4be17c0

Browse files
authored
Merge pull request #17 from jomjol/rolling
Update latest to v5.3.0
2 parents 0c5d320 + 234f41f commit 4be17c0

28 files changed

+129
-18
lines changed

Config_Description.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ Here a consistency check of the readout value with respect to the previous full
3030
| Parameter | Meaning | Example |
3131
| ------------- | ------------- | ------------- |
3232
| Enabled | Diable or Enable the Check | `Enabled=True` |
33+
| ReadPreValueFromFileAtStartup | Diable or Enable the Reading of the prevalue from file at Startup | `ReadPreValueFromFileAtStartup=True` |
34+
| ReadPreValueFromFileMaxAge | Maximum timedifference between last storage of prevalue in file and start in minutes | `ReadPreValueFromFileMaxAge=30` |
3335
| AllowNegativeRates | If set to `False`, then only increasing counter values are accepted | `AllowNegativeRates=False` |
3436
| MaxRateValue | Maximum absolute change from the previous value (+/-) | `MaxRateValue=0.1` |
3537
| ErrorReturn | Return value, in case of unconsistent values | `ErrorReturn=OldValue, ErrorMessage, Readout` |

README.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ This is available for an Intel based System (e.g. Synology Docker) as well as an
1515
| -------------- | ------------- | ------------- |
1616
| rolling | Experimental version for amd64-systems (e.g. Intel processors) | newest features, not fully tested |
1717
| raspi-rolling | Experimental version for armv7-systems (Raspberry PI3 and higher) | newest features, not fully tested |
18-
| latest | Latest stable version for amd64-systems (e.g. Intel processors) | Currently identical to v5.0.0 (2019-12-28) |
19-
| raspi-latest | Latest stable version for armv7-systems (Raspberry PI3 and higher) | Currently identical to v5.0.0 (2019-12-28) |
18+
| latest | Latest stable version for amd64-systems (e.g. Intel processors) | Currently identical to v5.3.0 (2020-01-12) |
19+
| raspi-latest | Latest stable version for armv7-systems (Raspberry PI3 and higher) | Currently identical to v5.3.0 (2020-01-12) |
2020
| v4.x | Update to Tensorflow 2.0, fully automated build | Details see below |
2121
| v3.x | Tensorflow 1.4, manual build | Details see below |
2222

@@ -36,6 +36,13 @@ Choose for the fitting docker tag and run the server with the following paramete
3636
The config and the log directory can be empty at the very first start. They will be loaded with a default configuratio, that can be modified afterwards.
3737

3838
## Changelog - lastest version
39+
##### 5.3.0 (2019-01-08)
40+
* Integration of storage of prevalue in file to reload on startup
41+
* Correction of drawing analog counter ROIs even if they are disabled
42+
##### 5.2.0 (2019-01-03)
43+
* Raspberry Version: Remove autorestart (not working) - instead: use cron job for regular restart to handle tensorflow memory leak [Setting up cron job](https://github.com/jomjol/water-meter-system-complete/blob/raspi-rolling/Raspi-Cron-Job.md)
44+
##### 5.1.0 (2019-12-28)
45+
* Raspberry Version: Autorestart on Python Crash of wasserzaehler.py
3946
##### 5.0.0 (2019-12-28)
4047
* Separate environmental setup to dedicated Docker images (for Raspberry: raspi-opencv-tensorflow and for Synology (Intel w/o AVX2): synology-opencv-tensorflow)
4148

Raspi-Cron-Job.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Setup of Cron job on Raspberry
2+
3+
In the current version of Tensorflow (2.0) is a memory leakage in the function tf.predict(). This causes especially on the Raspberry the docker container to crash after some time.
4+
A work around for this is a regular restart of the container. The idea is from the user pfried from the iobroker forum - Many thanks to this!
5+
6+
## Implementation
7+
The restart is done using within a cron job. To make this easier it is recommendet to give your docker container a dedicated name at start (```--name wasser```):
8+
9+
```docker run -d --name wasser -p 3000:3000 --mount type=bind,source=/PATH_TO_LOCAL_CONFIG, target=/config --mount type=bind,source=/PATH_TO_LOCAL_LOG,target=/log jomjol/wasserzaehler:raspi-latest```
10+
11+
After this you can easily restart it with a given frequency using a cron job in the file '''/etc/crontab''':
12+
13+
```0 */6 * * * root /usr/bin/docker restart wasser```
14+
15+
In this example the container will be restartet every 6 hours on the full hour.
16+
17+
Explanation for cron jobs on Raspberry Pi can be found [here](http://raspberry.tips/raspberrypi-einsteiger/cronjob-auf-dem-raspberry-pi-einrichten)
18+

code/Dockerfile_raspi

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,8 @@ RUN [ "cross-build-start" ]
55
WORKDIR /
66

77
COPY . ./
8-
#RUN pip3 install --no-cache-dir ./wheels_raspi/opencv_contrib_python-4.1.1.26-cp37-cp37m-linux_armv7l.whl
98
RUN pip3 install --no-cache-dir -r requirements_raspi.txt
109

11-
1210
RUN [ "cross-build-end" ]
1311

1412
EXPOSE 3000

code/config/config.ini

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,15 @@ URLImageSource=http://192.168.178.22/capture_with_flashlight
88

99
[ConsistencyCheck]
1010
Enabled=True
11+
12+
ReadPreValueFromFileAtStartup=True
13+
#Maximum Time spanning since last startup for use of preValue from Filestorage in minutes
14+
ReadPreValueFromFileMaxAge=30
15+
#Stores the last Value in a file for the case of a restart (e.g. Docker container after update)
16+
1117
AllowNegativeRates=False
1218
#Maximum Change of new to old value (+ or -)
1319
MaxRateValue=0.1
14-
1520
#Return in Case of Error: Value = OldValue or NewValue
1621
# ErrorMessage = Return Text with problem (seperated by Tabstopp) if nothing, then no error message
1722
# Readout = Real Readout without corrections (NewValue)

code/config/prevalue.ini

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[PreValue]
2+
time = 2000-01-01_00-00-00
3+
LastVorkomma = 00000
4+
LastNachkomma = 0000

code/config_default/config.ini

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,14 @@ URLImageSource=http://192.168.178.22/capture_with_flashlight
88

99
[ConsistencyCheck]
1010
Enabled=True
11+
ReadPreValueFromFileAtStartup=True
12+
#Maximum Time spanning since last startup for use of preValue from Filestorage in minutes
13+
ReadPreValueFromFileMaxAge=30
14+
1115
AllowNegativeRates=False
16+
#Stores the last Value in a file for the case of a restart (e.g. Docker container after update)
1217
#Maximum Change of new to old value (+ or -)
1318
MaxRateValue=0.1
14-
1519
#Return in Case of Error: Value = OldValue or NewValue
1620
# ErrorMessage = Return Text with problem (seperated by Tabstopp) if nothing, then no error message
1721
# Readout = Real Readout without corrections (NewValue)

code/config_default/prevalue.ini

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[PreValue]
2+
time = 2000-01-01_00-00-00
3+
LastVorkomma = 00000
4+
LastNachkomma = 0000

code/image_tmp/alg.jpg

1.09 KB
Loading

code/image_tmp/org.jpg

608 Bytes
Loading

0 commit comments

Comments
 (0)