LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Error trying to send SMS

Hello, having an issue transmitting an SMS with our labview VI.  I am using LabVIEW 2014, but can use 2012. 
Using this example...https://decibel.ni.com/content/docs/DOC-24116

In 2014 I am getting error:
Invoke Node System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
Inner Exception: System.ArgumentNullException: Value cannot be null.
Parameter name: message <append><b>System.ArgumentNullException</b> in ECGTT.vi


In 2012 I am getting error:
Exception has been thrown by the target of an invocation.
Inner Exception: System.ArgumentNullException: Value cannot be null.
Parameter name: message) <append><b>System.ArgumentNullException</b> in Send SMS 2012.vi


Also a few questions/things worth noting..

I am trying to test the VI from my PC
I had to change the information in the Carrier case box, because I am in Canada. So for example, I have Koodo as default, which is @msg.koodomobile.com
Will this automatically send a message when a VI starts, because I feel like that is what is happening, but I am trying to set it to activate when I get an error in my system. I have a couple of Global variables which when an error occurs it set off a visual light, so I attached that variable to the case loop, not sure if that is doing anything?
Also, could I hide the email stuff on another page, like create a button to open it so it's not prominately displayed all the time. 
Attached is my file just in case any of my explanations are too vague.
The goal being is that when an arrhythmia is detected, it will send a message to an emerncy contact. 

0 Kudos
Message 1 of 8
(4,076 Views)

Okay, so kind of just had some derp moments... 

When I use the error code to explain error... Might be al ittle more useful. Not sure how the parameter "message" is null right now..

"Error 1172 occurred at Invoke Node System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.

Inner Exception: System.ArgumentNullException: Value cannot be null.
Parameter name: message

Possible reason(s):

LabVIEW: A .NET exception occurred in an external assembly. For information about correcting this error, copy the following exception (in bold), and search the Microsoft Developer Network (MSDN) Web site or the Web for a possible explanation.
System.ArgumentNullException in ECGTT.vi"


Also had a realization that to set this to send only when there is an error I need to create a condition for a while loop to react to, I just need to sort that out unless there is another suggestion. Cannot be a button press.

I also looked at this option.. 
https://decibel.ni.com/content/docs/DOC-34170
And got this:

Error 363500 occurred at LabVIEWSMTPClient.lvlib:Send.vi:2280001

Possible reason(s):

LabVIEW: Failed to connect to the specified hostname. Be sure the specified hostname is correct, the server is running and configured to accept remote requests.


Complete call chain:
LabVIEWSMTPClient.lvlib:Send.vi:2280001
text message.vi


Edit:
Was given advice to make a dummy account and disable the security that cuts off "less secure apps" and was given the same error as before in the original situation. I adjusted the email username to include the full email and got this message:

Error 1172 occurred at Invoke Node System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
Inner Exception: System.Net.Mail.SmtpException: The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.5.1 Authentication Required. Learn more at

Possible reason(s):

LabVIEW: A .NET exception occurred in an external assembly. For information about correcting this error, copy the following exception (in bold), and search the Microsoft Developer Network (MSDN) Web site or the Web for a possible explanation.
System.Net.Mail.SmtpException in ECGTT.vi

0 Kudos
Message 2 of 8
(4,068 Views)

Here is my error with Less secure app access turned off:

 

 

Error 1172 occurred at Invoke Node System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
Inner Exception: System.Net.Mail.SmtpException: The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.5.1 Authentication Required. Learn more at

 

Possible reason(s):

LabVIEW: A .NET exception occurred in an external assembly. For information about correcting this error, copy the following exception (in bold), and search the Microsoft Developer Network (MSDN) Web site or the Web for a possible explanation.
System.Net.Mail.SmtpException in Send SMS 2012.vi->Send SMS example 2012.vi

 

 

Now when I enable Less secure app access..

Sent successfully.

 

 

The other error you mentioned Value cannot be null) could be from only inputting you google username without the @gmail.com 

 

Before you integrate this code into your existing VI, were you able to get the example running? I realize you will have to change the recipient since you have a different phone service provider.

0 Kudos
Message 3 of 8
(4,059 Views)

I am starting to realised that I never approached this the correct way to begin with. The example file is using the other one as subVI, so I don't think I was doing much of anything trying to do what I was doing. I just tried to just edit and run the example and it failed so I need to ask, 
Do I have to edit the SubVI first, then edit "example" ?
I also in the example file, I can't seem to find how to change the address for the sms message. like, Verizon is @vtech.com, so that is a thing as well. 


I did get a rejection email from google though before reading your message

ecgdetection2014@gmail.com

1:16 PM (55 minutes ago)
 
to 7097636700
 
 
 
 
This is a message, writing it longer to make more data

data


data


mtzx
 


 
 
 
Reply
 
Forward
   
 
 

Mail Delivery Subsystem <mailer-daemon@googlemail.com>

1:24 PM (47 minutes ago)
 
to me
 
 
 
 
Delivery to the following recipient failed permanently:

     7097636700@msg.koodomobile.com

Technical details of permanent failure:
Message rejected.  See http://support.google.com/mail/bin/answer.py?answer=69585 for more information.

----- Original message -----

X-Received: by 10.229.66.201 with SMTP id o9mr6649582qci.31.1427211992690;
        Tue, 24 Mar 2015 08:46:32 -0700 (PDT)
Return-Path: <ecgdetection2014@gmail.com>
Received: from RR-313-03 ([96.30.191.253])
        by mx.google.com with ESMTPSA id g82sm2926351qkh.18.2015.03.24.08.46.31
        for <7097636700@msg.koodomobile.com>
        (version=TLSv1 cipher=ECDHE-RSA-AES128-SHA bits=128/128);
        Tue, 24 Mar 2015 08:46:32 -0700 (PDT)
Message-ID: <551186d8.5516370a.1141.1110@mx.google.com>
Date: Tue, 24 Mar 2015 08:46:32 -0700 (PDT)
X-Google-Original-Date: 24 Mar 2015 13:16:32 -0230
MIME-Version: 1.0
From: ecgdetection2014@gmail.com
To: 7097636700@msg.koodomobile.com
Subject: Test
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: quoted-printable
0 Kudos
Message 4 of 8
(4,032 Views)

The subVI is standalone. The Send SMS Example.vi simply shows you how you could call it. Also notice that there are some instructions on the front panel of the example. To change the mail destination you need to modify the subVI, not the example. There should be a comment on the block diagram about changing the carrier. Basically, you change the contents of the case structure and the enum control.

 

Based on that bounce you got from Google, it seems that the code is now authenticating correctly and sending the email, so this means you are making progress. The link in the bounce email mentioned something about spam. It is possible that GMail blocked the email because it thought it was spam. I've been able to send texts to my T-Mobile phone by having "Test" as both my subject and body. Could you give that a try? Do you have another phone carrier you could try?

0 Kudos
Message 5 of 8
(4,015 Views)

Hello, we have tried with another phone but it was unsuccessful. I tried sending a message to the original address directly from the gmail account we created which succeeeded but with a five minute delay


We've since used the send SMTP VI which is located in the help examples located with labview (Labview\examples\protocols\smtp. It sent an email successfully to another email address but currently waiting to see if it will send but no bounceback email yet, so we'll see. 

 

Going to try that next, thank you


edit...
The email successfully sent to a phone via SMS, which is good but now the issue we're trying to solve is that we want the configure server button to always be true and then we will try to use a control to select "send" 

0 Kudos
Message 6 of 8
(3,955 Views)

Thank you for your app.

 

My provider is Verizon. I am getting a following error. Any help would be appreciated.

 

Invoke Node System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
Inner Exception: System.Net.Mail.SmtpException: The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.7.0 Must issue a STARTTLS command first. b129sm3321727ywe.99 - gsmtp <append><b>System.Net.Mail.SmtpException</b> in Send SMS 2012.vi

0 Kudos
Message 7 of 8
(2,386 Views)

Hello Sir,

I am trying the way you told . make dummy gmail account , and turn on option for less secure apps. But even though i am getting same error.

I am also entering username as full email address . Do i have to include the country code or just phone number?

Will wait for your reply

0 Kudos
Message 8 of 8
(2,257 Views)