diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index ee4f01af..e64de643 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -64,23 +64,23 @@ jobs: env: esp32-s3-4848S040 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: "true" - name: Cache pip - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ~/.cache/pip key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} restore-keys: | ${{ runner.os }}-pip- - name: Cache PlatformIO - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ~/.platformio key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }} - name: Set up Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: "3.x" - name: Install PlatformIO @@ -102,7 +102,7 @@ jobs: - name: Run PlatformIO run: pio run -e ${{ matrix.environment.env }} - name: Upload output file - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: ${{ matrix.environment.out }} path: build_output/firmware/*.bin @@ -132,23 +132,23 @@ jobs: linux_build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: "true" - name: Cache pip - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ~/.cache/pip key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} restore-keys: | ${{ runner.os }}-pip- - name: Cache PlatformIO - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ~/.platformio key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }} - name: Set up Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: "3.x" - name: Install PlatformIO diff --git a/.github/workflows/build_linux.yaml b/.github/workflows/build_linux.yaml index a4baea49..bfe4ede4 100644 --- a/.github/workflows/build_linux.yaml +++ b/.github/workflows/build_linux.yaml @@ -14,18 +14,18 @@ jobs: - linux_sdl_64bits steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: 'true' - name: Cache pip - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ~/.cache/pip key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} restore-keys: | ${{ runner.os }}-pip- - name: Cache PlatformIO - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ~/.platformio key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 62ef57b4..f4d093be 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -12,16 +12,16 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Cache pip - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ~/.cache/pip key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} restore-keys: | ${{ runner.os }}-pip- - name: Cache PlatformIO - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ~/.platformio key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }} @@ -71,7 +71,7 @@ jobs: - name: Run PlatformIO run: pio run -e m5stack-core2 - name: Upload output file - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: openHASP firmware.zip path: build_output/firmware/*.bin diff --git a/CHANGELOG.md b/CHANGELOG.md index fa53d7b7..23bfac23 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,7 @@ - Firmware files include the bitmapped font sizes 12, 16, 24 and 32pt - Use embedded TrueType font for other font sizes (PSram highly recommended) - Add glyphs from Cyrillic, Latin-2, Greek and Viernamese character sets to default fonts +- Add 12 new MDI icons ### Web UI - Update Web UI to petite-vue app @@ -58,7 +59,7 @@ - Add support for ESP32-S3 and ESP32-C3 devices - Deprecation of support for ESP32-S2 devices due to lack of sRAM -Updated libraries to ArduinoJson 6.21.4, ArduinoStreamUtils 1.7.3, AceButton 1.10.1, TFT_eSPI 2.5.0, LovyanGFX 1.1.8 and SimpleFTPServer 2.1.5 +Updated libraries to Arduino_GFX v1.4.0, ArduinoJson 6.21.5, ArduinoStreamUtils 1.8.0, AceButton 1.10.1, TFT_eSPI 2.5.34, LovyanGFX 1.1.12 and SimpleFTPServer 2.1.5 ## v0.6.3 @@ -168,23 +169,23 @@ Updated libraries to AceButton 1.9.1 and ArduinoJson 6.18.5 - Run `/online.cmd` or `/offline.cmd` script when the wifi status changed ### Objects -- Add new *[line](https://openhasp.haswitchplate.com/0.6.1/design/objects/#line)* object -- Add `val` to *[btnmatrix](https://openhasp.haswitchplate.com/0.6.1/design/objects/#button-matrix)* when `one_select` is set -- Cache up to 20 *[images](https://openhasp.haswitchplate.com/0.6.1/design/objects/#image)* in PSram when available -- Improve precision on the *[linemeter](https://openhasp.haswitchplate.com/0.6.1/design/objects/#line-meter)* scales -- Fix *[dropdown](https://openhasp.haswitchplate.com/0.6.1/design/objects/#dropdown-list)* redraw bug +- Add new *[line](https://www.openhasp.com/0.6.1/design/objects/#line)* object +- Add `val` to *[btnmatrix](https://www.openhasp.com/0.6.1/design/objects/#button-matrix)* when `one_select` is set +- Cache up to 20 *[images](https://www.openhasp.com/0.6.1/design/objects/#image)* in PSram when available +- Improve precision on the *[linemeter](https://www.openhasp.com/0.6.1/design/objects/#line-meter)* scales +- Fix *[dropdown](https://www.openhasp.com/0.6.1/design/objects/#dropdown-list)* redraw bug ### Devices -- Fix [L8-HD dimmer](https://openhasp.haswitchplate.com/0.6.1/devices/lanbon-l8/) not responding correctly to mqtt after a reboot -- Add [M5Stack Core2](https://openhasp.haswitchplate.com/0.6.1/devices/m5stack-core2/) backlight dimming -- Add [Yeacreate Nscreen32](https://openhasp.haswitchplate.com/0.6.1/devices/yeacreate-nscreen32/) -- Add [Makerfabs ESP32 TFT Touch](https://openhasp.haswitchplate.com/0.6.1/devices/makerfabs-tft-touch/) Capacitive +- Fix [L8-HD dimmer](https://www.openhasp.com/0.6.1/devices/lanbon-l8/) not responding correctly to mqtt after a reboot +- Add [M5Stack Core2](https://www.openhasp.com/0.6.1/devices/m5stack-core2/) backlight dimming +- Add [Yeacreate Nscreen32](https://www.openhasp.com/0.6.1/devices/yeacreate-nscreen32/) +- Add [Makerfabs ESP32 TFT Touch](https://www.openhasp.com/0.6.1/devices/makerfabs-tft-touch/) Capacitive ### Fonts -- [Additional characters](https://openhasp.haswitchplate.com/0.6.1/design/fonts/#ascii): `²` (squared) and `³` (cubed) -- [Additional icons](https://openhasp.haswitchplate.com/0.6.1/design/fonts/#built-in-icons): recycle-variant and additional weather icons -- Use latin1 as default charset on [WT32-SC01](https://openhasp.haswitchplate.com/0.6.1/devices/wt32-sc01/) -- Add [Greek font](https://openhasp.haswitchplate.com/0.6.1/design/fonts/#greek) +- [Additional characters](https://www.openhasp.com/0.6.1/design/fonts/#ascii): `²` (squared) and `³` (cubed) +- [Additional icons](https://www.openhasp.com/0.6.1/design/fonts/#built-in-icons): recycle-variant and additional weather icons +- Use latin1 as default charset on [WT32-SC01](https://www.openhasp.com/0.6.1/devices/wt32-sc01/) +- Add [Greek font](https://www.openhasp.com/0.6.1/design/fonts/#greek) ### Compiling - Allow custom bootlogo @@ -252,7 +253,7 @@ Updated libraries to lvgl 7.11.0, ArduinoJson 6.18.0 and TFT_eSPI 2.3.70 ## v0.5.0 -Name changed to openHASP - https://openhasp.haswitchplate.com/ +Name changed to openHASP - https://www.openhasp.com/ > When using HomeAssistant also update the [openHASP Custom Component](https://github.com/HASwitchPlate/openHASP-custom-component/releases/tag/0.5.0) - Switch built-in icons from FontAwesome to MaterialDesign icons #139 @@ -263,7 +264,7 @@ Name changed to openHASP - https://openhasp.haswitchplate.com/ - Add `back`, `prev`, `next` attributes to pages #114 - JSON Serialize text in payloads containing text attributes #140 - Add az-touch-mod-esp32_ili9341 config and allow for TFT_BACKLIGHT_ON set to LOW #131 -- Add [FreeTouchDeck](https://openhasp.haswitchplate.com/0.5/#devices/freetouchdeck/) and [ESP32-Touchdown](https://openhasp.haswitchplate.com/0.5/#devices/esp32-touchdown/) configs +- Add [FreeTouchDeck](https://www.openhasp.com/0.5/#devices/freetouchdeck/) and [ESP32-Touchdown](https://www.openhasp.com/0.5/#devices/esp32-touchdown/) configs - Add roller `mode` `infinite` attribute - Add btnmatrix `toggle` and `one_check` attributes - Rework all event handlers to reduce update events and prevent race condition #119 *(events have changed!)* @@ -291,7 +292,7 @@ Changes: - Remove HA auto-discovery in favor of the HA Custom Component - Add `clearpage all` command option - Add local page navigation and transitions -- Add [scale properties](https://openhasp.haswitchplate.com/0.5/#styling/#scale) +- Add [scale properties](https://www.openhasp.com/0.5/#styling/#scale) - Add `config/gpio` command - Allow for timezone setting in user_config_override.h (thanks @arovak) - Start localizations for NL, HU and RO (thanks @nagyrobi) diff --git a/LICENSE b/LICENSE index c212742b..85f9577f 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2019-2023 Francis Van Roie +Copyright (c) 2019-2024 Francis Van Roie Copyright (c) 2018-2019 Allen Derusha allen@derusha.org Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/data/cert/x509_crt_bundle.bin b/data/cert/x509_crt_bundle.bin index 77d8ea3e..c4c74b89 100644 Binary files a/data/cert/x509_crt_bundle.bin and b/data/cert/x509_crt_bundle.bin differ diff --git a/data/edit.htm b/data/edit.htm index 2d2eec60..ea1228a3 100644 --- a/data/edit.htm +++ b/data/edit.htm @@ -1 +1 @@ -openHASP File Editor
L:
\ No newline at end of file +openHASP File Editor
L:
\ No newline at end of file diff --git a/data/script.js b/data/script.js index 44b532f3..baca1bb2 100644 --- a/data/script.js +++ b/data/script.js @@ -1 +1 @@ -var ctx_el;function _(e){return document.getElementById(e)}function hidectx(){_("ctx").style.display="none",ctx_el&&ctx_el.classList.remove("selitem"),ctx_el=void 0}function doesFontExist(e){var t=document.createElement("canvas"),n=t.getContext("2d"),o="abcdefghijklmnopqrstuvwxyz0123456789";n.font="72px monospace";var a=n.measureText(o).width;return n.font="72px '"+e+"', monospace",t=null,n.measureText(o).width!=a}function createEditor(e,t,n,o,a){function i(e){let t=/(?:\.([^.]+))?$/.exec(e)[1];if(void 0!==typeof t)switch(t){case"htm":case"html":return"html";case"js":return"javascript";case"cmd":case"json":case"jsonl":return"json";case"css":case"svg":case"xml":return t}return"plain_text"}void 0===n&&(n=i(t)),void 0===a&&(a="text/"+n);["basePath","modePath","themePath"].forEach((e=>{ace.config.set(e,"https://cdnjs.cloudflare.com/ajax/libs/ace/1.32.0")}));var c=ace.edit(e,{useWorker:!1,wrap:!0,indentedSoftWrap:!1,showPrintMargin:!1,highlightGutterLine:!0,useSoftTabs:!0,tabSize:2});c.setFontSize(parseFloat(getComputedStyle(document.documentElement).fontSize)),c.setReadOnly(!0),c.getSession().setUndoManager(new ace.UndoManager),void 0===o&&(o=window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"monokai":"textmate");var s=_("save"),l=_("undo"),r=_("redo"),d=_("cut"),m=_("copy"),u=_("paste"),p=_("font"),f=_("fontsize"),g="none"!==_(e).display;f.value=parseFloat(c.getFontSize()).toFixed(1),p.onchange=function(){c.setOption("fontFamily","'"+p.value+"',monospace")},f.onchange=function(){var e=parseFloat(f.value);!isNaN(e)&&e>=9&&e<=40&&c.setFontSize(e),f.value=parseFloat(c.getFontSize()).toFixed(1)};function h(){let e=!g||c.session.getSelection().isEmpty();d.disabled=e,m.disabled=e}function y(){let e=c.session.getUndoManager();s.disabled=!g||e.isClean(),l.disabled=!g||!e.hasUndo(),r.disabled=!g||!e.hasRedo()}function v(){if(void 0===t)return;const e=function(e){var t=e.getValue();try{var n=JSON.parse(t);return JSON.stringify(n)}catch(e){return t+""}}(c),n=new FormData;n.append("data",new Blob([e],{type:a}),t),fetch("/edit",{method:"POST",body:n}).then((e=>e.ok?e.text().then((e=>{console.log("Save OK /edit "+e)})):e.text().then((e=>{throw console.log("Save FAIL /edit"),new Error(e)})))).then((e=>{console.log(e),generateToast({message:"Saved "+t,background:"#ddd",color:"#000"})})).catch((e=>{console.warn("AbortError"===e.name?"Promise Aborted":"Promise Rejected"),alert(e)})).finally((()=>{y()}))}function x(){var e=c.getCopyText();if(window.clipboardData&&window.clipboardData.setData)return window.clipboardData.setData("Text",e);if(document.queryCommandSupported&&document.queryCommandSupported("copy")){c.focus();try{return document.execCommand("copy")}catch(t){return console.warn("Copy to clipboard failed.",t),prompt("Copy to clipboard: Ctrl+C, Enter",e)}}}function w(e){_("name").innerHTML=e;fetch(e).then((t=>t.ok?(console.log("OK "+e),t.text()):t.text().then((e=>{throw console.log("ERROR "+url),new Error(e)})))).then((e=>{try{var t=JSON.parse(e);c.setValue(JSON.stringify(t,null,4)),console.log("parse json OK")}catch(t){c.setValue(e),console.log("parse json FAIL")}null!==_("editor")&&(_("editor").style.display="block"),null!==_("preview")&&(_("preview").style.display="none"),g=!0,c.setReadOnly(!1),c.focus(),y()})).catch((e=>{console.log(e),alert(e),c.setReadOnly(!0)})).finally((()=>{c.resize(!0),c.scrollToLine(1,!0,!0,(function(){})),c.gotoLine(1,0,!0),c.clearSelection(),c.session.getUndoManager().reset()}))}return["Courier New","Monaco","Lucida Console","Monospace","ui-monospace","Roboto Mono","Inconsolata","IBM Plex Mono","Space Mono","PT Mono","Ubuntu Mono","Nanum Gothic Coding","Cousine","Fira Mono","Share Tech Mono","Courier Prime","Anonymous Pro","Cutive Mono","Overpass Mono","Fira Code","VT323","DM Mono","Oxygen Mono","Nova Mono","B612 Mono","Spline Sans Mono","Noto Sans Mono","Major Mono Display","Azeret Mono","Red Hat Mono","Syne Mono","Xanh Mono"].sort().forEach((function(e,t){if(doesFontExist(e)){var n=document.createElement("option");n.text=e,p.add(n)}})),null!==s&&null!==l&&null!==r&&c.on("input",y),c.session.selection.on("changeCursor",h),s.onclick=v,l.onclick=e=>{c.undo()&&c.focus()},r.onclick=e=>{c.redo()&&c.focus()},d.onclick=e=>{x()&&c.execCommand("cut")},m.onclick=e=>{x()&&c.execCommand("copy")},u.onclick=function(){try{navigator.clipboard.readText().then((e=>{c.execCommand("paste",e)})).catch((e=>{u.disabled=!0}))}catch{u.disabled=!0}},c.loadUrl=(e,o)=>{n=i(t=e+o),a="text/"+n,"plain"!==n&&c.getSession().setMode("ace/mode/"+n),w(e+o)},c.hide=()=>{g=!1,y(),h(),_("editor").style.display="none"},"plain"!==n&&c.getSession().setMode("ace/mode/"+n),c.setTheme("ace/theme/"+o),c.$blockScrolling=1/0,c.commands.addCommand({name:"save",bindKey:{win:"Ctrl-S",mac:"Command-S"},exec:v,readOnly:!1}),c.commands.addCommand({name:"undo",bindKey:{win:"Ctrl-Z",mac:"Command-Z"},exec:function(){c.undo()}}),c.commands.addCommand({name:"redo",bindKey:{win:"Ctrl-Y",mac:"Command-Y"},exec:function(){c.redo()}}),void 0!==t&&w(t),c.resize(),c}function uploadFileAsync(e,t,n,o,a,i){fetchData("/edit","POST",e).then((e=>{generateToast({message:"Upload "+n+"/"+o+" "+t+" done.",background:"#ddd",color:"#000"}),n==o&&listFiles(a,i)}))}function doUpload(e,t){const n=_("upload"),o=n.files.length;if(0!==o)for(let a=0;a=0}function isText(e){if(isFolder(e))return!1;var t=/(?:\.([^.]+))?$/.exec(e.name)[1];if(void 0!==typeof t)switch(t){case"txt":case"cmd":case"json":case"jsonl":case"htm":case"html":case"js":case"c":case"cpp":case"css":case"svg":case"xml":return!0}return!1}function isImage(e){if(isFolder(e))return!1;var t=/(?:\.([^.]+))?$/.exec(e.name)[1];if(void 0!==typeof t)switch(t){case"bmp":case"png":case"jpg":case"gif":case"svg":return!0}return!1}function isAudio(e){if(isFolder(e))return!1;var t=/(?:\.([^.]+))?$/.exec(e.name)[1];if(void 0!==typeof t)switch(t){case"wav":case"mp3":case"aac":case"m4a":case"wma":return!0}return!1}function icon(e){if(isFolder(e))return"dir";if(isImage(e))return"image";if(isAudio(e))return"audio";var t=/(?:\.([^.]+))?$/.exec(e.name)[1];if(void 0!==typeof t)switch(t){case"cmd":case"css":case"json":case"jsonl":case"ttf":return t;case"zip":case"gz":return"zip";case"html":case"htm":return"html"}return"file"}function preview(e,t){if(isImage(e)){let n=t+e.name;const o=_("preview");o.innerHTML='',o.style.display="block",ace.edit("editor").hide(),_("name").innerHTML=n}}function edit(e,t){isText(e)&&(ace.edit("editor").loadUrl(t,e.name),_("preview").style.display="none")}function url(e,t){console.log("click "+t+e.name),isImage(e)?preview(e,t):isText(e)&&edit(e,t)}async function fetchData(e,t,n,o){await fetch(e,{method:t,body:n}).then((n=>n.ok?(console.log(t+" OK "+e),n.text()):n.text().then((n=>{throw console.log(t+" FAIL "+e),new Error(n)})))).then((e=>{o&&o.remove(),console.log(e)})).catch((e=>{console.warn("AbortError"===e.name?"Promise Aborted":"Promise Rejected"),alert(e)})).finally((()=>{}))}function download(e,t){console.log("download "+t+e.name),document.getElementById("download-frame").src=t+e.name+"?download=true"}function remove(e,t,n){let o=t+e.name;isFolder(e)&&(o+="/"),console.log("remove "+o);const a=new FormData;a.append("path",o),fetchData("/edit","DELETE",a,n)}function create(e,t,n){var o=window.prompt("Create File in "+e,"");if(null==o||""==o||o.includes("/"))return;const a=new FormData;a.append("path",e+o),fetchData("/edit","PUT",a),fetch("/api/files/").then((e=>e.json())).then((o=>{t&&t.remove(),listFiles(n,e),console.log(o)}))}function upload(e,t){_("upload").onchange=()=>{doUpload(e,t)},_("upload").click()}function ctx(e,t,n,o){e.preventDefault(),ctx_el=o;let a,i=isFolder(t),c=_("ctx");c.style.display="block",a=c.getElementsByTagName("li")[0],a.onclick=i?function(){hidectx(),create(n+t.name+"/",o.children.item(1),o)}:function(){hidectx(),create(n,o.parentNode,o.parentNode.parentNode)},a.style.display=i?"block":"none",a=c.getElementsByTagName("li")[1],i&&(a.onclick=function(){hidectx(),upload(o,n+t.name+"/")}),a.style.display=i?"block":"none",a=c.getElementsByTagName("li")[2],a.onclick=function(){edit(t,n),hidectx()},a.style.display=isText(t)?"block":"none",a=c.getElementsByTagName("li")[3],a.onclick=function(){preview(t,n),hidectx()},a.style.display=isImage(t)?"block":"none",a=c.getElementsByTagName("li")[4],a.onclick=function(){download(t,n),hidectx()},a.style.display=i?"none":"block",a=c.getElementsByTagName("li")[5],a.onclick=function(){remove(t,n,o),hidectx()},a.style.display=n?"block":"none";var s=document.body.scrollTop?document.body.scrollTop:document.documentElement.scrollTop,l=document.body.scrollLeft?document.body.scrollLeft:document.documentElement.scrollLeft,r=e.clientX+l+10,d=e.clientY+s-20,m=(c.offsetWidth,c.offsetHeight),u=document.documentElement.clientHeight;d+m>u&&(d=u-m-20),c.style.left=r+"px",c.style.top=d+"px",o&&o.classList.add("selitem")}function drag(e,t,n){let o=n+t.name;isFolder(t)&&(o+="/"),e.dataTransfer.setData("text",o),console.log("drag start "+o)}function drop(e,t){let n=e.dataTransfer.getData("text");n.startsWith(t)||(e.preventDefault(),console.log("Move "+n+" to "+t))}function listFiles(e,t){return console.log("listFiles"),fetch("/api/files/?dir="+t).then((e=>e.json())).then((n=>{if(0==n.length)return!1;let o=e.getElementsByTagName("div")[0];o&&(o.onclick=n=>{i.remove(),o.onclick=()=>{listFiles(e,t)},n.stopPropagation()});let a=e.getElementsByTagName("ul");for(let e=0;e{drag(event,e,t)},a.appendChild(s),s.innerHTML=''+o+"",isFolder(e)){let n=t+e.name+"/";s.classList.add("bold"),s.onclick=function(e){listFiles(a,n)},s.ondragover=e=>{e.preventDefault()},s.ondrop=e=>{drop(e,n)}}else(isText(e)||isImage(e)||isAudio(e))&&(s.onclick=function(n){url(e,t)});s.oncontextmenu=n=>{ctx(n,e,t,a)}}return e.scrollIntoView(),!0}))}function generateToast({message:e,background:t="#00214d",color:n="#fffffe",length:o="7000ms"}){_("toast").insertAdjacentHTML("afterbegin",`

\n ${e}\n

`);const a=_("toast").firstElementChild;a.addEventListener("animationend",(()=>a.remove()))}document.addEventListener("blur",(function(){hidectx()})),document.addEventListener("DOMContentLoaded",(function(){createEditor("editor",void 0,void 0,void 0);listFiles(_("tree"),"/"),_("tree").getElementsByTagName("div")[0].oncontextmenu=e=>{ctx(e,{name:"",children:[]},"",_("tree"))},_("load").onclick=function(e){const t=new FormData;t.append("load",""),fetchData("/edit","PUT",t)},_("init").onclick=function(e){const t=new FormData;t.append("init",""),fetchData("/edit","PUT",t)},_("home").onclick=function(e){window.location.href="/"},_("page").onchange=function(e){const t=new FormData;t.append("page",_("page").value),fetchData("/edit","PUT",t)}})),document.addEventListener("DOMContentLoaded",(function(){const e=document.getElementById("dragMe"),t=e.previousElementSibling,n=e.nextElementSibling;let o=0,a=0,i=0;const c=function(a){const c=a.clientX-o,s=(a.clientY,100*(i+c)/e.parentNode.getBoundingClientRect().width);t.style.width=`${s}%`,t.style.right=t.style.width,e.style.cursor="col-resize",document.body.style.cursor="col-resize",t.style.userSelect="none",t.style.pointerEvents="none",n.style.userSelect="none",n.style.pointerEvents="none",ace.edit("editor").resize()},s=function(){e.style.removeProperty("cursor"),document.body.style.removeProperty("cursor"),t.style.removeProperty("user-select"),t.style.removeProperty("pointer-events"),n.style.removeProperty("user-select"),n.style.removeProperty("pointer-events"),document.removeEventListener("mousemove",c),document.removeEventListener("mouseup",s)};e.addEventListener("mousedown",(function(e){o=e.clientX,a=e.clientY,i=t.getBoundingClientRect().width,document.addEventListener("mousemove",c),document.addEventListener("mouseup",s)})),e.addEventListener("dblclick",(()=>{var e=t.style.visibility="hidden"===t.style.visibility;t.style.visibility=e?"unset":"hidden",t.style.position=e?"unset":"absolute",ace.edit("editor").resize()}))})); \ No newline at end of file +var ctx_el;function _(e){return document.getElementById(e)}function hidectx(){_("ctx").style.display="none",ctx_el&&ctx_el.classList.remove("selitem"),ctx_el=void 0}function doesFontExist(e){var t=document.createElement("canvas"),n=t.getContext("2d"),o="abcdefghijklmnopqrstuvwxyz0123456789";n.font="72px monospace";var a=n.measureText(o).width;return n.font="72px '"+e+"', monospace",t=null,n.measureText(o).width!=a}function createEditor(e,t,n,o,a){function i(e){let t=/(?:\.([^.]+))?$/.exec(e)[1];if(void 0!==typeof t)switch(t){case"htm":case"html":return"html";case"js":return"javascript";case"cmd":case"json":case"jsonl":return"json";case"css":case"svg":case"xml":return t}return"plain_text"}void 0===n&&(n=i(t)),void 0===a&&(a="text/"+n);["basePath","modePath","themePath"].forEach((e=>{ace.config.set(e,"https://cdnjs.cloudflare.com/ajax/libs/ace/1.32.6")}));var c=ace.edit(e,{useWorker:!1,wrap:!0,indentedSoftWrap:!1,showPrintMargin:!1,highlightGutterLine:!0,useSoftTabs:!0,tabSize:2});c.setFontSize(parseFloat(getComputedStyle(document.documentElement).fontSize)),c.setReadOnly(!0),c.getSession().setUndoManager(new ace.UndoManager),void 0===o&&(o=window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"monokai":"textmate");var s=_("save"),l=_("undo"),r=_("redo"),d=_("cut"),m=_("copy"),u=_("paste"),p=_("font"),f=_("fontsize"),g="none"!==_(e).display;f.value=parseFloat(c.getFontSize()).toFixed(1),p.onchange=function(){c.setOption("fontFamily","'"+p.value+"',monospace")},f.onchange=function(){var e=parseFloat(f.value);!isNaN(e)&&e>=9&&e<=40&&c.setFontSize(e),f.value=parseFloat(c.getFontSize()).toFixed(1)};function h(){let e=!g||c.session.getSelection().isEmpty();d.disabled=e,m.disabled=e}function y(){let e=c.session.getUndoManager();s.disabled=!g||e.isClean(),l.disabled=!g||!e.hasUndo(),r.disabled=!g||!e.hasRedo()}function v(){if(void 0===t)return;const e=function(e){var t=e.getValue();try{var n=JSON.parse(t);return JSON.stringify(n)}catch(e){return t+""}}(c),n=new FormData;n.append("data",new Blob([e],{type:a}),t),fetch("/edit",{method:"POST",body:n}).then((e=>e.ok?e.text().then((e=>{console.log("Save OK /edit "+e)})):e.text().then((e=>{throw console.log("Save FAIL /edit"),new Error(e)})))).then((e=>{console.log(e),generateToast({message:"Saved "+t,background:"#ddd",color:"#000"})})).catch((e=>{console.warn("AbortError"===e.name?"Promise Aborted":"Promise Rejected"),alert(e)})).finally((()=>{y()}))}function x(){var e=c.getCopyText();if(window.clipboardData&&window.clipboardData.setData)return window.clipboardData.setData("Text",e);if(document.queryCommandSupported&&document.queryCommandSupported("copy")){c.focus();try{return document.execCommand("copy")}catch(t){return console.warn("Copy to clipboard failed.",t),prompt("Copy to clipboard: Ctrl+C, Enter",e)}}}function w(e){_("name").innerHTML=e;fetch(e).then((t=>t.ok?(console.log("OK "+e),t.text()):t.text().then((e=>{throw console.log("ERROR "+url),new Error(e)})))).then((e=>{try{var t=JSON.parse(e);c.setValue(JSON.stringify(t,null,4)),console.log("parse json OK")}catch(t){c.setValue(e),console.log("parse json FAIL")}null!==_("editor")&&(_("editor").style.display="block"),null!==_("preview")&&(_("preview").style.display="none"),g=!0,c.setReadOnly(!1),c.focus(),y()})).catch((e=>{console.log(e),alert(e),c.setReadOnly(!0)})).finally((()=>{c.resize(!0),c.scrollToLine(1,!0,!0,(function(){})),c.gotoLine(1,0,!0),c.clearSelection(),c.session.getUndoManager().reset()}))}return["Courier New","Monaco","Lucida Console","Monospace","ui-monospace","Roboto Mono","Inconsolata","IBM Plex Mono","Space Mono","PT Mono","Ubuntu Mono","Nanum Gothic Coding","Cousine","Fira Mono","Share Tech Mono","Courier Prime","Anonymous Pro","Cutive Mono","Overpass Mono","Fira Code","VT323","DM Mono","Oxygen Mono","Nova Mono","B612 Mono","Spline Sans Mono","Noto Sans Mono","Major Mono Display","Azeret Mono","Red Hat Mono","Syne Mono","Xanh Mono"].sort().forEach((function(e,t){if(doesFontExist(e)){var n=document.createElement("option");n.text=e,p.add(n)}})),null!==s&&null!==l&&null!==r&&c.on("input",y),c.session.selection.on("changeCursor",h),s.onclick=v,l.onclick=e=>{c.undo()&&c.focus()},r.onclick=e=>{c.redo()&&c.focus()},d.onclick=e=>{x()&&c.execCommand("cut")},m.onclick=e=>{x()&&c.execCommand("copy")},u.onclick=function(){try{navigator.clipboard.readText().then((e=>{c.execCommand("paste",e)})).catch((e=>{u.disabled=!0}))}catch{u.disabled=!0}},c.loadUrl=(e,o)=>{n=i(t=e+o),a="text/"+n,"plain"!==n&&c.getSession().setMode("ace/mode/"+n),w(e+o)},c.hide=()=>{g=!1,y(),h(),_("editor").style.display="none"},"plain"!==n&&c.getSession().setMode("ace/mode/"+n),c.setTheme("ace/theme/"+o),c.$blockScrolling=1/0,c.commands.addCommand({name:"save",bindKey:{win:"Ctrl-S",mac:"Command-S"},exec:v,readOnly:!1}),c.commands.addCommand({name:"undo",bindKey:{win:"Ctrl-Z",mac:"Command-Z"},exec:function(){c.undo()}}),c.commands.addCommand({name:"redo",bindKey:{win:"Ctrl-Y",mac:"Command-Y"},exec:function(){c.redo()}}),void 0!==t&&w(t),c.resize(),c}function uploadFileAsync(e,t,n,o,a,i){fetchData("/edit","POST",e).then((e=>{generateToast({message:"Upload "+n+"/"+o+" "+t+" done.",background:"#ddd",color:"#000"}),n==o&&listFiles(a,i)}))}function doUpload(e,t){const n=_("upload"),o=n.files.length;if(0!==o)for(let a=0;a=0}function isText(e){if(isFolder(e))return!1;var t=/(?:\.([^.]+))?$/.exec(e.name)[1];if(void 0!==typeof t)switch(t){case"txt":case"cmd":case"json":case"jsonl":case"htm":case"html":case"js":case"c":case"cpp":case"css":case"svg":case"xml":return!0}return!1}function isImage(e){if(isFolder(e))return!1;var t=/(?:\.([^.]+))?$/.exec(e.name)[1];if(void 0!==typeof t)switch(t){case"bmp":case"png":case"jpg":case"gif":case"svg":return!0}return!1}function isAudio(e){if(isFolder(e))return!1;var t=/(?:\.([^.]+))?$/.exec(e.name)[1];if(void 0!==typeof t)switch(t){case"wav":case"mp3":case"aac":case"m4a":case"wma":return!0}return!1}function icon(e){if(isFolder(e))return"dir";if(isImage(e))return"image";if(isAudio(e))return"audio";var t=/(?:\.([^.]+))?$/.exec(e.name)[1];if(void 0!==typeof t)switch(t){case"cmd":case"css":case"json":case"jsonl":case"ttf":return t;case"zip":case"gz":return"zip";case"html":case"htm":return"html"}return"file"}function preview(e,t){if(isImage(e)){let n=t+e.name;const o=_("preview");o.innerHTML='',o.style.display="block",ace.edit("editor").hide(),_("name").innerHTML=n}}function edit(e,t){isText(e)&&(ace.edit("editor").loadUrl(t,e.name),_("preview").style.display="none")}function url(e,t){console.log("click "+t+e.name),isImage(e)?preview(e,t):isText(e)&&edit(e,t)}async function fetchData(e,t,n,o){await fetch(e,{method:t,body:n}).then((n=>n.ok?(console.log(t+" OK "+e),n.text()):n.text().then((n=>{throw console.log(t+" FAIL "+e),new Error(n)})))).then((e=>{o&&o.remove(),console.log(e)})).catch((e=>{console.warn("AbortError"===e.name?"Promise Aborted":"Promise Rejected"),alert(e)})).finally((()=>{}))}function download(e,t){console.log("download "+t+e.name),document.getElementById("download-frame").src=t+e.name+"?download=true"}function remove(e,t,n){let o=t+e.name;isFolder(e)&&(o+="/"),console.log("remove "+o);const a=new FormData;a.append("path",o),fetchData("/edit","DELETE",a,n)}function create(e,t,n){var o=window.prompt("Create File in "+e,"");if(null==o||""==o||o.includes("/"))return;const a=new FormData;a.append("path",e+o),fetchData("/edit","PUT",a),fetch("/api/files/").then((e=>e.json())).then((o=>{t&&t.remove(),listFiles(n,e),console.log(o)}))}function upload(e,t){_("upload").onchange=()=>{doUpload(e,t)},_("upload").click()}function ctx(e,t,n,o){e.preventDefault(),ctx_el=o;let a,i=isFolder(t),c=_("ctx");c.style.display="block",a=c.getElementsByTagName("li")[0],a.onclick=i?function(){hidectx(),create(n+t.name+"/",o.children.item(1),o)}:function(){hidectx(),create(n,o.parentNode,o.parentNode.parentNode)},a.style.display=i?"block":"none",a=c.getElementsByTagName("li")[1],i&&(a.onclick=function(){hidectx(),upload(o,n+t.name+"/")}),a.style.display=i?"block":"none",a=c.getElementsByTagName("li")[2],a.onclick=function(){edit(t,n),hidectx()},a.style.display=isText(t)?"block":"none",a=c.getElementsByTagName("li")[3],a.onclick=function(){preview(t,n),hidectx()},a.style.display=isImage(t)?"block":"none",a=c.getElementsByTagName("li")[4],a.onclick=function(){download(t,n),hidectx()},a.style.display=i?"none":"block",a=c.getElementsByTagName("li")[5],a.onclick=function(){remove(t,n,o),hidectx()},a.style.display=n?"block":"none";var s=document.body.scrollTop?document.body.scrollTop:document.documentElement.scrollTop,l=document.body.scrollLeft?document.body.scrollLeft:document.documentElement.scrollLeft,r=e.clientX+l+10,d=e.clientY+s-20,m=(c.offsetWidth,c.offsetHeight),u=document.documentElement.clientHeight;d+m>u&&(d=u-m-20),c.style.left=r+"px",c.style.top=d+"px",o&&o.classList.add("selitem")}function drag(e,t,n){let o=n+t.name;isFolder(t)&&(o+="/"),e.dataTransfer.setData("text",o),console.log("drag start "+o)}function drop(e,t){let n=e.dataTransfer.getData("text");n.startsWith(t)||(e.preventDefault(),console.log("Move "+n+" to "+t))}function listFiles(e,t){return console.log("listFiles"),fetch("/api/files/?dir="+t).then((e=>e.json())).then((n=>{if(0==n.length)return!1;let o=e.getElementsByTagName("div")[0];o&&(o.onclick=n=>{i.remove(),o.onclick=()=>{listFiles(e,t)},n.stopPropagation()});let a=e.getElementsByTagName("ul");for(let e=0;e{drag(event,e,t)},a.appendChild(s),s.innerHTML=''+o+"",isFolder(e)){let n=t+e.name+"/";s.classList.add("bold"),s.onclick=function(e){listFiles(a,n)},s.ondragover=e=>{e.preventDefault()},s.ondrop=e=>{drop(e,n)}}else(isText(e)||isImage(e)||isAudio(e))&&(s.onclick=function(n){url(e,t)});s.oncontextmenu=n=>{ctx(n,e,t,a)}}return e.scrollIntoView(),!0}))}function generateToast({message:e,background:t="#00214d",color:n="#fffffe",length:o="7000ms"}){_("toast").insertAdjacentHTML("afterbegin",`

\n ${e}\n

`);const a=_("toast").firstElementChild;a.addEventListener("animationend",(()=>a.remove()))}document.addEventListener("blur",(function(){hidectx()})),document.addEventListener("DOMContentLoaded",(function(){createEditor("editor",void 0,void 0,void 0);listFiles(_("tree"),"/"),_("tree").getElementsByTagName("div")[0].oncontextmenu=e=>{ctx(e,{name:"",children:[]},"",_("tree"))},_("load").onclick=function(e){const t=new FormData;t.append("load",""),fetchData("/edit","PUT",t)},_("init").onclick=function(e){const t=new FormData;t.append("init",""),fetchData("/edit","PUT",t)},_("home").onclick=function(e){window.location.href="/"},_("page").onchange=function(e){const t=new FormData;t.append("page",_("page").value),fetchData("/edit","PUT",t)}})),document.addEventListener("DOMContentLoaded",(function(){const e=document.getElementById("dragMe"),t=e.previousElementSibling,n=e.nextElementSibling;let o=0,a=0,i=0;const c=function(a){const c=a.clientX-o,s=(a.clientY,100*(i+c)/e.parentNode.getBoundingClientRect().width);t.style.width=`${s}%`,t.style.right=t.style.width,e.style.cursor="col-resize",document.body.style.cursor="col-resize",t.style.userSelect="none",t.style.pointerEvents="none",n.style.userSelect="none",n.style.pointerEvents="none",ace.edit("editor").resize()},s=function(){e.style.removeProperty("cursor"),document.body.style.removeProperty("cursor"),t.style.removeProperty("user-select"),t.style.removeProperty("pointer-events"),n.style.removeProperty("user-select"),n.style.removeProperty("pointer-events"),document.removeEventListener("mousemove",c),document.removeEventListener("mouseup",s)};e.addEventListener("mousedown",(function(e){o=e.clientX,a=e.clientY,i=t.getBoundingClientRect().width,document.addEventListener("mousemove",c),document.addEventListener("mouseup",s)})),e.addEventListener("dblclick",(()=>{var e=t.style.visibility="hidden"===t.style.visibility;t.style.visibility=e?"unset":"hidden",t.style.position=e?"unset":"absolute",ace.edit("editor").resize()}))})); \ No newline at end of file diff --git a/platformio.ini b/platformio.ini index ba38d320..05f259ea 100644 --- a/platformio.ini +++ b/platformio.ini @@ -1,4 +1,4 @@ -; MIT License - Copyright (c) 2019-2023 Francis Van Roie +; MIT License - Copyright (c) 2019-2024 Francis Van Roie ; For full license information read the LICENSE file in the project folder ; ; PlatformIO Project Configuration File @@ -75,14 +75,14 @@ build_flags = -D HASP_VER_MAJ=0 -D HASP_VER_MIN=7 ;-D HASP_VER_REV=4 - -D HASP_VER_REV=0-rc10 + -D HASP_VER_REV=0-rc11 ;-D HASP_VER_REV=4-rc1 ${override.build_flags} ; -- Shared library dependencies in all environments ; Warning : don't put comments after github links => causes infinite download loop lib_deps = - bblanchon/ArduinoJson@^6.21.4 + bblanchon/ArduinoJson@^6.21.5 ;git+https://github.com/fvanroie/ConsoleInput.git ;git+https://github.com/andrethomas/TasmotaSlave.git ;git+https://github.com/lvgl/lvgl.git @@ -104,11 +104,11 @@ build_src_filter = +<*> -<.git/> - - - - - #include "touch_driver.h" // base class diff --git a/src/hasp/hasp.cpp b/src/hasp/hasp.cpp index 1a3336ee..e2e49f0f 100644 --- a/src/hasp/hasp.cpp +++ b/src/hasp/hasp.cpp @@ -1,4 +1,4 @@ -/* MIT License - Copyright (c) 2019-2023 Francis Van Roie +/* MIT License - Copyright (c) 2019-2024 Francis Van Roie For full license information read the LICENSE file in the project folder */ #include "hasplib.h" diff --git a/src/hasp/hasp.h b/src/hasp/hasp.h index 4b9b5217..bc786c50 100644 --- a/src/hasp/hasp.h +++ b/src/hasp/hasp.h @@ -1,4 +1,4 @@ -/* MIT License - Copyright (c) 2019-2023 Francis Van Roie +/* MIT License - Copyright (c) 2019-2024 Francis Van Roie For full license information read the LICENSE file in the project folder */ #ifndef HASP_H diff --git a/src/hasp/hasp_attribute.cpp b/src/hasp/hasp_attribute.cpp index 105cefce..b903cc93 100644 --- a/src/hasp/hasp_attribute.cpp +++ b/src/hasp/hasp_attribute.cpp @@ -1,4 +1,4 @@ -/* MIT License - Copyright (c) 2019-2023 Francis Van Roie +/* MIT License - Copyright (c) 2019-2024 Francis Van Roie For full license information read the LICENSE file in the project folder */ #include "hasplib.h" @@ -19,6 +19,9 @@ LV_FONT_DECLARE(unscii_8_icon); extern const char** btnmatrix_default_map; // memory pointer to lvgl default btnmatrix map extern const char* msgbox_default_map[]; // memory pointer to lvgl default btnmatrix map +extern const uint8_t rootca_crt_bundle_start[] asm("_binary_data_cert_x509_crt_bundle_bin_start"); +extern const uint8_t rootca_crt_bundle_end[] asm("_binary_data_cert_x509_crt_bundle_bin_end"); + void my_image_release_resources(lv_obj_t* obj) { if(!obj) return; @@ -1345,6 +1348,7 @@ static hasp_attribute_type_t special_attribute_src(lv_obj_t* obj, const char* pa #if defined(ARDUINO) && defined(ARDUINO_ARCH_ESP32) #if HASP_USE_WIFI > 0 || HASP_USE_ETHERNET > 0 HTTPClient http; + // http.begin(payload, (const char*)rootca_crt_bundle_start); http.begin(payload); http.setTimeout(5000); http.setConnectTimeout(5000); diff --git a/src/hasp/hasp_dispatch.cpp b/src/hasp/hasp_dispatch.cpp index 3ffe667f..d828b2b8 100644 --- a/src/hasp/hasp_dispatch.cpp +++ b/src/hasp/hasp_dispatch.cpp @@ -1,4 +1,4 @@ -/* MIT License - Copyright (c) 2019-2023 Francis Van Roie +/* MIT License - Copyright (c) 2019-2024 Francis Van Roie For full license information read the LICENSE file in the project folder */ #include @@ -269,6 +269,42 @@ static void dispatch_output(const char* topic, const char* payload) #endif } +// static inline size_t dispatch_msg_length(size_t len) +// { +// return (len / 64) * 64 + 64; +// } + +// void dispatch_enqueue_message(const char* topic, const char* payload, size_t payload_len, uint8_t source) +// { +// // Add new message to the queue +// dispatch_message_t data; + +// size_t topic_len = strlen(topic); +// data.topic = (char*)hasp_calloc(sizeof(char), dispatch_msg_length(topic_len + 1)); +// data.payload = (char*)hasp_calloc(sizeof(char), dispatch_msg_length(payload_len + 1)); +// data.source = source; + +// if(!data.topic || !data.payload) { +// LOG_ERROR(TAG_MQTT_RCV, D_ERROR_OUT_OF_MEMORY); +// hasp_free(data.topic); +// hasp_free(data.payload); +// return; +// } +// memcpy(data.topic, topic, topic_len); +// memcpy(data.payload, payload, payload_len); + +// { +// size_t attempt = 0; +// while(xQueueSend(message_queue, &data, (TickType_t)0) == errQUEUE_FULL && attempt < 100) { +// delay(5); +// attempt++; +// }; +// if(attempt >= 100) { +// LOG_ERROR(TAG_MSGR, D_ERROR_OUT_OF_MEMORY); +// } +// } +// } + // objectattribute=value static void dispatch_command(const char* topic, const char* payload, bool update, uint8_t source) { @@ -765,6 +801,11 @@ void dispatch_run_script(const char*, const char* payload, uint8_t source) return; } + // if(!gui_acquire(pdMS_TO_TICKS(500))) { + // LOG_ERROR(TAG_MSGR, F(D_FILE_LOAD_FAILED), payload); + // return; + // } + // char buffer[512]; // use stack String buffer((char*)0); // use heap buffer.reserve(512); @@ -788,6 +829,7 @@ void dispatch_run_script(const char*, const char* payload, uint8_t source) } } + // gui_release(); cmdfile.close(); LOG_INFO(TAG_MSGR, F(D_FILE_LOADED), payload); #else @@ -1321,8 +1363,8 @@ void dispatch_current_state(uint8_t source) bool dispatch_factory_reset() { bool formatted = true; - bool erased = true; - bool cleared = true; + bool erased = true; + bool cleared = true; #if ESP32 erased = nvs_clear_user_config(); @@ -1519,7 +1561,20 @@ void dispatchSetup() } IRAM_ATTR void dispatchLoop() -{} +{ + // UBaseType_t msg_count = uxQueueMessagesWaiting(message_queue)); + // if(msg_count == 0) return; + + // dispatch_message_t data; + // while(xQueueReceive(message_queue, &data, (TickType_t)0)) { + // LOG_WARNING(TAG_MSGR, F("[%d] QUE %s => %s"), msg_count, data.topic, data.payload); + // size_t length = strlen(data.payload); + // dispatch_topic_payload(data.topic, data.payload, length > 0, data.source); + // hasp_free(data.topic); + // hasp_free(data.payload); + // // delay(1); + // } +} #if 1 || ARDUINO void dispatchEverySecond() @@ -1551,7 +1606,7 @@ void everySecond() { if(dispatch_setings.teleperiod > 0) { std::chrono::steady_clock::time_point end = std::chrono::steady_clock::now(); - std::chrono::seconds elapsed = std::chrono::duration_cast(end - begin); + std::chrono::seconds elapsed = std::chrono::duration_cast(end - begin); if(elapsed.count() >= dispatch_setings.teleperiod) { std::chrono::steady_clock::time_point begin = std::chrono::steady_clock::now(); diff --git a/src/hasp/hasp_dispatch.h b/src/hasp/hasp_dispatch.h index 245da30c..13967871 100644 --- a/src/hasp/hasp_dispatch.h +++ b/src/hasp/hasp_dispatch.h @@ -5,6 +5,15 @@ #define HASP_DISPATCH_H #include "hasplib.h" +// #include "freertos/queue.h" + +// QueueHandle_t message_queue; +// typedef struct +// { +// char* topic; //[64]; +// char* payload; //[512]; +// uint source; +// } dispatch_message_t; struct dispatch_conf_t { diff --git a/src/hasp/hasp_font.cpp b/src/hasp/hasp_font.cpp index 1f50c81a..98a20c46 100644 --- a/src/hasp/hasp_font.cpp +++ b/src/hasp/hasp_font.cpp @@ -1,4 +1,4 @@ -/* MIT License - Copyright (c) 2019-2023 Francis Van Roie +/* MIT License - Copyright (c) 2019-2024 Francis Van Roie For full license information read the LICENSE file in the project folder */ #include diff --git a/src/hasp/hasp_nvs.cpp b/src/hasp/hasp_nvs.cpp index a2fd0b23..1ce54e93 100644 --- a/src/hasp/hasp_nvs.cpp +++ b/src/hasp/hasp_nvs.cpp @@ -1,4 +1,4 @@ -/* MIT License - Copyright (c) 2019-2023 Francis Van Roie +/* MIT License - Copyright (c) 2019-2024 Francis Van Roie For full license information read the LICENSE file in the project folder */ #ifdef ESP32 diff --git a/src/hasp/hasp_nvs.h b/src/hasp/hasp_nvs.h index 809f65ca..ef87e5a6 100644 --- a/src/hasp/hasp_nvs.h +++ b/src/hasp/hasp_nvs.h @@ -1,4 +1,4 @@ -/* MIT License - Copyright (c) 2019-2023 Francis Van Roie +/* MIT License - Copyright (c) 2019-2024 Francis Van Roie For full license information read the LICENSE file in the project folder */ #ifndef HASP_NVS_H diff --git a/src/hasp/hasp_object.h b/src/hasp/hasp_object.h index cd1a0a20..5bfe157a 100644 --- a/src/hasp/hasp_object.h +++ b/src/hasp/hasp_object.h @@ -1,4 +1,4 @@ -/* MIT License - Copyright (c) 2019-2023 Francis Van Roie +/* MIT License - Copyright (c) 2019-2024 Francis Van Roie For full license information read the LICENSE file in the project folder */ #ifndef HASP_OBJECT_H diff --git a/src/hasp/hasp_task.cpp b/src/hasp/hasp_task.cpp index 23fb2027..a6d01900 100644 --- a/src/hasp/hasp_task.cpp +++ b/src/hasp/hasp_task.cpp @@ -1,4 +1,4 @@ -/* MIT License - Copyright (c) 2019-2023 Francis Van Roie +/* MIT License - Copyright (c) 2019-2024 Francis Van Roie For full license information read the LICENSE file in the project folder */ #include "hasplib.h" diff --git a/src/hasp_config.cpp b/src/hasp_config.cpp index 09ceea05..d3e55b1e 100644 --- a/src/hasp_config.cpp +++ b/src/hasp_config.cpp @@ -1,4 +1,4 @@ -/* MIT License - Copyright (c) 2019-2023 Francis Van Roie +/* MIT License - Copyright (c) 2019-2024 Francis Van Roie For full license information read the LICENSE file in the project folder */ #if HASP_USE_CONFIG > 0 diff --git a/src/hasp_config.h b/src/hasp_config.h index 7effe4cd..8a667ed6 100644 --- a/src/hasp_config.h +++ b/src/hasp_config.h @@ -1,4 +1,4 @@ -/* MIT License - Copyright (c) 2019-2023 Francis Van Roie +/* MIT License - Copyright (c) 2019-2024 Francis Van Roie For full license information read the LICENSE file in the project folder */ #if HASP_USE_CONFIG > 0 diff --git a/src/hasp_debug.cpp b/src/hasp_debug.cpp index 52977625..672c0ba2 100644 --- a/src/hasp_debug.cpp +++ b/src/hasp_debug.cpp @@ -1,4 +1,4 @@ -/* MIT License - Copyright (c) 2019-2023 Francis Van Roie +/* MIT License - Copyright (c) 2019-2024 Francis Van Roie For full license information read the LICENSE file in the project folder */ #include "hasplib.h" diff --git a/src/hasp_filesystem.cpp b/src/hasp_filesystem.cpp index 56c96cc3..ac39a344 100644 --- a/src/hasp_filesystem.cpp +++ b/src/hasp_filesystem.cpp @@ -1,4 +1,4 @@ -/* MIT License - Copyright (c) 2019-2023 Francis Van Roie +/* MIT License - Copyright (c) 2019-2024 Francis Van Roie For full license information read the LICENSE file in the project folder */ #ifdef ARDUINO diff --git a/src/hasp_filesystem.h b/src/hasp_filesystem.h index 3bb3d490..0299fc7f 100644 --- a/src/hasp_filesystem.h +++ b/src/hasp_filesystem.h @@ -1,4 +1,4 @@ -/* MIT License - Copyright (c) 2019-2023 Francis Van Roie +/* MIT License - Copyright (c) 2019-2024 Francis Van Roie For full license information read the LICENSE file in the project folder */ #ifndef HASP_FILESYSTEM_H diff --git a/src/hasp_gui.cpp b/src/hasp_gui.cpp index 3d05a80e..b69a1ee5 100644 --- a/src/hasp_gui.cpp +++ b/src/hasp_gui.cpp @@ -1,4 +1,4 @@ -/* MIT License - Copyright (c) 2019-2023 Francis Van Roie +/* MIT License - Copyright (c) 2019-2024 Francis Van Roie For full license information read the LICENSE file in the project folder */ #include "hasplib.h" diff --git a/src/hasp_oobe.cpp b/src/hasp_oobe.cpp index f816afbd..1e9cb932 100644 --- a/src/hasp_oobe.cpp +++ b/src/hasp_oobe.cpp @@ -1,4 +1,4 @@ -/* MIT License - Copyright (c) 2019-2023 Francis Van Roie +/* MIT License - Copyright (c) 2019-2024 Francis Van Roie For full license information read the LICENSE file in the project folder */ #if HASP_USE_CONFIG > 0 diff --git a/src/hasp_oobe.h b/src/hasp_oobe.h index 931ab220..b5b5ad0e 100644 --- a/src/hasp_oobe.h +++ b/src/hasp_oobe.h @@ -1,4 +1,4 @@ -/* MIT License - Copyright (c) 2019-2023 Francis Van Roie +/* MIT License - Copyright (c) 2019-2024 Francis Van Roie For full license information read the LICENSE file in the project folder */ #if HASP_USE_CONFIG > 0 diff --git a/src/hasplib.h b/src/hasplib.h index 1cd8691b..05ce613c 100644 --- a/src/hasplib.h +++ b/src/hasplib.h @@ -1,4 +1,4 @@ -/* MIT License - Copyright (c) 2019-2023 Francis Van Roie +/* MIT License - Copyright (c) 2019-2024 Francis Van Roie For full license information read the LICENSE file in the project folder */ #ifdef ARDUINO diff --git a/src/main_arduino.cpp b/src/main_arduino.cpp index 86b53902..8fc378b2 100644 --- a/src/main_arduino.cpp +++ b/src/main_arduino.cpp @@ -1,4 +1,4 @@ -/* MIT License - Copyright (c) 2019-2023 Francis Van Roie +/* MIT License - Copyright (c) 2019-2024 Francis Van Roie For full license information read the LICENSE file in the project folder */ #if !(defined(WINDOWS) || defined(POSIX)) diff --git a/src/mqtt/hasp_mqtt.h b/src/mqtt/hasp_mqtt.h index 63e9ed9e..f5d57196 100644 --- a/src/mqtt/hasp_mqtt.h +++ b/src/mqtt/hasp_mqtt.h @@ -1,4 +1,4 @@ -/* MIT License - Copyright (c) 2019-2023 Francis Van Roie +/* MIT License - Copyright (c) 2019-2024 Francis Van Roie For full license information read the LICENSE file in the project folder */ #ifndef HASP_MQTT_H diff --git a/src/mqtt/hasp_mqtt_esp.cpp b/src/mqtt/hasp_mqtt_esp.cpp index 0b1c42ea..9fbac1e0 100644 --- a/src/mqtt/hasp_mqtt_esp.cpp +++ b/src/mqtt/hasp_mqtt_esp.cpp @@ -1,4 +1,4 @@ -/* MIT License - Copyright (c) 2019-2023 Francis Van Roie +/* MIT License - Copyright (c) 2019-2024 Francis Van Roie For full license information read the LICENSE file in the project folder */ #include "hasp_conf.h" diff --git a/src/mqtt/hasp_mqtt_paho_single.cpp b/src/mqtt/hasp_mqtt_paho_single.cpp index 0811e29d..17804f89 100644 --- a/src/mqtt/hasp_mqtt_paho_single.cpp +++ b/src/mqtt/hasp_mqtt_paho_single.cpp @@ -1,4 +1,4 @@ -/* MIT License - Copyright (c) 2019-2023 Francis Van Roie +/* MIT License - Copyright (c) 2019-2024 Francis Van Roie For full license information read the LICENSE file in the project folder */ /* Single threaded synchronous paho client */ diff --git a/src/mqtt/hasp_mqtt_pubsubclient.cpp b/src/mqtt/hasp_mqtt_pubsubclient.cpp index 8821fc59..29e11b2f 100644 --- a/src/mqtt/hasp_mqtt_pubsubclient.cpp +++ b/src/mqtt/hasp_mqtt_pubsubclient.cpp @@ -1,4 +1,4 @@ -/* MIT License - Copyright (c) 2019-2023 Francis Van Roie +/* MIT License - Copyright (c) 2019-2024 Francis Van Roie For full license information read the LICENSE file in the project folder */ #include "hasp_conf.h" diff --git a/src/sys/gpio/hasp_gpio.cpp b/src/sys/gpio/hasp_gpio.cpp index b27e3594..0094f80b 100644 --- a/src/sys/gpio/hasp_gpio.cpp +++ b/src/sys/gpio/hasp_gpio.cpp @@ -1,4 +1,4 @@ -/* MIT License - Copyright (c) 2019-2023 Francis Van Roie +/* MIT License - Copyright (c) 2019-2024 Francis Van Roie For full license information read the LICENSE file in the project folder */ #include "lv_conf.h" // For timing defines diff --git a/src/sys/gpio/hasp_gpio.h b/src/sys/gpio/hasp_gpio.h index 43a68376..df093048 100644 --- a/src/sys/gpio/hasp_gpio.h +++ b/src/sys/gpio/hasp_gpio.h @@ -1,4 +1,4 @@ -/* MIT License - Copyright (c) 2019-2023 Francis Van Roie +/* MIT License - Copyright (c) 2019-2024 Francis Van Roie For full license information read the LICENSE file in the project folder */ #ifndef HASP_GPIO_H diff --git a/src/sys/net/hasp_time.cpp b/src/sys/net/hasp_time.cpp index 0087a35c..3a193049 100644 --- a/src/sys/net/hasp_time.cpp +++ b/src/sys/net/hasp_time.cpp @@ -1,4 +1,4 @@ -/* MIT License - Copyright (c) 2019-2023 Francis Van Roie +/* MIT License - Copyright (c) 2019-2024 Francis Van Roie For full license information read the LICENSE file in the project folder */ #include @@ -110,9 +110,7 @@ String time_zone_to_possix(const char* timezone) case TZ_ASIA_RIYADH: case TZ_ETC_GMT__3: case TZ_EUROPE_ISTANBUL: - case TZ_EUROPE_KIROV: case TZ_EUROPE_MINSK: - case TZ_EUROPE_VOLGOGRAD: return "<+03>-3"; case TZ_ASIA_TEHRAN: return "<+0330>-3:30"; @@ -283,9 +281,9 @@ String time_zone_to_possix(const char* timezone) return "<-03>3"; case TZ_AMERICA_MIQUELON: return "<-03>3<-02>,M3.2.0,M11.1.0"; - case TZ_AMERICA_GODTHAB: case TZ_AMERICA_NUUK: - return "<-03>3<-02>,M3.4.6/22,J365/25"; + case TZ_AMERICA_GODTHAB: + return "<-02>2<-01>,M3.5.0/-1,M10.5.0/0"; case TZ_AMERICA_BOA_VISTA: case TZ_AMERICA_CAMPO_GRANDE: case TZ_AMERICA_CARACAS: @@ -482,10 +480,11 @@ String time_zone_to_possix(const char* timezone) case TZ_INDIAN_COMORO: case TZ_INDIAN_MAYOTTE: return "EAT-3"; - case TZ_AFRICA_CAIRO: case TZ_AFRICA_TRIPOLI: case TZ_EUROPE_KALININGRAD: return "EET-2"; + case TZ_AFRICA_CAIRO: + return "EET-2EEST,M4.5.5/0,M10.5.4/24"; case TZ_EUROPE_CHISINAU: return "EET-2EEST,M3.5.0,M10.5.0/3"; case TZ_ASIA_BEIRUT: @@ -506,7 +505,7 @@ String time_zone_to_possix(const char* timezone) return "EET-2EEST,M3.5.0/3,M10.5.0/4"; case TZ_ASIA_GAZA: case TZ_ASIA_HEBRON: - return "EET-2EEST,M3.5.6,M10.5.6"; + return "EET-2EEST,M3.4.4/50,M10.4.4/50"; case TZ_AMERICA_ATIKOKAN: case TZ_AMERICA_CANCUN: case TZ_AMERICA_CAYMAN: @@ -577,8 +576,10 @@ String time_zone_to_possix(const char* timezone) case TZ_ASIA_PYONGYANG: case TZ_ASIA_SEOUL: return "KST-9"; + case TZ_EUROPE_KIROV: case TZ_EUROPE_MOSCOW: case TZ_EUROPE_SIMFEROPOL: + case TZ_EUROPE_VOLGOGRAD: return "MSK-3"; case TZ_AMERICA_CRESTON: case TZ_AMERICA_DAWSON: diff --git a/src/sys/net/hasp_time.h b/src/sys/net/hasp_time.h index 5d1b3e26..0448fd29 100644 --- a/src/sys/net/hasp_time.h +++ b/src/sys/net/hasp_time.h @@ -1,4 +1,4 @@ -/* MIT License - Copyright (c) 2019-2023 Francis Van Roie +/* MIT License - Copyright (c) 2019-2024 Francis Van Roie For full license information read the LICENSE file in the project folder */ #ifndef HASP_TIME_H diff --git a/src/sys/net/hasp_wifi.cpp b/src/sys/net/hasp_wifi.cpp index 36f69b26..dc6041e7 100644 --- a/src/sys/net/hasp_wifi.cpp +++ b/src/sys/net/hasp_wifi.cpp @@ -1,4 +1,4 @@ -/* MIT License - Copyright (c) 2019-2023 Francis Van Roie +/* MIT License - Copyright (c) 2019-2024 Francis Van Roie For full license information read the LICENSE file in the project folder */ #include diff --git a/src/sys/net/hasp_wifi.h b/src/sys/net/hasp_wifi.h index 1418efa0..03c98e06 100644 --- a/src/sys/net/hasp_wifi.h +++ b/src/sys/net/hasp_wifi.h @@ -1,4 +1,4 @@ -/* MIT License - Copyright (c) 2019-2023 Francis Van Roie +/* MIT License - Copyright (c) 2019-2024 Francis Van Roie For full license information read the LICENSE file in the project folder */ #ifndef HASP_WIFI_H diff --git a/src/sys/net/hasp_wireguard.cpp b/src/sys/net/hasp_wireguard.cpp index 36b05515..c2ca170a 100644 --- a/src/sys/net/hasp_wireguard.cpp +++ b/src/sys/net/hasp_wireguard.cpp @@ -12,7 +12,7 @@ char wg_ip[16] = WIREGUARD_IP; char wg_private_key[45] = WIREGUARD_PRIVATE_KEY; -char wg_ep_ip[16] = WIREGUARD_EP_IP; +char wg_ep_ip[40] = WIREGUARD_EP_IP; uint16_t wg_ep_port = WIREGUARD_EP_PORT; char wg_ep_public_key[45] = WIREGUARD_EP_PUBLIC_KEY; static WireGuard wg; diff --git a/src/sys/svc/hasp_console.cpp b/src/sys/svc/hasp_console.cpp index 9e7f1632..66312569 100644 --- a/src/sys/svc/hasp_console.cpp +++ b/src/sys/svc/hasp_console.cpp @@ -1,4 +1,4 @@ -/* MIT License - Copyright (c) 2019-2023 Francis Van Roie +/* MIT License - Copyright (c) 2019-2024 Francis Van Roie For full license information read the LICENSE file in the project folder */ #include "hasplib.h" diff --git a/src/sys/svc/hasp_console.h b/src/sys/svc/hasp_console.h index ac2e4223..10c17b69 100644 --- a/src/sys/svc/hasp_console.h +++ b/src/sys/svc/hasp_console.h @@ -1,4 +1,4 @@ -/* MIT License - Copyright (c) 2019-2023 Francis Van Roie +/* MIT License - Copyright (c) 2019-2024 Francis Van Roie For full license information read the LICENSE file in the project folder */ #ifndef HASP_CONSOLE_H diff --git a/src/sys/svc/hasp_ftp.cpp b/src/sys/svc/hasp_ftp.cpp index 0e1e8ef3..9b1e11ac 100644 --- a/src/sys/svc/hasp_ftp.cpp +++ b/src/sys/svc/hasp_ftp.cpp @@ -1,4 +1,4 @@ -/* MIT License - Copyright (c) 2019-2023 Francis Van Roie +/* MIT License - Copyright (c) 2019-2024 Francis Van Roie For full license information read the LICENSE file in the project folder */ #include "hasplib.h" diff --git a/src/sys/svc/hasp_ftp.h b/src/sys/svc/hasp_ftp.h index 11571a95..35f6b69f 100644 --- a/src/sys/svc/hasp_ftp.h +++ b/src/sys/svc/hasp_ftp.h @@ -1,4 +1,4 @@ -/* MIT License - Copyright (c) 2019-2023 Francis Van Roie +/* MIT License - Copyright (c) 2019-2024 Francis Van Roie For full license information read the LICENSE file in the project folder */ #ifndef HASP_FTP_H diff --git a/src/sys/svc/hasp_http.cpp b/src/sys/svc/hasp_http.cpp index 6139b177..1f78c7f8 100644 --- a/src/sys/svc/hasp_http.cpp +++ b/src/sys/svc/hasp_http.cpp @@ -1,4 +1,4 @@ -/* MIT License - Copyright (c) 2019-2023 Francis Van Roie +/* MIT License - Copyright (c) 2019-2024 Francis Van Roie For full license information read the LICENSE file in the project folder */ #include "hasplib.h" @@ -920,7 +920,7 @@ static void http_handle_about()

-

openHASP

Copyright 2019-2023 Francis Van Roie
MIT License

+

openHASP

Copyright 2019-2024 Francis Van Roie
MIT License

@@ -2357,7 +2357,7 @@ static void http_handle_wireguard()
-
+
diff --git a/src/sys/svc/hasp_http.h b/src/sys/svc/hasp_http.h index bdbe13c4..388bb67c 100644 --- a/src/sys/svc/hasp_http.h +++ b/src/sys/svc/hasp_http.h @@ -1,4 +1,4 @@ -/* MIT License - Copyright (c) 2019-2023 Francis Van Roie +/* MIT License - Copyright (c) 2019-2024 Francis Van Roie For full license information read the LICENSE file in the project folder */ #ifndef HASP_HTTP_H diff --git a/src/sys/svc/hasp_http_async.cpp b/src/sys/svc/hasp_http_async.cpp index d73f112f..2c8ec707 100644 --- a/src/sys/svc/hasp_http_async.cpp +++ b/src/sys/svc/hasp_http_async.cpp @@ -1,4 +1,4 @@ -/* MIT License - Copyright (c) 2019-2023 Francis Van Roie +/* MIT License - Copyright (c) 2019-2024 Francis Van Roie For full license information read the LICENSE file in the project folder */ //#include "webServer.h" diff --git a/src/sys/svc/hasp_mdns.h b/src/sys/svc/hasp_mdns.h index 2f472814..82893e16 100644 --- a/src/sys/svc/hasp_mdns.h +++ b/src/sys/svc/hasp_mdns.h @@ -1,4 +1,4 @@ -/* MIT License - Copyright (c) 2019-2023 Francis Van Roie +/* MIT License - Copyright (c) 2019-2024 Francis Van Roie For full license information read the LICENSE file in the project folder */ #ifndef HASP_MDNS_H diff --git a/src/sys/svc/hasp_ota.cpp b/src/sys/svc/hasp_ota.cpp index f4c18f12..d42ccf61 100644 --- a/src/sys/svc/hasp_ota.cpp +++ b/src/sys/svc/hasp_ota.cpp @@ -1,4 +1,4 @@ -/* MIT License - Copyright (c) 2019-2023 Francis Van Roie +/* MIT License - Copyright (c) 2019-2024 Francis Van Roie For full license information read the LICENSE file in the project folder */ #if defined(ARDUINO_ARCH_ESP8266) || defined(ARDUINO_ARCH_ESP32) diff --git a/src/sys/svc/hasp_telnet.cpp b/src/sys/svc/hasp_telnet.cpp index da8f2e85..1f3d8a09 100644 --- a/src/sys/svc/hasp_telnet.cpp +++ b/src/sys/svc/hasp_telnet.cpp @@ -1,4 +1,4 @@ -/* MIT License - Copyright (c) 2019-2023 Francis Van Roie +/* MIT License - Copyright (c) 2019-2024 Francis Van Roie For full license information read the LICENSE file in the project folder */ #include "hasplib.h" diff --git a/user_setups/esp32/_esp32.ini b/user_setups/esp32/_esp32.ini index a7440eae..93c493ed 100644 --- a/user_setups/esp32/_esp32.ini +++ b/user_setups/esp32/_esp32.ini @@ -95,7 +95,7 @@ lib_deps = git+https://github.com/fvanroie/ConsoleInput.git#dev ; lorol/LittleFS_esp32@^1.0.6 ; for Arduino v1 only bxparks/AceButton@^1.10.1 ; GPIO button library - bblanchon/StreamUtils@^1.7.3 ; for EEPromStream and BufferedTelnetClient + bblanchon/StreamUtils@^1.8.0 ; for EEPromStream and BufferedTelnetClient ; knolleary/PubSubClient@^2.8.0 ; MQTT client extra_scripts = @@ -144,7 +144,6 @@ framework = arduino ;platform = https://github.com/tasmota/platform-espressif32/releases/download/2023.10.03/platform-espressif32.zip ;;;platform = https://github.com/tasmota/platform-espressif32/releases/download/2023.11.01/platform-espressif32.zip platform = https://github.com/Jason2866/platform-espressif32/releases/download/2023.10.02/platform-espressif32-2023.10.02.zip - lib_ignore = ${esp32.lib_ignore} LittleFS_esp32 ; Not needed for Arduino v2 diff --git a/user_setups/esp32s2/_esp32s2.ini b/user_setups/esp32s2/_esp32s2.ini index f21817b8..88bcf8a7 100644 --- a/user_setups/esp32s2/_esp32s2.ini +++ b/user_setups/esp32s2/_esp32s2.ini @@ -83,7 +83,8 @@ platform = https://github.com/tasmota/platform-espressif32/releases/download/202 [arduino_esp32s2-solo_v2] framework = arduino ; platform = https://github.com/tasmota/platform-espressif32/releases/download/2023.01.01/platform-espressif32.zip -platform = https://github.com/tasmota/platform-espressif32/releases/download/2023.10.03/platform-espressif32.zip +; platform = https://github.com/tasmota/platform-espressif32/releases/download/2023.10.03/platform-espressif32.zip +platform = https://github.com/Jason2866/platform-espressif32/releases/download/2023.10.02/platform-espressif32-2023.10.02.zip board_build.embed_files = ${esp32.board_build.embed_files} board_build.filesystem = littlefs ; ----- crash reporter diff --git a/user_setups/esp32s3/_esp32s3.ini b/user_setups/esp32s3/_esp32s3.ini index 198975ba..13f7a122 100644 --- a/user_setups/esp32s3/_esp32s3.ini +++ b/user_setups/esp32s3/_esp32s3.ini @@ -17,4 +17,5 @@ extends = esp32s3 framework = arduino ; platform = https://github.com/tasmota/platform-espressif32/releases/download/2023.05.01/platform-espressif32.zip ; platform = https://github.com/tasmota/platform-espressif32/releases/download/2023.08.01/platform-espressif32.zip -platform = https://github.com/tasmota/platform-espressif32/releases/download/2023.10.03/platform-espressif32.zip +; platform = https://github.com/tasmota/platform-espressif32/releases/download/2023.10.03/platform-espressif32.zip +platform = https://github.com/Jason2866/platform-espressif32/releases/download/2023.10.02/platform-espressif32-2023.10.02.zip \ No newline at end of file