DrAlexLiu / OctoPrint-PiNozCam

AI model running on RPi for failure detection
GNU Affero General Public License v3.0
39 stars 4 forks source link

Feature request: max failure messages per print #18

Closed jofland closed 5 months ago

jofland commented 5 months ago

When a failure is detected I get Telegram messages until the print is stopped. Then my phone gets crazy :-).

I would like to request a limit input field for failure messages per print. E. g. setting this to "5" would only send max. 5 messages within one print job.

There should be a option to switch the limit off. Could be reached by "0" as input value.

DrAlexLiu commented 5 months ago

Sure. I will do it.

DrAlexLiu commented 5 months ago

@jofland I really want to get a telegram/discord two-way communication. Like, when sending a failure picture, it will have three options: mute, pause, and stop.

When you click one of three buttons, like mute, you won't receive any more notifications. (It could also be false alarms, keeping sending error printing while it is printing good.)

when you click pause or stop, you can stop the failure print even if you are outside your home, etc.

However, this design requires async/await functions, which is conflict with octoprint's flask service. I am trying to how to solve it.

But I will do your request first.

DrAlexLiu commented 5 months ago

@jofland

Would you please try this test.zip?

https://github.com/DrAlexLiu/OctoPrint-PiNozCam/archive/test.zip

To test, an easy way is to: Put https://raw.githubusercontent.com/DrAlexLiu/OctoPrint-PiNozCam/master/assets/images/failure_detection2.jpg in the custom URL, and set the printer to a virtual printer,

Let me whether you need to other modifications?

One more thing: When you are printing and turn AI from OFF to ON, your printer will experience a pause/blob. I can get this away, but it will load the AI model into memory even switch is set to OFF (It should not be designed in this way).

jofland commented 5 months ago

Would you please try this test.zip?

Sorry, the test failed. Here what I did:

Custom URL as you said.

Test 1:

Test 2:

Test 3:

Let me whether you need to other modifications?

Next improvement could be mouse over hints for the input fields :-)

One more thing: When you are printing and turn AI from OFF to ON, your printer will experience a pause/blob. I can get this away, but it will load the AI model into memory even switch is set to OFF (It should not be designed in this way).

I did not understand what you mean by this? Do you mean this could cause a problem with IO traffic to my ssd (related to the other issue last week)?

DrAlexLiu commented 5 months ago

Thanks.

For the situations like test2 and test3, it was working on my end last night. I will take a look again tonight.

I did not understand what you mean by this? Do you mean this could cause a problem with IO traffic to my ssd (related to the other issue last week)?

Sort of. So:

  1. When you are printing a job, and you turn on the "Enable PiNozCAM" from OFF to ON, and click save. it will load the AI model data from SSD and it will cause a pause/blob only happens one time.

  2. If you turn on/off the "Enable PiNozCAM" and click save when you are not printing, or you turn "Enable PiNozCAM" to OFF while you are printing, it would not cause a pause/blob.

jofland commented 5 months ago

For the situations like test2 and test3, it was working on my end last night. I will take a look again tonight.

I just realized I did all tests within the same print job and got more than 5 failure messages in test 1. So there shouldn't have been any messages in test 2 and 3. Version might be working.

I will run an isolated test 2 in a fresh print job.

jofland commented 5 months ago

I tested again. It´s working, but there is an off by one:

Test 4:

Test 5:

Test 6:

Test 7:

DrAlexLiu commented 5 months ago

@jofland

Thank you for testing. I have updated it and would you download and try the test.zip again?

https://github.com/DrAlexLiu/OctoPrint-PiNozCam/archive/test.zip

Next improvement could be mouse over hints for the input fields :-) I try to add the responsive UI like this, or use a similar way to explain the parameters in a detailed way.

jofland commented 5 months ago

Testresults (Tests as above):

Test 4:

Test 6:

Test 7:

jofland commented 5 months ago

One thing:

DrAlexLiu commented 5 months ago

@jofland

Thank you for your detailed testing. I have already fixed the bug. It should solve the issue you mentioned.

https://github.com/DrAlexLiu/OctoPrint-PiNozCam/archive/test.zip

jofland commented 5 months ago

Test is OK :-)

DrAlexLiu commented 5 months ago

I have already merge this to the master branch, you can download this: https://github.com/DrAlexLiu/OctoPrint-PiNozCam/archive/master.zip

I am also working on the "mouse over hints for the input fields". I will let you know then.

DrAlexLiu commented 3 months ago

@jofland

When a failure is detected I get Telegram messages until the print is stopped. Then my phone gets crazy :-).

A: The version 1.0.3 has a remote control on Telegram. You can remote stop it, or at least mute it. I hope this function will help you.