Skip to content

Commit

Permalink
Merge pull request #56 from thorrak/tweaks
Browse files Browse the repository at this point in the history
Merge tweaks for v0.2.3 release
  • Loading branch information
thorrak committed Dec 29, 2020
2 parents 42adac7 + 2d36315 commit a182588
Show file tree
Hide file tree
Showing 22 changed files with 259 additions and 118 deletions.
Binary file modified bin/d32_pro_tft_firmware.bin
Binary file not shown.
Binary file modified bin/d32_pro_tft_spiffs.bin
Binary file not shown.
Binary file modified bin/lcd_ssd1306_firmware.bin
Binary file not shown.
Binary file modified bin/lcd_ssd1306_spiffs.bin
Binary file not shown.
Binary file modified bin/tft_espi_firmware.bin
Binary file not shown.
Binary file modified bin/tft_espi_spiffs.bin
Binary file not shown.
6 changes: 3 additions & 3 deletions data/about.htm
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.5.0/css/all.css" integrity="sha384-B4dIYHKNBt8Bc12p+WXckhzcICo0wtJAoU8YZTY5qE0Id1GSseTk6S+L3BlXeVIU" crossorigin="anonymous">
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
<link rel="icon" href="favicon.ico" type="image/x-icon">

<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon">
<link rel="icon" href="/favicon.ico" type="image/x-icon">
<style>
body {padding-top: 5rem; padding-bottom: 5rem;}

Expand Down
6 changes: 3 additions & 3 deletions data/calibration.htm
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.5.0/css/all.css" integrity="sha384-B4dIYHKNBt8Bc12p+WXckhzcICo0wtJAoU8YZTY5qE0Id1GSseTk6S+L3BlXeVIU" crossorigin="anonymous">
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
<link rel="icon" href="favicon.ico" type="image/x-icon">

<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon">
<link rel="icon" href="/favicon.ico" type="image/x-icon">
<style>
body {padding-top: 5rem; padding-bottom: 5rem;}

Expand Down
13 changes: 8 additions & 5 deletions data/index.htm
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.5.0/css/all.css" integrity="sha384-B4dIYHKNBt8Bc12p+WXckhzcICo0wtJAoU8YZTY5qE0Id1GSseTk6S+L3BlXeVIU" crossorigin="anonymous">
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
<link rel="icon" href="favicon.ico" type="image/x-icon">
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon">
<link rel="icon" href="/favicon.ico" type="image/x-icon">

<!-- Custom styles for this template -->
<style>
Expand Down Expand Up @@ -70,7 +70,7 @@ <h6 class="card-subtitle mb-2 text-muted">Google Sheets: {{sensor.gsheets_name}}
<!-- GravitySensor Line -->
<div class="row">
<div class="col-6 d-flex flex-column text-center">
<div class="p-2 h3">Gravity</div><div class="p-2">{{sensor.gravity | numeral('0.000')}}</div>
<div class="p-2 h3">Gravity</div><div class="p-2">{{sensor.gravity | numeral('0.0000')}}</div>
</div>
<div class="col-6 d-flex flex-column text-center">
<div class="p-2 h3">Temp</div><div class="p-2 text-center">{{sensor.temp}} &deg;{{sensor.tempUnit}}</div>
Expand Down Expand Up @@ -110,9 +110,12 @@ <h6 class="card-subtitle mb-2 text-muted">Google Sheets: {{sensor.gsheets_name}}
xhr.onload = function () {
self.fullDict = JSON.parse(xhr.responseText);
self.sensors = [];
Object.keys(self.fullDict).forEach(function(key) {

if (self.fullDict != null) {
Object.keys(self.fullDict).forEach(function(key) {
self.sensors.push(self.fullDict[key]);
});
});
}
//console.log(self.fullDict);
//console.log(self.sensors);
};
Expand Down
44 changes: 39 additions & 5 deletions data/restarting.htm
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,8 @@
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.5.0/css/all.css" integrity="sha384-B4dIYHKNBt8Bc12p+WXckhzcICo0wtJAoU8YZTY5qE0Id1GSseTk6S+L3BlXeVIU" crossorigin="anonymous">
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
<link rel="icon" href="favicon.ico" type="image/x-icon">

<meta http-equiv="refresh" content="20;url=/" />
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon">
<link rel="icon" href="/favicon.ico" type="image/x-icon">

<!-- Custom styles for this template -->
<style>
Expand Down Expand Up @@ -59,11 +57,47 @@ <h4>Restarting Tiltbridge</h4>

<p>
Your TiltBridge is currently being restarted. You should be automatically redirected to the TiltBridge's main
dashboard in 20 seconds or you can <a href="/">click here</a> once the TiltBridge has finished reconnecting.
dashboard in 20 seconds or you can <a href="#" onclick="redirect_now()">click here</a> once the TiltBridge has finished reconnecting.
</p>

</main>

<script>
function asleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}

function getmdns(url) {
return new Promise(function(resolve) {
var xhr = new XMLHttpRequest();
xhr.onload = function() {
resolve(JSON.parse(xhr.responseText));
};
xhr.open('GET', url);
xhr.overrideMimeType("application/json");
xhr.send();
});
}

var newmDNS;
getmdns('/settings/json/')
.then(function(result) {
newmDNS = result.mdnsID;
//console.log(newmDNS);
})

function redirect_now() {
window.location.replace("http://" + newmDNS + ".local");
}

async function delayed_redirect() {
await asleep(20000);
window.location.replace("http://" + newmDNS + ".local");
}

delayed_redirect();
</script>

<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js" integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js" integrity="sha384-ChfqqxuZUCnJSK3+MXmPNIyE6ZbWh2IMqE241rYiqJxyMiZ6OW/JmZQ5stwEULTy" crossorigin="anonymous"></script>
Expand Down
42 changes: 23 additions & 19 deletions data/settings.htm
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.5.0/css/all.css" integrity="sha384-B4dIYHKNBt8Bc12p+WXckhzcICo0wtJAoU8YZTY5qE0Id1GSseTk6S+L3BlXeVIU" crossorigin="anonymous">
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
<link rel="icon" href="favicon.ico" type="image/x-icon">
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon">
<link rel="icon" href="/favicon.ico" type="image/x-icon">

<style>
body {padding-top: 5rem; padding-bottom: 5rem;}
Expand Down Expand Up @@ -65,11 +65,18 @@ <h5 class="card-header">
<p class="card-text">These settings apply to the TiltBridge as a whole. Updating mDNS will cause the TiltBridge to restart.</p>
<form action="/settings/update/" method="POST" enctype="multipart/form-data">
<div class="form-group row">
<label for="mdnsID" class="col-sm-3 col-form-label" data-toggle="tooltip" title="mDNS name (the xxxx in http://xxxx.local/)">mDNS ID</label>
<label for="mdnsID" class="col-sm-3 col-form-label" data-toggle="tooltip" title="mDNS name (the xxxx in http://xxxx.local/) Must be 8
- 31 characters.">mDNS ID</label>
<div class="col-sm-8">
<input type="text" class="form-control" name="mdnsID" id="mdnsID" placeholder="tiltbridge" :value="settings.mdnsID">
</div>
</div>
<div class="form-group row">
<label for="TZoffset" class="col-sm-3 col-form-label" data-toggle="tooltip" title="Time zone offset from GMT (in hours)">Time Zone Offset</label>
<div class="col-sm-8">
<input type="text" class="form-control" name="TZoffset" id="TZoffset" placeholder="-5" :value="settings.TZoffset">
</div>
</div>
<div class="form-group row">
<label for="tempUnit" class="col-sm-3 col-form-label" data-toggle="tooltip" title="Units used for temperature measurement">Temperature Units</label>
<div class="col-sm-8">
Expand All @@ -81,11 +88,11 @@ <h5 class="card-header">
</div>
<div class="form-group row">
<label for="smoothFactor" class="col-sm-3 col-form-label" data-toggle="tooltip" title="Valid range 0 to 99. Setting affects time constant of
exponentially weighted moving average filter applied to specific gravity reading.
A value of 0 is equivalent to no averaging. Higher values mean more averaging.
A value of 40 gives time constant of just over 5 seconds while a value of 99 results in over 8 minutes.">Specific Gravity Averaging</label>
exponentially weighted moving average filter applied to specific gravity reading. In response to a step change, the filtered value should
reach steady state after ~ 5 time constants. Setting of 0 is equivalent to no averaging (filtering off) while higher values mean more averaging.
Setting of 60 gives time constant of just over 5 seconds while 99 results in ~ 5 minutes.">Specific Gravity Averaging</label>
<div class="col-sm-8">
<input type="text" class="form-control" name="smoothFactor" id="smoothFactor" placeholder="40" :value="settings.smoothFactor">
<input type="text" class="form-control" name="smoothFactor" id="smoothFactor" placeholder="60" :value="settings.smoothFactor">
</div>
</div>
<div class="form-group row">
Expand Down Expand Up @@ -355,13 +362,6 @@ <h5 class="card-header">
<input type="text" class="form-control" name="brewstatusPushEvery" id="brewstatusPushEvery" placeholder="30" :value="settings.brewstatusPushEvery">
</div>
</div>

<div class="form-group row">
<label for="brewstatusTZoffset" class="col-sm-3 col-form-label" data-toggle="tooltip" title="Time zone offset from UTC (in hours)">Time Zone Offset</label>
<div class="col-sm-8">
<input type="text" class="form-control" name="brewstatusTZoffset" id="brewstatusTZoffset" placeholder="-5" :value="settings.brewstatusTZoffset">
</div>
</div>
<div class="form-group row">
<div class="col-sm-5"></div>
<div class="col-sm-2"><button type="submit" class="btn btn-primary">Update</button></div>
Expand All @@ -384,9 +384,12 @@ <h5 class="card-header">
<a href="https://mqtt.org/">MQTT</a> Broker. To disable pushing to the MQTT broker, delete
the MQTT Broker IP. <br><br>

Message payload is json format and is formatted as follows: <br>
&nbsp;&nbsp;&nbsp;&nbsp;{"color":"Tilt Color","device":"mdnsID","gravity":#.#####,"gravity_unit":"G","temp":##.#,"temp_unit":"F"}
<br>
MQTT implementation supports <a href="https://www.home-assistant.io/">Home Assistant</a> Auto Discovery of temperature and
specific gravity sensors.<br><br>

General message payload is json and is formatted as follows: <br>
&nbsp;&nbsp;&nbsp;&nbsp;Topic: topic/tilt_color<br>
&nbsp;&nbsp;&nbsp;&nbsp;Payload: {"Color":"color","SG":"#.####","Temp":"##.#","fermunits":"SG","tempunits":"F","timeStamp":##########}<br><br>
</p>
<form action="/settings/update/" method="POST" enctype="multipart/form-data">
<div class="form-group row">
Expand All @@ -397,7 +400,7 @@ <h5 class="card-header">
</div>

<div class="form-group row">
<label for="mqttBrokerPort" class="col-sm-3 col-form-label" data-toggle="tooltip" title="MQTT Broker Server Port Number">MQTT Broker Port</label>
<label for="mqttBrokerPort" class="col-sm-3 col-form-label" data-toggle="tooltip" title="MQTT Broker Server Port Number. Must be > 1024 and < 65535.">MQTT Broker Port</label>
<div class="col-sm-8">
<input type="text" class="form-control" name="mqttBrokerPort" id="mqttBrokerPort" placeholder="1883" :value="settings.mqttBrokerPort">
</div>
Expand All @@ -418,7 +421,7 @@ <h5 class="card-header">
</div>

<div class="form-group row">
<label for="mqttTopic" class="col-sm-3 col-form-label" data-toggle="tooltip" title="MQTT Topic to publish data to.">MQTT Topic</label>
<label for="mqttTopic" class="col-sm-3 col-form-label" data-toggle="tooltip" title="MQTT Topic to publish data to. Limited to maximum of 30 characters.">MQTT Topic</label>
<div class="col-sm-8">
<input type="text" class="form-control" name="mqttTopic" id="mqttTopic" placeholder="tiltbridge" :value="settings.mqttTopic">
</div>
Expand Down Expand Up @@ -473,6 +476,7 @@ <h5 class="card-header">
xhr.open('GET', '/settings/json/');
xhr.onload = function () {
self.settings = JSON.parse(xhr.responseText);
if ( self.settings.all_valid == "0" ) window.alert("Invalid value for one or more parameters! Please confirm settings and resubmit");
if ( self.settings.invertTFT ) document.getElementById("invertTFT").checked = true;
if ( self.settings.applyCalibration ) document.getElementById("applyCalibration").checked = true;
if ( self.settings.tempCorrect ) document.getElementById("tempCorrect").checked = true;
Expand Down
4 changes: 2 additions & 2 deletions data/updating.htm
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.5.0/css/all.css" integrity="sha384-B4dIYHKNBt8Bc12p+WXckhzcICo0wtJAoU8YZTY5qE0Id1GSseTk6S+L3BlXeVIU" crossorigin="anonymous">
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
<link rel="icon" href="favicon.ico" type="image/x-icon">
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon">
<link rel="icon" href="/favicon.ico" type="image/x-icon">

<!-- Custom styles for this template -->
<style>
Expand Down
4 changes: 2 additions & 2 deletions data/wifi_reset.htm
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.5.0/css/all.css" integrity="sha384-B4dIYHKNBt8Bc12p+WXckhzcICo0wtJAoU8YZTY5qE0Id1GSseTk6S+L3BlXeVIU" crossorigin="anonymous">
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
<link rel="icon" href="favicon.ico" type="image/x-icon">
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon">
<link rel="icon" href="/favicon.ico" type="image/x-icon">

<!-- Custom styles for this template -->
<style>
Expand Down

0 comments on commit a182588

Please sign in to comment.