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

i2c problem #14

Closed
Stan92 opened this issue May 22, 2017 · 2 comments
Closed

i2c problem #14

Stan92 opened this issue May 22, 2017 · 2 comments

Comments

@Stan92
Copy link

Stan92 commented May 22, 2017

Hi,
I tried your package, and it seems it doesn't work in i2c mode.
The problem comes from this line
var rfid = new pn532.PN532(wire);
I get this error


/home/pi/rfidtest/node_modules/i2c/lib/i2c.coffee:88
          return callback(err);
                 ^
TypeError: callback is not a function

Do you have any idea?
thanks

@techniq
Copy link
Owner

techniq commented May 22, 2017

Hi @Stan92. Sorry, but i2c in the released versions is not functional. For my projects I've always used UART/Serial, although I did make some progress in the i2c branch. Last I remembered I had it working successfully over Firmata but had some hard coded pins and it still needed some work before I could merge it back to master (are the IRQ pins required or can I fall back to polling etc).

I've not done a lot of work with I2C myself (just using other's libraries, etc) but it seems I2C is more of a "pull" approach while UART is more "push" (UART you can wait for data to come to you, I2C you have to go get it, or at least that's where the IRQ pin on the pn532 comes in to let me know data is available to go fetch).

Anyways, you can try to experiment with the i2c branch, but you'll need to pull from source. I'm also always willing to help others like I did with card emulation and would love for someone to get this going and send a PR. I've not had a project recently that used this library so it's not been a priority for me to work on.

@Stan92
Copy link
Author

Stan92 commented May 22, 2017

No problem.. I thank you for explanation (I've learned something about pull vs push approach)..
Thanks once again.

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

2 participants