-->
Page 1 of 2

Add data to web server from BMP180

PostPosted: Thu Jul 22, 2021 12:17 pm
by zepjau
Hello.
I need add data from BMP180 to a web server page into my ESP8266.

How can i do it?

Regards.

Re: Add data to web server from BMP180

PostPosted: Thu Jul 22, 2021 12:21 pm
by eriksl
1) write code for web server
2) write code for I2C interface
3) write code for BMP180 interface

But actually don't use BMP180, it's obsolete and inaccurate.

Re: Add data to web server from BMP180

PostPosted: Thu Jul 22, 2021 2:19 pm
by Bonzo
Try searching the web for: esp8266 send data website
There are quite a few examples to follow. One tip is try and use a http web page not a https page as that creates problems.

Re: Add data to web server from BMP180

PostPosted: Fri Jul 23, 2021 5:36 am
by zepjau
Thank you.
I need insert data values into this html page:
const char index_html[] PROGMEM = R"rawliteral(
<!DOCTYPE HTML><html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
html {font-family: Arial; display: inline-block; text-align: center;}
h2 {font-size: 3.0rem;}
p {font-size: 3.0rem;}
body {max-width: 600px; margin:0px auto; padding-bottom: 25px;}
.switch {position: relative; display: inline-block; width: 120px; height: 68px}
.switch input {display: none}
.slider {position: absolute; top: 0; left: 0; right: 0; bottom: 0; background-color: #ccc; border-radius: 34px}
.slider:before {position: absolute; content: ""; height: 52px; width: 52px; left: 8px; bottom: 8px; background-color: #fff; -webkit-transition: .4s; transition: .4s; border-radius: 68px}
input:checked+.slider {background-color: #2196F3}
input:checked+.slider:before {-webkit-transform: translateX(52px); -ms-transform: translateX(52px); transform: translateX(52px)}
</style>
</head>
<body>
<h3>Control 4 zonas</h3>
%BUTTONPLACEHOLDER%
<script>function toggleCheckbox(element) {
var xhr = new XMLHttpRequest();
if(element.checked){ xhr.open("GET", "/update?relay="+element.id+"&state=1", true); }
else { xhr.open("GET", "/update?relay="+element.id+"&state=0", true); }
xhr.send();
}</script>
<form method="post" action="/save" >
Encendido:<sp><input name="onTime" type="text" size="10" value="5" ><br><br>
Apagado :<sp><input name="offTime" type="text" size="10" value="8" ><br>
<input type="submit" name="clk_action" value="accept">
</form>
</body>
</html>
)rawliteral";

How do it?.

Regards.
Javier.