29-05-2023, 03:05
Hi everyone
For some time now I have been using the option to upload my air quality data directly to my website using the "Air Quality Monitor - Upload data to My Server" which passes a string of data directly to my website for processing.
Recently my website host has advised that I should start adopting "https" and not "http". I have changed and updated my site to now support this change.
There is one thing that I cannot get right however which is having my weather station pass data directly to my web server when I have "Redirect from http to https" enabled on my web server. "Enhances the security of website's visitors by setting up a permanent, SEO-safe 301 redirect from the insecure HTTP to the secure HTTPS version of the website."
Have any other users come across this issue before?
I have tried the following changes with no success:
* Changing the port number from "80" (http) to "433" (https)
* Changing the web header to "https"
* Changing "My_Server" variable to "https://palmyweather.co.nz";
Any ideas on a way to fix this would be much appreciated.
Kind regards,
Matt
For some time now I have been using the option to upload my air quality data directly to my website using the "Air Quality Monitor - Upload data to My Server" which passes a string of data directly to my website for processing.
Recently my website host has advised that I should start adopting "https" and not "http". I have changed and updated my site to now support this change.
There is one thing that I cannot get right however which is having my weather station pass data directly to my web server when I have "Redirect from http to https" enabled on my web server. "Enhances the security of website's visitors by setting up a permanent, SEO-safe 301 redirect from the insecure HTTP to the secure HTTPS version of the website."
Have any other users come across this issue before?
I have tried the following changes with no success:
* Changing the port number from "80" (http) to "433" (https)
Code:
// Send AQM data to My Server
if (wifi.createTCP(mux_id, My_Server, 443, 0))
{
#ifdef PRINT_DEBUG_MYSERVER_UPLOAD
Serial.println(F("Connection OK"));
#endif
wifi.send(mux_id, (const uint8_t*)Data.c_str(), strlen(Data.c_str()));
}
* Changing the web header to "https"
Code:
Data += " HTTPS/1.0\r\nHost: "; //WebHeader_0; // " HTTPS/1.0\r\nHost: "
* Changing "My_Server" variable to "https://palmyweather.co.nz";
Code:
const char* My_Server = "palmyweather.co.nz"; // Put here your server address
const char* Path_To_LogToSQL_PHPfile = "/XXXXXXXX/AirQuality_LogToSQL.php"; // Name and path to AirQuality_LogToSQL.php file on My Server
Any ideas on a way to fix this would be much appreciated.
Kind regards,
Matt