09-02-2015 08:17 AM
Hi,
I have a SBRIO which is supposed to acquire data and send e-mails in case of alarms.
As soon as the SMTP vis are runned, the compactrio hangs completely:
- I get the"Waiting for connection to target pop-up" when the system is trying to send an e-mail.
- CPU usage drops.
What can cause this behavior? Isn't a compactrio supposed to be able to send e-mail while doing something else?
best regards
peper
Solved! Go to Solution.
09-02-2015 08:22 AM
Is it connected to a network or directly connected to your comp?
Which SMTP software package did you install on the sbRIO?
09-02-2015 08:27 AM
The compactrio (sbrio) is connected to internet via a 3G modem.
I have the following packages intstalled:
SMTP Client 13.5.0
SMTP Client with SSL support 13.5.0
SSL support for Labiew RT 13.5.1
regards
09-02-2015 08:54 AM
Do you have the necessary software components installed on the CompactRIO for sending email (SMTP or maybe it's part of some other software component)? If you're using TLS you might need the SSL libraries installed perhaps.
Are you specifying the SMTP server by IP address or DNS/domain name? If it's the latter, check you have a valid DNS server configured on the sbRIO.
You might want to see if you can find any error logs on the sbRIO that might indicate if there was an error or something. I would also try to run a simple VI on the sbRIO that just sends an email to see if it works in isolation.
I don't know the inner workings of the SMTP library that NI provides so it might be that sending the email will pause execution until the email is sent (which, as it uses TCP, could take an undetermined period of time) - you might want to do the sending of the email in a seperate loop to avoid hanging your application.
09-02-2015 09:05 AM
Thanks for your reply.
SMTP and SSL packages are installed.
The compactrio is configured with 10.127.13.150 as DNS and the server is specifyed with the DNS name. (10.127.13.150 is the 3g modem (gateway) wich itself is confifured to use the 8.8.8.8 DNS).
E-mail sending is already a parallel process in my application that's it's so weird everything gets locked up when an e-mail is being sent.
I'll check if it's possible to make a small vi with TCP command that would replace the NI's vis.
regards
09-03-2015 03:12 AM
FYI
I programmed a basic e-mail sending function using only the TCP IP primitives and it works very well without hanging the compactRIO.
So i guess there is something wrong with the SMTP packages NI is using.
Anyway, let's find a base64 encoding library now...
09-03-2015 03:33 AM
I'm pretty sure there is a 'cryptography' library on the tools network which includes a Base64 encode/decode function.
09-03-2015 03:52 AM
I had an issue in LabVIEW on a PC similar to yours. LabVIEW would just hang while sending an email using the built-in functions. NI never would confirm it was a bug, but I had used some code someone else posted to make it work. The last message has the modified example code. It probably is basically what you have already done.
09-03-2015 07:21 AM
Thanks Matthew,
Indeed, I reprogrammed the basic SMTP function but your code implements a few extra function that I did not implement (like mail attachements). It might come in handy some day!
Regards
09-03-2015 08:53 AM - edited 09-03-2015 09:03 AM
Update.
FYI
It looks like trying to resolve a domain name also hangs the compactrio for several seconds. So if you specify the SMTP server by it's name and not it's IP address, and the compactRIO has no internet connection, you'll still get the freezing (even with the TCP IP primitives).
So I added a check where I try to open a TCP connection on port 53 of 8.8.8.8 to make sure I will be able to resolve the SMTP sever name.
peper