Coder Social home page Coder Social logo

Comments (12)

devrim-oguz avatar devrim-oguz commented on May 31, 2024

Edit: I have just seen the commit to resolve the issue, I guess it is caused by the npm package coming from behind. Can you update the npm repo?

from mfrc522-rpi.

firsttris avatar firsttris commented on May 31, 2024

hey @devrim-oguz can you check 2.1.3. an report back?

thx for reporting

Tristan

from mfrc522-rpi.

devrim-oguz avatar devrim-oguz commented on May 31, 2024

I cleared the node modules, removed the libray from the package.json file and installed the v2.1.3, issue seems to be still there, code doesn't seem to be changed.

Thanks for the quick response.

from mfrc522-rpi.

devrim-oguz avatar devrim-oguz commented on May 31, 2024

Ok, my bad I'm so sorry. The commited code of "AhmedBHameed" #17 is on the line 202, whereas the electron gives the error on "line 32" of the index.js file. Can this issue be fixed by replacing it with something else?

// Hold RESET pin low for 50ms to hard reset the reader
    rpio.open(this.reset_pin, rpio.OUTPUT, rpio.LOW);
    Atomics.wait(new Int32Array(new SharedArrayBuffer(4)), 0, 0, 50);   //<- This line gives the error (Line 32 of index.js)
    rpio.write(this.reset_pin, rpio.HIGH);
    return this;

from mfrc522-rpi.

firsttris avatar firsttris commented on May 31, 2024

can you report back if this works?

  setResetPin(pin = 22) {
    if (!pin) {
      throw new Error(
        "Invalid parameter! reset pin parameter is invalid or not provided!"
      );
    }
    this.reset_pin = pin;
    // Hold RESET pin low for 50ms to hard reset the reader
    rpio.open(this.reset_pin, rpio.OUTPUT, rpio.LOW);
    setTimeout(function() {
          rpio.write(this.reset_pin, rpio.HIGH);
    }, 50);
    return this;
  }

or if you know a better way.

from mfrc522-rpi.

firsttris avatar firsttris commented on May 31, 2024

feel free to create a pull-request to fix this issue! i will release a new version.

from mfrc522-rpi.

devrim-oguz avatar devrim-oguz commented on May 31, 2024

Thanks for quick response again, I've tried the code

setResetPin(pin = 22) {
    if (!pin) {
      throw new Error(
        "Invalid parameter! reset pin parameter is invalid or not provided!"
      );
    }
    this.reset_pin = pin;
    // Hold RESET pin low for 50ms to hard reset the reader
    rpio.open(this.reset_pin, rpio.OUTPUT, rpio.LOW);
    setTimeout(function() {
          rpio.write(this.reset_pin, rpio.HIGH);
    }, 50);
    return this;
  }

and it gives an error of the pin not being defined, but I figured that it is caused by this.reset_pin since the reset pin belongs to the parent function, so changed the code like this:

setResetPin(pin = 22) {
    if (!pin) {
      throw new Error(
        "Invalid parameter! reset pin parameter is invalid or not provided!"
      );
    }
    this.reset_pin = pin;
    // Hold RESET pin low for 50ms to hard reset the reader
    rpio.open(this.reset_pin, rpio.OUTPUT, rpio.LOW);
    setTimeout(function() {
          rpio.write(this.reset_pin, rpio.HIGH);
    }.bind(this), 50);
    return this;
  }

and this time it worked.
Thanks for the help, I will create a pull request in a few minutes after testing it again.

from mfrc522-rpi.

devrim-oguz avatar devrim-oguz commented on May 31, 2024

I created a pull request in #21 but only changed the package.json file to update the version number. Is this enough or more changes neededed for a version update? Can you update the required parts before updating the npm package please?

from mfrc522-rpi.

devrim-oguz avatar devrim-oguz commented on May 31, 2024

Created a new pull-request by changing both the package.json file and the package-lock.json file. Can you please review the changes before merging it?

from mfrc522-rpi.

devrim-oguz avatar devrim-oguz commented on May 31, 2024

Also, what does the new Int32Array(new SharedArrayBuffer(4)) do in the Atomics.wait function?

from mfrc522-rpi.

devrim-oguz avatar devrim-oguz commented on May 31, 2024

Hey, did you forgot about the pull request? 😊

from mfrc522-rpi.

devrim-oguz avatar devrim-oguz commented on May 31, 2024

Issue resolved in #22. Closing the issue.

from mfrc522-rpi.

Related Issues (17)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.