While going through your project “Visualize Your Sensor Readings from Anywhere in the World (ESP32/ESP8266 + MySQL + PHP)” step by step, I get an empty, white screen when viewing esp-chart.php in my Edge browser.
I have completed steps 1, 2 and 3 on your page Visualize ESP32/ESP8266 Sensor Readings from Anywhere in the World | Random Nerd Tutorials with succes. That means that the layouts/pictures up to and including the picture showing the result after loading http://example.com/post-data.php are the same as on your page.
Then after having saved the created page esp-chart.php with the code in step 4 I get, as said above, a white empty screen in my browser. To make sure, I have made a new esp-chart page with code but also that page was empty.
When I temporarily remove the code between <?php and ?> of esp-chart.php then
(only) the text “ESP Weather Station” is shown in the browser.
After uploading the code to the ESP32 dev module with the Arduino IDE in step 5 the serial monitor showed:
httpRequestData: api_key=tPmAT5Ab3j7F9&value1=19.46&value2=46.67&value3=1008.76
HTTP Response code: 400
httpRequestData: api_key=tPmAT5Ab3j7F9&value1=19.50&value2=46.36&value3=1008.75
HTTP Response code: 400
So I also have to deal with a code 400:Bad request error. I have used the hosting service of my ISP. Maybe there are not sufficient privileges from the web server under these circumstances, although maintaining my own website just works.
Perhaps you have some tips to try with which I can further investigate what is going wrong.
Hello Rui,
Thank you for your reply.
I have a paid subscription with a serviceprovider (not Bluehost) that is hosting my website. After having logged on I can access the Controlpanel which is facilitating including the Filemanager, a Database server MySQL and also phpMyAdmin. No problem so far. Only the page esp-chart.php with the code you provide on your Example page is empty (white page).
I give it a try to solve this empty page first and then looking into the HTTP 400 failure. Maybe that is a Read/Write problem (file security setting owner/group/world).
I assume that there should be no difference between my ISP and Bluehost as far as using php is concerned.
Can you please post the URL for your domain name including the path for the project files? So I can take a look, I think your host is enabling https by default on those urls