Our full technical support staff does not monitor this forum. If you need assistance from a member of our staff, please submit your question from the Ask a Question page.


Log in or register to post/reply in the forum.

EmailSend on CR1000


oceanographer Dec 7, 2012 10:02 PM

Good afternoon!

I am using a CR1000 with a Raven XTG modem. I have had success setting up LoggerNet for scheduled calling of the modem which has a static IP address. I am now trying to also use the modem to send an email to a gmail account. I keep getting a "Failed to Connect" message as my EmailResult. Any advice? Here is the applicable portion of my code:

Const SvrAddress = "smtp.gmail.com:465"
Const ToAddress = "wallcm55@gmail.com"
Const FromAddress = "wallcm55@gmail.com"
Const EmailSubject = "N.E.D Location Update"
Const UserName = "wallcm55@gmail.com"
Const Password = "cai5tlyn"
Const Attach = ""
Public EmailMessage As String * 100
Public EmailResult As String * 100
Public EmailSuccess As Boolean

SlowSequence
Scan (3,Sec,1,0)
EmailMessage = Garmin_latitude & "," & " " & Garmin_longitude
EmailSuccess = EMailSend (SvrAddress ,ToAddress, FromAddress, EmailSubject, EmailMessage, Attach, UserName, Password, EmailResult)
CallTable(NED_Status)

NextScan
EndProg


Thanks!


GaryTRoberts Dec 7, 2012 10:59 PM

Is your Raven set up to be a serial server (connecting on port 3001), or PPP (using port 6785)? If it is in serial server mode, you will not be able to use many of the Logger's TCP/IP based instructions.

* Last updated by: GaryTRoberts on 12/7/2012 @ 4:00 PM *


oceanographer Dec 7, 2012 11:18 PM

Can LoggerNet still access the modem is I use the 6785 Port? I want to be able to do both the email and the LoggerNet data polling.


GaryTRoberts Dec 8, 2012 05:27 AM

Yes, LoggerNet will work just like it has in the past. With the Raven in PPP mode, the logger with see the Raven as a type of ethernet interface just like the NL120 and NL115.

To see how to set up your Raven and Datalogger to work in PPP mode, refer to Appendix B of the Raven manual. https://s.campbellsci.com/documents/us/manuals/ravenxtv.pdf

* Last updated by: GaryTRoberts on 12/7/2012 @ 10:37 PM *


oceanographer Dec 10, 2012 09:06 PM

I changed the port in the setup menu to 6785, but I am still getting the Error: Failed to Connect Message. Is there anywhere else I need to change the port (the configuration utility?). Thank you.


GaryTRoberts Dec 10, 2012 09:33 PM

Have you put the modem in PPP mode and also configured the logger for PPP?


oceanographer Dec 10, 2012 09:40 PM

Yes, the datalogger and modem are set up for PPP already. Loggernet was properly following a data collection schedule utilizing the modem. I was just trying to also make it send an email.


GaryTRoberts Dec 11, 2012 07:44 PM

Try changing your port number for the smtp server to 587 instead of 465. The logger does TLS not SSL.

Here is the information from Google:
Outgoing Mail (SMTP) Server - requires TLS or SSL: smtp.gmail.com
Use Authentication: Yes
Port for TLS/STARTTLS: 587
Port for SSL: 465

Also, your username only needs to be "wallcm55". You can drop the @gmail.com (optional).

* Last updated by: GaryTRoberts on 12/11/2012 @ 1:25 PM *


GaryTRoberts Dec 11, 2012 08:14 PM

Also a SlowScan rate of 3 seconds will be to fast for the logger. You will get several skipped scans. The timeout for this instruction is around 70 seconds. So the fastest I would send is every two minutes.

It also takes the CR1000 about 30 seconds to negotiate the TLS with GMail's servers.

* Last updated by: GaryTRoberts on 12/11/2012 @ 1:26 PM *


AlexH Jan 16, 2013 06:39 AM

I'm using the Raven modem recently.Here is some advice:
1、Use Deviceconfig connect the CR1000,check the TCP/IP option of the logger,if CR1000 have IP,that the modem and the CR1000's setting will be OK.
2、Use the NL115 connect the CR1000,then you could let the CR1000 has the IP,you could use your programm check if your setting is OK.
After the 2 steps,you will know the reason why you cann't send the mail.Also,you could connect the Raven directly,check it's IP address.Please notice the antenna,maybe you could try your own antenna.

Log in or register to post/reply in the forum.