Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 16 additions & 13 deletions data/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ <h2 id="large-modal-header"></h2>
<p>Communication problem between ESP and STM</p>
</div>

<div id="param-success-bar" class="param-success-bar">
<p id="param-success-bar-text"></p>
</div>

<!-- 'Add CAN Mapping' modal -->
<div id="can-mapping-modal-overlay" class="modal-overlay">
<div id="can-mapping-modal-container" class="can-mapping-modal-container">
Expand Down Expand Up @@ -91,7 +95,7 @@ <h3 class="underline">New CAN Mapping</h3>
<td>Set the ID of the CAN frame to send/receive</td>
</tr>
<tr>
<td>Offset</td>
<td>Position</td>
<td><input type="number" step="1" min="0" max="63" id="canpos"></td>
<td>Specify the position (offset) within the frame to place (transmit) or find (receive) this value</td>
</tr>
Expand All @@ -105,6 +109,11 @@ <h3 class="underline">New CAN Mapping</h3>
<td><input type="number" step="1" min="1" max="100" id="cangain"></td>
<td>Specify a gain to scale the value up or down</td>
</tr>
<tr>
<td>Offset</td>
<td><input type="number" step="1" min="-128" max="127" id="canoffset"></td>
<td>Specify an offset to add to the value</td>
</tr>
</table>
<button onclick="ui.canMapping();">
<!-- /icon-check-circle.png -->
Expand Down Expand Up @@ -151,22 +160,15 @@ <h3 class="underline">New CAN Mapping</h3>
<img class="navimg" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAACXBIWXMAAA7DAAAOwwHHb6hkAAAAGXRFWHRTb2Z0d2FyZQB3d3cuaW5rc2NhcGUub3Jnm+48GgAAAdRJREFUSInF1T1rlEEUBeBHYpHFJZDFQkhqsxELwdrPwlLtLP0g+heU+Ee0sLIViRYWJgGjEFBT6ppEsDGFNsYQLSUWc4d9s072fSOIB6Y598y5l7kzd/jHOFAT7+AyLqKLyeA3sIqnmMO3/SZuYRZb2KlZ30Pbamo+iZWKwXPMYAqHYnVxE/MV3QommphvxIY1nG5Q0Bmsx56NYUlalcpfYLyBecY4lmLvG4yWRLP6lQ+an8Az/MBXPCxU2sHH8LgzaN7Rb+jgsZzET3829wuODGjP6jd+V5E39Bs6iNzIBxiT+rQQ3L2CPseuVcm5IGcKGx6hJ92ejOOhf1fQ34rY4yq5FuRUYUMJF4Yk6EZstUpuB9muMR6RjjPr7xY07Yht7zfBSFScm3w/uEGMRXyrSjY5opyghyv2nmO7juhgkD0cxalIVsIvqbl1yNf8fZW8HlnnGxjUYTG8rlbJjvQ4dqTZshdeYXlI/Hx4bCqMmjwqPuHwXySojorbJcEo3oZgqVTBEHTwUs2wIw2wPK7XpdlSh3P6lX/W4E+YiCryfV+Qnv+09E7aOBbcYkX3uol5xqg0cnPjh61N6cyLx1L36Y/jkvTpT9v96X+QPv0nkeT/4DdxyppwcyvRBAAAAABJRU5ErkJggg=="><p class="navbar-text">SUPPORT</p></a>
</div>

<!-- spinner div -->
<div id="spinner-div" class="control">
<img style="vertical-align:middle" src="ajax-loader.gif"><p> refreshing...</p>
</div>

<!-- auto reload toggle -->
<div id="auto-reload-toggle-div" class="control small-screen-hide">
<label class="switch">
<input id="auto-reload-checkbox" type="checkbox" onclick="ui.setAutoReload(this.checked);"><span class="slider round"></span>
</label><p style="display: inline-block;">Auto reload</p>
</div>
<!-- beta features toggle -->
<div id="beta-features-toggle-div" onclick="ui.toggleBetaFeaturesVisibility();" class="control small-screen-hide">
<label class="switch">
<input id="beta-features-checkbox" type="checkbox"><span class="slider round"></span>
</label><p style="display: inline-block;">Beta features</p>
<!-- spinner div -->
<div id="spinner-div" class="control">
<img style="vertical-align:middle" src="ajax-loader.gif"><p> refreshing...</p>
</div>

<div id="version" class="small-screen-hide"></div>
Expand Down Expand Up @@ -256,7 +258,7 @@ <h3>OpenInverter Board Firmware</h3>
<p>To install a new firmware on your OpenInverter board click on the 'Install firmware from file' button on the right. Use the stm32_sine.bin file to install the sine firmware or use the stm32_foc.bin file to install the FOC firmware. You can find information about the latest available releases, including download links, on the OpenInverter forum <a href="https://openinverter.org/forum/viewforum.php?f=7&sid=cdb63cfa1d2f7ab493e7079fc13a8e65">here</a>.</p>

<h3>Web Interface Firmware</h3>
<p>The ESP8266 firmware can be upgraded with platformio via OTA i.e. directly via wifi without programming cable, see <a href="https://openinverter.org/forum/viewtopic.php?p=60907#p60907">forum</a>.<br>
<p>The ESP32 firmware can be upgraded with platformio via OTA i.e. directly via wifi without programming cable, see <a href="https://openinverter.org/forum/viewtopic.php?p=60907#p60907">forum</a>.
You can also program with a cable, see <a href="https://openinverter.org/forum/viewtopic.php?f=5&t=8">here</a> for more details.</p>

<h3>Web Interface Application</h3>
Expand Down Expand Up @@ -493,9 +495,10 @@ <h3 class="underline">Existing CAN Mappings</h3>
<th>Spot Value</th>
<th>Transmit or Receive</th>
<th>ID</th>
<th>Offset</th>
<th>Position</th>
<th>Length</th>
<th>Gain</th>
<th>Offset</th>
<th>Delete Mapping</th>
</tr>
</table>
Expand Down
40 changes: 21 additions & 19 deletions data/inverter.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,23 @@ var inverter = {
{
if (replyFunc) replyFunc(this.responseText);
}
xmlhttp.onreadystatechange = function() {
if (xmlhttp.readyState === XMLHttpRequest.DONE) {
console.log(req + ": " + xmlhttp.status);
if (xmlhttp.status != 200) {
paramsCache.failedFetchCount += 1;
if ( paramsCache.failedFetchCount >= 2 && typeof ui !== 'undefined'){
ui.showCommunicationErrorBar();
}
}
else {
paramsCache.failedFetchCount = 0;
}
if ( paramsCache.failedFetchCount < 2 && typeof ui !== 'undefined') {
ui.hideCommunicationErrorBar();
}
}
}

if (repeat)
req += "&repeat=" + repeat;
Expand All @@ -107,8 +124,7 @@ var inverter = {

inverter.sendCmd(cmd, function(reply) {
var params = {};
try
{
try {
params = JSON.parse(reply);

for (var name in params)
Expand All @@ -119,19 +135,8 @@ var inverter = {
if (name == "version")
inverter.firmwareVersion = parseFloat(param.value);
}
paramsCache.failedFetchCount = 0;
}
catch(ex)
{
paramsCache.failedFetchCount += 1;
if ( paramsCache.failedFetchCount >= 2 ){
ui.showCommunicationErrorBar();
}
}
if ( paramsCache.failedFetchCount < 2 )
{
ui.hideCommunicationErrorBar();
}
} catch(ex) { console.error('Failed to parse params:', ex); }

paramsCache.setData(params);
if (replyFunc) replyFunc(params);
});
Expand All @@ -157,10 +162,7 @@ var inverter = {
replyFunc(values);
};

if (inverter.firmwareVersion < 3.53 || items.length > 10)
inverter.sendCmd("get " + items.join(','), process, repeat);
else
inverter.sendCmd("stream " + repeat + " " + items.join(','), process);
inverter.sendCmd("stream " + repeat + " " + items.join(','), process);
},


Expand Down
19 changes: 19 additions & 0 deletions data/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -656,3 +656,22 @@ input:checked + .slider:before {
.communication-error-bar p {
text-align: center;
}

.param-success-bar {
display: none;
padding: 15px;
background-color: #4caf50;
color: white;
z-index: 100;
margin: 0 auto;
position: relative;
width: 30%;
top: 0px;
clear: left;
height: 20px;
border-radius: 0px 0px 20px 20px;
}

.param-success-bar p {
text-align: center;
}
Loading