Chat freely about anything...

User avatar
By calgalli
#2336 what do you use on the server site? netcat? I modified you code and test it using net cat and I faced that same problem. The problem seems to be connection reset from esp8266 site. I searched the net and I found that if we set the tcp packet timeout to be 0, it may help to solve this problem. So I now using node js in the server site. This is my code

var net = require('net');
var server = net.createServer(function(c) { //'connection' listener
console.log('server connected');
c.timeout = 0;
c.on('end', function() {
console.log('server disconnected');
});
c.on('data', function(data) {
console.log('Received: ' + data);
});

server.on('error', function (e) {
if (e.code == 'ECONNRESET') {
console.log('RST');
}});
//c.write('hello\r\n');
//c.pipe(c);

});
server.listen(8000, function() { //'listening' listener
console.log('server bound');
});


Please give it a try to see what is the source of the problem.
User avatar
By elektronika_ba
#2340 My module is connecting to server running NodeJS socket server implementation.
Actually, the problem is not with the TCP connection (that's what I thought originally) but the problem is with the module's WIFI connection!

You can try this code on your module and see what happens: http://www.elektronika.ba/wifi_problem.rar

It is a project that can be compiled on lubuntu environment with SDK 0.9.2. Test it out and see what happens. The WIFI connection will break after ~58 seconds once module re-connects to WIFI. If it only connects initially everything works, so after it initially connects, restart your AP and see what happens once module reconnects.