change webserver
This commit is contained in:
parent
c4f4043007
commit
17ff81c11d
@ -1,64 +0,0 @@
|
|||||||
<!doctype html>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<title>fadeIn demo</title>
|
|
||||||
<style>
|
|
||||||
p {
|
|
||||||
text-align:center;
|
|
||||||
}
|
|
||||||
div {
|
|
||||||
margin:auto;
|
|
||||||
font-size: 36px;
|
|
||||||
text-align: center;
|
|
||||||
color: yellow;
|
|
||||||
background: red;
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
span {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
<script src="https://code.jquery.com/jquery-1.10.2.js"></script>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
|
|
||||||
<div>
|
|
||||||
<span><div style='text-align:left;display:inline-block;min-width:340px;'>
|
|
||||||
<div style='text-align:center;'>
|
|
||||||
<h1>Passerelle LoRa</h1>
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<h2>[Température actuelle]</h2>
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<p>
|
|
||||||
Nombre d'échantillons envoyés = %, Echec d'envoi : %
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
<div id='l1' name='l1'></div>
|
|
||||||
<!--<table style='width:100%'>
|
|
||||||
<tr>
|
|
||||||
<button onclick='la('?o=1');'>Informations</button>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<button onclick='alea()'>rafraichir</button>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<button onclick='la('?o=1');'>Redémarrer</button>
|
|
||||||
</tr>
|
|
||||||
</table>-->
|
|
||||||
</div></span>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
$(document).ready(function() {
|
|
||||||
$( "div" ).fadeIn( 3000, function() {
|
|
||||||
$( "span" ).fadeIn( 100 );
|
|
||||||
});
|
|
||||||
return false;
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
112
WebServer/index.htm
Normal file
112
WebServer/index.htm
Normal file
@ -0,0 +1,112 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang='fr' class=''>
|
||||||
|
<head>
|
||||||
|
<meta charset='utf-8'>
|
||||||
|
<meta name='viewport' content='width=device-width,initial-scale=1,user-scalable=no'/>
|
||||||
|
<meta http-equiv='refresh' content='1' />
|
||||||
|
<title>Passerelle LoRa</title>
|
||||||
|
<style>
|
||||||
|
div,fieldset,input,select
|
||||||
|
{
|
||||||
|
padding:5px;
|
||||||
|
font-size:1em;
|
||||||
|
}
|
||||||
|
|
||||||
|
input
|
||||||
|
{
|
||||||
|
width:100%;
|
||||||
|
box-sizing:border-box;
|
||||||
|
-webkit-box-sizing:border-box;
|
||||||
|
-moz-box-sizing:border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
select
|
||||||
|
{
|
||||||
|
width:100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
textarea
|
||||||
|
{
|
||||||
|
resize:none;
|
||||||
|
width:98%;
|
||||||
|
height:318px;
|
||||||
|
padding:5px;
|
||||||
|
overflow:auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
body
|
||||||
|
{
|
||||||
|
text-align:center;
|
||||||
|
font-family:verdana;
|
||||||
|
background-color: #bcd5ff;
|
||||||
|
}
|
||||||
|
|
||||||
|
td
|
||||||
|
{
|
||||||
|
padding:0px;
|
||||||
|
}
|
||||||
|
|
||||||
|
button
|
||||||
|
{
|
||||||
|
border:0;
|
||||||
|
border-radius:0.3rem;
|
||||||
|
background-color:#1fa3ec;
|
||||||
|
color:#fff;
|
||||||
|
line-height:2.4rem;
|
||||||
|
font-size:1.2rem;
|
||||||
|
width:100%;
|
||||||
|
-webkit-transition-duration:0.4s;
|
||||||
|
transition-duration:0.4s;
|
||||||
|
}
|
||||||
|
|
||||||
|
button:hover
|
||||||
|
{
|
||||||
|
background-color:#006cba;
|
||||||
|
}
|
||||||
|
|
||||||
|
.p
|
||||||
|
{
|
||||||
|
float:left;
|
||||||
|
text-align:left;
|
||||||
|
}
|
||||||
|
|
||||||
|
.q
|
||||||
|
{
|
||||||
|
float:right;
|
||||||
|
text-align:right;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body onload='alea()'>
|
||||||
|
<script>
|
||||||
|
function alea() {
|
||||||
|
var x = document.getElementById('demo')x.innerHTML = Math.floor((Math.random() * 10) + 1);
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<div style='text-align:left;display:inline-block;min-width:340px;'>
|
||||||
|
<div style='text-align:center;'>
|
||||||
|
<h1>Passerelle LoRa</h1>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<h2>[Température actuelle]</h2>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<p>
|
||||||
|
Nombre d'échantillons envoyés = %, Echec d'envoi : %
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<div id='l1' name='l1'></div>
|
||||||
|
<table style='width:100%'>
|
||||||
|
<tr>
|
||||||
|
<button onclick='la('?o=1');'>Informations</button>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<button onclick='alea()'>rafraichir</button>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<button onclick='la('?o=1');'>Redémarrer</button>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@ -1,121 +1,64 @@
|
|||||||
<!DOCTYPE html>
|
<!doctype html>
|
||||||
<html lang='fr' class=''>
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta charset='utf-8'>
|
<meta charset="utf-8">
|
||||||
<meta name='viewport' content='width=device-width,initial-scale=1,user-scalable=no'/>
|
<title>Passerelle LoRa</title>
|
||||||
<!--<meta http-equiv='refresh' content='1' />-->
|
<style>
|
||||||
<title>Passerelle LoRa</title>
|
p {
|
||||||
<style>
|
text-align:center;
|
||||||
div,fieldset,input,select
|
}
|
||||||
{
|
div {
|
||||||
padding:5px;
|
margin:auto;
|
||||||
font-size:1em;
|
font-size: 36px;
|
||||||
}
|
text-align: center;
|
||||||
|
color: black;
|
||||||
|
background: white;
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
span {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<script src="https://code.jquery.com/jquery-1.10.2.js"></script>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
|
||||||
input
|
<div>
|
||||||
{
|
<span><div style='text-align:left;display:inline-block;min-width:340px;'>
|
||||||
width:100%;
|
<div style='text-align:center;'>
|
||||||
box-sizing:border-box;
|
<h1>Passerelle LoRa</h1>
|
||||||
-webkit-box-sizing:border-box;
|
</div>
|
||||||
-moz-box-sizing:border-box;
|
<div>
|
||||||
}
|
<h2>[Température actuelle]</h2>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<p>
|
||||||
|
Nombre d'échantillons envoyés = %, Echec d'envoi : %
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<div id='l1' name='l1'></div>
|
||||||
|
<!--<table style='width:100%'>
|
||||||
|
<tr>
|
||||||
|
<button onclick='la('?o=1');'>Informations</button>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<button onclick='alea()'>rafraichir</button>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<button onclick='la('?o=1');'>Redémarrer</button>
|
||||||
|
</tr>
|
||||||
|
</table>-->
|
||||||
|
</div></span>
|
||||||
|
</div>
|
||||||
|
|
||||||
select
|
<script>
|
||||||
{
|
$(document).ready(function() {
|
||||||
width:100%;
|
$( "div" ).fadeIn( 2000, function() {
|
||||||
}
|
$( "span" ).fadeIn( 100 );
|
||||||
|
});
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
textarea
|
</body>
|
||||||
{
|
|
||||||
resize:none;
|
|
||||||
width:98%;
|
|
||||||
height:318px;
|
|
||||||
padding:5px;
|
|
||||||
overflow:auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
body
|
|
||||||
{
|
|
||||||
text-align:center;
|
|
||||||
font-family:verdana;
|
|
||||||
background-color: #bcd5ff;
|
|
||||||
}
|
|
||||||
|
|
||||||
td
|
|
||||||
{
|
|
||||||
padding:0px;
|
|
||||||
}
|
|
||||||
|
|
||||||
button
|
|
||||||
{
|
|
||||||
border:0;
|
|
||||||
border-radius:0.3rem;
|
|
||||||
background-color:#1fa3ec;
|
|
||||||
color:#fff;
|
|
||||||
line-height:2.4rem;
|
|
||||||
font-size:1.2rem;
|
|
||||||
width:100%;
|
|
||||||
-webkit-transition-duration:0.4s;
|
|
||||||
transition-duration:0.4s;
|
|
||||||
}
|
|
||||||
|
|
||||||
button:hover
|
|
||||||
{
|
|
||||||
background-color:#006cba;
|
|
||||||
}
|
|
||||||
|
|
||||||
.p
|
|
||||||
{
|
|
||||||
float:left;
|
|
||||||
text-align:left;
|
|
||||||
}
|
|
||||||
|
|
||||||
.q
|
|
||||||
{
|
|
||||||
float:right;
|
|
||||||
text-align:right;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
<script
|
|
||||||
src="https://code.jquery.com/jquery-3.3.1.min.js"
|
|
||||||
integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8="
|
|
||||||
crossorigin="anonymous"></script>
|
|
||||||
</head>
|
|
||||||
<body onload=mafonction()>
|
|
||||||
<!--<script>
|
|
||||||
function alea() {
|
|
||||||
var x = document.getElementById('demo')x.innerHTML = Math.floor((Math.random() * 10) + 1);
|
|
||||||
}
|
|
||||||
</script>-->
|
|
||||||
<div style='text-align:left;display:inline-block;min-width:340px;'>
|
|
||||||
<div style='text-align:center;'>
|
|
||||||
<h1>Passerelle LoRa</h1>
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<h2>[Température actuelle]</h2>
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<p>
|
|
||||||
Nombre d'échantillons envoyés = %, Echec d'envoi : %
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
<div id='l1' name='l1'></div>
|
|
||||||
<!--<table style='width:100%'>
|
|
||||||
<tr>
|
|
||||||
<button onclick='la('?o=1');'>Informations</button>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<button onclick='alea()'>rafraichir</button>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<button onclick='la('?o=1');'>Redémarrer</button>
|
|
||||||
</tr>
|
|
||||||
</table>-->
|
|
||||||
</div>
|
|
||||||
<script type="text/javascript">
|
|
||||||
function mafonction(){
|
|
||||||
$(document.body).fadeIn(6000);
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
</body>
|
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@ -12,7 +12,7 @@ void setup() {
|
|||||||
SerialUSB.begin(9600);
|
SerialUSB.begin(9600);
|
||||||
SerialUSB.println("LoRa Sender");
|
SerialUSB.println("LoRa Sender");
|
||||||
thisLoRa.begin();
|
thisLoRa.begin();
|
||||||
protocol.codeFrame(0x0B,0x00,0x0000,0x0001,0x0000,0x0000,0x0000);
|
protocol.codeFrame(0x0A,0x00,0x0000,0x0001,0x0000,0x0000,0x0000);
|
||||||
}
|
}
|
||||||
|
|
||||||
void loop()
|
void loop()
|
||||||
|
|||||||
@ -15,6 +15,10 @@ CProtocol12Bytes protocol; // create object to
|
|||||||
|
|
||||||
File webFile; // variable for the file containing the webpage
|
File webFile; // variable for the file containing the webpage
|
||||||
|
|
||||||
|
//String postData;
|
||||||
|
//String tsarray;
|
||||||
|
//String oldpostData;
|
||||||
|
|
||||||
byte mac[] = {0xFA, 0xE3, 0x40, 0xEF, 0xFF, 0xFD}; // set the mac address
|
byte mac[] = {0xFA, 0xE3, 0x40, 0xEF, 0xFF, 0xFD}; // set the mac address
|
||||||
//IPAddress ip(192, 1, 1, 150); // set the IP address for the ethernet shield, overwise the librairy use DHCP
|
//IPAddress ip(192, 1, 1, 150); // set the IP address for the ethernet shield, overwise the librairy use DHCP
|
||||||
|
|
||||||
@ -43,11 +47,11 @@ void setup(){
|
|||||||
return; // init failed
|
return; // init failed
|
||||||
}
|
}
|
||||||
SerialUSB.println("SUCCESS - SD card initialized.");
|
SerialUSB.println("SUCCESS - SD card initialized.");
|
||||||
if (!SD.exists("index.htm")) { // check for index.htm file
|
if (!SD.exists("index.html")) { // check for index.html file
|
||||||
SerialUSB.println("ERROR - Can't find index.htm file!");
|
SerialUSB.println("ERROR - Can't find index.html file!");
|
||||||
return; // can't find index file
|
return; // can't find index file
|
||||||
}
|
}
|
||||||
SerialUSB.println("SUCCESS - Found index.htm file.");
|
SerialUSB.println("SUCCESS - Found index.html file.");
|
||||||
}// end of setup
|
}// end of setup
|
||||||
|
|
||||||
void loop() {
|
void loop() {
|
||||||
@ -117,7 +121,7 @@ void loop() {
|
|||||||
serverGateway.println("Connection: close");
|
serverGateway.println("Connection: close");
|
||||||
serverGateway.println();
|
serverGateway.println();
|
||||||
// send web page
|
// send web page
|
||||||
webFile = SD.open("index.htm"); // open web page file
|
webFile = SD.open("index.html"); // open web page file
|
||||||
if (webFile) { // if the webfile exist
|
if (webFile) { // if the webfile exist
|
||||||
while(webFile.available()) { // the webfile is avaible
|
while(webFile.available()) { // the webfile is avaible
|
||||||
serverGateway.write(webFile.read()); // send webfile to client
|
serverGateway.write(webFile.read()); // send webfile to client
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user