diff --git a/Robot_Lua/index_robot.html b/Robot_Lua/index_robot.html
new file mode 100755
index 0000000..8acb3c6
--- /dev/null
+++ b/Robot_Lua/index_robot.html
@@ -0,0 +1,50 @@
+
+
+
+
+ \n"
+
+
+
+
+ ESP8266 home page
+
+
+
+
+ ESP8266 server
+ ___________________
+ Employee Information:
+
+
___________________
+
+
+
diff --git a/zyx-framework/tests/FKT6N22IJEMN0VK/bob.htm b/WEB/web_html_multi/bob.htm
similarity index 100%
rename from zyx-framework/tests/FKT6N22IJEMN0VK/bob.htm
rename to WEB/web_html_multi/bob.htm
diff --git a/zyx-framework/tests/FKT6N22IJEMN0VK/index.htm b/WEB/web_html_multi/index.htm
similarity index 100%
rename from zyx-framework/tests/FKT6N22IJEMN0VK/index.htm
rename to WEB/web_html_multi/index.htm
diff --git a/zyx-framework/tests/FKT6N22IJEMN0VK/newserver.lua b/WEB/web_html_multi/newserver.lua
similarity index 100%
rename from zyx-framework/tests/FKT6N22IJEMN0VK/newserver.lua
rename to WEB/web_html_multi/newserver.lua
diff --git a/zyx-framework/index.html b/zyx-framework/index.html
new file mode 100644
index 0000000..4a02c7c
--- /dev/null
+++ b/zyx-framework/index.html
@@ -0,0 +1,22 @@
+
+
+
+
+
+ ESP8266 home page
+
+
+
+ ESP8266 home page 190126.1757
+
___________________
+ Différentes pages HTML:
+
+
___________________
+
+
+
+
diff --git a/zyx-framework/page1.html b/zyx-framework/page1.html
new file mode 100644
index 0000000..8f0d66e
--- /dev/null
+++ b/zyx-framework/page1.html
@@ -0,0 +1,17 @@
+
+
+
+
+
+ ESP8266 page 1
+
+
+
+ ESP8266 page 1 190126.1757
+
+ Coucou c'est la page 1 !
+ Retour à la home page...
+
+
+
+
diff --git a/zyx-framework/page2.html b/zyx-framework/page2.html
new file mode 100644
index 0000000..1cc6d6e
--- /dev/null
+++ b/zyx-framework/page2.html
@@ -0,0 +1,17 @@
+
+
+
+
+
+ ESP8266 page 2
+
+
+
+ ESP8266 page 2 190126.1757
+
+ Coucou c'est la page 2 !
+ Retour à la home page...
+
+
+
+
diff --git a/zyx-framework/test1.html b/zyx-framework/test1.html
deleted file mode 100644
index f3d1e37..0000000
--- a/zyx-framework/test1.html
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-Mesures de température 190123.2000
-
-<%
-for i=1,5 do
- zoutput("la valeur est "..i.."
")
-end
-%>
-
-
-
diff --git a/zyx-framework/tests/server.lua b/zyx-framework/tests/server.lua
deleted file mode 100644
index 5ea35d4..0000000
--- a/zyx-framework/tests/server.lua
+++ /dev/null
@@ -1,9 +0,0 @@
-srv=net.createServer(net.TCP)
-srv:listen(80,function(conn)
- conn:on("receive",function(conn,payload)
- print(payload)
- conn:send(" ESP8266
Server is working!
")
- conn:close()
- end)
-end)
-
diff --git a/zyx-framework/web_srv.lua b/zyx-framework/web_srv.lua
deleted file mode 100644
index 16ad45e..0000000
--- a/zyx-framework/web_srv.lua
+++ /dev/null
@@ -1,38 +0,0 @@
--- petit script de serveur WEB Wifi
-
-print("\n web_srv.lua zf190119.1932 \n")
-
---dofile("web_get.lua")
-dofile("web_html.lua")
-
-srv = net.createServer(net.TCP)
-srv:listen(80, function(conn)
- conn:on("receive", function(client, request)
- _, _, method, path, vars = string.find(request, "([A-Z]+) (.+)?(.+) HTTP")
-
- --print("\n\nweb_srv")
- --print("method: ",method)
- --print("path: ",path)
- --print("request: ",request)
- --print("vars: ",vars)
-
- if not string.find(request, "/favicon.ico") then
- --print("coucou")
- if (method == nil) then
- _, _, method, path = string.find(request, "([A-Z]+) (.+) HTTP")
- end
- _GET = {}
- if (vars ~= nil) then
- for k, v in string.gmatch(vars, "(%w+)=(%w+)&*") do
- _GET[k] = v
- print(k..": "..v)
- end
- end
--- web_get()
- html_home()
- client:send(buf)
- buf=nil
- end
- end)
- conn:on("sent", function(c) c:close() end)
-end)
diff --git a/zyx-framework/web_srv2.lua b/zyx-framework/web_srv2.lua
index d17a880..cb9ff54 100644
--- a/zyx-framework/web_srv2.lua
+++ b/zyx-framework/web_srv2.lua
@@ -1,9 +1,19 @@
--- petit script de serveur WEB Wifi
+-- petit script de serveur WEB avec Active Server Page Zyx
-print("\n web_srv.lua zf181018.1610 \n")
+print("\n web_srv2.lua zf190126.1658 \n")
---dofile("web_get.lua")
---dofile("web_html.lua")
+-- send a file from memory to the client; max. line length = 1024 bytes!
+function send_file(client, filename)
+ if file.open(filename, "r") then
+ repeat
+ local line=file.read('\n')
+ if line then
+ client:send(line)
+ end
+ until not line
+ file.close()
+ end
+end
srv = net.createServer(net.TCP)
srv:listen(80, function(conn)
@@ -30,12 +40,14 @@ srv:listen(80, function(conn)
end
file_html=string.gsub(path, "/", "")
print("file_html: ",file_html)
+
+ send_file(conn, file_html)
- conn:send(" ESP8266
Server is working!
\n\n")
+-- conn:send(" ESP8266
Server is working!
\n\n")
end
end)
conn:on("sent", function(c) c:close() end)
end)
-
\ No newline at end of file
+