Comments (12)
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.
hey @devrim-oguz can you check 2.1.3. an report back?
thx for reporting
Tristan
from mfrc522-rpi.
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.
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.
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.
feel free to create a pull-request to fix this issue! i will release a new version.
from mfrc522-rpi.
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.
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.
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.
Also, what does the new Int32Array(new SharedArrayBuffer(4))
do in the Atomics.wait function?
from mfrc522-rpi.
Hey, did you forgot about the pull request? 😊
from mfrc522-rpi.
Issue resolved in #22. Closing the issue.
from mfrc522-rpi.
Related Issues (17)
- Unable to determine hardware version. I see: Hardware : BCM2835 HOT 9
- MFRC522 not working on RPi 4 HOT 5
- Increasing range of MFRC522 HOT 2
- MFRC522-python not working after running mfrc522-rpi HOT 1
- Very long delay on startup: Reason for 250ms delay? HOT 10
- 7 byte uid HOT 1
- Cannot get continuous read HOT 5
- Pin in use
- Request for publishing the package in npm
- Race condition(?) on a mifare ISO/IEC 14443-4 card
- Request for publishing the repo in npm
- Error while reading! Status: false Data: 55 BitSize: 0
- Use SPI1 HOT 8
- Error: Cannot find module '../build/Release/WiringPi HOT 6
- Example of how to write on NTAG213, if possible HOT 3
- LEDs on module HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mfrc522-rpi.