Hobbyist Toolkit

cancel
Showing results for 
Search instead for 
Did you mean: 

Send mail with raspberry pi

Solved!
Go to solution

Dear, I have a project in labview, with which I send an email when an alarm situation occurs.
For this I am using an Rpi 4 and the SMTP protocol.
So far I have been able to send the mail correctly when the alarm situation occurs.
The problem occurs when the Vi is in an alarm situation, then it sends the email constantly, saturating the mailbox.
To send the emails I am using the SMTP protocol within a case structure. In the attached image you can see the condition for case 2 to be executed (the idea of ​​using the iteration icon I have obtained from a video made by NI Mexico), but with this condition I have not managed to send the email a once.
I hope you understand what I want to do and that you can have a solution for this.

Total thanks

0 Kudos
Message 1 of 7
(1,915 Views)

The issue has nothing to do with sending the email.  The email is working as every time your case 2 is triggered an email is sent.

 

If you only want 1 email to be sent you need to use a flag to indicate you sent the email and clear the flag when a new alarm is sent.

 

I am not sure what you are using the digitals for on the bottom of your image so I can't suggest exactly how to take care of this.

David Wilt
The New Standard LLC
0 Kudos
Message 2 of 7
(1,905 Views)

Thanks David for the prompt reply.

 

Regarding the digital ones and particularly in case 2, they are being used so that when a situation occurs in the physical environment, case 2 also occurs, nothing more than that.

 

Regarding the use of flag, sorry for the ignorance, but I don't know what you mean. Please, will you have an example or tutorial that I can refer to.

Thanks

0 Kudos
Message 3 of 7
(1,879 Views)
Solution
Accepted by topic author Choke

I can put together a quick VI but I am not in front of my development system at the moment.

 

By flag I just mean a boolean variable.  Set the boolean to False when you initialize your condition you are monitoring for the email notification.  When the condition for the email occur if the variable is False send the email and set the variable to True.  This way next time the condition occurs it will not send the email as the variable is not False.  In this situation an email will only be sent once after initializing the condition you are monitoring for.

 

Please let me know if you still need an example based on this explanation.

David Wilt
The New Standard LLC
Message 4 of 7
(1,871 Views)

Ok David.


I will try to do it on my own.

If I can't, I'll ask you for an example.

Thanks a lot

0 Kudos
Message 5 of 7
(1,867 Views)
Solved! David, thank you very much.
0 Kudos
Message 6 of 7
(1,832 Views)

No problem.

 

You can mark the response that solve your issue so others can find it easier and it will mark your question as solved.

David Wilt
The New Standard LLC
0 Kudos
Message 7 of 7
(1,827 Views)