Other Parts Discussed in Thread: CC3100, CC3200, MSP430FR6989, CC3220SF, CC3100BOOST, UNIFLASH, CC31XXEMUBOOST, CC3100MOD, MSP430F5529
Hi Experts,
Our customer have a concern, as shown below:
TI CC3100 SDK-Ver-1.3.1 Email No Longer Works
A. Solution Request
We are looking for a TI fix for the CC3100 email example. The current posted CC3100 email example no longer works. So please either provide a solution, or provide an update WARNING that the CC3100 no longer supports emails.
B. CC3100 Email code Working with Gmail for over 3 years
For over 3 years we have had multiple TI CC3100 BOOST using SDK-1.3.1 mounted on both F5529 and FR6989 launch pads Microcontrollers using WiFi to both “Get Timer from an SNTP Timer Server”, and “Send status emails” from GMAIL using smtp and sending the email to a number of different destination email services.
In 2021 GMAIL required AP’s like TI Microcontrollers with CC3100 WiFi cards to upgrade to use a GMAIL generated AP password. Creating the Gmail AP password enabled the TI devices to successfully send emails.
C. TI CC3100 email no long works on Gmail, Outlook.com target="_blank">Outlook.com email, or SOHO email
In the fall to 2022 Gmail posting was that they would soon not support AP passwords and less secure devices in the future. On Friday January 27, 2023 multiple TI microcontrollers with the CC3100, in different states all stopped being able to send email status. These microcontrollers have no means of remote software updates, so no code changes were made to multiple micro’s. Also there is near zero probability that multiple micro’s in multiple cities / states had a code corruption at the exact same date and hour. Obviously some Gmail code and security change is now blocking TI micro’s.
We have tried Outlook.com email, SOHO email, AOL email, and Proton email. None of these email services work with the TI CC3100 and SDK-1.3.1. All of these email services progress through the code to the same point and end with “Device couldn’t send the email”.
D. Code Sequence Trace
This shows that the device can first connect to an SNPT time server and SUCCESFULLY get the TIME. This proves that the CC3100 hardware, most of the Code, WiFi access, etc are all still working. The SEND EMAIL trace shows that it is NOT able to send an email.
Get time application - Version 1.3.0
*******************************************************************************
Line 1774 Device is configured in default state
Line 1791 Device started as STATION
Line 1803 Connection established w/ AP and IP is acquired
Line 1808 LH Just after get HostIP
Line 1818 LH Just after createConnection
Line 1825 LH Just BEFORE getSNTPTTime...
Line 336 In socket.c, sl_Sendto
Line 95 In socket.c, _sl_BuildAddress
Line 95 In socket.c, _sl_BuildAddress
Line 1829 LH Just AFTER getSNTPTTime...
Line 1488 in _i32 disconnectFromAP() after retVal = sl_WlanDisconnect();
Line 1490 in _i32 disconnectFromAP() after if(0 == retVal)
Line 1022 Device disconnected from the AP on application's request
Email application - Version 1.3.0
*******************************************************************************
Line 881 Device is configured in default state
Line 898 Device started as STATION
Line 171 email Username
Line 180 email Password
Line 159 email port, security
Line 915 Connection established w/ AP and IP is acquired
Line 918 Sending email...
Line 189 email Destination
Line 1253 After...DESTINATION_EMAIL
Line 198 email Subject
Line 1265 After...LHemailSubject
Line 208 email Message Body
Line 1278 After...LHemailBody
Line 301 In _smtpConnect after if TLS create secure socket
Line 306 In _smtpConnect Set Socket
Line 333 In _smtpConnect before connect to Socket
Line 513 In socket.c, _sl_Connect
Line 95 In socket.c, _sl_BuildAddress
Line 554 In socket.c, _sl_Connect Verify_RET_OK
Line 335 In _smtpConnect after connect to Socket
Line 339 In _smtpConnect if Status < 0 && SL_ESECSNOVERIFY != Status
Line 1281 After...Status = sl_NetAppEmailConnect()
Line 922 Device couldn't send the email
Line 1488 in _i32 disconnectFromAP() after retVal = sl_WlanDisconnect();
Line 1490 in _i32 disconnectFromAP() after if(0 == retVal)
Line 1011 Device disconnected from the AP on application's request
This is a subset longer version of the Send Email try which shows in more detail all the SPI read and writes to the CC3100 device. Just before and after the “Line 922 Device couldn’t send the email”
Line 554 In socket.c, _sl_Connect Verify_RET_OK
Line 211 in spi.c spi_Write(...)
Line 239 in spi.c spi_Read(...)
Line 239 in spi.c spi_Read(...)
Line 239 in spi.c spi_Read(...)
Line 335 In _smtpConnect after connect to Socket
Line 339 In _smtpConnect if Status < 0 && SL_ESECSNOVERIFY != Status
Line 1281 After...Status = sl_NetAppEmailConnect()
Line 922 Device couldn't send the email
Line 211 in spi.c spi_Write(...)
Line 211 in spi.c spi_Write(...)
Line 211 in spi.c spi_Write(...)
Line 239 in spi.c spi_Read(...)
Line 239 in spi.c spi_Read(...)
Line 239 in spi.c spi_Read(...)
Line 1488 in _i32 disconnectFromAP() after retVal = sl_WlanDisconnect();
Line 1490 in _i32 disconnectFromAP() after if(0 == retVal)
Line 211 in spi.c spi_Write(...)
Line 239 in spi.c spi_Read(...)
Line 239 in spi.c spi_Read(...)
Line 239 in spi.c spi_Read(...)
Line 1011 Device disconnected from the AP on application's request
E. Selected Code Extracts to show the main code path
E.1 _SetEmail
I suspect the reason CC3100 SDK-1.3.0 no longer works has something to do with Email service security changes. I have use TLS successfully from 2014 to 2023…….so for 9 years it has worked. I tried port 465 with SSL as well but that also does not work.
eMailServerSetting.Family = AF_INET;
// eMailServerSetting.Port = GMAIL_HOST_PORT; //Line 27 in config.h #define GMAIL_HOST_PORT 465
// eMailServerSetting.Port = OUTLOOK_HOST_PORT; //Line i41n config.h #define OUTLOOK_PORT 587
eMailServerSetting.Port = ZOHO_HOST_PORT; //Line i41n config.h #define OUTLOOK_PORT 587
// eMailServerSetting.Port = VERIZON_HOST_PORT; //2-14-2023 changed to Verizon so can try LBH2015NVR
eMailServerSetting.Ip = SL_IPV4_VAL(74,125,129,108);
eMailServerSetting.SecurityMethod = SL_SO_SEC_METHOD_TLSV1_2; //Original 2014 to Jan 2023
eMailServerSetting.SecurityCypher = SL_SEC_MASK_TLS_RSA_WITH_AES_256_CBC_SHA; //Original 2014 to Jan 2023
//2-23-2023 Thomas Schmitt link said Gmail port 465 with SSL
// CC3100 SDK1.3.0 shows about 25 Transport Security Options, Two with SSL
// SSLV3 SSL_RSA_WITH_RC4_128_SHA
// SSLV3 SSL_RSA_WITH_RC4_128_MD5
// eMailServerSetting.SecurityMethod = SL_SO_SEC_METHOD_SSLV3;
// eMailServerSetting.SecurityCypher = SL_SEC_MASK_SSL_RSA_WITH_RC4_128_SHA;
// eMailServerSetting.SecurityCypher = SL_SEC_MASK_SSL_RSA_WITH_RC4_128_MD5;
E.2 Config.h
See below the settings for: GMAIL, YAHOO, OUTLOOK, ZOHO per there Websites
#define SMTP_BUF_LEN 100
//#define GMAIL_HOST_NAME "smtp.gmail.com"
//#define GMAIL_HOST_PORT 465 //Line 1212 in emailAndGetTime.c eMailServerSetting.Port = GMAIL_HOST_PORT;
//#define GMAIL_HOST_PORT 465 //Line 1212 in emailAndGetTime.c 2-23-2023 link from Thomas 465 ok for use with SSL
//#define GMAIL_HOST_PORT 587 //10-5-2022 Google post says port 465 no longer accepted as the standard port, no2 587, 2525 and 25
// 2-18-2023 try 587, 2525, and 25
//Another post says for plain text use port 465 for SSL, use port 587 for TLS
// Line 1215 in emailAndGetTime.c defines the security method, ..... see below looks like TLS V1_2
// eMailServerSetting.SecurityMethod = SL_SO_SEC_METHOD_TLSV1_2;
//#define YAHOO_HOST_NAME "smtp.mail.yahoo.com"
//#define YAHOO_HOST_PORT 25
//#define OUTLOOK_HOST_NAME "smtp-mail.outlook.com"
//#define OUTLOOK_HOST_PORT 587 //Port Number: 587 (With TLS)
//#define OUTLOOK_HOST_PORT 25 //Alternative Port Number: 25 (Without TLS/SSL) 2-21-2023 but in emailAndGetTime.c I don't know how to specify none
#define ZOHO_HOST_NAME "smtp.zoho.com"
//#define ZOHO_HOST_PORT 465 //Port Number: 465 (With SSL)
#define ZOHO_HOST_PORT 587 //Port Number: 587 (With TLS)
//2-14-2023
//#define AOL_HOST_NAME "smtp.aol.com"
//#define VERIZON_HOST_NAME "smtp.verizon.net target="_blank">smtp.verizon.net"
//#define GMAIL_HOST_NAME "smtp.verizon.net" //Can't find any place were it refers to GMAIL_HOST_NAME, so I could change to Verizon so fake it
//#define VERIZON_HOST_PORT 465 //2-14-2023, found that the AOL Port is also 465
E.3 Lines 137 – 217 _i32 sl_NetAppEmailSet
_i32 sl_NetAppEmailSet(_u8 command ,_u8 pValueLen,
_u8 *pValue)
{
SlNetAppEmailOpt_t* pEmailOpt = 0;
SlNetAppSourceEmail_t* pSourceEmail = NULL;
SlNetAppSourcePassword_t* pSourcePassword = NULL;
SlNetAppDestination_t* pDestinationEmail = NULL;
SlNetAppEmailSubject_t* pSubject = NULL;
switch (command)
{
case NETAPP_ADVANCED_OPT:
pEmailOpt = (SlNetAppEmailOpt_t*)pValue;
g_EmailOpt.Port = pEmailOpt->Port;
g_EmailOpt.Family = pEmailOpt->Family;
g_EmailOpt.SecurityMethod = pEmailOpt->SecurityMethod;
g_EmailOpt.SecurityCypher = pEmailOpt->SecurityCypher;
g_EmailOpt.Ip = pEmailOpt->Ip;
g_EmailSetStatus+=1;
CLI_Write(" Line 159 email port, security \n\r"); //2-16-2023 added
// CLI_Write(" \n Line 159 email port: %d\n\", Port); //Gives errors
break;
// See Thermostat Controller code in mytimers.c; works there but not here
// printf("\nMessage Body is: %d\n", usiGMTOffsetHrSet); //%d is an integer
// CLI_Write("\nMessage Body is: %s\n", LHemailBody);
case NETAPP_SOURCE_EMAIL:
pSourceEmail = (SlNetAppSourceEmail_t*)pValue;
pal_Memset(g_Email.Username, '\0', MAX_USERNAME_LEN);
pal_Memcpy(g_Email.Username, pSourceEmail->Username, pValueLen);
g_EmailSetStatus+=2;
CLI_Write(" Line 171 email Username \n\r"); //2-16-2023 added
break;
case NETAPP_PASSWORD:
pSourcePassword = (SlNetAppSourcePassword_t*)pValue;
pal_Memset(g_SourcePass.Password, '\0', MAX_PASSWORD_LEN);
pal_Memcpy(g_SourcePass.Password, pSourcePassword->Password, pValueLen);
g_EmailSetStatus+=4;
CLI_Write(" Line 180 email Password \n\r"); //2-16-2023 added
break;
case NETAPP_DEST_EMAIL:
pDestinationEmail=(SlNetAppDestination_t*)pValue;
pal_Memset(g_Destination.Email target="_blank">Destination.Email, '\0', MAX_DEST_EMAIL_LEN);
pal_Memcpy(g_Destination.Email, pDestinationEmail->Email, pValueLen);
g_EmailSetStatus+=8;
CLI_Write(" Line 189 email Destination \n\r"); //2-16-2023 added
break;
case NETAPP_SUBJECT:
pSubject=(SlNetAppEmailSubject_t*)pValue;
pal_Memset(g_Subject.Value, '\0', MAX_SUBJECT_LEN);
pal_Memcpy(g_Subject.Value, pSubject->Value, pValueLen);
g_EmailSetStatus+=16;
CLI_Write(" Line 198 email Subject \n\r"); //2-16-2023 added
break;
case NETAPP_MESSAGE:
if(pValueLen > (MAX_MESSAGE_LEN - 1))
{
ASSERT_ON_ERROR(EMAIL_SET_INVALID_MESSAGE);
}
pal_Memset(message, '\0', MAX_MESSAGE_LEN);
pal_Memcpy(message ,pValue, pValueLen);
CLI_Write(" Line 208 email Message Body \n\r"); //2-16-2023 added
break;
default:
CLI_Write((_u8*)"\n\rLine209 Error:Default case\n\r");
ASSERT_ON_ERROR(EMAIL_SET_INVALID_CASE);
}
return SUCCESS;
}
E.4 Lines 271 – 351 _i32 _smtpConnect
static _i32 _smtpConnect(void)
{
SlSockAddrIn_t LocalAddr;
SlTimeval_t tTimeout;
_i32 cipher = 0;
_i32 LocalAddrSize = 0;
_i8 method = 0;
_i32 Status = 0;
LocalAddr.sin_family = g_EmailOpt.Family;
LocalAddr.sin_port = sl_Htons(g_EmailOpt.Port);
LocalAddr.sin_addr.s_addr = sl_Htonl(g_EmailOpt.Ip);
LocalAddrSize = sizeof(SlSockAddrIn_t);
/* If TLS is required */
if(g_EmailOpt.SecurityMethod <= 5)
{
/* Create secure socket */
smtpSocket = sl_Socket(SL_AF_INET, SL_SOCK_STREAM, SL_SEC_SOCKET);
ASSERT_ON_ERROR(smtpSocket);
tTimeout.tv target="_blank">tTimeout.tv_sec = 10;
tTimeout.tv_usec = 90000;
Status = sl_SetSockOpt(smtpSocket, SOL_SOCKET, SL_SO_RCVTIMEO,
&tTimeout, sizeof(SlTimeval_t));
ASSERT_ON_ERROR(Status);
method = g_EmailOpt.SecurityMethod;
cipher = g_EmailOpt.SecurityCypher;
CLI_Write(" Line 301 In _smtpConnect after if TLS create secure socket \n\r");
/* Set Socket Options that were just defined */
Status = sl_SetSockOpt(smtpSocket, SL_SOL_SOCKET, SL_SO_SECMETHOD,
&method, sizeof(method));
CLI_Write(" Line 306 In _smtpConnect Set Socket \n\r");
if( Status < 0 )
{
sl_Close(smtpSocket);
ASSERT_ON_ERROR(Status);
CLI_Write(" Line 311 In _smtpConnect sl_Close smtpSocket step 1 \n\r");
}
Status = sl_SetSockOpt(smtpSocket, SL_SOL_SOCKET, SL_SO_SECURE_MASK,
&cipher, sizeof(cipher));
if( Status < 0 )
{
sl_Close(smtpSocket);
ASSERT_ON_ERROR(Status);
CLI_Write(" Line 319 In _smtpConnect sl_Close smtpSocket step 2 \n\r");
}
}
/* If no TLS required */
else
{
/* Create socket */
smtpSocket = sl_Socket(SL_AF_INET, SL_SOCK_STREAM, SL_IPPROTO_TCP);
ASSERT_ON_ERROR(smtpSocket);
CLI_Write(" Line 329 In _smtpConnect after if NO TLS required create socket \n\r");
}
/* connect to socket */
CLI_Write(" Line 333 In _smtpConnect before connect to Socket \n\r");
Status = sl_Connect(smtpSocket, (SlSockAddr_t *)&LocalAddr, LocalAddrSize);
CLI_Write(" Line 335 In _smtpConnect after connect to Socket \n\r"); //2-16-2023 this prints
if((Status < 0) && (SL_ESECSNOVERIFY != Status))
{
CLI_Write(" Line 339 In _smtpConnect if Status < 0 && SL_ESECSNOVERIFY != Status \n\r"); //2-16-2023 this prints
// **************************************************************
// Jan 30, 2023 I do get the above CLI write, but then no more
// Appears that Connect to Socket is NOT successful
// Next write I get is at line 914
// **************************************************
ASSERT_ON_ERROR(Status);
CLI_Write(" Line 347 In _smtpConnect Status after connect to socket \n\r"); //2-16-2023 do not get this
}
CLI_Write(" Line 349 In _smtpConnect right before return SUCCESS \n\r"); //2-16-2023 do not get this
return SUCCESS;
}
E.5 Lines 839 – 951 int LHSendEmail()
int LHSendEmail()
{
usiEmailDummy = 0;
usiEmail1OrTime2 = 1; //In the function call set to 1 for email, set to 2 for get-time
_i32 retVal = -1;
retVal = initializeAppVariables();
ASSERT_ON_ERROR(retVal);
// /* Stop WDT and initialize the system-clock of the MCU */
// stopWDT();
// initClk();
/* Configure command line interface */
CLI_Configure();
displayBanner();
/*
* Following function configures the device to default state by cleaning
* the persistent settings stored in NVMEM (viz. connection profiles &
* policies, power policy etc)
*
* Applications may choose to skip this step if the developer is sure
* that the device is in its default state at start of application
*
* Note that all profiles and persistent settings that were done on the
* device will be lost
*/
retVal = configureSimpleLinkToDefaultState();
if(retVal < 0)
{
if (DEVICE_NOT_IN_STATION_MODE == retVal)
CLI_Write(" Line 874 Failed to configure the device in its default state \n\r");
// 5-24-2020, I don't see the value of LOOP_FOREVER(); as this just hangs the program forever at this point
//I think better to move on, as already printed out the failure, maybe some time later it will work
// LOOP_FOREVER();
}
CLI_Write(" Line 881 Device is configured in default state \n\r");
/*
* Initializing the CC3100 device
* Assumption is that the device is configured in station mode already
* and it is in its default state
*/
retVal = sl_Start(0, 0, 0);
if ((retVal < 0) ||
(ROLE_STA != retVal) )
{
CLI_Write(" Line 892 Failed to start the device \n\r");
// 5-24-2020, I don't see the value of LOOP_FOREVER(); as this just hangs the program forever at this point
//I think better to move on, as already printed out the failure, maybe some time later it will work
// LOOP_FOREVER();
}
CLI_Write(" Line 898 Device started as STATION \n\r");
/* Configure the source email */
retVal = setEmail();
if(retVal < 0)
LOOP_FOREVER();
/* Connecting to WLAN AP */
retVal = establishConnectionWithAP();
if(retVal < 0)
{
CLI_Write(" Line 909 Failed to establish connection w/ an AP \n\r");
// 5-24-2020, I don't see the value of LOOP_FOREVER(); as this just hangs the program forever at this point
//I think better to move on, as already printed out the failure, maybe some time later it will work
// LOOP_FOREVER();
}
CLI_Write(" Line 915 Connection established w/ AP and IP is acquired \n\r");
/* Configure and send the email */
CLI_Write(" Line 918 Sending email... \n\r"); //Jan 30, 2023 successfully get this
retVal = sendEmail();
if (retVal < 0)
{
CLI_Write(" Line 922 Device couldn't send the email \n\r");
// 5-24-2020, I don't see the value of LOOP_FOREVER(); as this just hangs the program forever at this point
//I think better to move on, as already printed out the failure, maybe some time later it will work
// LOOP_FOREVER();
// LOOP_FOREVER(); // Jan 30, 2023 put this back in as get Device couldn't send the email \n\r
//Did not solve the problem of not sending email and just locks at this point
}
else
{
CLI_Write(" Line 931 Email Sent successfully \n\r");
}
/* Disconnect from AP */
retVal = disconnectFromAP();
if(retVal < 0)
{
CLI_Write(" Line 938 Failed to disconnect from the AP \n\r");
// 5-24-2020, I don't see the value of LOOP_FOREVER(); as this just hangs the program forever at this point
//I think better to move on, as already printed out the failure, maybe some time later it will work
// LOOP_FOREVER();
}
retVal = sl_Stop(SL_STOP_TIMEOUT);
// 5-24-2020, I don't see the value of LOOP_FOREVER(); as this just hangs the program forever at this point
//I think better to move on, as already printed out the failure, maybe some time later it will work
// if(retVal < 0)
// LOOP_FOREVER();
return 0;
} // Closing bracket for int LHSendEmail()
E.6 Lines 1194 – 1233 _i32 setEmail()
static _i32 setEmail()
{
_i32 retVal = -1;
SlNetAppSourceEmail_t sourceEmailId = {0};
SlNetAppSourcePassword_t sourceEmailPwd = {0};
SlNetAppEmailOpt_t eMailServerSetting = {0};
pal_Memcpy(sourceEmailId.Username,USER,pal_Strlen(USER)+1);
retVal = sl_NetAppEmailSet(NETAPP_SOURCE_EMAIL,pal_Strlen(USER)+1,
(_u8*)&sourceEmailId);
ASSERT_ON_ERROR(retVal);
pal_Memcpy(sourceEmailPwd.Password,PASS,pal_Strlen(PASS)+1);
retVal = sl_NetAppEmailSet(NETAPP_PASSWORD,pal_Strlen(PASS)+1,
(_u8*)&sourceEmailPwd);
ASSERT_ON_ERROR(retVal);
eMailServerSetting.Family = AF_INET;
// eMailServerSetting.Port = GMAIL_HOST_PORT; //Line 27 in config.h #define GMAIL_HOST_PORT 465
// eMailServerSetting.Port = OUTLOOK_HOST_PORT; //Line i41n config.h #define OUTLOOK_PORT 587
eMailServerSetting.Port = ZOHO_HOST_PORT; //Line i41n config.h #define OUTLOOK_PORT 587
// eMailServerSetting.Port = VERIZON_HOST_PORT; //2-14-2023 changed to Verizon so can try LBH2015NVR
eMailServerSetting.Ip = SL_IPV4_VAL(74,125,129,108);
eMailServerSetting.SecurityMethod = SL_SO_SEC_METHOD_TLSV1_2; //Original 2014 to Jan 2023
eMailServerSetting.SecurityCypher = SL_SEC_MASK_TLS_RSA_WITH_AES_256_CBC_SHA; //Original 2014 to Jan 2023
//2-23-2023 Thomas Schmitt link said Gmail port 465 with SSL
// CC3100 SDK1.3.0 shows about 25 Transport Security Options, Two with SSL
// SSLV3 SSL_RSA_WITH_RC4_128_SHA
// SSLV3 SSL_RSA_WITH_RC4_128_MD5
// eMailServerSetting.SecurityMethod = SL_SO_SEC_METHOD_SSLV3;
// eMailServerSetting.SecurityCypher = SL_SEC_MASK_SSL_RSA_WITH_RC4_128_SHA;
// eMailServerSetting.SecurityCypher = SL_SEC_MASK_SSL_RSA_WITH_RC4_128_MD5;
retVal = sl_NetAppEmailSet(NETAPP_ADVANCED_OPT,sizeof(SlNetAppEmailOpt_t),
(_u8*)&eMailServerSetting);
ASSERT_ON_ERROR(retVal);
return SUCCESS;
}
E.7 Lines 1246 – 1290 _i32 sendEmail()
static _i32 sendEmail()
{
_i32 Status = -1;
Status = sl_NetAppEmailSet(NETAPP_DEST_EMAIL,
pal_Strlen(DESTINATION_EMAIL),
(_u8 *)DESTINATION_EMAIL);
ASSERT_ON_ERROR(Status);
CLI_Write(" Line 1253 After...DESTINATION_EMAIL \n\r"); //Jan 30, 2023 added this
// Status = sl_NetAppEmailSet(NETAPP_SUBJECT,
// pal_Strlen(EMAIL_SUBJECT),
// (_u8 *)EMAIL_SUBJECT);
//LH added 5-20-2020 to use my character array for the email subject
Status = sl_NetAppEmailSet(NETAPP_SUBJECT,
pal_Strlen(LHemailSubject),
(_u8 *)LHemailSubject);
ASSERT_ON_ERROR(Status);
CLI_Write(" Line 1265 After...LHemailSubject \n\r"); //Jan 30, 2023 added, this is printed
// Status = sl_NetAppEmailSet(NETAPP_MESSAGE,
// pal_Strlen(EMAIL_MESSAGE),
// (_u8 *)EMAIL_MESSAGE);
//LH added 5-20-2020 to use my character array for the email message
Status = sl_NetAppEmailSet(NETAPP_MESSAGE,
pal_Strlen(LHemailBody),
(_u8 *)LHemailBody);
ASSERT_ON_ERROR(Status);
CLI_Write(" Line 1278 After...LHemailBody \n\r"); //Jan 30, 2023 added this, this IS printed
Status = sl_NetAppEmailConnect(); //2-16-2022 looks like this function does not complete
CLI_Write(" Line 1281 After...Status = sl_NetAppEmailConnect() \n\r"); //2-16-2022, this is NOT printed
ASSERT_ON_ERROR(Status);
CLI_Write(" Line 1283 After...sl_NetAppEmailConnect \n\r"); //Jan 30, 2023 added this, this is NOT printed
Status = sl_NetAppEmailSend();
ASSERT_ON_ERROR(Status);
CLI_Write(" Line 1287 After...sl_NetAppEmailSend \n\r"); //Jan 30, 2023 added, this is NOT printed
return SUCCESS;
}
E.8 Lines 1480 – 1498 _i32 disconnectFromAP()
static _i32 disconnectFromAP()
{
_i32 retVal = -1;
/*
* The function returns 0 if 'Disconnected done', negative number if already disconnected
* Wait for 'disconnection' event if 0 is returned, Ignore other return-codes
*/
retVal = sl_WlanDisconnect();
CLI_Write(" Line 1488 in _i32 disconnectFromAP() after retVal = sl_WlanDisconnect(); \n\r");
if(0 == retVal)
CLI_Write(" Line 1490 in _i32 disconnectFromAP() after if(0 == retVal) \n\r");
{
/* Wait */
while(IS_CONNECTED(g_Status)) { _SlNonOsMainLoopTask(); }
}
return SUCCESS;
}
END
The Terma Term trace show line by line how the code is stepping throught the various function calls. I have the included lines of code so you can see exatly what lines it executed up until it said cannot send email.
*******************************************************************************
Line 881 Device is configured in default state
Line 898 Device started as STATION
Line 171 email Username
Line 180 email Password
Line 159 email port, security
Line 915 Connection established w/ AP and IP is acquired
Line 918 Sending email...
Line 189 email Destination
Line 1253 After...DESTINATION_EMAIL
Line 198 email Subject
Line 1265 After...LHemailSubject
Line 208 email Message Body
Line 1278 After...LHemailBody
Line 301 In _smtpConnect after if TLS create secure socket
Line 306 In _smtpConnect Set Socket
Line 333 In _smtpConnect before connect to Socket
Line 513 In socket.c, _sl_Connect
Line 95 In socket.c, _sl_BuildAddress
Line 554 In socket.c, _sl_Connect Verify_RET_OK
Line 335 In _smtpConnect after connect to Socket
Line 339 In _smtpConnect if Status < 0 && SL_ESECSNOVERIFY != Status
Line 1281 After...Status = sl_NetAppEmailConnect()
Line 922 Device couldn't send the email
Line 1488 in _i32 disconnectFromAP() after retVal = sl_WlanDisconnect();
Line 1490 in _i32 disconnectFromAP() after if(0 == retVal)
Line 1011 Device disconnected from the AP on application's request
// eMailServerSetting.Port = GMAIL_HOST_PORT; //Line 27 in config.h #define GMAIL_HOST_PORT 465
// eMailServerSetting.Port = OUTLOOK_HOST_PORT; //Line i41n config.h #define OUTLOOK_PORT 587
eMailServerSetting.Port = ZOHO_HOST_PORT; //Line i41n config.h #define OUTLOOK_PORT 587
// eMailServerSetting.Port = VERIZON_HOST_PORT; //2-14-2023 changed to Verizon so can try LBH2015NVR
eMailServerSetting.Ip = SL_IPV4_VAL(74,125,129,108);
eMailServerSetting.SecurityMethod = SL_SO_SEC_METHOD_TLSV1_2; //Original 2014 to Jan 2023
eMailServerSetting.SecurityCypher = SL_SEC_MASK_TLS_RSA_WITH_AES_256_CBC_SHA; //Original 2014 to Jan 2023
I am sure TI would like to advertise that they have a fix so CC3100 SDK-1.3.0 can still send emails.
I mentioned it in the Chat but I do not see it in the attached emails.
We get an SMTP return code of -111.
Google says
The SMTP 111 error occurs when an issue is present while connecting with the remote SMTP server. For example, you would run into this error due to invalid sender domains or firewall issues.
Please let me know if you need anymore information. I believe I have submitted all the sections of code that you need. I have pasted the complete Code Composer Studio emailAndGetTime.c and .h that had run for 9 years with F5529 and FR6989 micros, with the simplelink files, and includes for SDK_1.3.0.
You should be able to load and run this file. Call from main is:
ret = LHGetTime (); //Calls functions in emailAndGetTime.c; to get the time
ret = LHSendEmail (); //Calls functions in emailAndGetTime.c; to send an email
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------
I updated the problem description document that I want to post. I also plan to post a Code Composer Studio Exported working Application based on the FR6989 with the CC3100 Boost.
I am pleased to share this working code so it will be very easy for TI email / security experts to just load and run this program and work on a solution. The emailAndGetTime.c code is 99% untouched original TI SDK-1.3.0 code with enhanced links to the application. So all the WiFi, smpt, etc code is all original TI code, but obviously now lacking in being able to deal with new email server security protocols.
I also hope that other TI customers find the extensive LCD display code and Email message creation framework / code helpful as a basis for their projects.
Attached is the Posting and the CCS Exported Application ready to load into and FR6989 microcontroller with an CC3100 Boost daughter card.
Thanks for your help,
Gerald