diff --git a/Changelog.md b/Changelog.md new file mode 100644 index 0000000..7f1f606 --- /dev/null +++ b/Changelog.md @@ -0,0 +1,193 @@ +# Changelog + +## v0.9.2 +Some fixes and improvements have been made. +For example the Reboot button didn't actually reboot the system. + +Also the status page will now reflect the actual error state of the CAN-module instead of just counting erroneous messages. + +A few code style errors have been fixed and some deprecated code snippets replaced. + +## v0.9.1 +This release contains a much needed enhancement to the user friendliness. +The integrated web interface allows you to: +- View overall system status +- Manage files (i.e. download your configuration and upload it again) +- Upload firmware and filesystem images so you don't have to spin up Platformio everytime there is a new release. +- Configure everything via forms instead of dealing with a json file +- Watch CAN messages on your bus with automatic value change highlighting. This will help you identify new message types without having to spin up a full blown CAN analyzer. + +### Install Instructions +- Upload firmware +- Upload filesystem +- Open the Web UI @ http://cerasmarter/ +- Configure everything to your needs + + +### REST Api + +With the addition of a web UI a REST Api has been introduced. You can query via GET on the endpoints to receive the currently active config or POST to store the config. + +The Endpoints are located at: +/api/config +- /general +```json +{ + "heatingvalues": true, + "watervalues": false, + "auxvalues": true, + "tz": "Europe/Berlin", + "busmsgtimeout": 30, + "debug": true, + "sniffing": true +} +``` +- /wifi +```json +{ + "wifi_ssid": "ssid", + "wifi_pw": "", + "hostname": "CERASMARTER" +} +``` +- /canbus +```json +{ + "Controller": { + "FlameStatus": "0x209", + "Error": "0x206", + "DateTime": "0x256" + }, + "Heating": { + "FeedCurrent": "0x201", + "FeedMax": "0x200", + "FeedSetpoint": "0x252", + "OutsideTemperature": "0x207", + "Pump": "0x20A", + "Season": "0x20C", + "Operation": "0x250", + "Power": "0x251", + "Mode": "0x258", + "Economy": "0x253" + }, + "HotWater": { + "SetpointTemperature": "0x203", + "MaxTemperature": "0x204", + "CurrentTemperature": "0x205", + "Now": "0x254", + "BufferOperation": "0x20B", + "ContinousFlow": { + "SetpointTemperature": "0x255" + } + }, + "MixedCircuit": { + "Pump": "0x404", + "FeedSetpoint": "0x405", + "FeedCurrent": "0x440", + "Economy": "0x407" + } +} +``` +- /leds +```json +{ + "wifi-led": 26, + "status-led": 27, + "mqtt-led": 14, + "heating-led": 25 +} +``` +- /mqtt +```json +{ + "mqtt-server": "1.2.3.4", + "mqtt-port": 1883, + "mqtt-user": "mqtt", + "mqtt-password": "mqtt" +} +``` +- /auxsensors +```json +[ + [ + { + "Label": "Feed", + "IsReturnValue": false, + "Address": [ + "0x28", + "0x76", + "0x51", + "0x91", + "0x42", + "0x20", + "0x01", + "0xE3" + ] + }, + { + "Label": "Return", + "IsReturnValue": true, + "Address": [ + "0x28", + "0x6F", + "0x9C", + "0xF6", + "0x42", + "0x20", + "0x01", + "0xF6" + ] + }, + { + "Label": "Exhaust", + "IsReturnValue": false, + "Address": [ + "0x28", + "0x6D", + "0x98", + "0xF5", + "0x42", + "0x20", + "0x01", + "0x0F" + ] + }, + { + "Label": "Ambient", + "IsReturnValue": false, + "Address": [ + "0x28", + "0xBF", + "0x39", + "0x10", + "0x42", + "0x20", + "0x01", + "0x93" + ] + } + ] +] +``` + +## v0.9.0 +Not only I noticed that it's about time to optimize the heating system. Thanks to the input of @rejoe2 we were able to simplify things so it can be adopted by a broader audience! + +This release is all about making things easier. No longer is it necessary to modify code to get this working. You only need VS Code, the Platformio extension and you're (mostly) good to go! + +Previously I considered this project a PoC (Proof of Concept) - a foundation for others to build their own system on. + +Please let us know if anything should be broken or you got trouble making it work. + +Instructions for this release: +- See Readme for prerequisites +- Build firmware and filesystem images +- Upload firmware to ESP32 +- Modify the configuration so it fits your environment +- Upload filesystem image to ESP + +## What's Changed +* Merge Feature and Optimization Overhaul by @Neuroquila-n8fall in https://github.com/Neuroquila-n8fall/JunkersControl/pull/7 + + +**Full Changelog**: https://github.com/Neuroquila-n8fall/JunkersControl/commits/v0.9.0 diff --git a/data/frontend/auxsensors.html b/data/frontend/auxsensors.html index dfd6cc1..9807079 100644 --- a/data/frontend/auxsensors.html +++ b/data/frontend/auxsensors.html @@ -31,7 +31,7 @@

Auxiliary Sensors Configuration

Add Sensor

-
+
Sensor Label @@ -71,7 +71,7 @@

Add Sensor

Configured Sensors

-
+
@@ -85,10 +85,14 @@

Configured Sensors

- - - - + + + + + return hex; + } + + function startEvents() { + const es = new EventSource('/events'); + es.addEventListener('can', function (e) { + addMessage(e.data); + }, false); + } + \ No newline at end of file diff --git a/data/frontend/canbus.html b/data/frontend/canbus.html index ed4ce0d..7fecaae 100644 --- a/data/frontend/canbus.html +++ b/data/frontend/canbus.html @@ -23,11 +23,11 @@

CAN-Bus Configuration

- +
- MHz Enter the frequency of the quartz (oscillator) which is used @@ -128,7 +128,7 @@
Hot Water
Hot Water 'Now' Flag -
@@ -193,6 +193,8 @@
Mixed Circuit
loadNavigation(); loadCanAddresses(); + _("canbus-form").addEventListener("onsubmit", saveCanbusData); + async function loadCanAddresses() { const form = document.forms["canbus-form"]; const result = await getConfigJson("/api/config/canbus"); diff --git a/data/frontend/firmware.html b/data/frontend/firmware.html index 7c558a7..bea3285 100644 --- a/data/frontend/firmware.html +++ b/data/frontend/firmware.html @@ -31,7 +31,7 @@

Update Firmware & Filesystem

- +
@@ -64,5 +64,7 @@

Update Firmware & Filesystem

\ No newline at end of file diff --git a/data/frontend/general.html b/data/frontend/general.html index c1a5a9a..4630d50 100644 --- a/data/frontend/general.html +++ b/data/frontend/general.html @@ -22,7 +22,7 @@

General Settings

- +
@@ -50,7 +50,7 @@

General Settings

+ class="form-control" autocomplete="busmsgtimeout" value="30" required> Time in seconds before control over the heating is assumed when no other controllers have been detected on the bus.
@@ -93,6 +93,8 @@

General Settings

getTz(); loadGeneralConfig(); + _("general-form").addEventListener("onsubmit", sendGeneralConfig); + async function loadGeneralConfig() { let form = document.forms["general-form"]; const config = await getGeneralConfig(); diff --git a/data/frontend/index.html b/data/frontend/index.html index afaf7de..bcfa34f 100644 --- a/data/frontend/index.html +++ b/data/frontend/index.html @@ -50,7 +50,7 @@

System Status

  • - CAN-Bus Status + CAN-Bus Module
  • @@ -116,15 +116,24 @@

    System Status

    _("prog-sketch").setAttribute('aria-valuenow', occupiedSketchPercent); _("prog-sketch").innerHTML = `${Math.round(occupiedSketchPercent)}%`; _("sketch").innerHTML = `${humanReadableSize(status["sketchsize"])} out of ${humanReadableSize(status["freesketch"])} used`; - _("can").innerHTML = status["canstatus"] ? "Working" : "Error"; - if(status["canstatus"]) { + let canStatus = status["canstatus"]; + _("can").innerHTML = CanErrorCodes[canStatus]; + if(canStatus === 0) { _("can").classList.remove("bg-danger"); _("can").classList.add("bg-success"); } else { _("can").classList.remove("bg-success"); _("can").classList.add("bg-danger"); } - _("canerrorcount").innerHTML = status["canerrorcount"]; + let canErrorCount = status["canerrorcount"]; + _("canerrorcount").innerHTML = canErrorCount; + if(canErrorCount === 0) { + _("canerrorcount").classList.remove("bg-danger"); + _("canerrorcount").classList.add("bg-success"); + } else { + _("canerrorcount").classList.remove("bg-success"); + _("canerrorcount").classList.add("bg-danger"); + } _("mqtt").innerHTML = status["mqtt"] ? "Connected" : "Disconnected"; if(status["mqtt"]) { _("mqtt").classList.remove("bg-danger"); diff --git a/data/frontend/js/framework.js b/data/frontend/js/framework.js index 0ea584f..8da678a 100644 --- a/data/frontend/js/framework.js +++ b/data/frontend/js/framework.js @@ -2,6 +2,24 @@ function _(el) { return document.getElementById(el); } +const CanErrorCodes = [ + "OK", + "No MCP2515", + "Too Far From Desired Bit Rate", + "Inconsistent Bit Rate Settings", + "INT Pin Is Not An Interrupt", + "ISR Is Null", + "Requested Mode TimeOut", + "Acceptance Filter Array Is NULL", + "One Filter Mask Requires One Or Two Acceptance Filters", + "Two Filter Masks Require Three To Six Acceptance Filters", + "Cannot Allocate Receive Buffer", + "Cannot Allocate Transmit Buffer 0", + "Cannot Allocate Transmit Buffer 1", + "Cannot Allocate Transmit Buffer 2", + "ISR Not Null And No Int Pin", +] + function humanReadableSize(bytes) { if (bytes < 1024) return bytes + " B"; diff --git a/data/frontend/leds.html b/data/frontend/leds.html index e505736..f3d80bb 100644 --- a/data/frontend/leds.html +++ b/data/frontend/leds.html @@ -36,7 +36,7 @@

    LED Configuration

    Loading...
  • - +
    Status LED @@ -96,6 +96,8 @@

    LED Configuration

    loadNavigation(); loadConfig(); + _("led-form").addEventListener("onsubmit", saveConfig); + async function loadConfig() { const form = document.forms["led-form"]; _("form-fieldset").disabled = true; diff --git a/data/frontend/mqtt.html b/data/frontend/mqtt.html index 41d17e6..01ba1f1 100644 --- a/data/frontend/mqtt.html +++ b/data/frontend/mqtt.html @@ -26,13 +26,13 @@

    MQTT Configuration

    Server Configuration

    - +
    @@ -76,7 +76,7 @@

    Server Configuration

    Topics Configuration

    - +
    @@ -194,6 +194,9 @@

    Topics Configuration

    loadMqttConfig(); loadMqttTopicsConfig(); + _("mqtt-form").addEventListener("onsubmit", sendMqttConfig); + _("mqtt-topics-form").addEventListener("onsubmit", sendMqttTopicsConfig); + async function loadMqttConfig() { const form = document.forms["mqtt-form"]; form.disabled = true; diff --git a/data/frontend/reboot.html b/data/frontend/reboot.html index d6a0de6..25c5f61 100644 --- a/data/frontend/reboot.html +++ b/data/frontend/reboot.html @@ -10,23 +10,26 @@ +
    - + } + + countdown(); + \ No newline at end of file diff --git a/data/frontend/wifi.html b/data/frontend/wifi.html index 5a8418e..df9eeaf 100644 --- a/data/frontend/wifi.html +++ b/data/frontend/wifi.html @@ -22,7 +22,7 @@

    Set Wifi Credentials

    - +
    @@ -86,7 +86,9 @@

    Found Networks

    loadNavigation();