{"action":"opened","issue":{"url":"https://api.github.com/repos/nodemcu/nodemcu-firmware/issues/102","labels_url":"https://api.github.com/repos/nodemcu/nodemcu-firmware/issues/102/labels{/name}","comments_url":"https://api.github.com/repos/nodemcu/nodemcu-firmware/issues/102/comments","events_url":"https://api.github.com/repos/nodemcu/nodemcu-firmware/issues/102/events","html_url":"https://github.com/nodemcu/nodemcu-firmware/issues/102","id":54141231,"number":102,"title":"sending messages from one esp to another","user":{"login":"michal2229","id":7946276,"avatar_url":"https://avatars.githubusercontent.com/u/7946276?v=3","gravatar_id":"","url":"https://api.github.com/users/michal2229","html_url":"https://github.com/michal2229","followers_url":"https://api.github.com/users/michal2229/followers","following_url":"https://api.github.com/users/michal2229/following{/other_user}","gists_url":"https://api.github.com/users/michal2229/gists{/gist_id}","starred_url":"https://api.github.com/users/michal2229/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michal2229/subscriptions","organizations_url":"https://api.github.com/users/michal2229/orgs","repos_url":"https://api.github.com/users/michal2229/repos","events_url":"https://api.github.com/users/michal2229/events{/privacy}","received_events_url":"https://api.github.com/users/michal2229/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-01-13T01:56:44Z","updated_at":"2015-01-13T01:56:44Z","closed_at":null,"body":"Hi there. \r\nI am working on a project in which i need to communicate between two esp8266 modules. \r\nI am setting esp1 as a server AP and esp2 as a client. \r\nThen I am connecting client esp2 to a server esp1 AP via ssid and password.\r\nNext I am creating connection on the client to server's IP (192.168.4.1) and trying to send a message, but I have no response. I tried many ways to communicate between these two modules but with no effect...\r\nI have no problem with creating webserver trough AP, webserver trough router and sending to thingspeak every 15s on one device at the same time with 3 clients connected to it (PC and two smartphones) and refreshing page quite fast, so i doubt it is related to low heap or something like that... \r\nClient is connected to AP properly - print(wifi.sta.getip()) returns 192.168.4.2.\r\n\r\nCould You help me figuring out how it should be done? Is it even possible to send message from one esp to another? \r\n\r\nHere is my test code:\r\n```lua\r\nwifi.setmode(wifi.STATIONAP)\r\ncfg={}; \r\ncfg.ssid=\"ESP8266_\" .. wifi.ap.getmac(); cfg.pwd=\"mypassword\"; \r\nwifi.ap.config(cfg)\r\nwifi.sta.config(\"ESP8266_1A-FE-34-9C-D7-70\",\"mypassword\") -- esp-03 - client\r\n--wifi.sta.config(\"ESP8266_1A-FE-34-9E-0B-FE\",\"mypassword\") -- esp-01 - server\r\nwifi.sta.connect() \r\n\r\ntmr.alarm(2, 10000, 1, function() -- I am sending message every 10s\r\n\tprint(\"alarm 2...\")\r\n\tprint(wifi.ap.getip()) \r\n\tprint(wifi.sta.getip()) -- checking if connected succesfully\r\n\tconn2 = net.createConnection(net.TCP, 0)  \r\n\tconn2:on(\"receive\", function(conn2, payload) \r\n\t\tprint(payload) -- nothing prints here, means there is no response... :(\r\n\t\tconn2:close()\r\n\t\tcollectgarbage()\r\n\tend) \r\n\tconn2:connect(80, \"192.168.4.1\") -- server/AP IP\r\n\tconn2:send(\"some message that I want to send to other (server) ESP\")\r\n\tprint(\"sent in alarm 2...\")\r\nend)\r\n\r\n--server = net.createServer(net.TCP) \r\n--server:listen(80, function(conn) \r\n--\tconn:on(\"receive\", function(conn, receivedData)\r\n--\t\tprint(receivedData)\t\t\t\r\n--\t\tmessage = \"message received, OK.\"\r\n--\t\tconn:send(message); message = nil -- here the response should be sended, but it does not even do \"print(receivedData)\", means there is no message received at all...\r\n--\tend) \r\n--\tconn:on(\"sent\", function(conn) \r\n--\t\tconn:close() \r\n--\t\tcollectgarbage() \r\n--\tend)\r\n--end)\r\n```\r\n\r\nAnd here is my response trough uart from client:\r\n*NodeMCU 0.9.5 build 20150108  powered by Lua 5.1.4\r\nalarm 2...\r\n192.168.4.1\r\n192.168.4.2\r\nsent in alarm 2...\r\nalarm 2...\r\n192.168.4.1\r\n192.168.4.2\r\nsent in alarm 2...*\r\nand so on... \r\nServer, on the other hand, prints nothing...\r\n\r\nThanks in advance."}}