wifi.setmode(wifi.SOFTAP)

cfg={}
cfg.ssid="Odometry"
cfg.pwd="qwerty123"

cfg.ip="192.168.100.1"
cfg.netmask="255.255.255.0"
cfg.gateway="192.168.100.1"

port = 9876

wifi.ap.setip(cfg)
wifi.ap.config(cfg)





uart.setup(0, 115200, 8, 0, 1, 1)
srv=net.createServer(net.TCP, 28800) 
srv:listen(port,function(conn)
     
        uart.on("data", "\r", function(data)
            conn:send(data)
        end, 0)
        
        conn:on("receive",function(conn,payload) 
            uart.write(0, payload)
        end)  
        
        conn:on("disconnection",function(c) 
            uart.on("data")
        end)
        
    end)


