Difference between revisions of "ESP-2"

From Hackerspace ACKspace
Jump to: navigation, search
Line 8: Line 8:
 
<br>  
 
<br>  
  
Behold, the egg salad run prog run (ESRPR):
+
Behold, the egg salad run prog run (ESRPR):  
  
[[Image:Runprogrun.JPG]]
+
[[Image:Runprogrun.JPG]]  
  
More info to follow soon..
+
More info to follow soon..  
  
 
== loading scripts from a webserver  ==
 
== loading scripts from a webserver  ==
  
I ( ~~ ) got tired from typing the scripts line for line into the lua console of the nodeMCU firmware. I wrote a little function to load the scripts from a webserver running on my laptop. This way I can just save the script on my laptop and load it to my ESP8266 calling 2 functions ( netload() and dofile("netloaded.lua") )
+
I ([[User:Da Syntax|Da Syntax]]) got tired from typing the scripts line for line into the lua console of the nodeMCU firmware. I wrote a little function to load the scripts from a webserver running on my laptop. This way I can just save the script on my laptop and load it to my ESP8266 calling 2 functions ( netload() and dofile("netloaded.lua") )  
 
 
 
<div>
 
<div>
function netload()
+
function netload() conn=net.createConnection(net.TCP, 0) conn:on("receive", function(conn, payload) print(payload) file.open("netloaded.lua", "w") file.write(payload) file.close() end) conn:connect(8080,"192.168.1.193") conn:send("GET /test.lua HTTP/1.1\r\nHost: www.example.com\r\n" .."Connection: keep-alive\r\nAccept: */*\r\n\r\n") end  
conn=net.createConnection(net.TCP, 0)
 
conn:on("receive", function(conn, payload)
 
print(payload)
 
file.open("netloaded.lua", "w")
 
file.write(payload)
 
file.close()
 
end)
 
conn:connect(8080,"192.168.1.193")
 
conn:send("GET /test.lua HTTP/1.1\r\nHost: www.example.com\r\n"       .."Connection: keep-alive\r\nAccept: */*\r\n\r\n")
 
end
 
 
</div>
 
</div>

Revision as of 22:12, 15 December 2014

Project: ESP-2
Featured:
State Active
Members Prodigity
GitHub No GitHub project defined. Add your project here.
Description Playing around with cheap wifi modules
Picture
No project picture! Fill in form Picture or Upload a jpeg here

To make the ESP8266 more accessible to everyone I have created a "programmer" which allows for easy firmware uploading and communication with the module.


Behold, the egg salad run prog run (ESRPR):

Runprogrun.JPG

More info to follow soon..

loading scripts from a webserver

I (Da Syntax) got tired from typing the scripts line for line into the lua console of the nodeMCU firmware. I wrote a little function to load the scripts from a webserver running on my laptop. This way I can just save the script on my laptop and load it to my ESP8266 calling 2 functions ( netload() and dofile("netloaded.lua") )

function netload() conn=net.createConnection(net.TCP, 0) conn:on("receive", function(conn, payload) print(payload) file.open("netloaded.lua", "w") file.write(payload) file.close() end) conn:connect(8080,"192.168.1.193") conn:send("GET /test.lua HTTP/1.1\r\nHost: www.example.com\r\n" .."Connection: keep-alive\r\nAccept: */*\r\n\r\n") end