There are not many examples on the web for the ESP8266 in LUA, which is a shame. I'm struggling with similarly simple things myself because the documentation is there, but the examples are extremely laconically written. But it's nice that someone is trying to do something in lua, because using Arduino or Raspberry for ESP8266 is often too much.
Your code doesn't work for me, but I have an ESP that works both as an http server (switching on relays) and also connects to other ESPs by downloading the temperature (actually a page with the temperature written on it) from them (from the http server). The download is done via
tmr.alarm .
The readout is something like this:
.
This is not my code, I even downloaded it from I don't know where but it was the output code for what I carved;)
EDIT:
Or this code:
.
from here:
Link