GeenenTijd / llrp-nodejs

RFID implementation using Nodejs
24 stars 14 forks source link

Maximum call stack size exceeded error #2

Open ceremcem opened 9 years ago

ceremcem commented 9 years ago

Sometimes it runs for minutes, sometimes it doesn't even start and throws the following error:

buffer.js:277
Buffer.isBuffer = function isBuffer(b) {
                                   ^
RangeError: Maximum call stack size exceeded

source is as follows:

// Generated by LiveScript 1.3.1
(function(){
  console.log("Reader started...");

  var llrp = require('llrp');

  var reader = new llrp({
      ipaddress: '192.168.1.100'
  });

  reader.connect();

  reader.on('timeout', function () {
      console.log('timeout');
  });

  reader.on('disconnect', function () {
      console.log('disconnect');
  });

  reader.on('error', function (error) {
      console.log('error: ' + JSON.stringify(error));
  });

  /* 
  reader.on('didSeeTag', function (tag) {
      console.log('TAG: ' + tag.tagID);
  });
  */

  reader.on('didSeeTag', function(tag){
    if (in$("19b2", tag.tagID)) {
      console.log("we found what we looking for: ", tag.tagID);
    } else {
      console.log("---------------------------", tag.tagID);
    }
  });
  function in$(x, xs){
    var i = -1, l = xs.length >>> 0;
    while (++i < l) if (x === xs[i]) return true;
    return false;
  }
}).call(this);
GlennGeenen commented 9 years ago

I'm aware of this problem. The package was a test and isn't ready for any serious use. The reader sends all data it can see to node with the tagdata attached, so node explodes. Normally you want the reader to notify you for changes and to read all tags every x milliseconds instead of the reader sending you everything. I still use LLRP toolkit (http://www.llrp.org) until I have time to write a good implementation in node. It's on my todo list.

ceremcem commented 9 years ago

If I understand correctly, this is caused by very big/fast data blocks sent by the reader. I'm trying to dig this a bit.

GlennGeenen commented 9 years ago

Yes the reader sends more events / data to node than node can handle. I have set myself the goal to have a proper node implementation by the end of the year.

meneva commented 6 years ago

Hello... I am trying to implement this module with FX7500(zebra motorolla RFID reader) . can we stop the counting once it finished reading all tags in range ? now it's just keep counting ...

GlennGeenen commented 6 years ago

That's how an RFID reader works, it reads till you tell it to stop reading. This library was a test, I do not intend to fix anything since I use other solutions (not LLRP), Zebra provides you with an SDK for your reader.

meneva commented 6 years ago

Hello Glenngeenen thanks for this nice LLRP implementation. I found it useful to test my RFID reader(fx7500). it was reading the tags nicely... but now suddenly it does not count anything. nodejs just running and timeout. can u pls suggest me what can be the reason ? it will be really helpful for me. thanks in advance