As the title says... Chat on...

User avatar
By flllo
#24400 Hi all!

I have a little problem with my esp.... i´m despairing!

Here's my Code:

Code: Select allport = 80
srv=net.createServer(net.TCP)
OSS = 2 -- oversampling setting (0-3)
SDA_PIN = 4 -- sda pin, GPIO2
SCL_PIN = 3 -- scl pin, GPIO0
bmp180 = require("bmp180")
bmp180.init(SDA_PIN, SCL_PIN)
bmp180.read(OSS)
t = bmp180.getTemperature()
p = bmp180.getPressure()
srv:listen(port,
     function(conn)
          conn:send("HTTP/1.1 200 OK\nContent-Type: text/html\nRefresh: 5\n\n" ..
              "<!DOCTYPE HTML>" ..
              "<html><body><b>OutdoorSensor</b><br>" ..
              (p/100) ..
              "<br>" ..
              (t/10) ..
              "</html></body>")         
          conn:on("sent",function(conn) conn:close() end)
     end
)



-- release module
bmp180 = nil
package.loaded["bmp180"]=nil


It displays the data from a BMP180 sensor on a simple HTML page. Now the Problem: It doesn't refreshes the data - the values are saved until i reboot my esp. But logically, it should display me the new values when i refresh the web-page...

Can you help me? :?