Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Sergey Remizov
BluetoothHeater
Commits
cfa5ac85
Commit
cfa5ac85
authored
6 years ago
by
Ray Jones
Browse files
Options
Download
Plain Diff
Merge branch 'JIM_mqttSettingsPage' into MQTTstore
parents
04fab407
a36ef97a
master
DS18B20_trials
MQTTstore
V3.1.3
V3.1.2
V3.1.1
V3.1.0
V3.0.3
V3.0.3a
V3.0.2
V3.0.1
V2.3.6n
V2.3.6c
V2.3.5
V2.3.4
V2.3.3
V2.3.2
V2.3.1
V2.3.0
JustinMods
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
Arduino/BTCDieselHeater/BTCDieselHeater.ino
+1
-0
Arduino/BTCDieselHeater/BTCDieselHeater.ino
Arduino/BTCDieselHeater/data/index.html
+80
-3
Arduino/BTCDieselHeater/data/index.html
Arduino/BTCDieselHeater/src/WiFi/BTCWifi.h
+1
-0
Arduino/BTCDieselHeater/src/WiFi/BTCWifi.h
with
82 additions
and
3 deletions
+82
-3
Arduino/BTCDieselHeater/BTCDieselHeater.ino
View file @
cfa5ac85
...
...
@@ -85,6 +85,7 @@
This example code is in the public domain.
*/
#include "src/WiFi/ABMqtt.h"
#include <OneWire.h>
#include <Wire.h>
#include "src/cfg/BTCConfig.h"
...
...
This diff is collapsed.
Click to expand it.
Arduino/BTCDieselHeater/data/index.html
View file @
cfa5ac85
<!DOCTYPE html>
<!DOCTYPE html>
<html
lang=
"en"
>
<head>
<meta
charset=
"utf-8"
/>
...
...
@@ -35,7 +35,22 @@ function init() {
case
"
RunString
"
:
document
.
getElementById
(
key
).
innerHTML
=
heater
[
key
];
break
;
case
"
PumpFixed
"
:
case
"
MEn
"
:
document
.
getElementById
(
key
).
value
=
heater
[
key
];
break
;
case
"
MPort
"
:
document
.
getElementById
(
key
).
value
=
heater
[
key
];
break
;
case
"
MHost
"
:
document
.
getElementById
(
key
).
value
=
heater
[
key
];
break
;
case
"
MUser
"
:
document
.
getElementById
(
key
).
value
=
heater
[
key
];
break
;
case
"
MPasswd
"
:
document
.
getElementById
(
key
).
value
=
heater
[
key
];
break
;
case
"
PumpFixed
"
:
case
"
TempCurrent
"
:
document
.
getElementById
(
key
).
innerHTML
=
parseFloat
(
heater
[
key
]).
toFixed
(
1
);
break
;
...
...
@@ -134,6 +149,18 @@ function setcurrenttime(){
}
function
setMQTTDetails
(){
var
cmd
=
{};
cmd
.
MEn
=
document
.
getElementById
(
"
MEn
"
).
value
;
sendJSONobject
(
cmd
);
cmd
.
MHost
=
document
.
getElementById
(
"
MHost
"
).
value
;
sendJSONobject
(
cmd
);
cmd
.
MPasswd
=
document
.
getElementById
(
"
MPasswd
"
).
value
;
sendJSONobject
(
cmd
);
cmd
.
MUser
=
document
.
getElementById
(
"
MUser
"
).
value
;
sendJSONobject
(
cmd
);
}
function
setcurrentdate
(){
var
cmd
=
{};
cmd
.
Date
=
document
.
getElementById
(
"
curdate
"
).
value
;
...
...
@@ -183,6 +210,8 @@ function funcdispSettings() {
}
function
funcdispHome
(){
document
.
getElementById
(
"
Settings
"
).
style
.
display
=
"
none
"
;
document
.
getElementById
(
"
Home
"
).
style
.
display
=
"
block
"
;
...
...
@@ -238,6 +267,25 @@ function onSlideDone(newVal, JSONKey) {
sendJSONobject
(
cmd
);
}
function
UpdateMQTTSettings
()
{
var
cmd
=
{};
cmd
.
Time
=
document
.
getElementById
(
"
MPort
"
).
value
;
sendJSONobject
(
cmd
);
var
cmd
=
{};
cmd
.
Time
=
document
.
getElementById
(
"
MEn
"
).
value
;
sendJSONobject
(
cmd
);
var
cmd
=
{};
cmd
.
Time
=
document
.
getElementById
(
"
MHost
"
).
value
;
sendJSONobject
(
cmd
);
var
cmd
=
{};
cmd
.
Time
=
document
.
getElementById
(
"
MUsername
"
).
value
;
sendJSONobject
(
cmd
);
var
cmd
=
{};
cmd
.
Time
=
document
.
getElementById
(
"
MPasswd
"
).
value
;
sendJSONobject
(
cmd
);
}
function
onSlideUpdate
(
newVal
,
JSONKey
)
{
//elementid must equal the JSON name for each setting
...
...
@@ -251,6 +299,17 @@ function SetPumpMin(){
sendJSONobject
(
cmd
);
}
function
funcShowMQTT
()
{
var
checkbox
=
document
.
getElementById
(
"
MEn
"
);
if
(
checkbox
.
checked
==
false
)
{
document
.
getElementById
(
"
DIVMPort
"
).
style
.
display
=
"
none
"
;
}
else
{
document
.
getElementById
(
"
DIVMPort
"
).
style
.
display
=
"
block
"
;
}
}
</script>
<meta
name=
"viewport"
content=
"height=device-height, width=device-width, initial-scale=1"
>
...
...
@@ -440,6 +499,8 @@ display: none
display
:
none
}
#DIVMPort
{
display
:
none
}
</style>
...
...
@@ -518,7 +579,7 @@ display: none
</div>
<D
iv
id=
"Settings"
>
<d
iv
id=
"Settings"
>
Current Date:
<br>
<input
type=
"date"
id=
"curdate"
><input
type=
"button"
Value=
"Set Date"
onclick=
"setcurrentdate()"
>
...
...
@@ -526,11 +587,27 @@ Current Date:<br>
Current Time (24 Hour Format):
<br>
<input
type=
"time"
id=
"curtime"
>
<input
type=
"button"
Value=
"Set Time"
onclick=
"setcurrenttime()"
>
<br><br>
<hr></hr>
<H2>
MQTT Settings
</H2>
<b>
Enabled:
</b><input
type=
"checkbox"
border-radius=
"4px"
name=
"MEn"
id=
"MEn"
onclick=
"funcShowMQTT()"
>
<div
id=
"DIVMPort"
>
<b>
Host/Server:
</b><input
type=
"text"
name=
"MHost"
id=
"MHost"
value=
""
></br>
<b>
Port:
</b><input
type=
"text"
name=
"MPort"
id=
"MPort"
defaultvalue=
"1883"
value=
"1883"
></br>
<b>
Username:
</b><input
type=
"text"
name=
"MUser"
id=
"MUser"
value=
""
></br>
<b>
Password:
</b><input
type=
"text"
name=
"MPasswd"
id=
"MPasswd"
value=
""
></br></br>
<input
type=
"button"
name=
"mqttsubmit"
value=
"Save/Update Settings"
onclick=
"UpdateMQTTSettings()"
>
</div>
<br><br>
<hr></hr>
<br><br>
<div
id=
"Timer"
Timer1:
<
input
type=
"checkbox"
border-radius=
"4px"
name=
"Timer"
id=
"Timer1onoff"
>
<input
type=
"text"
class=
"schedule"
id=
"Timer1Start"
>
<input
type=
"text"
id=
"Timer1End"
>
<br>
Timer2:
<input
type=
"checkbox"
border-radius=
"4px"
name=
"Tue"
>
<input
type=
"text"
class=
"schedule"
id=
"Timer2Start"
>
<input
type=
"text"
id=
"Timer2End"
><br>
<input
type=
"button"
Value=
"Save Schedule"
onclick=
"setSchedule()"
>
</Div>
</div>
</body>
</html>
This diff is collapsed.
Click to expand it.
Arduino/BTCDieselHeater/src/WiFi/BTCWifi.h
View file @
cfa5ac85
...
...
@@ -32,6 +32,7 @@
const
char
*
getWifiSTAAddrStr
();
const
char
*
getWifiAPMACStr
();
const
char
*
getWifiSTAMACStr
();
bool
isWifiConnected
();
bool
isWifiAP
();
bool
isWifiSTA
();
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help