diff --git a/html/console.html b/data/html/console.html similarity index 100% rename from html/console.html rename to data/html/console.html diff --git a/html/console.js b/data/html/console.js similarity index 100% rename from html/console.js rename to data/html/console.js diff --git a/html/favicon.ico b/data/html/favicon.ico similarity index 100% rename from html/favicon.ico rename to data/html/favicon.ico diff --git a/html/flash.html b/data/html/flash.html similarity index 100% rename from html/flash.html rename to data/html/flash.html diff --git a/html/flash.js b/data/html/flash.js similarity index 100% rename from html/flash.js rename to data/html/flash.js diff --git a/html/head- b/data/html/head- similarity index 100% rename from html/head- rename to data/html/head- diff --git a/html/home.html b/data/html/home.html similarity index 100% rename from html/home.html rename to data/html/home.html diff --git a/html/jl-400x110.png- b/data/html/jl-400x110.png- similarity index 100% rename from html/jl-400x110.png- rename to data/html/jl-400x110.png- diff --git a/html/log.html b/data/html/log.html similarity index 100% rename from html/log.html rename to data/html/log.html diff --git a/html/mqtt.html b/data/html/mqtt.html similarity index 100% rename from html/mqtt.html rename to data/html/mqtt.html diff --git a/html/mqtt.js b/data/html/mqtt.js similarity index 100% rename from html/mqtt.js rename to data/html/mqtt.js diff --git a/html/pure.css b/data/html/pure.css similarity index 100% rename from html/pure.css rename to data/html/pure.css diff --git a/html/services.html b/data/html/services.html similarity index 100% rename from html/services.html rename to data/html/services.html diff --git a/html/services.js b/data/html/services.js similarity index 100% rename from html/services.js rename to data/html/services.js diff --git a/html/style.css b/data/html/style.css similarity index 100% rename from html/style.css rename to data/html/style.css diff --git a/html/ui.js b/data/html/ui.js similarity index 100% rename from html/ui.js rename to data/html/ui.js diff --git a/html/userpage.js b/data/html/userpage.js similarity index 100% rename from html/userpage.js rename to data/html/userpage.js diff --git a/html/web-server.html b/data/html/web-server.html similarity index 100% rename from html/web-server.html rename to data/html/web-server.html diff --git a/html/wifi/icons.png b/data/html/wifi/icons.png similarity index 100% rename from html/wifi/icons.png rename to data/html/wifi/icons.png diff --git a/html/wifi/wifiAp.html b/data/html/wifi/wifiAp.html similarity index 100% rename from html/wifi/wifiAp.html rename to data/html/wifi/wifiAp.html diff --git a/html/wifi/wifiAp.js b/data/html/wifi/wifiAp.js similarity index 100% rename from html/wifi/wifiAp.js rename to data/html/wifi/wifiAp.js diff --git a/html/wifi/wifiSta.html b/data/html/wifi/wifiSta.html similarity index 100% rename from html/wifi/wifiSta.html rename to data/html/wifi/wifiSta.html diff --git a/html/wifi/wifiSta.js b/data/html/wifi/wifiSta.js similarity index 100% rename from html/wifi/wifiSta.js rename to data/html/wifi/wifiSta.js diff --git a/data/spiffs/console.html b/data/spiffs/console.html new file mode 100644 index 0000000..d811640 --- /dev/null +++ b/data/spiffs/console.html @@ -0,0 +1,56 @@ +esp-link

Microcontroller Console

Reset µC   Clear Log   Baud:   Fmt:

Console
--- No Content ---
Console entry
(ENTER to submit, ESC to clear)
Add:
History buffer
(UP/DOWN arrows to select)
\ No newline at end of file diff --git a/data/spiffs/console.js b/data/spiffs/console.js new file mode 100644 index 0000000..e2451ff --- /dev/null +++ b/data/spiffs/console.js @@ -0,0 +1,72 @@ +function fetchText(a,c){var b=$("#console"); +if(b.textEnd==undefined){b.textEnd=0; +b.innerHTML="" +}window.setTimeout(function(){ajaxJson("GET",console_url+"?start="+b.textEnd,function(e){var d=updateText(e); +if(c){fetchText(d,c) +}},function(){retryLoad(c) +}) +},a) +}function updateText(d){var b=$("#console"); +var a=3000; +if(d!=null&&d.len>0){var c=b.scrollHeight-b.clientHeight<=b.scrollTop+1; +if(d.start>b.textEnd){b.innerHTML=b.innerHTML.concat("\r\n/g,">").replace(/"/g,""")); +b.textEnd=d.start+d.len; +a=500; +if(c){b.scrollTop=b.scrollHeight-b.clientHeight +}}return a +}function retryLoad(a){fetchText(1000,a) +}function consoleSendInit(){var e=$("#send-history"); +var h=$("#input-text"); +var d=$("#input-add-cr"); +var b=$("#input-add-lf"); +function g(k){for(var j=0; +j=e.children.length){i=0 +}a(i) +}e.addEventListener("change",function(i){h.value=e.value +}); +function c(k){var i=g(k); +if(i!==null){a(i); +return false +}var j=m(""); +j.value=k; +e.appendChild(j); +e.value=k; +for(; +e.children.length>15; +){e.removeChild(e.children[0]) +}return true +}h.addEventListener("keydown",function(i){switch(i.keyCode){case 38:i.preventDefault(); +f(-1); +break; +case 40:i.preventDefault(); +f(+1); +break; +case 27:i.preventDefault(); +h.value=""; +e.value=""; +break; +case 13:i.preventDefault(); +var j=h.value; +if(d.checked){j+="\r" +}if(b.checked){j+="\n" +}c(h.value); +h.value=""; +ajaxSpin("POST","/console/send?text="+encodeURIComponent(j),function(k){showNotification("Text sent") +},function(l,k){showWarning("Error sending text") +}); +break +}}) +}function showDbgMode(c){var b=$(".dbg-btn"); +for(var a=0; +aesp-link

Upgrade Firmware

Upgrade Firmware

\ No newline at end of file diff --git a/data/spiffs/flash.js b/data/spiffs/flash.js new file mode 100644 index 0000000..b1ff173 --- /dev/null +++ b/data/spiffs/flash.js @@ -0,0 +1,20 @@ +function flashFirmware(b){b.preventDefault(); +var a=document.getElementById("fw-file").files[0]; +$("#fw-form").setAttribute("hidden",""); +$("#fw-spinner").removeAttribute("hidden"); +showNotification("Firmware is being updated ..."); +ajaxReq("POST","/flash/upload",function(c){ajaxReq("GET","/flash/reboot",function(d){showNotification("Firmware has been successfully updated!"); +setTimeout(function(){window.location.reload() +},4000); +$("#fw-spinner").setAttribute("hidden",""); +$("#fw-form").removeAttribute("hidden") +}) +},null,a) +}function fetchFlash(){ajaxReq("GET","/flash/next",function(a){$("#fw-slot").innerHTML=a; +$("#fw-spinner").setAttribute("hidden",""); +$("#fw-form").removeAttribute("hidden") +}); +ajaxJson("GET","/menu",function(b){var a=$("#current-fw"); +if(a!=null){a.innerHTML=b.version +}}) +}; \ No newline at end of file diff --git a/data/spiffs/home.html b/data/spiffs/home.html new file mode 100644 index 0000000..3f14706 --- /dev/null +++ b/data/spiffs/home.html @@ -0,0 +1,10 @@ +esp-link
JEELABS

esp-link

System overview

Info

The JeeLabs esp-link firmware bridges the ESP8266 serial port to WiFi and can program microcontrollers over the serial port, in particular Arduinos, AVRs, and NXP's LPC800 and other ARM processors. Typical avrdude command line to program an Arduino:

/home/arduino/hardware/tools/avrdude \
  -DV -patmega328p \
  -Pnet:esp-link.local:23 \
  -carduino -b115200 \
  -U flash:w:my_sketch.hex:i\
  -C /home/arduino/hardware/tools/avrdude.conf

where -Pnet:esp-link.local:23 tells avrdude to connect to port 23 of esp-link. You can substitute the IP address of your esp-link for esp-link.local if necessary. Please refer to the online README for up-to-date help.

Pin assignment

System details

\ No newline at end of file diff --git a/data/spiffs/log.html b/data/spiffs/log.html new file mode 100644 index 0000000..b50e772 --- /dev/null +++ b/data/spiffs/log.html @@ -0,0 +1,31 @@ +esp-link

Debug Log

The debug log shows the most recent characters printed by the esp-link software itself to its own debug log.

\ No newline at end of file diff --git a/data/spiffs/mqtt.html b/data/spiffs/mqtt.html new file mode 100644 index 0000000..4c4537d --- /dev/null +++ b/data/spiffs/mqtt.html @@ -0,0 +1,7 @@ +esp-link

REST & MQTT

The REST & MQTT support uses the SLIP protocol over the serial port to enable the attached microcontroller to initiate outbound connections. The REST support lets the uC initiate simple HTTP requests while the MQTT support lets it communicate with an MQTT server bidirectionally at QoS 0 thru 2.

The MQTT support is in the form of a built-in client that connects to a server using parameters set below and stored in esp-link's flash settings. This allows esp-link to take care of connection parameters and disconnect/reconnect operations.

The MQTT client also supports sending periodic status messages about esp-link itself, including WiFi RSSI, and free heap memory.

MQTT

Status reporting

REST

REST requests are enabled as soon as SLIP is enabled. There are no REST-specific settings.

\ No newline at end of file diff --git a/data/spiffs/mqtt.js b/data/spiffs/mqtt.js new file mode 100644 index 0000000..1b3ffb1 --- /dev/null +++ b/data/spiffs/mqtt.js @@ -0,0 +1,46 @@ +function changeMqtt(f){f.preventDefault(); +var c="mqtt?1=1"; +var d,b=document.querySelectorAll("#mqtt-form input"); +for(d=0; +d0 +}else{el.value=c[d] +}}}); +$("#mqtt-spinner").setAttribute("hidden",""); +$("#mqtt-status-spinner").setAttribute("hidden",""); +$("#mqtt-form").removeAttribute("hidden"); +$("#mqtt-status-form").removeAttribute("hidden"); +var b,a=$("input"); +for(b=0; +b.pure-menu-children,.pure-menu-active>.pure-menu-children{display:block;position:absolute}.pure-menu-has-children>.pure-menu-link:after{padding-left:.5em;content:"\25B8";font-size:small}.pure-menu-horizontal .pure-menu-has-children>.pure-menu-link:after{content:"\25BE"}.pure-menu-scrollable{overflow-y:scroll;overflow-x:hidden}.pure-menu-scrollable .pure-menu-list{display:block}.pure-menu-horizontal.pure-menu-scrollable .pure-menu-list{display:inline-block}.pure-menu-horizontal.pure-menu-scrollable{white-space:nowrap;overflow-y:hidden;overflow-x:auto;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;padding:.5em 0}.pure-menu-horizontal.pure-menu-scrollable::-webkit-scrollbar{display:none}.pure-menu-separator{background-color:#ccc;height:1px;margin:.3em 0}.pure-menu-horizontal .pure-menu-separator{width:1px;height:1.3em;margin:0 .3em}.pure-menu-heading{text-transform:uppercase;color:#565d64}.pure-menu-link{color:#777}.pure-menu-children{background-color:#fff}.pure-menu-link,.pure-menu-disabled,.pure-menu-heading{padding:.5em 1em}.pure-menu-disabled{opacity:.5}.pure-menu-disabled .pure-menu-link:hover{background-color:transparent}.pure-menu-active>.pure-menu-link,.pure-menu-link:hover,.pure-menu-link:focus{background-color:#eee}.pure-menu-selected .pure-menu-link,.pure-menu-selected .pure-menu-link:visited{color:#000}.pure-table{border-collapse:collapse;border-spacing:0;empty-cells:show;border:1px solid #cbcbcb}.pure-table caption{color:#000;font:italic 85%/1 arial,sans-serif;padding:1em 0;text-align:center}.pure-table td,.pure-table th{border-left:1px solid #cbcbcb;border-width:0 0 0 1px;font-size:inherit;margin:0;overflow:visible;padding:.5em 1em}.pure-table td:first-child,.pure-table th:first-child{border-left-width:0}.pure-table thead{background-color:#e0e0e0;color:#000;text-align:left;vertical-align:bottom}.pure-table td{background-color:transparent}.pure-table-odd td{background-color:#f2f2f2}.pure-table-striped tr:nth-child(2n-1) td{background-color:#f2f2f2}.pure-table-bordered td{border-bottom:1px solid #cbcbcb}.pure-table-bordered tbody>tr:last-child>td{border-bottom-width:0}.pure-table-horizontal td,.pure-table-horizontal th{border-width:0 0 1px 0;border-bottom:1px solid #cbcbcb}.pure-table-horizontal tbody>tr:last-child>td{border-bottom-width:0} \ No newline at end of file diff --git a/data/spiffs/services.html b/data/spiffs/services.html new file mode 100644 index 0000000..ee84f4e --- /dev/null +++ b/data/spiffs/services.html @@ -0,0 +1,8 @@ +esp-link

Services

Syslog

mDNS

SNTP

\ No newline at end of file diff --git a/data/spiffs/services.js b/data/spiffs/services.js new file mode 100644 index 0000000..5786505 --- /dev/null +++ b/data/spiffs/services.js @@ -0,0 +1,47 @@ +function changeServices(f){f.preventDefault(); +var c="services/update?1=1"; +var d,b=document.querySelectorAll("#"+f.target.id+" input,select"); +for(d=0; +d=200&&g.status<300){h(g.responseText) +}else{console.log("XHR ERR :",i,a,"->",g.status,g.responseText,g); +c(g.status,g.responseText) +}}; +try{g.send(f) +}catch(b){console.log("XHR EXC :",i,a,"->",b); +c(599,b) +}}function dispatchJson(f,d,c){var a; +try{a=JSON.parse(f) +}catch(b){console.log("JSON parse error: "+b+". In: "+f); +c(500,"JSON parse error: "+b); +return +}d(a) +}function ajaxJson(d,a,c,b){ajaxReq(d,a,function(f){dispatchJson(f,c,b) +},b) +}function ajaxSpin(d,a,c,b){$("#spinner").removeAttribute("hidden"); +ajaxReq(d,a,function(f){$("#spinner").setAttribute("hidden",""); +c(f) +},function(f,g){$("#spinner").setAttribute("hidden",""); +b(f,g) +}) +}function ajaxJsonSpin(d,a,c,b){ajaxSpin(d,a,function(f){dispatchJson(f,c,b) +},b) +}function hidePopup(a){addClass(a,"popup-hidden"); +addClass(a.parentNode,"popup-target") +}onLoad(function(){var a=$("#layout"); +var d=a.childNodes[0]; +a.insertBefore(m(''),d); +a.insertBefore(m('
'),d); +a.insertBefore(m(''),d); +var c=m(' '); +a.insertBefore(c,d); +var f=$("#menuLink"),c=$("#menu"); +bnd(f,"click",function(h){var g="active"; +h.preventDefault(); +toggleClass(a,g); +toggleClass(c,g); +toggleClass(f,g) +}); +domForEach($(".popup"),function(g){hidePopup(g) +}); +var b=function(){ajaxJson("GET","/menu",function(n){var l="",o=window.location.pathname; +for(var k=0; +k'+n.menu[k]+"") +}$("#menu-list").innerHTML=l; +var g=$("#version"); +if(g!=null){g.innerHTML=n.version +}$("title")[0].innerHTML=n.name; +setEditToClick("system-name",n.name) +},function(){setTimeout(b,1000) +}) +}; +b() +}); +function showWifiInfo(b){Object.keys(b).forEach(function(c){el=$("#wifi-"+c); +if(el!=null){if(el.nodeName==="INPUT"){el.value=b[c] +}else{el.innerHTML=b[c] +}}}); +var a=$("#dhcp-r"+b.dhcp); +if(a){a.click() +}$("#wifi-spinner").setAttribute("hidden",""); +$("#wifi-table").removeAttribute("hidden"); +currAp=b.ssid +}function getWifiInfo(){ajaxJson("GET","/wifi/info",showWifiInfo,function(b,a){window.setTimeout(getWifiInfo,1000) +}) +}function showSystemInfo(a){Object.keys(a).forEach(function(b){setEditToClick("system-"+b,a[b]) +}); +$("#system-spinner").setAttribute("hidden",""); +$("#system-table").removeAttribute("hidden"); +currAp=a.ssid +}function getSystemInfo(){ajaxJson("GET","/system/info",showSystemInfo,function(b,a){window.setTimeout(getSystemInfo,1000) +}) +}function makeAjaxInput(a,b){domForEach($("."+a+"-"+b),function(i){var f=$(".edit-on",i); +var d=$(".edit-off",i)[0]; +var c="/"+a+"/update?"+b; +if(d===undefined||f==undefined){return +}var h=function(){d.setAttribute("hidden",""); +domForEach(f,function(k){k.removeAttribute("hidden") +}); +f[0].select(); +return false +}; +var g=function(k){ajaxSpin("POST",c+"="+k,function(){domForEach(f,function(l){l.setAttribute("hidden","") +}); +d.removeAttribute("hidden"); +setEditToClick(a+"-"+b,k); +showNotification(b+" changed to "+k) +},function(){showWarning(b+" change failed") +}); +return false +}; +bnd(d,"click",function(){return h() +}); +bnd(f[0],"blur",function(){return g(f[0].value) +}); +bnd(f[0],"keyup",function(k){if((k||window.event).keyCode==13){return g(f[0].value) +}}) +}) +}function setEditToClick(a,b){domForEach($("."+a),function(c){if(c.children.length>0){domForEach(c.children,function(d){if(d.nodeName==="INPUT"){d.value=b +}else{if(d.nodeName!=="DIV"){d.innerHTML=b +}}}) +}else{c.innerHTML=b +}}) +}function showWarning(b){var a=$("#warning"); +a.innerHTML=b; +a.removeAttribute("hidden"); +window.scrollTo(0,0) +}function hideWarning(){el=$("#warning").setAttribute("hidden","") +}var notifTimeout=null; +function showNotification(b){var a=$("#notification"); +a.innerHTML=b; +a.removeAttribute("hidden"); +if(notifTimeout!=null){clearTimeout(notifTimeout) +}notifTimout=setTimeout(function(){a.setAttribute("hidden",""); +notifTimout=null +},4000) +}var pinPresets={"esp-01":[0,-1,2,-1,0,1],"esp-12":[12,14,0,2,0,1],"esp-12 swap":[1,3,0,2,1,1],"esp-bridge":[12,13,0,14,0,0],"wifi-link-12":[1,3,0,2,1,0]}; +function createPresets(c){for(var d in pinPresets){var a=m('"); +c.appendChild(a) +}function b(h){var f=pinPresets[h]; +if(f===undefined){return f +}function g(l,i){$("#pin-"+l).value=i +}g("reset",f[0]); +g("isp",f[1]); +g("conn",f[2]); +g("ser",f[3]); +g("swap",f[4]); +$("#pin-rxpup").checked=!!f[5]; +c.value=0 +}bnd(c,"change",function(f){f.preventDefault(); +b(c.value) +}) +}function displayPins(b){function a(f,c){var g=$("#pin-"+f); +addClass(g,"pure-button"); +g.innerHTML=""; +[-1,0,1,2,3,4,5,12,13,14,15].forEach(function(k){var h=document.createElement("option"); +h.value=k; +if(k>=0){h.innerHTML="gpio"+k +}else{h.innerHTML="disabled" +}if(k===1){h.innerHTML+="/TX0" +}if(k===2){h.innerHTML+="/TX1" +}if(k===3){h.innerHTML+="/RX0" +}if(k==c){h.selected=true +}g.appendChild(h) +}); +var d=$(".popup",g.parentNode); +if(d!==undefined){hidePopup(d[0]) +}}a("reset",b.reset); +a("isp",b.isp); +a("conn",b.conn); +a("ser",b.ser); +$("#pin-swap").value=b.swap; +$("#pin-rxpup").checked=!!b.rxpup; +createPresets($("#pin-preset")); +$("#pin-spinner").setAttribute("hidden",""); +$("#pin-table").removeAttribute("hidden") +}function fetchPins(){ajaxJson("GET","/pins",displayPins,function(){window.setTimeout(fetchPins,1000) +}) +}function setPins(c){c.preventDefault(); +var b="/pins"; +var a="?"; +["reset","isp","conn","ser","swap"].forEach(function(d){b+=a+d+"="+$("#pin-"+d).value; +a="&" +}); +b+="&rxpup="+($("#pin-rxpup").checked?"1":"0"); +ajaxSpin("POST",b,function(){showNotification("Pin assignment changed") +},function(d,f){showWarning(f); +window.setTimeout(fetchPins,100) +}) +}; \ No newline at end of file diff --git a/data/spiffs/userpage.js b/data/spiffs/userpage.js new file mode 100644 index 0000000..adcc050 --- /dev/null +++ b/data/spiffs/userpage.js @@ -0,0 +1,115 @@ +var loadCounter=0; +var refreshRate=0; +var refreshTimer; +var hiddenInputs=[]; +function notifyResponse(a){Object.keys(a).forEach(function(m){var c=document.getElementsByName(m); +var n; +for(n=0; +n"+l[h]+"") +}e.innerHTML=k +}if(e.tagName=="TABLE"){var l=a[m]; +var k=""; +if(l.length>0){var b=l[0]; +k=k.concat(""); +for(var h=0; +h"+b[h]+"") +}k=k.concat("") +}for(var h=1; +h"); +for(var f=0; +f"+g[f]+"") +}k=k.concat("") +}e.innerHTML=k +}}}); +if(refreshRate!=0){clearTimeout(refreshTimer); +refreshTimer=setTimeout(function(){ajaxJson("GET",window.location.pathname+".json?reason=refresh",notifyResponse) +},refreshRate) +}}function notifyButtonPressed(a){ajaxJson("POST",window.location.pathname+".json?reason=button&id="+a,notifyResponse) +}function refreshFormData(){setTimeout(function(){ajaxJson("GET",window.location.pathname+".json?reason=refresh",function(a){notifyResponse(a); +if(loadCounter>0){loadCounter--; +refreshFormData() +}}) +},250) +}function recalculateHiddenInputs(){for(var f=0; +fesp-link

Web Server

User defined web pages can be uploaded to esp-link. This is useful if esp-link acts as a web server while MCU provides the measurement data.

The custom web page to upload:
\ No newline at end of file diff --git a/data/spiffs/wifi/icons.png b/data/spiffs/wifi/icons.png new file mode 100644 index 0000000..08c933f Binary files /dev/null and b/data/spiffs/wifi/icons.png differ diff --git a/data/spiffs/wifi/wifiAp.html b/data/spiffs/wifi/wifiAp.html new file mode 100644 index 0000000..7abe962 --- /dev/null +++ b/data/spiffs/wifi/wifiAp.html @@ -0,0 +1,10 @@ +esp-link

WiFi Soft-AP Configuration

Soft-AP State

Soft-AP Settings

\ No newline at end of file diff --git a/data/spiffs/wifi/wifiAp.js b/data/spiffs/wifi/wifiAp.js new file mode 100644 index 0000000..0740996 --- /dev/null +++ b/data/spiffs/wifi/wifiAp.js @@ -0,0 +1,53 @@ +var specials=[]; +specials.ap_ssid="SSID name"; +specials.ap_password="PASSWORD"; +specials.ap_maxconn="Max Connections number"; +specials.ap_beacon="Beacon Interval"; +function changeWifiMode(a){blockScan=1; +hideWarning(); +ajaxSpin("POST","setmode?mode="+a,function(b){showNotification("Mode changed"); +window.setTimeout(getWifiInfo,100); +blockScan=0 +},function(c,b){showWarning("Error changing mode: "+b); +window.setTimeout(getWifiInfo,100); +blockScan=0 +}) +}function changeApSettings(j){j.preventDefault(); +var a="/wifi/apchange?100=1"; +var f,h=document.querySelectorAll("#"+j.target.id+" input,select"); +for(f=0; +fesp-link

WiFi Station Configuration

WiFi State

WiFi Association

To connect to a WiFi network, please select one of the detected networks, enter the password, and hit the connect button...
Scanning...

Special Settings

Special settings, use with care!
\ No newline at end of file diff --git a/data/spiffs/wifi/wifiSta.js b/data/spiffs/wifi/wifiSta.js new file mode 100644 index 0000000..137e1a4 --- /dev/null +++ b/data/spiffs/wifi/wifiSta.js @@ -0,0 +1,134 @@ +var currAp=""; +var blockScan=0; +function createInputForAp(b){if(b.essid==""&&b.rssi==0){return +}var g=e("input"); +g.type="radio"; +g.name="essid"; +g.value=b.essid; +g.id="opt-"+b.essid; +if(currAp==b.essid){g.checked="1" +}var i=e("div"); +var j=-Math.floor(b.rssi/51)*32; +i.className="lock-icon"; +i.style.backgroundPosition="0px "+(j-1)+"px"; +var d=e("div"); +d.innerHTML=""+b.rssi+"dB"; +var c=e("div"); +var h="-65"; +if(b.enc=="0"){h="0" +}if(b.enc=="1"){h="-33" +}c.className="lock-icon"; +c.style.backgroundPosition="-32px "+h+"px"; +var f=e("div"); +f.innerHTML=b.essid; +var a=m('').childNodes[0]; +a.appendChild(g); +a.appendChild(c); +a.appendChild(i); +a.appendChild(d); +a.appendChild(f); +return a +}function getSelectedEssid(){var c=document.forms.wifiform.elements; +for(var b=0; +b60){return scanAPs() +}scanReqCnt+=1; +ajaxJson("GET","scan",function(c){currAp=getSelectedEssid(); +if(c.result.inProgress=="0"&&c.result.APs.length>0){$("#aps").innerHTML=""; +var d=0; +for(var b=0; +b'+c.ip+", else connect to network "+c.ssid+" first." +}else{blockScan=0; +showWarning("Connection failed: "+c.status+", "+c.reason); +$("#aps").innerHTML='Check password and selected AP. Go Back' +}}},function(b,a){window.setTimeout(getStatus,2000) +}) +}function changeWifiMode(a){blockScan=1; +hideWarning(); +ajaxSpin("POST","setmode?mode="+a,function(b){showNotification("Mode changed"); +window.setTimeout(getWifiInfo,100); +blockScan=0; +window.setTimeout(scanAPs,500); +$("#aps").innerHTML='Scanning...
' +},function(c,b){showWarning("Error changing mode: "+b); +window.setTimeout(getWifiInfo,100); +blockScan=0 +}) +}function changeWifiAp(d){d.preventDefault(); +var b=$("#wifi-passwd").value; +var f=getSelectedEssid(); +showNotification("Connecting to "+f); +var c="connect?essid="+encodeURIComponent(f)+"&passwd="+encodeURIComponent(b); +hideWarning(); +$("#reconnect").setAttribute("hidden",""); +$("#wifi-passwd").value=""; +var a=$("#connect-button"); +var g=a.className; +a.className+=" pure-button-disabled"; +blockScan=1; +ajaxSpin("POST",c,function(h){$("#spinner").removeAttribute("hidden"); +showNotification("Waiting for network change..."); +window.scrollTo(0,0); +window.setTimeout(getStatus,2000) +},function(i,h){showWarning("Error switching network: "+h); +a.className=g; +window.setTimeout(scanAPs,1000) +}) +}function changeSpecial(c){c.preventDefault(); +var b="special"; +b+="?dhcp="+document.querySelector('input[name="dhcp"]:checked').value; +b+="&staticip="+encodeURIComponent($("#wifi-staticip").value); +b+="&netmask="+encodeURIComponent($("#wifi-netmask").value); +b+="&gateway="+encodeURIComponent($("#wifi-gateway").value); +hideWarning(); +var a=$("#special-button"); +addClass(a,"pure-button-disabled"); +ajaxSpin("POST",b,function(d){removeClass(a,"pure-button-disabled") +},function(f,d){showWarning("Error: "+d); +removeClass(a,"pure-button-disabled"); +getWifiInfo() +}) +}function doDhcp(){$("#dhcp-on").removeAttribute("hidden"); +$("#dhcp-off").setAttribute("hidden","") +}function doStatic(){$("#dhcp-off").removeAttribute("hidden"); +$("#dhcp-on").setAttribute("hidden","") +}; \ No newline at end of file diff --git a/espfs/mkespfsimage/Makefile b/mkespfsimage/Makefile similarity index 100% rename from espfs/mkespfsimage/Makefile rename to mkespfsimage/Makefile diff --git a/mkespfsimage/heatshrink_encoder.o b/mkespfsimage/heatshrink_encoder.o new file mode 100644 index 0000000..8b68558 Binary files /dev/null and b/mkespfsimage/heatshrink_encoder.o differ diff --git a/espfs/mkespfsimage/main.c b/mkespfsimage/main.c similarity index 100% rename from espfs/mkespfsimage/main.c rename to mkespfsimage/main.c diff --git a/mkespfsimage/main.o b/mkespfsimage/main.o new file mode 100644 index 0000000..4178452 Binary files /dev/null and b/mkespfsimage/main.o differ diff --git a/mkespfsimage/mkespfsimage b/mkespfsimage/mkespfsimage new file mode 100755 index 0000000..e06e46e Binary files /dev/null and b/mkespfsimage/mkespfsimage differ diff --git a/espfs/mkespfsimage/mman-win32/Makefile b/mkespfsimage/mman-win32/Makefile similarity index 100% rename from espfs/mkespfsimage/mman-win32/Makefile rename to mkespfsimage/mman-win32/Makefile diff --git a/espfs/mkespfsimage/mman-win32/config.mak b/mkespfsimage/mman-win32/config.mak similarity index 100% rename from espfs/mkespfsimage/mman-win32/config.mak rename to mkespfsimage/mman-win32/config.mak diff --git a/espfs/mkespfsimage/mman-win32/configure b/mkespfsimage/mman-win32/configure similarity index 100% rename from espfs/mkespfsimage/mman-win32/configure rename to mkespfsimage/mman-win32/configure diff --git a/espfs/mkespfsimage/mman-win32/mman.c b/mkespfsimage/mman-win32/mman.c similarity index 100% rename from espfs/mkespfsimage/mman-win32/mman.c rename to mkespfsimage/mman-win32/mman.c diff --git a/espfs/mkespfsimage/mman-win32/mman.h b/mkespfsimage/mman-win32/mman.h similarity index 100% rename from espfs/mkespfsimage/mman-win32/mman.h rename to mkespfsimage/mman-win32/mman.h diff --git a/espfs/mkespfsimage/mman-win32/test.c b/mkespfsimage/mman-win32/test.c similarity index 100% rename from espfs/mkespfsimage/mman-win32/test.c rename to mkespfsimage/mman-win32/test.c diff --git a/platformio.ini b/platformio.ini new file mode 100644 index 0000000..d4d013d --- /dev/null +++ b/platformio.ini @@ -0,0 +1,24 @@ +[platformio] +env_default = esp12e + +[env:esp12e] +platform = espressif8266 +board = esp12e +framework = esp8266-nonos-sdk +monitor_speed = 115200 +upload_resetmethod = ck +;build_flags = -Wl,-Teagle.flash.1m0.ld +build_flags = + -Isrc/include -I. + -DFIRMWARE_SIZE=503808 + -DMCU_RESET_PIN=12 + -DMCU_ISP_PIN=13 + -DLED_CONN_PIN=0 + -DLED_SERIAL_PIN=14 + -DMQTT -DREST -DSOCKET -DWEBSERVER -DSYSLOG + -DCHANGE_TO_STA=yes + -DESP_HOSTNAME=esp-link-v3 + +upload_speed = 460800 +#upload_speed = 230400 + diff --git a/esp-link/cgi.c b/src/cgi.c similarity index 99% rename from esp-link/cgi.c rename to src/cgi.c index d667be3..846d2dc 100644 --- a/esp-link/cgi.c +++ b/src/cgi.c @@ -16,7 +16,7 @@ Some random cgi routines. #include #include "cgi.h" #include "config.h" -#include "web-server.h" +#include "web-server/web-server.h" #ifdef CGI_DBG #define DBG(format, ...) do { os_printf(format, ## __VA_ARGS__); } while(0) diff --git a/esp-link/cgi.h b/src/cgi.h similarity index 98% rename from esp-link/cgi.h rename to src/cgi.h index 330a5e6..b7051b8 100644 --- a/esp-link/cgi.h +++ b/src/cgi.h @@ -2,7 +2,7 @@ #define CGI_H #include -#include "httpd.h" +#include "httpd/httpd.h" void noCacheHeaders(HttpdConnData *connData, int code); void jsonHeader(HttpdConnData *connData, int code); diff --git a/esp-link/cgiflash.c b/src/cgiflash.c similarity index 100% rename from esp-link/cgiflash.c rename to src/cgiflash.c diff --git a/esp-link/cgiflash.h b/src/cgiflash.h similarity index 91% rename from esp-link/cgiflash.h rename to src/cgiflash.h index f03b8e0..f8e1913 100644 --- a/esp-link/cgiflash.h +++ b/src/cgiflash.h @@ -1,7 +1,7 @@ #ifndef CGIFLASH_H #define CGIFLASH_H -#include "httpd.h" +#include "httpd/httpd.h" int cgiReadFlash(HttpdConnData *connData); int cgiGetFirmwareNext(HttpdConnData *connData); diff --git a/esp-link/cgimega.c b/src/cgimega.c similarity index 99% rename from esp-link/cgimega.c rename to src/cgimega.c index 38fce83..dd634bd 100644 --- a/esp-link/cgimega.c +++ b/src/cgimega.c @@ -33,10 +33,10 @@ #include #include "cgi.h" #include "config.h" -#include "uart.h" +#include "serial/uart.h" #include "stk500v2.h" -#include "serbridge.h" -#include "serled.h" +#include "serial/serbridge.h" +#include "serial/serled.h" #include "pgmshared.h" #define INIT_DELAY 150 // wait this many millisecs before sending anything diff --git a/esp-link/cgimega.h b/src/cgimega.h similarity index 94% rename from esp-link/cgimega.h rename to src/cgimega.h index e30a2d1..117fa0d 100644 --- a/esp-link/cgimega.h +++ b/src/cgimega.h @@ -3,7 +3,7 @@ #ifndef CGIMEGA_H #define CGIMEGA_H -#include +#include int ICACHE_FLASH_ATTR cgiMegaSync(HttpdConnData *connData); int ICACHE_FLASH_ATTR cgiMegaData(HttpdConnData *connData); diff --git a/esp-link/cgimqtt.c b/src/cgimqtt.c similarity index 100% rename from esp-link/cgimqtt.c rename to src/cgimqtt.c diff --git a/esp-link/cgimqtt.h b/src/cgimqtt.h similarity index 85% rename from esp-link/cgimqtt.h rename to src/cgimqtt.h index b3e7809..8da712d 100644 --- a/esp-link/cgimqtt.h +++ b/src/cgimqtt.h @@ -3,7 +3,7 @@ char *mqttState(void); #ifndef CGIMQTT_H #define CGIMQTT_H -#include "httpd.h" +#include "httpd/httpd.h" int cgiMqtt(HttpdConnData *connData); #endif // CGIMQTT_H diff --git a/esp-link/cgioptiboot.c b/src/cgioptiboot.c similarity index 99% rename from esp-link/cgioptiboot.c rename to src/cgioptiboot.c index c3ca1ea..93233bb 100644 --- a/esp-link/cgioptiboot.c +++ b/src/cgioptiboot.c @@ -9,11 +9,11 @@ #include "cgi.h" #include "cgioptiboot.h" #include "config.h" -#include "uart.h" +#include "serial/uart.h" #include "stk500.h" -#include "serbridge.h" -#include "mqtt_cmd.h" -#include "serled.h" +#include "serial/serbridge.h" +#include "mqtt/mqtt_cmd.h" +#include "serial/serled.h" #include "pgmshared.h" diff --git a/esp-link/cgioptiboot.h b/src/cgioptiboot.h similarity index 91% rename from esp-link/cgioptiboot.h rename to src/cgioptiboot.h index bc4d20c..5178440 100644 --- a/esp-link/cgioptiboot.h +++ b/src/cgioptiboot.h @@ -3,7 +3,7 @@ #ifndef OPTIBOOT_H #define OPTIBOOT_H -#include +#include int ICACHE_FLASH_ATTR cgiOptibootSync(HttpdConnData *connData); int ICACHE_FLASH_ATTR cgiOptibootData(HttpdConnData *connData); diff --git a/esp-link/cgipins.c b/src/cgipins.c similarity index 97% rename from esp-link/cgipins.c rename to src/cgipins.c index b763d12..21b7921 100644 --- a/esp-link/cgipins.c +++ b/src/cgipins.c @@ -1,11 +1,11 @@ #include #include "cgi.h" -#include "espfs.h" +#include "espfs/espfs.h" #include "config.h" -#include "serled.h" +#include "serial/serled.h" #include "status.h" -#include "serbridge.h" +#include "serial/serbridge.h" #if 0 static char *map_names[] = { diff --git a/esp-link/cgipins.h b/src/cgipins.h similarity index 83% rename from esp-link/cgipins.h rename to src/cgipins.h index cacd913..2fcadeb 100644 --- a/esp-link/cgipins.h +++ b/src/cgipins.h @@ -1,7 +1,7 @@ #ifndef CGIPINS_H #define CGIPINS_H -#include "httpd.h" +#include "httpd/httpd.h" int cgiPins(HttpdConnData *connData); int8_t pin_reset, pin_isp, pin_conn, pin_ser; diff --git a/esp-link/cgiservices.c b/src/cgiservices.c similarity index 99% rename from esp-link/cgiservices.c rename to src/cgiservices.c index dddb616..c27f9ff 100644 --- a/esp-link/cgiservices.c +++ b/src/cgiservices.c @@ -6,7 +6,7 @@ #include "sntp.h" #include "cgimqtt.h" #ifdef SYSLOG -#include "syslog.h" +#include "syslog/syslog.h" #endif #ifdef CGISERVICES_DBG diff --git a/esp-link/cgiservices.h b/src/cgiservices.h similarity index 93% rename from esp-link/cgiservices.h rename to src/cgiservices.h index 9c44242..9f33503 100644 --- a/esp-link/cgiservices.h +++ b/src/cgiservices.h @@ -1,7 +1,7 @@ #ifndef CGISERVICES_H #define CGISERVICES_H -#include "httpd.h" +#include "httpd/httpd.h" int cgiSystemSet(HttpdConnData *connData); int cgiSystemInfo(HttpdConnData *connData); diff --git a/esp-link/cgitcp.c b/src/cgitcp.c similarity index 100% rename from esp-link/cgitcp.c rename to src/cgitcp.c diff --git a/esp-link/cgitcp.h b/src/cgitcp.h similarity index 76% rename from esp-link/cgitcp.h rename to src/cgitcp.h index 2b7b2a9..c06747d 100644 --- a/esp-link/cgitcp.h +++ b/src/cgitcp.h @@ -1,7 +1,7 @@ #ifndef CGITCP_H #define CGITCP_H -#include "httpd.h" +#include "httpd/httpd.h" int cgiTcp(HttpdConnData *connData); diff --git a/esp-link/cgiwebserversetup.c b/src/cgiwebserversetup.c similarity index 97% rename from esp-link/cgiwebserversetup.c rename to src/cgiwebserversetup.c index 1d1d2e6..9e95375 100644 --- a/esp-link/cgiwebserversetup.c +++ b/src/cgiwebserversetup.c @@ -4,10 +4,10 @@ #include #include "cgi.h" #include "cgioptiboot.h" -#include "multipart.h" -#include "espfsformat.h" +#include "httpd/multipart.h" +#include "espfs/espfsformat.h" #include "config.h" -#include "web-server.h" +#include "web-server/web-server.h" int header_position = 0; // flash offset of the file header int upload_position = 0; // flash offset where to store page upload @@ -107,7 +107,7 @@ int ICACHE_FLASH_ATTR webServerSetupMultipartCallback(MultipartCmd cmd, char *da if( webServerSetupWriteFlash( upload_position, (uint32_t *)(&hdr), sizeof(EspFsHeader) ) ) return 1; upload_position += sizeof(EspFsHeader); - + char nameBuf[len]; os_memset(nameBuf, 0, len); os_memcpy(nameBuf, data, dataLen); @@ -115,7 +115,7 @@ int ICACHE_FLASH_ATTR webServerSetupMultipartCallback(MultipartCmd cmd, char *da if( webServerSetupWriteFlash( upload_position, (uint32_t *)(nameBuf), len ) ) return 1; upload_position += len; - + // add header to HTML files if( ( dataLen > 5 ) && ( os_strcmp(data + dataLen - 5, ".html") == 0 ) ) // if the file ends with .html, wrap into an espfs image { @@ -145,7 +145,7 @@ int ICACHE_FLASH_ATTR webServerSetupMultipartCallback(MultipartCmd cmd, char *da } EspFsHeader hdr; - hdr.magic = ESPFS_MAGIC; + hdr.magic = ESPFS_MAGIC; hdr.fileLenComp = hdr.fileLenDecomp = position + html_header_len; // restore ESPFS magic @@ -160,7 +160,7 @@ int ICACHE_FLASH_ATTR webServerSetupMultipartCallback(MultipartCmd cmd, char *da // write the termination block EspFsHeader hdr; - hdr.magic = ESPFS_MAGIC; + hdr.magic = ESPFS_MAGIC; hdr.flags = 1; hdr.compression = 0; hdr.nameLen = 0; @@ -184,6 +184,6 @@ int ICACHE_FLASH_ATTR cgiWebServerSetupUpload(HttpdConnData *connData) { if( webServerContext == NULL ) webServerContext = multipartCreateContext( webServerSetupMultipartCallback ); - + return multipartProcess(webServerContext, connData); } diff --git a/esp-link/cgiwebserversetup.h b/src/cgiwebserversetup.h similarity index 85% rename from esp-link/cgiwebserversetup.h rename to src/cgiwebserversetup.h index ffecb82..418e5fa 100644 --- a/esp-link/cgiwebserversetup.h +++ b/src/cgiwebserversetup.h @@ -1,7 +1,7 @@ #ifndef CGIWEBSERVER_H #define CGIWEBSERVER_H -#include +#include int ICACHE_FLASH_ATTR cgiWebServerSetupUpload(HttpdConnData *connData); diff --git a/esp-link/cgiwifi.c b/src/cgiwifi.c similarity index 100% rename from esp-link/cgiwifi.c rename to src/cgiwifi.c diff --git a/esp-link/cgiwifi.h b/src/cgiwifi.h similarity index 97% rename from esp-link/cgiwifi.h rename to src/cgiwifi.h index ccae68f..dc264e6 100644 --- a/esp-link/cgiwifi.h +++ b/src/cgiwifi.h @@ -1,7 +1,7 @@ #ifndef CGIWIFI_H #define CGIWIFI_H -#include "httpd.h" +#include "httpd/httpd.h" enum { wifiIsDisconnected, wifiIsConnected, wifiGotIP }; typedef void(*WifiStateChangeCb)(uint8_t wifiStatus); diff --git a/cmd/cmd.c b/src/cmd/cmd.c similarity index 98% rename from cmd/cmd.c rename to src/cmd/cmd.c index 4a8dc64..319ab8e 100644 --- a/cmd/cmd.c +++ b/src/cmd/cmd.c @@ -4,8 +4,8 @@ #include "esp8266.h" #include "cmd.h" -#include "crc16.h" -#include "uart.h" +#include "serial/crc16.h" +#include "serial/uart.h" #ifdef CMD_DBG #define DBG(format, ...) do { os_printf(format, ## __VA_ARGS__); } while(0) diff --git a/cmd/cmd.h b/src/cmd/cmd.h similarity index 100% rename from cmd/cmd.h rename to src/cmd/cmd.h diff --git a/cmd/handlers.c b/src/cmd/handlers.c similarity index 98% rename from cmd/handlers.c rename to src/cmd/handlers.c index 8605f68..a181e3b 100644 --- a/cmd/handlers.c +++ b/src/cmd/handlers.c @@ -5,20 +5,20 @@ #include "esp8266.h" #include "sntp.h" #include "cmd.h" -#include "uart.h" +#include "serial/uart.h" #include #ifdef MQTT -#include +#include #endif #ifdef REST -#include +#include #endif -#include +#include #ifdef SOCKET -#include +#include #endif #include -#include "esp-link/cgi.h" +#include "cgi.h" #include "config.h" diff --git a/esp-link/config.c b/src/config.c similarity index 99% rename from esp-link/config.c rename to src/config.c index 224f047..0437eb7 100644 --- a/esp-link/config.c +++ b/src/config.c @@ -3,8 +3,8 @@ #include #include "config.h" -#include "espfs.h" -#include "crc16.h" +#include "espfs/espfs.h" +#include "serial/crc16.h" FlashConfig flashConfig; FlashConfig flashDefault = { diff --git a/esp-link/config.h b/src/config.h similarity index 100% rename from esp-link/config.h rename to src/config.h diff --git a/espfs/espfs.c b/src/espfs/espfs.c similarity index 100% rename from espfs/espfs.c rename to src/espfs/espfs.c diff --git a/espfs/espfs.h b/src/espfs/espfs.h similarity index 100% rename from espfs/espfs.h rename to src/espfs/espfs.h diff --git a/espfs/espfsformat.h b/src/espfs/espfsformat.h similarity index 100% rename from espfs/espfsformat.h rename to src/espfs/espfsformat.h diff --git a/httpd/auth.c b/src/httpd/auth.c similarity index 100% rename from httpd/auth.c rename to src/httpd/auth.c diff --git a/httpd/auth.h b/src/httpd/auth.h similarity index 100% rename from httpd/auth.h rename to src/httpd/auth.h diff --git a/httpd/base64.c b/src/httpd/base64.c similarity index 100% rename from httpd/base64.c rename to src/httpd/base64.c diff --git a/httpd/base64.h b/src/httpd/base64.h similarity index 100% rename from httpd/base64.h rename to src/httpd/base64.h diff --git a/httpd/httpd.c b/src/httpd/httpd.c similarity index 100% rename from httpd/httpd.c rename to src/httpd/httpd.c diff --git a/httpd/httpd.h b/src/httpd/httpd.h similarity index 100% rename from httpd/httpd.h rename to src/httpd/httpd.h diff --git a/httpd/httpdespfs.c b/src/httpd/httpdespfs.c similarity index 100% rename from httpd/httpdespfs.c rename to src/httpd/httpdespfs.c diff --git a/httpd/httpdespfs.h b/src/httpd/httpdespfs.h similarity index 75% rename from httpd/httpdespfs.h rename to src/httpd/httpdespfs.h index 847a8b6..576bfed 100644 --- a/httpd/httpdespfs.h +++ b/src/httpd/httpdespfs.h @@ -2,10 +2,10 @@ #define HTTPDESPFS_H #include -#include "espfs.h" -#include "espfsformat.h" +#include "espfs/espfs.h" +#include "espfs/espfsformat.h" #include "cgi.h" -#include "httpd.h" +#include "httpd/httpd.h" int cgiEspFsHook(HttpdConnData *connData); //int cgiEspFsTemplate(HttpdConnData *connData); diff --git a/httpd/multipart.c b/src/httpd/multipart.c similarity index 100% rename from httpd/multipart.c rename to src/httpd/multipart.c diff --git a/httpd/multipart.h b/src/httpd/multipart.h similarity index 97% rename from httpd/multipart.h rename to src/httpd/multipart.h index a1205cd..6f664f2 100644 --- a/httpd/multipart.h +++ b/src/httpd/multipart.h @@ -1,7 +1,7 @@ #ifndef MULTIPART_H #define MULTIPART_H -#include +#include typedef enum { FILE_UPLOAD_START, // multipart: uploading files started diff --git a/include/c_types.h b/src/include/c_types.h similarity index 100% rename from include/c_types.h rename to src/include/c_types.h diff --git a/include/esp8266.h b/src/include/esp8266.h similarity index 100% rename from include/esp8266.h rename to src/include/esp8266.h diff --git a/include/espmissingincludes.h b/src/include/espmissingincludes.h similarity index 100% rename from include/espmissingincludes.h rename to src/include/espmissingincludes.h diff --git a/include/uart_hw.h b/src/include/uart_hw.h similarity index 100% rename from include/uart_hw.h rename to src/include/uart_hw.h diff --git a/include/user_config.h b/src/include/user_config.h similarity index 100% rename from include/user_config.h rename to src/include/user_config.h diff --git a/esp-link/log.c b/src/log.c similarity index 99% rename from esp-link/log.c rename to src/log.c index 821641f..ed89260 100644 --- a/esp-link/log.c +++ b/src/log.c @@ -1,7 +1,7 @@ // Copyright 2015 by Thorsten von Eicken, see LICENSE.txt #include -#include "uart.h" +#include "serial/uart.h" #include "cgi.h" #include "config.h" #include "log.h" diff --git a/esp-link/log.h b/src/log.h similarity index 94% rename from esp-link/log.h rename to src/log.h index 3b7e03a..b17b94d 100644 --- a/esp-link/log.h +++ b/src/log.h @@ -1,7 +1,7 @@ #ifndef LOG_H #define LOG_H -#include "httpd.h" +#include "httpd/httpd.h" #define LOG_MODE_AUTO 0 // start by logging to uart0, turn aff after we get an IP #define LOG_MODE_OFF 1 // always off diff --git a/esp-link/main.c b/src/main.c similarity index 96% rename from esp-link/main.c rename to src/main.c index d2a316e..3eb0180 100644 --- a/esp-link/main.c +++ b/src/main.c @@ -10,8 +10,8 @@ */ #include -#include "httpd.h" -#include "httpdespfs.h" +#include "httpd/httpd.h" +#include "httpd/httpdespfs.h" #include "cgi.h" #include "cgiwifi.h" #include "cgipins.h" @@ -21,24 +21,24 @@ #include "cgioptiboot.h" #include "cgimega.h" #include "cgiwebserversetup.h" -#include "auth.h" -#include "espfs.h" -#include "uart.h" -#include "serbridge.h" +#include "httpd/auth.h" +#include "espfs/espfs.h" +#include "serial/uart.h" +#include "serial/serbridge.h" #include "status.h" -#include "serled.h" -#include "console.h" +#include "serial/serled.h" +#include "serial/console.h" #include "config.h" #include "log.h" #include "gpio.h" #include "cgiservices.h" #ifdef WEBSERVER -#include "web-server.h" +#include "web-server/web-server.h" #endif #ifdef SYSLOG -#include "syslog.h" +#include "syslog/syslog.h" #define NOTICE(format, ...) do { \ LOG_NOTICE(format, ## __VA_ARGS__ ); \ os_printf(format "\n", ## __VA_ARGS__); \ @@ -131,7 +131,9 @@ static void ICACHE_FLASH_ATTR prHeapTimerCb(void *arg) { char* esp_link_version = VERS_STR(VERSION); // address of espfs binary blob +#if PIO_HACK extern uint32_t _binary_espfs_img_start; +#endif extern void app_init(void); extern void mqtt_client_init(void); @@ -184,8 +186,10 @@ user_init(void) { serledInit(); // Wifi wifiInit(); +#if PIO_HACK // init the flash filesystem with the html stuff espFsInit(espLinkCtx, &_binary_espfs_img_start, ESPFS_MEMORY); +#endif //EspFsInitResult res = espFsInit(&_binary_espfs_img_start); //os_printf("espFsInit %s\n", res?"ERR":"ok"); diff --git a/mqtt/mqtt.c b/src/mqtt/mqtt.c similarity index 100% rename from mqtt/mqtt.c rename to src/mqtt/mqtt.c diff --git a/mqtt/mqtt.h b/src/mqtt/mqtt.h similarity index 100% rename from mqtt/mqtt.h rename to src/mqtt/mqtt.h diff --git a/mqtt/mqtt_cmd.c b/src/mqtt/mqtt_cmd.c similarity index 99% rename from mqtt/mqtt_cmd.c rename to src/mqtt/mqtt_cmd.c index b6bb909..8450f29 100644 --- a/mqtt/mqtt_cmd.c +++ b/src/mqtt/mqtt_cmd.c @@ -3,9 +3,9 @@ // #include -#include "mqtt.h" +#include "mqtt/mqtt.h" #include "mqtt_client.h" -#include "mqtt_cmd.h" +#include "mqtt/mqtt_cmd.h" #ifdef MQTTCMD_DBG #define DBG(format, ...) do { os_printf(format, ## __VA_ARGS__); } while(0) diff --git a/mqtt/mqtt_cmd.h b/src/mqtt/mqtt_cmd.h similarity index 95% rename from mqtt/mqtt_cmd.h rename to src/mqtt/mqtt_cmd.h index e7121c7..239f583 100644 --- a/mqtt/mqtt_cmd.h +++ b/src/mqtt/mqtt_cmd.h @@ -1,7 +1,7 @@ #ifndef MODULES_MQTT_CMD_H_ #define MODULES_MQTT_CMD_H_ -#include "cmd.h" +#include "cmd/cmd.h" typedef struct { uint32_t connectedCb; diff --git a/mqtt/mqtt_msg.c b/src/mqtt/mqtt_msg.c similarity index 100% rename from mqtt/mqtt_msg.c rename to src/mqtt/mqtt_msg.c diff --git a/mqtt/mqtt_msg.h b/src/mqtt/mqtt_msg.h similarity index 100% rename from mqtt/mqtt_msg.h rename to src/mqtt/mqtt_msg.h diff --git a/mqtt/pktbuf.c b/src/mqtt/pktbuf.c similarity index 100% rename from mqtt/pktbuf.c rename to src/mqtt/pktbuf.c diff --git a/mqtt/pktbuf.h b/src/mqtt/pktbuf.h similarity index 100% rename from mqtt/pktbuf.h rename to src/mqtt/pktbuf.h diff --git a/esp-link/mqtt_client.c b/src/mqtt_client.c similarity index 99% rename from esp-link/mqtt_client.c rename to src/mqtt_client.c index 61fec1e..0b2aa80 100644 --- a/esp-link/mqtt_client.c +++ b/src/mqtt_client.c @@ -2,7 +2,7 @@ #include #include "cgiwifi.h" #include "config.h" -#include "mqtt.h" +#include "mqtt/mqtt.h" #ifdef MQTTCLIENT_DBG diff --git a/esp-link/mqtt_client.h b/src/mqtt_client.h similarity index 94% rename from esp-link/mqtt_client.h rename to src/mqtt_client.h index 75fc8dc..34f1cf8 100644 --- a/esp-link/mqtt_client.h +++ b/src/mqtt_client.h @@ -1,7 +1,7 @@ #ifdef MQTT #ifndef MQTT_CLIENT_H #define MQTT_CLIENT_H -#include "mqtt.h" +#include "mqtt/mqtt.h" extern MQTT_Client mqttClient; extern char* statusTopicStr; diff --git a/esp-link/pgmshared.c b/src/pgmshared.c similarity index 98% rename from esp-link/pgmshared.c rename to src/pgmshared.c index 44e157a..f51173e 100644 --- a/esp-link/pgmshared.c +++ b/src/pgmshared.c @@ -5,10 +5,10 @@ #include #include "cgi.h" #include "config.h" -#include "uart.h" +#include "serial/uart.h" #include "stk500v2.h" -#include "serbridge.h" -#include "serled.h" +#include "serial/serbridge.h" +#include "serial/serled.h" #include "pgmshared.h" diff --git a/esp-link/pgmshared.h b/src/pgmshared.h similarity index 100% rename from esp-link/pgmshared.h rename to src/pgmshared.h diff --git a/rest/rest.c b/src/rest/rest.c similarity index 99% rename from rest/rest.c rename to src/rest/rest.c index 2100109..a728bd2 100644 --- a/rest/rest.c +++ b/src/rest/rest.c @@ -6,7 +6,7 @@ #include "c_types.h" #include "ip_addr.h" #include "rest.h" -#include "cmd.h" +#include "cmd/cmd.h" #ifdef REST_DBG #define DBG_REST(format, ...) os_printf(format, ## __VA_ARGS__) diff --git a/rest/rest.h b/src/rest/rest.h similarity index 92% rename from rest/rest.h rename to src/rest/rest.h index 281a9f4..09261cc 100644 --- a/rest/rest.h +++ b/src/rest/rest.h @@ -8,7 +8,7 @@ #ifndef MODULES_API_H_ #define MODULES_API_H_ -#include "cmd.h" +#include "cmd/cmd.h" void REST_Setup(CmdPacket *cmd); void REST_Request(CmdPacket *cmd); diff --git a/serial/console.c b/src/serial/console.c similarity index 100% rename from serial/console.c rename to src/serial/console.c diff --git a/serial/console.h b/src/serial/console.h similarity index 94% rename from serial/console.h rename to src/serial/console.h index 3020903..db04f42 100644 --- a/serial/console.h +++ b/src/serial/console.h @@ -1,7 +1,7 @@ #ifndef CONSOLE_H #define CONSOLE_H -#include "httpd.h" +#include "httpd/httpd.h" void consoleInit(void); void ICACHE_FLASH_ATTR console_write_char(char c); diff --git a/serial/crc16.c b/src/serial/crc16.c similarity index 100% rename from serial/crc16.c rename to src/serial/crc16.c diff --git a/serial/crc16.h b/src/serial/crc16.h similarity index 100% rename from serial/crc16.h rename to src/serial/crc16.h diff --git a/serial/serbridge.c b/src/serial/serbridge.c similarity index 99% rename from serial/serbridge.c rename to src/serial/serbridge.c index 7ba8e8e..7f738e5 100644 --- a/serial/serbridge.c +++ b/src/serial/serbridge.c @@ -10,7 +10,7 @@ #include "console.h" #include "slip.h" #ifdef SYSLOG -#include "syslog.h" +#include "syslog/syslog.h" #else #define syslog(X1...) #endif diff --git a/serial/serbridge.h b/src/serial/serbridge.h similarity index 100% rename from serial/serbridge.h rename to src/serial/serbridge.h diff --git a/serial/serled.c b/src/serial/serled.c similarity index 98% rename from serial/serled.c rename to src/serial/serled.c index 5bd66a2..cca5262 100644 --- a/serial/serled.c +++ b/src/serial/serled.c @@ -2,7 +2,7 @@ #include #include -#include +#include "serled.h" static ETSTimer serledTimer; diff --git a/serial/serled.h b/src/serial/serled.h similarity index 100% rename from serial/serled.h rename to src/serial/serled.h diff --git a/serial/slip.c b/src/serial/slip.c similarity index 99% rename from serial/slip.c rename to src/serial/slip.c index 2f15186..d3dac10 100644 --- a/serial/slip.c +++ b/src/serial/slip.c @@ -5,7 +5,7 @@ #include "crc16.h" #include "serbridge.h" #include "console.h" -#include "cmd.h" +#include "cmd/cmd.h" #ifdef SLIP_DBG #define DBG(format, ...) do { os_printf(format, ## __VA_ARGS__); } while(0) diff --git a/serial/slip.h b/src/serial/slip.h similarity index 100% rename from serial/slip.h rename to src/serial/slip.h diff --git a/serial/uart.c b/src/serial/uart.c similarity index 100% rename from serial/uart.c rename to src/serial/uart.c diff --git a/serial/uart.h b/src/serial/uart.h similarity index 100% rename from serial/uart.h rename to src/serial/uart.h diff --git a/socket/socket.c b/src/socket/socket.c similarity index 100% rename from socket/socket.c rename to src/socket/socket.c diff --git a/socket/socket.h b/src/socket/socket.h similarity index 97% rename from socket/socket.h rename to src/socket/socket.h index 258109b..c37ad36 100644 --- a/socket/socket.h +++ b/src/socket/socket.h @@ -8,7 +8,7 @@ #ifndef MODULES_SOCKET_H_ #define MODULES_SOCKET_H_ -#include "cmd.h" +#include "cmd/cmd.h" void SOCKET_Setup(CmdPacket *cmd); void SOCKET_Send(CmdPacket *cmd); diff --git a/esp-link/status.c b/src/status.c similarity index 98% rename from esp-link/status.c rename to src/status.c index 6905850..7d1cbe8 100644 --- a/esp-link/status.c +++ b/src/status.c @@ -2,11 +2,11 @@ #include #include "config.h" -#include "serled.h" +#include "serial/serled.h" #include "cgiwifi.h" #ifdef MQTT -#include "mqtt.h" +#include "mqtt/mqtt.h" #include "mqtt_client.h" extern MQTT_Client mqttClient; diff --git a/esp-link/status.h b/src/status.h similarity index 100% rename from esp-link/status.h rename to src/status.h diff --git a/esp-link/stk500.h b/src/stk500.h similarity index 100% rename from esp-link/stk500.h rename to src/stk500.h diff --git a/esp-link/stk500v2.h b/src/stk500v2.h similarity index 100% rename from esp-link/stk500v2.h rename to src/stk500v2.h diff --git a/syslog/syslog.c b/src/syslog/syslog.c similarity index 100% rename from syslog/syslog.c rename to src/syslog/syslog.c diff --git a/syslog/syslog.h b/src/syslog/syslog.h similarity index 100% rename from syslog/syslog.h rename to src/syslog/syslog.h diff --git a/syslog/syslog.md b/src/syslog/syslog.md similarity index 100% rename from syslog/syslog.md rename to src/syslog/syslog.md diff --git a/esp-link/task.c b/src/task.c similarity index 100% rename from esp-link/task.c rename to src/task.c diff --git a/esp-link/task.h b/src/task.h similarity index 100% rename from esp-link/task.h rename to src/task.h diff --git a/user/user_main.c b/src/user/user_main.c similarity index 100% rename from user/user_main.c rename to src/user/user_main.c diff --git a/web-server/web-server.c b/src/web-server/web-server.c similarity index 97% rename from web-server/web-server.c rename to src/web-server/web-server.c index fd41486..e129fc8 100644 --- a/web-server/web-server.c +++ b/src/web-server/web-server.c @@ -2,11 +2,11 @@ #include -#include "espfs.h" +#include "espfs/espfs.h" #include "config.h" #include "cgi.h" -#include "cmd.h" -#include "serbridge.h" +#include "cmd/cmd.h" +#include "serial/serbridge.h" // the file is responsible for handling user defined web-pages // - collects HTML files from user image, shows them on the left frame @@ -34,7 +34,7 @@ static char* web_server_reasons[] = { // this variable contains the names of the user defined pages // this information appears at the left frame below of the built in URL-s -// format: ,"UserPage1", "/UserPage1.html", "UserPage2", "/UserPage2.html", +// format: ,"UserPage1", "/UserPage1.html", "UserPage2", "/UserPage2.html", char * webServerPages = NULL; char * ICACHE_FLASH_ATTR WEB_UserPages() @@ -47,7 +47,7 @@ void ICACHE_FLASH_ATTR WEB_BrowseFiles() { char buffer[1024]; buffer[0] = 0; - + if( espFsIsValid( userPageCtx ) ) { EspFsIterator it; @@ -61,23 +61,23 @@ void ICACHE_FLASH_ATTR WEB_BrowseFiles() if( os_strcmp( it.name + nameLen-5, ".html" ) == 0 ) { int slashPos = nameLen - 5; - + // chop path and .html from the name while( slashPos > 0 && it.name[slashPos-1] != '/' ) slashPos--; - + // here we check buffer overrun int maxLen = 10 + os_strlen( it.name ) + (nameLen - slashPos -5); if( maxLen >= sizeof(buffer) ) break; - + os_strcat(buffer, ", \""); - + int writePos = os_strlen(buffer); for( int i=slashPos; i < nameLen-5; i++ ) buffer[writePos++] = it.name[i]; buffer[writePos] = 0; // terminating zero - + os_strcat(buffer, "\", \"/"); os_strcat(buffer, it.name); os_strcat(buffer, "\""); @@ -85,10 +85,10 @@ void ICACHE_FLASH_ATTR WEB_BrowseFiles() } } } - + if( webServerPages != NULL ) os_free( webServerPages ); - + int len = os_strlen(buffer) + 1; webServerPages = (char *)os_malloc( len ); os_memcpy( webServerPages, buffer, len ); @@ -117,15 +117,15 @@ static int ICACHE_FLASH_ATTR WEB_addArg(struct ArgumentBuffer * argBuffer, char { if( argBuffer->argBufferPtr + argLen + sizeof(int) >= MAX_ARGUMENT_BUFFER_SIZE ) return -1; // buffer overflow - + os_memcpy(argBuffer->argBuffer + argBuffer->argBufferPtr, &argLen, sizeof(int)); - + if( argLen != 0 ) { os_memcpy( argBuffer->argBuffer + argBuffer->argBufferPtr + sizeof(int), arg, argLen ); argBuffer->numberOfArgs++; } - + argBuffer->argBufferPtr += argLen + sizeof(int); return 0; } @@ -139,18 +139,18 @@ static void ICACHE_FLASH_ATTR WEB_sendArgBuffer(struct ArgumentBuffer * argBuffe cmdResponseBody(&connData->conn->proto.tcp->remote_ip, 4); // 2nd argument: IP cmdResponseBody(&connData->conn->proto.tcp->remote_port, sizeof(uint16_t)); // 3rd argument: port cmdResponseBody(connData->url, os_strlen(connData->url)); // 4th argument: URL - + int p = 0; for( int j=0; j < argBuffer->numberOfArgs; j++ ) { int argLen; os_memcpy( &argLen, argBuffer->argBuffer + p, sizeof(int) ); - + char * arg = argBuffer->argBuffer + p + sizeof(int); cmdResponseBody(arg, argLen); p += argLen + sizeof(int); } - + cmdResponseEnd(); } @@ -163,7 +163,7 @@ static int ICACHE_FLASH_ATTR WEB_handleJSONRequest(HttpdConnData *connData) errorResponse(connData, 400, "Slip processing is disabled!"); return HTTPD_CGI_DONE; } - + if( web_server_cb == 0 ) { errorResponse(connData, 500, "No MCU callback is registered!"); @@ -174,7 +174,7 @@ static int ICACHE_FLASH_ATTR WEB_handleJSONRequest(HttpdConnData *connData) errorResponse(connData, 500, "Slip disabled at uploading program onto the MCU!"); return HTTPD_CGI_DONE; } - + char reasonBuf[16]; int i; int len = httpdFindArg(connData->getArgs, "reason", reasonBuf, sizeof(reasonBuf)); @@ -183,29 +183,29 @@ static int ICACHE_FLASH_ATTR WEB_handleJSONRequest(HttpdConnData *connData) errorResponse(connData, 400, "No reason specified!"); return HTTPD_CGI_DONE; } - + RequestReason reason = INVALID; for(i=0; i < sizeof(web_server_reasons)/sizeof(char *); i++) { if( os_strcmp( web_server_reasons[i], reasonBuf ) == 0 ) reason = (RequestReason)i; } - + if( reason == INVALID ) { errorResponse(connData, 400, "Invalid reason!"); return HTTPD_CGI_DONE; } - + struct ArgumentBuffer argBuffer; WEB_argInit( &argBuffer ); - + switch(reason) { case BUTTON: { char id_buf[40]; - + int id_len = httpdFindArg(connData->getArgs, "id", id_buf, sizeof(id_buf)); if( id_len <= 0 ) { @@ -226,15 +226,15 @@ static int ICACHE_FLASH_ATTR WEB_handleJSONRequest(HttpdConnData *connData) errorResponse(connData, 400, "Post too large!"); return HTTPD_CGI_DONE; } - + int bptr = 0; int sent_args = 0; int max_buf_size = MAX_ARGUMENT_BUFFER_SIZE - HEADER_SIZE - os_strlen(connData->url); - + while( bptr < connData->post->len ) { char * line = connData->post->buff + bptr; - + char * eo = os_strchr(line, '&' ); if( eo != NULL ) { @@ -246,12 +246,12 @@ static int ICACHE_FLASH_ATTR WEB_handleJSONRequest(HttpdConnData *connData) eo = line + os_strlen( line ); bptr = connData->post->len; } - + int len = os_strlen(line); while( len >= 1 && ( line[len-1] == '\r' || line[len-1] == '\n' )) len--; line[len] = 0; - + char * val = os_strchr(line, '='); if( val != NULL ) { @@ -260,10 +260,10 @@ static int ICACHE_FLASH_ATTR WEB_handleJSONRequest(HttpdConnData *connData) int vblen = os_strlen(val+1) * 2; char value[vblen]; httpdUrlDecode(val+1, strlen(val+1), value, vblen); - + int namLen = os_strlen(name); int valLen = os_strlen(value); - + char arg[namLen + valLen + 3]; int argPtr = 0; arg[argPtr++] = (char)WEB_STRING; @@ -272,7 +272,7 @@ static int ICACHE_FLASH_ATTR WEB_handleJSONRequest(HttpdConnData *connData) arg[argPtr++] = 0; os_strcpy( arg + argPtr, value ); argPtr += valLen; - + if( sent_args != 0 ) { if( argBuffer.argBufferPtr + argPtr >= max_buf_size ) @@ -283,7 +283,7 @@ static int ICACHE_FLASH_ATTR WEB_handleJSONRequest(HttpdConnData *connData) sent_args = 0; } } - + if( WEB_addArg(&argBuffer, arg, argPtr) ) { errorResponse(connData, 400, "Post too large!"); @@ -299,24 +299,24 @@ static int ICACHE_FLASH_ATTR WEB_handleJSONRequest(HttpdConnData *connData) default: break; } - + if( WEB_addArg(&argBuffer, NULL, 0) ) { errorResponse(connData, 400, "Post too large!"); return HTTPD_CGI_DONE; } - + os_printf("Web callback to MCU: %s\n", reasonBuf); - + WEB_sendArgBuffer(&argBuffer, connData, reason ); - + if( reason == SUBMIT ) { httpdStartResponse(connData, 204); httpdEndHeaders(connData); return HTTPD_CGI_DONE; } - + return HTTPD_CGI_MORE; } @@ -325,42 +325,42 @@ static int ICACHE_FLASH_ATTR WEB_handleMCUResponse(HttpdConnData *connData, CmdR { char jsonBuf[1500]; int jsonPtr = 0; - - + + jsonBuf[jsonPtr++] = '{'; - + int c = 2; while( c++ < cmdGetArgc(response) ) { int len = cmdArgLen(response); char buf[len+1]; buf[len] = 0; - + cmdPopArg(response, buf, len); - + if(len == 0) break; // last argument - + if( c > 3 ) // skip the first argument jsonBuf[jsonPtr++] = ','; - + if( jsonPtr + 20 + len > sizeof(jsonBuf) ) { errorResponse(connData, 500, "Response too large!"); return HTTPD_CGI_DONE; } - + WebValueType type = (WebValueType)buf[0]; - + int nameLen = os_strlen(buf+1); jsonBuf[jsonPtr++] = '"'; os_memcpy(jsonBuf + jsonPtr, buf + 1, nameLen); jsonPtr += nameLen; jsonBuf[jsonPtr++] = '"'; jsonBuf[jsonPtr++] = ':'; - + char * value = buf + 2 + nameLen; - + switch(type) { case WEB_NULL: @@ -371,7 +371,7 @@ static int ICACHE_FLASH_ATTR WEB_handleMCUResponse(HttpdConnData *connData, CmdR { int v; os_memcpy( &v, value, 4); - + char intbuf[20]; os_sprintf(intbuf, "%d", v); os_strcpy(jsonBuf + jsonPtr, intbuf); @@ -391,13 +391,13 @@ static int ICACHE_FLASH_ATTR WEB_handleMCUResponse(HttpdConnData *connData, CmdR { float f; os_memcpy( &f, value, 4); - + // os_sprintf doesn't support %f int intPart = f; int fracPart = (f - intPart) * 1000; // use 3 digit precision if( fracPart < 0 ) // for negative numbers fracPart = -fracPart; - + char floatBuf[20]; os_sprintf(floatBuf, "%d.%03d", intPart, fracPart); os_strcpy(jsonBuf + jsonPtr, floatBuf); @@ -420,17 +420,17 @@ static int ICACHE_FLASH_ATTR WEB_handleMCUResponse(HttpdConnData *connData, CmdR break; } } - + jsonBuf[jsonPtr++] = '}'; - + noCacheHeaders(connData, 200); httpdHeader(connData, "Content-Type", "application/json"); - + char cl[16]; os_sprintf(cl, "%d", jsonPtr); httpdHeader(connData, "Content-Length", cl); httpdEndHeaders(connData); - + httpdSend(connData, jsonBuf, jsonPtr); return HTTPD_CGI_DONE; } @@ -439,18 +439,18 @@ static int ICACHE_FLASH_ATTR WEB_handleMCUResponse(HttpdConnData *connData, CmdR int ICACHE_FLASH_ATTR WEB_CgiJsonHook(HttpdConnData *connData) { if (connData->conn==NULL) return HTTPD_CGI_DONE; // Connection aborted. Clean up. - + void * cgiData = connData->cgiData; - + if( cgiData == NULL ) { connData->cgiData = (void *)1; // indicate, that request was processed return WEB_handleJSONRequest(connData); } - + if( connData->cgiResponse != NULL ) // data from MCU return WEB_handleMCUResponse(connData, (CmdRequest *)(connData->cgiResponse)); - + return HTTPD_CGI_MORE; } @@ -459,11 +459,11 @@ void ICACHE_FLASH_ATTR WEB_Setup(CmdPacket *cmd) { CmdRequest req; cmdRequest(&req, cmd); - + if (cmdGetArgc(&req) < 1) return; - + cmdPopArg(&req, &web_server_cb, 4); // pop the callback - + os_printf("Web-server connected, cb=0x%x\n", web_server_cb); } @@ -472,15 +472,15 @@ void ICACHE_FLASH_ATTR WEB_Data(CmdPacket *cmd) { CmdRequest req; cmdRequest(&req, cmd); - + if (cmdGetArgc(&req) < 2) return; - + uint8_t ip[4]; cmdPopArg(&req, ip, 4); // pop the IP address - + uint16_t port; cmdPopArg(&req, &port, 2); // pop the HTTP port - + HttpdConnData * conn = httpdLookUpConn(ip, port); // look up connection based on IP/port if( conn != NULL && conn->cgi == WEB_CgiJsonHook ) // make sure that the right CGI handler is configured httpdSetCGIResponse( conn, &req ); diff --git a/web-server/web-server.h b/src/web-server/web-server.h similarity index 94% rename from web-server/web-server.h rename to src/web-server/web-server.h index c6609a6..b22b181 100644 --- a/web-server/web-server.h +++ b/src/web-server/web-server.h @@ -3,8 +3,8 @@ #include -#include "httpd.h" -#include "cmd.h" +#include "httpd/httpd.h" +#include "cmd/cmd.h" typedef enum {