jomjol / AI-on-the-edge-device

Easy to use device for connecting "old" measuring units (water, power, gas, ...) to the digital world
https://jomjol.github.io/AI-on-the-edge-device-docs/
5.69k stars 614 forks source link

MQTT did not seems to reconnect (10.2.0) #602

Closed lanwin closed 2 years ago

lanwin commented 2 years ago

The stability with 10.2.0 seems to be a lot better..at least for me. Thank you.

But I have the issue that my MQTT status works for a while. Then it drops a "connection lost" status and did not seems to reconnect again. But the device is still connect via WIFI. I can connect to the web page and the recognition works. My access point is 3m away.

jomjol commented 2 years ago

There is a problem with the MQTT in the current version. I will update a new version v10.3 soon, but unfortuneatly I need to tell, that this will be much more unstable again, as I need to go back to the old camera driver. There are systems, that get totally stall in the v10.2. Which one is unpredicable and I'm not able to remove this behaviour.

There I decided after a long trial to go back to the more unstable version to avoid the fully stall systems.

jomjol commented 2 years ago

Stability issue and MQTT should be better in the current rolling version. You could try this for the time beeing.

lanwin commented 2 years ago

Yes I do. I already flashed the rolling version and will report back.

jomjol commented 2 years ago

How is your experience? I just updated another time, because there was still a little problem within setting the illumination intensity

lanwin commented 2 years ago

It seems to work with the old build. Didnt noticed any abort yet. I had once pretty dark image. And the LEDIntensity property on the reference image mask did not seem to do anything.

Now I flashed the new one. LEDIntensity still does nothing. The rest seems to work for now.

lanwin commented 2 years ago

Well I need to correct me. LEDIntensity works but only for values <10. In my case 4 seems to be a good value.

jomjol commented 2 years ago

Well, both informations (works / doesn't work) are correct if you know how the camera is working. The camera illumination is done in automated mode. That means it corrects it's exposure time and gain automated. For a wide range of intensity, this compensates the illumination intensity. Only if you go below a certain setting, where you are at the limits of the camera settings, it start to change something.

lanwin commented 2 years ago

Hmm I still have the MQTT connection lost problem with the build from yesterday.

friedpa commented 2 years ago

Please post your respective config.ini section.

lanwin commented 2 years ago

Hmm it seems the problem wasnt the MQTT connection. I noticed that the previous value was higher then the actual. After setting the prev value to the actual its starts to connect again. Now I optimized the reference image and will see if this helps.

lanwin commented 2 years ago

Its still connected but the detections did not seems to work correct. The previous value is near the right value. But the current value is wrong. Even after restart. image

jomjol commented 2 years ago

It seems, that the first analog is about 1 digit off. But it looks likes the ROI there is strange, because it does not look quadratic, but the width is bigger than the height. That should not be the case. You can check for this firstly and then observe, if this already solves your problem. Otherwise one would need to retrain the model.

friedpa commented 2 years ago

When the detection is wrong, e.g. reading is less then the previous one, no MQTT values are submitted. The readings are to be valuated over a longer period. Not every reading is right. There are a lot of other tflite files, maybe you try another one, as the image is not that bad. The PresetValueUse is 720 minutes valid, if you did not change the parameter. So a reboot does not help until you change the value....

lanwin commented 2 years ago

It seems, that the first analog is about 1 digit off. But it looks likes the ROI there is strange, because it does not look quadratic, but the width is bigger than the height. That should not be the case. You can check for this firstly and then observe, if this already solves your problem. Otherwise one would need to retrain the model.

Ok will check. So the rect is the captured part not the circle? Should the circle always be the same size as the box?

jomjol commented 2 years ago

yes, the rect one. the circle is only for optical alignment and I assume, that I draw the circle based on the widht only :-)

lanwin commented 2 years ago

yes, the rect one. the circle is only for optical alignment and I assume, that I draw the circle based on the widht only :-)

Okay, then I would really suggest to make the circle the same size as the rect cause I always optimized for the circles cause it felt more natural to do so. By the way.

I am not 100% sure but it seems the connection work now. Will still watch that.

image Here is another negative value case. It seems the analog 0.x switched from 9-0 after the digital one switched. So it got 742.9 and on the next read 742.0. Is there anything to prevent that situation?

jomjol commented 2 years ago

:-) - topic for one of the next updates.

lanwin commented 2 years ago

:-) - topic for one of the next updates.

Thank you @jomjol is there an issue I can track for the negative value problem? Seems to happen every time the digital number changes.