Skip to content

Commit 1e09bfb

Browse files
authored
Merge pull request #216 from jomjol/rolling
Update to v7.0.0
2 parents c2d1bbb + 91fa1c0 commit 1e09bfb

27 files changed

+312
-119
lines changed

Changelog.md

Lines changed: 79 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,83 @@
11
# Versions
22

3+
4+
5+
##### 6.7.2 Image Processing in Memory - (2021-05-01)
6+
7+
* NEW 6.7.2: Updated html for setup modus - remove reboot on edit configuration)
8+
9+
* NEW 6.7.1: Improved stability of camera (back to v6.6.1) - remove black strips and areas
10+
11+
* Upgrade digital CNN to v8.3.0 (added new type of digits)
12+
13+
* Internal update: TFlite (v2.5), esp32cam, startup sequence
14+
15+
* Rollback to espressif v2.1.0, as v3.2.0 shows unstable reboot
16+
17+
* Bugfix: WLan-passwords, reset of hostname
18+
19+
20+
##### 6.6.1 Image Processing in Memory - (2021-04-05)
21+
22+
* NEW 6.6.1: failed SD card initialization indicated by fast blinking LED at startup
23+
* Improved SD-card handling (increase compatibility with more type of cards)
24+
25+
##### 6.5.0 Image Processing in Memory - (2021-03-25)
26+
27+
* Upgrade digital CNN to v8.2.0 (added new type of digits)
28+
* Supporting alignment structures in ROI definition
29+
* Bug fixing: definition of hostname in `config.ini`
30+
31+
##### 6.4.0 Image Processing in Memory - (2021-03-20)
32+
33+
* Additional alignment marks for settings the ROIs (analog and digit)
34+
* Upgrade analog CNN to v7.0.0 (added new type of pointer)
35+
36+
##### 6.3.1 Image Processing in Memory - (2021-03-16)
37+
38+
* NEW: 6.3.1: bug fixing in initial edit reference image and `config.ini` (Spelling error in `InitialRotate`)
39+
* Initial setup mode: bug fixing, error correction
40+
* Bug-fixing
41+
42+
##### 6.2.2 Image Processing in Memory - (2021-03-10)
43+
44+
* NEW 6.2.2: bug fixing
45+
* NEW 6.2.1: Changed brightness and contrast to default if not enabled (resolves to bright images)
46+
* Determination of fixed illumination settings during startup - speed up of 5s in each run
47+
* Update digital CNN to v8.1.1 (additional digital images trained)
48+
* Extended error message in MQTT error message
49+
50+
51+
* Image brightness is now adjustable
52+
53+
54+
* Bug fixing: minor topics
55+
56+
57+
##### 6.1.0 Image Processing in Memory - (2021-01-20)
58+
59+
* Disabling of analog / digital counters in configuration
60+
* Improved Alignment Algorithm (`AlignmentAlgo` = `Default`, `Accurate` , `Fast`)
61+
* Analog counters: `ExtendedResolution` (last digit is extended by sub comma value of CNN)
62+
* `config.ini`: additional parameter `hostname` (additional to wlan.ini)
63+
* Switching of GPIO12/13 via http-interface: `/GPIO?GPIO=12&Status=high/low`
64+
* Bug fixing: html configuration page, wlan password ("=" now possible)
65+
66+
##### 6.0.0 Image Processing in Memory - (2021-01-02)
67+
68+
* **Major change**: image processing fully in memory - no need of SD card buffer anymore
69+
70+
* Need to limit camera resolution to VGA (due to memory limits)
71+
* MQTT: Last Will Testament (LWT) implemented: "connection lost" in case of connection lost to `TopicError`
72+
* Disabled `CheckDigitIncreaseConsistency` in default configuration - must now be explicit enabled if needed
73+
* Update digital CNN to v7.2.1 (additional digital images trained)
74+
* Setting of arbitrary time server in `config.ini`
75+
* Option for fixed IP-, DNS-Settings in `wlan.ini`
76+
* Increased stability (internal image and camera handling)
77+
* Bug fixing: edit digits, handling PreValue, html-bugs
78+
79+
80+
381
##### 5.0.0 Setup Modus - (2020-12-06)
482

583
* Implementation of initial setup modus for fresh installation
@@ -127,4 +205,4 @@
127205

128206
##### 0.1.0 (2020-08-07)
129207

130-
* Initial Version
208+
* Initial Version

README.md

Lines changed: 7 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -45,82 +45,16 @@ In other cases you can contact the developer via email: <img src="https://raw.gi
4545

4646

4747

48-
##### 6.7.2 Image Processing in Memory - (2021-01-05)
48+
##### 7.0.0 MQTT-Update - (2021-05-08)
4949

50-
* NEW 6.7.2: Updated html for setup modus - remove reboot on edit configuration)
50+
* Upgrade digital CNN to v8.5.0 (added new images)
51+
* New MQTT topics: flow rate (units/minute), time stamp (last correct read readout)
5152

52-
* NEW 6.7.1: Improved stability of camera (back to v6.6.1) - remove black strips and areas
53+
* Update MQTT/Error topic to " " in case no error (instead of empty string)
5354

54-
* Upgrade digital CNN to v8.3.0 (added new type of digits)
55+
* Portrait or landscape image orientation in rotated image (avoid cropping)
5556

56-
* Internal update: TFlite (v2.5), esp32cam, startup sequence
57-
58-
* Rollback to espressif v2.1.0, as v3.2.0 shows unstable reboot
59-
60-
* Bugfix: WLan-passwords, reset of hostname
61-
62-
63-
64-
##### 6.6.1 Image Processing in Memory - (2021-04-05)
65-
66-
* NEW 6.6.1: failed SD card initialization indicated by fast blinking LED at startup
67-
* Improved SD-card handling (increase compatibility with more type of cards)
68-
69-
##### 6.5.0 Image Processing in Memory - (2021-03-25)
70-
71-
* Upgrade digital CNN to v8.2.0 (added new type of digits)
72-
* Supporting alignment structures in ROI definition
73-
* Bug fixing: definition of hostname in `config.ini`
74-
75-
##### 6.4.0 Image Processing in Memory - (2021-03-20)
76-
77-
* Additional alignment marks for settings the ROIs (analog and digit)
78-
* Upgrade analog CNN to v7.0.0 (added new type of pointer)
79-
80-
##### 6.3.1 Image Processing in Memory - (2021-03-16)
81-
82-
* NEW: 6.3.1: bug fixing in initial edit reference image and `config.ini` (Spelling error in `InitialRotate`)
83-
* Initial setup mode: bug fixing, error correction
84-
* Bug-fixing
85-
86-
##### 6.2.2 Image Processing in Memory - (2021-03-10)
87-
88-
* NEW 6.2.2: bug fixing
89-
* NEW 6.2.1: Changed brightness and contrast to default if not enabled (resolves to bright images)
90-
* Determination of fixed illumination settings during startup - speed up of 5s in each run
91-
* Update digital CNN to v8.1.1 (additional digital images trained)
92-
* Extended error message in MQTT error message
93-
94-
95-
* Image brightness is now adjustable
96-
97-
98-
* Bug fixing: minor topics
99-
100-
101-
##### 6.1.0 Image Processing in Memory - (2021-01-20)
102-
103-
* Disabling of analog / digital counters in configuration
104-
* Improved Alignment Algorithm (`AlignmentAlgo` = `Default`, `Accurate` , `Fast`)
105-
* Analog counters: `ExtendedResolution` (last digit is extended by sub comma value of CNN)
106-
* `config.ini`: additional parameter `hostname` (additional to wlan.ini)
107-
* Switching of GPIO12/13 via http-interface: `/GPIO?GPIO=12&Status=high/low`
108-
* Bug fixing: html configuration page, wlan password ("=" now possible)
109-
110-
##### 6.0.0 Image Processing in Memory - (2021-01-02)
111-
112-
* **Major change**: image processing fully in memory - no need of SD card buffer anymore
11357

114-
* Need to limit camera resolution to VGA (due to memory limits)
115-
* MQTT: Last Will Testament (LWT) implemented: "connection lost" in case of connection lost to `TopicError`
116-
* Disabled `CheckDigitIncreaseConsistency` in default configuration - must now be explicit enabled if needed
117-
* Update digital CNN to v7.2.1 (additional digital images trained)
118-
* Setting of arbitrary time server in `config.ini`
119-
* Option for fixed IP-, DNS-Settings in `wlan.ini`
120-
* Increased stability (internal image and camera handling)
121-
* Bug fixing: edit digits, handling PreValue, html-bugs
122-
123-
12458

12559

12660
## Additional ideas
@@ -133,6 +67,8 @@ There are some ideas and feature request, which are not followed currently - mai
13367

13468
## History
13569

70+
##### 6.7.2 Image Processing in Memory - (2021-05-01)
71+
13672
##### 5.0.0 Setup Modus - (2020-12-06)
13773

13874
##### 4.1.1 Configuration editor - (2020-12-02)

code/components/jomjol_flowcontroll/ClassFlowAlignment.cpp

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ void ClassFlowAlignment::SetInitialParameter(void)
1919
initalrotate = 0;
2020
anz_ref = 0;
2121
initialmirror = false;
22+
initialflip = false;
2223
SaveAllFiles = false;
2324
namerawimage = "/sdcard/img_tmp/raw.jpg";
2425
FileStoreRefAlignment = "/sdcard/config/align.txt";
@@ -72,6 +73,11 @@ bool ClassFlowAlignment::ReadParameter(FILE* pfile, string& aktparamgraph)
7273
while (this->getNextLine(pfile, &aktparamgraph) && !this->isNewParagraph(aktparamgraph))
7374
{
7475
zerlegt = ZerlegeZeile(aktparamgraph);
76+
if ((toUpper(zerlegt[0]) == "FLIPIMAGESIZE") && (zerlegt.size() > 1))
77+
{
78+
if (toUpper(zerlegt[1]) == "TRUE")
79+
initialflip = true;
80+
}
7581
if ((toUpper(zerlegt[0]) == "INITIALMIRROR") && (zerlegt.size() > 1))
7682
{
7783
if (toUpper(zerlegt[1]) == "TRUE")
@@ -153,15 +159,21 @@ bool ClassFlowAlignment::doFlow(string time)
153159
delete AlignAndCutImage;
154160
AlignAndCutImage = new CAlignAndCutImage(ImageBasis, ImageTMP);
155161

156-
CRotateImage rt(AlignAndCutImage, ImageTMP);
162+
CRotateImage rt(AlignAndCutImage, ImageTMP, initialflip);
163+
if (initialflip)
164+
{
165+
int _zw = ImageBasis->height;
166+
ImageBasis->height = ImageBasis->width;
167+
ImageBasis->width = _zw;
168+
}
157169

158170
if (initialmirror){
159171
printf("do mirror\n");
160172
rt.Mirror();
161173
if (SaveAllFiles) AlignAndCutImage->SaveToFile(FormatFileName("/sdcard/img_tmp/mirror.jpg"));
162174
}
163175

164-
if (initalrotate != 0)
176+
if ((initalrotate != 0) || initialflip)
165177
{
166178
rt.Rotate(initalrotate);
167179
if (SaveAllFiles) AlignAndCutImage->SaveToFile(FormatFileName("/sdcard/img_tmp/rot.jpg"));
@@ -176,6 +188,12 @@ bool ClassFlowAlignment::doFlow(string time)
176188

177189
if (SaveAllFiles)
178190
{
191+
if (initialflip)
192+
{
193+
int _zw = ImageTMP->width;
194+
ImageTMP->width = ImageTMP->height;
195+
ImageTMP->height = _zw;
196+
}
179197
DrawRef(ImageTMP);
180198
ImageTMP->SaveToFile(FormatFileName("/sdcard/img_tmp/alg_roi.jpg"));
181199
}
@@ -209,7 +227,7 @@ void ClassFlowAlignment::SaveReferenceAlignmentValues()
209227
time(&rawtime);
210228
timeinfo = localtime(&rawtime);
211229

212-
strftime(buffer, 80, "%Y-%m-%d_%H-%M-%S", timeinfo);
230+
strftime(buffer, 80, "%Y-%m-%dT%H:%M:%S", timeinfo);
213231
zwtime = std::string(buffer);
214232
}
215233

code/components/jomjol_flowcontroll/ClassFlowAlignment.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ class ClassFlowAlignment :
1515
protected:
1616
float initalrotate;
1717
bool initialmirror;
18+
bool initialflip;
1819
RefInfo References[2];
1920
int anz_ref;
2021
string namerawimage;

code/components/jomjol_flowcontroll/ClassFlowMQTT.cpp

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ void ClassFlowMQTT::SetInitialParameter(void)
1111
uri = "";
1212
topic = "";
1313
topicError = "";
14+
topicRate = "";
15+
topicTimeStamp = "";
1416
clientname = "watermeter";
1517
OldValue = "";
1618
flowpostprocessing = NULL;
@@ -94,6 +96,15 @@ bool ClassFlowMQTT::ReadParameter(FILE* pfile, string& aktparamgraph)
9496
{
9597
this->topicError = zerlegt[1];
9698
}
99+
if ((toUpper(zerlegt[0]) == "TOPICRATE") && (zerlegt.size() > 1))
100+
{
101+
this->topicRate = zerlegt[1];
102+
}
103+
if ((toUpper(zerlegt[0]) == "TOPICTIMESTAMP") && (zerlegt.size() > 1))
104+
{
105+
this->topicTimeStamp = zerlegt[1];
106+
}
107+
97108
if ((toUpper(zerlegt[0]) == "CLIENTID") && (zerlegt.size() > 1))
98109
{
99110
this->clientname = zerlegt[1];
@@ -114,12 +125,16 @@ bool ClassFlowMQTT::doFlow(string zwtime)
114125
{
115126
std::string result;
116127
std::string resulterror = "";
128+
std::string resultrate = "";
129+
std::string resulttimestamp = "";
117130
string zw = "";
118131

119132
if (flowpostprocessing)
120133
{
121134
result = flowpostprocessing->getReadoutParam(false, true);
122135
resulterror = flowpostprocessing->getReadoutError();
136+
resultrate = flowpostprocessing->getReadoutRate();
137+
resulttimestamp = flowpostprocessing->getReadoutTimeStamp();
123138
}
124139
else
125140
{
@@ -139,9 +154,21 @@ bool ClassFlowMQTT::doFlow(string zwtime)
139154
MQTTPublish(topic, result);
140155

141156
if (topicError.length() > 0) {
157+
if (resulterror.length() == 0)
158+
{
159+
resulterror = " ";
160+
}
142161
MQTTPublish(topicError, resulterror);
143162
}
144163

164+
if (topicRate.length() > 0) {
165+
MQTTPublish(topicRate, resultrate);
166+
}
167+
168+
if (topicRate.length() > 0) {
169+
MQTTPublish(topicTimeStamp, resulttimestamp);
170+
}
171+
145172
OldValue = result;
146173

147174
return true;

code/components/jomjol_flowcontroll/ClassFlowMQTT.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class ClassFlowMQTT :
99
public ClassFlow
1010
{
1111
protected:
12-
std::string uri, topic, topicError, clientname;
12+
std::string uri, topic, topicError, clientname, topicRate, topicTimeStamp;
1313
std::string OldValue;
1414
ClassFlowPostProcessing* flowpostprocessing;
1515
std::string user, password;

code/components/jomjol_flowcontroll/ClassFlowMakeImage.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ esp_err_t ClassFlowMakeImage::camera_capture(){
1919

2020
void ClassFlowMakeImage::takePictureWithFlash(int flashdauer)
2121
{
22+
// für den Fall, dass das Bild geflippt wird, muss es hier zurück gesetzt werden ////
23+
rawImage->width = image_width;
24+
rawImage->height = image_height;
25+
/////////////////////////////////////////////////////////////////////////////////////
2226
Camera.CaptureToBasisImage(rawImage, flashdauer);
2327
if (SaveAllFiles) rawImage->SaveToFile(namerawimage);
2428
}

0 commit comments

Comments
 (0)