uart with net.tcp

Home Forums NodeLua firmware Startup uart with net.tcp

This topic contains 1 reply, has 2 voices, and was last updated by  dkumar 2 years, 9 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #505

    labelohase
    Participant

    sorry for my bad one in English
    how can I send daten from ‘uart’ to a server TCP?
    cannot send ‘data’ in to the TCP, always … attempt to concatenate global ‘c’ (a nil value))

    uart.on(“data”,10, function(data)
    print(“receivex from uart:”, data)
    if data==”quit\L” then
    uart.on(“data”)
    conn:send(data)
    c = (data)

    end
    end, 0)

    thank you
    l-hase

    #507

    dkumar
    Participant


    data sending from both side in esp8266

    i am not able to send message from server(AP) to client , using hyper terminal, simply server replied to client, when any message received from client

    send(“hi”) //send message “Hi” from client using hyper-terminal
    received: Hi, I read You //received message from server

    but not sending message from server to client just like above

    this is my server(AP) code

    print("configuring ap")
    
    wifi.setmode(wifi.STATIONAP)
    cfg={}
    cfg.ssid="WS"
    cfg.pwd="12345678"
    wifi.ap.config(cfg)
    
    print("config TCP server")
    server = net.createServer(net.TCP,28800)
    server:listen(80, function(conn)
         conn:on("receive",function(conn,data)
              print(data)
              message = "Hi, I read You."
            conn:send(message); message = nil
    
         end)
         conn:on("sent",function(conn)
    
              collectgarbage()
         end)
              conn:on("connection",function(conn)
              print("Connected")
         end)
Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.