-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
extend trender use cases introductin ThingSpeak Connector.
AP will be closed after 30s (TK_BASE_TIMEOUT) in case no timekeeper is initiated. ThingSpeak mode can also be forced using dedicated webpage. TODO : Implement states 1&2 for state machine in loop function
- Loading branch information
1 parent
6942017
commit 2664aa0
Showing
3 changed files
with
159 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
/** | ||
* This file is part of Trender. | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
* | ||
* Copyright 2016 Jérôme Labidurie [email protected] | ||
* Copyright 2016 Cédric Bernard [email protected] | ||
* Copyright 2016 Julien Jacques [email protected] | ||
*/ | ||
|
||
#ifndef PAGE_THINGPSEAK_H | ||
#define PAGE_THINGPSEAK_H | ||
|
||
|
||
// | ||
// The HTML PAGE | ||
// | ||
const char PAGE_ThingSpeak[] = R"=====( | ||
<meta name="viewport" content="width=device-width, initial-scale=1" /> | ||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | ||
<link rel="stylesheet" href="style.css" type="text/css" /> | ||
<script src="microajax.js"></script> | ||
<a href="/" class="btn btn--s"><</a> <strong>ThingSpeak Mode enabled, reset device to go back to Configuration Mode</strong> | ||
<hr> | ||
<table border="0" cellspacing="0" cellpadding="3" style="width:310px" > | ||
<tr><td align="right">ChannelID :</td><td><span id="x_channelid"></span></td></tr> | ||
<tr><td colspan="2" align="center"><a href="javascript:GetThingSpeakState()" class="btn btn--m btn--blue">Refresh</a></td></tr> | ||
</table> | ||
<script> | ||
|
||
function GetThingSpeakState() | ||
{ | ||
setValues("/admin/infothingspeak"); | ||
} | ||
|
||
window.onload = function () | ||
{ | ||
load("style.css","css", function() | ||
{ | ||
load("microajax.js","js", function() | ||
{ | ||
GetThingSpeakState(); | ||
}); | ||
}); | ||
} | ||
function load(e,t,n){if("js"==t){var a=document.createElement("script");a.src=e,a.type="text/javascript",a.async=!1,a.onload=function(){n()},document.getElementsByTagName("head")[0].appendChild(a)}else if("css"==t){var a=document.createElement("link");a.href=e,a.rel="stylesheet",a.type="text/css",a.async=!1,a.onload=function(){n()},document.getElementsByTagName("head")[0].appendChild(a)}} | ||
|
||
|
||
|
||
</script> | ||
)=====" ; | ||
// | ||
// FILL WITH INFOMATION | ||
// | ||
|
||
void send_thingspeak_values_html () | ||
{ | ||
|
||
String values =""; | ||
|
||
values += "x_channelid|" + (String)myThingSpeakChannel + "|div\n"; | ||
server.send ( 200, "text/plain", values); | ||
Serial.println(__FUNCTION__); | ||
|
||
thingSpeakMode=1; | ||
|
||
|
||
|
||
|
||
} | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters