ESP8266 data uploading to sql or hosting

Hello everybody,

I am new here, so I don’t know much about this forum, although I have tried my best to select the relevant forum.

I am working on a project, where I am trying to upload my sensors’ data on a web server. I am using ESP8266 in its purest form, not using any breakout board like NodeMCU.

I’m using this ESP8266: ESP8266 Pinout, Datasheet, Features & Applications - The Engineering Projects

I have successfully connected it with WiFi and it’s getting the webpage. Now my question, How can I upload my sensors’ data on my web server??

I don’'t want the code, I just want to know the way to do it? Should I use FTP and upload txt files containing data or there’s any other way to store data in DB or hosting?

Thanks in advance. :slight_smile:

You can have your ESP send a request for a web page.

"http:myButtIsNotTelling.com/EnableHumidity.php?&chkYesNo=1"

The web server can take that request for a web page that has:

<?php
$chkYesNo = $_GET['chkYesNo'];
include 'db_connection.php';
$query = "UPDATE State SET EnableHumidity =" . $chkYesNo ;  
$result = mysqli_query($con, $query); 
mysqli_close($con); 
?>

is one way of doing the thing.

Or you can use MySQL Connector Arduino

Or you can do other things that are a bit more complicated.

Idahowalker:
You can have your ESP send a request for a web page.

Is it a secure way to send the data as parameter? It's too open, anyone can access it or update it (I think).

oliviasmithh900:
Is it a secure way to send the data as parameter? It's too open, anyone can access it or update it (I think).

I use a RPi as a MQTT Broker. All the ESP32's connect to the RPi on a local network. The RPi connects, on a different network, to the internet.

I don't use the http thingy cause of the obvious issues.

Idahowalker:
I use a RPi as a MQTT Broker. All the ESP32's connect to the RPi on a local network. The RPi connects, on a different network, to the internet.

I don't use the http thingy cause of the obvious issues.

Yeah Raspberry Pi is an easy option but it comes with a price so let's try some more luck with esp8266 as its low cost.

@oliviasmithh900

Banned as a sock puppet you may complain through official channels if you wish the account restored.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.