From Hackerspace ACKspace
|
|
(18 intermediate revisions by 3 users not shown) |
Line 1: |
Line 1: |
− | {{Project
| + | #REDIRECT [[ESP8266]] |
− | |State=Active
| |
− | |Members=Prodigity, Da Syntax
| |
− | |Description=Playing around with cheap wifi modules
| |
− | }}
| |
− | <noinclude>{{Featured}}</noinclude> To make the ESP8266 more accessible to everyone I have created a "programmer" which allows for easy firmware uploading and communication with the module.
| |
− | | |
− | <br>
| |
− | | |
− | Behold, the egg salad run prog run (ESRPR):
| |
− | | |
− | [[Image:Runprogrun.JPG]] | |
− | | |
− | More info to follow soon..
| |
− | | |
− | == loading scripts from a webserver ==
| |
− | | |
− | 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") )
| |
− | <pre>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
| |
− | </pre>
| |
− | Future plans
| |
− | | |
− | *Send mac adress of the wifi module in get so the webserver can return device specific firmwares
| |
− | *Put the script between specific tags so there wont be any problems with headers that are added by the webserver + gives the possibility to add metadata (e.g. version of script or a signature)
| |
− | *Create a nice php/mysql webapp to easily manage the scripts per module
| |
Latest revision as of 09:36, 20 November 2021