From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Real-Time Measurement and Control

cancel
Showing results for 
Search instead for 
Did you mean: 

Real Time smtp

Hello all,

A thank you for your help.  I have a Real Time target cDAQ 9132 running LabVIEW Real Time 2015 and NI Linux.  I want to send emails directly from the target, either from an internal email client or accessing an external one.  The nature of its usage outside R&D requires no host computer and and email authentication tag on the sent data.  So far this is what i have done/found:

- I tried using the smtp library, i effectively sent email from my computer but not when these vis were run from the target.  This, i believe, is from the library calling DLL's which don't run on Linux (need .so)

- I tried using the cmd call vi to run: mail, mailx, sendmail; but none of those packages exist on the target, so the commands are not recognized

- i tried to install sendmail, however 'make' doesn't exist

- i tried using opkg install to install thee and this failed as well.

- I have done fairly extensive searching in forums, kb's, etc and found a lot of good information on how to email from a Linux distro with mail commands, just not NI Linux. 

- I do not know a lot about TCP, but i am guessing maybe there is a way to use the TCP comms vi's to ping my external email server (say Apple) and send the smtp commands?  maybe break down the tasks the DLLs were performing into subVIs that will run on the RT target??

Thanks again all

 

 

0 Kudos
Message 1 of 6
(3,316 Views)

Hi sol_rev,

 

Have you looked into out the links listed in this forum post

 

Specifically, check out the post on using Gmail from an RT target. One of the forum users in that thread posted a library which utilizes TCP to connect to the SMTP server. I looked through the library and how it connects to the client. I think that this would be a helpful starting place if you wanted to develop your own communication via TCP, or even to just use the library as is.

 

Regards,

Regards,

Michael Whitten
Senior RF Applications Engineer
0 Kudos
Message 2 of 6
(3,264 Views)

Michael,

Thank you for you quick reply, I will check these out.

0 Kudos
Message 3 of 6
(3,255 Views)

No problem!

 

Also, I wanted to let you know that I just noticed that the library I mentioned in the previous post was actually created for a VxWorks target.

 

As long as it is just using TCP/IP commands, which is all that I found, then there shouldn't be a problem. However, if it is calling a VxWorks library (a .out file) it won't work on your system.

 

Regards,

 

Regards,

Michael Whitten
Senior RF Applications Engineer
0 Kudos
Message 4 of 6
(3,248 Views)

Ok, thank you for the heads up. 

0 Kudos
Message 5 of 6
(3,244 Views)

 - I tried using the smtp library, i effectively sent email from my computer but not when these vis were run from the target.  This, i believe, is from the library calling DLL's which don't run on Linux (need .so)

Obviously. Linux doesn't support MZ binaries, and even if, they wouldn't fit in tons of other places (starting w/ cpu architecture, calling convention, data structures, ...) By the way: binary libs need to fit exactly for the target platform (*including* toolchain, libc, etc). *never ever* use any precompiled binaries, unless you know *exactly* what you're doing.


@sol_rev wrote:

- i tried to install sendmail, however 'make' doesn't exist

sendmail would be way oversized. qmail seems a good candidate.


- I have done fairly extensive searching in forums, kb's, etc and found a lot of good information on how to email from a Linux distro with mail commands, just not NI Linux. 

You'll have to compile the mta of your choice on your own for that platform.


- I do not know a lot about TCP, but i am guessing maybe there is a way to use the TCP comms vi's to ping my external email server (say Apple) and send the smtp commands?

I doubt you seriously want to write your own mta. Just use one of the dozens existing ones.

Linux Embedded / Kernel Hacker / BSP / Driver development / Systems engineering
0 Kudos
Message 6 of 6
(3,155 Views)