Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 852

Python • Re: PIR false positive when sending mail

$
0
0
The code where you read the PIR and make the decision to send the email is not there. Sending emails take a fairly long time. Check if you have a flag (variable) with the state of the PIR that stays "on" during the whole process of sending. Maybe you will need to send the email in another thread while the PIR checking code keeps running in the other. Also, you may want to think this over again. Do you really want an email for every movement? In a similar situation, I had included a timer so a notification will only be sent if the last one is at least one minute ago.

Statistics: Posted by kheylen25 — Sun Nov 03, 2024 8:23 am



Viewing all articles
Browse latest Browse all 852

Trending Articles