-->
Page 1 of 1

error after compiling

PostPosted: Thu Apr 23, 2015 4:29 am
by jumjum123
After compiling this module, UART is disconnected.
Happens only with this code, others are compiled without problems.
Code: Select alllocal Serv = {
  srv = nil,
  script = function(path,params) return "Empty" end,
  response = function(self,path,params)
    return "<html><body>"..self.script(path,params).."</body></html>"
  end,
  startServer = function(self,port)
    self.srv=net.createServer(net.TCP)
    self.srv:listen(port,function(conn)
      conn:on("receive",function(conn,request)
        local params = {}
        local _, _, method, path, vars = string.find(request, "([A-Z]+) /(.+)?(.+) HTTP");
        if (vars ~= nil)then for k, v in string.gmatch(vars, "(%w+)=(%w+)&*") do params[k] = v end end
        conn:send(self:response(path,params))
        conn:on("sent",function(conn) conn:close() conn=nil collectgarbage() end)
      end)
    end)
  end,
  stopServer = function(self) self.srv:close() end,
}
return Serv

Re: error after compiling

PostPosted: Thu Apr 23, 2015 5:06 am
by cal
Moin,

You didn't tell which firmware you used.
I have no problem compiling that on

1. current dev version + my cal_dex module
2. some customized nodemcu

If you use one of the march builds: Use either a february build or a build from the dev branch.

Cal

P.S.
Die Küste ist hier nur im Geiste. Tief im Wee~eesteeen triffts eher. ;-)

Re: error after compiling

PostPosted: Mon Apr 27, 2015 12:51 pm
by jumjum123
Got it running after upgrading to 0.96
Regards Jürgen

P.S. vom Niederrhein