Greetings,
I have an text sending issue that I hope someone will be able to help me with. Here are the details:
My microcontrollers are - Adafruit Feather MO WIFI
Computer - iMac OSX v12.6
Arduino IDE v2.0.1
Background
I have developed a water level sensor for my water association. This microcontroller is embedded in an enclosure which is why I refer to it as the 'Embedded Board'. Receiving texts from this board is the heart of this project because it sends low water level alerts to member's so they can act on the problem causing the low water level.
The 'Test Board', is just that, a Feather MO WIFI used for test purposes.
Sketches
The pertinent function that triggers text sending is nearly identical in both sketches. This will be shown later.
Test Board
I can receive texts from either HTTP or HTTPS websites using the sketch on this test board.
Problem
The 'Embedded Board' will send texts from an HTTP website, but will not send texts from an HTTPS. The pertinent text sending functions are as follows:
Test Board text sending function:
{
//if (client.connect(server, 80)) { // use for HTTP ports
if (client.connectSSL(server, 443)) { // use for HTTPS ports
client.println("POST /includes/text_to_be_sent.php HTTP/1.1");
client.println("Host: www.https-site.org");
//client.println("Host: www.http-site.com");
client.println("Content-Type: application/x-www-form-urlencoded");
client.print("Content-Length: ");
client.println(postData.length());
client.println();
client.print(postData);
Serial.println("Message sent!");
}
if (client.connected()) {
client.stop();
}
delay(60000);
}
Embedded Board text sending function:
void send_text(float interval, float tank_level){
String current_tank_level = String (tank_level,2);
postData = postVariable + current_tank_level;
unsigned long tank_level_currentMillis = millis();
if (tank_level_currentMillis - tank_level_previousMillis >= interval)
{
tank_level_previousMillis = tank_level_currentMillis;
//if (client.connect(server, 80)) // HTTP port ...
if (client.connectSSL(server, 443)) // HTTP port ...
{
client.println("POST /includes/text_to_be_sent.php HTTP/1.1");
client.println("Host: www.https-site.org");
//client.println( "Host: www.http-site.com" );
client.println( "Content-Type: application/x-www-form-urlencoded" );
client.print("Content-Length: ");
client.println(postData.length());
client.println();
client.print(postData);
Serial.println("Email Sent");
Serial.println(postData);
}
if (client.connected()) {
client.stop();
}
}
}
The Embedded Board text sending function receives a time delay (interval) and the current water level (tank_level). This function is only triggered if the water level falls below 8 feet.
QUESTION
Using a nearly identical text sending sketch function as the Test Board - why is the Embedded Board able to send texts from an HTTP website but not from an HTTPS website?
I hope I have made my problem as clear as possible. If not please let me know.
Thank you for any help you can provide.




