Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A few dozen small, but rapid, socket exchanges kills CC3K #128

Open
natevw opened this issue Jan 24, 2015 · 2 comments
Open

A few dozen small, but rapid, socket exchanges kills CC3K #128

natevw opened this issue Jan 24, 2015 · 2 comments

Comments

@natevw
Copy link
Contributor

natevw commented Jan 24, 2015

Run this somewhere the Tessel can talk to:

require('net').createServer(function (sock) {
  sock.on('data', sock.write);
}).listen(5004, function () {
  console.log("listening", this.address().port);
});

Run this with tessel run -l all -s script.js:

require('net').connect(5004, "192.168.4.114", function () {
  console.log("connected, initiating writes");
  for (var i = 0; i < 25; i += 1) this.write(".");
  this.end();
});

Gets stuck in a loop like the following, and then needs a power cycle before doing any other WiFi stuff:


Sending 1 bytes <Buffer 2e>
tSLInformation.usNumberOfFreeBuffers 1
HCI Event error on command: 1008
HCI Event error on command: 1008
HCI Event error on command: 1008
HCI Event error on command: 1008
kicking out of buffer wait
HostFlowControlConsumeBuff is bad -5
Sending 1 bytes <Buffer 2e>
tSLInformation.usNumberOfFreeBuffers 1
HCI Event error on command: 1008

Full log at https://gist.github.com/natevw/6c39419e1e3bca9bf17c

@natevw natevw changed the title Less than a dozen small, but rapid, socket writes kills CC3K Less than a dozen small, but rapid, socket exchanges kills CC3K Jan 30, 2015
@natevw natevw changed the title Less than a dozen small, but rapid, socket exchanges kills CC3K A few dozen small, but rapid, socket exchanges kills CC3K Jan 30, 2015
@natevw
Copy link
Contributor Author

natevw commented Feb 2, 2015

UPDATE: disregard, I don't think this is particularly relevant.


Another potential way to trigger (at least something similar).

Server:

require('net').createServer(function (sock) {
  sock.setNoDelay();
  for (var i = 0; i < 25; i += 1) setTimeout(function () {
    sock.write(".");
  }, i*.1e3);
}).listen(5004, function () {
  console.log("listening", this.address().port);
});

Tessel:

require('net').connect(5004, "192.168.4.114", function () {
  console.log("connected, waiting");
  setInterval(function () {
    console.log("spin");
    var i = 100000;
    while (--i) ;
    console.log("done");
  }, 1e3);
});

There's no timeout errors, but the Tessel doesn't seem to read as much as expected (though it doesn't totally stop either!)the pattern of data read is a little weird. Full log is https://gist.github.com/natevw/ec2ce0be64ad41f6773c. Maybe this is simply due to event loop scheduling?

@natevw
Copy link
Contributor Author

natevw commented Feb 25, 2015

Will tessel/t1-runtime#713 improve this situation at least by making it detectable?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant