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

Seeking Guidance on Implementing NFC Authentication for Home Key-based Door Lock using hap-nodejs #4

Closed
FlyRenxing opened this issue Sep 13, 2023 · 4 comments

Comments

@FlyRenxing
Copy link

Hello,

I am very interested in your project. Currently, I am working on creating a home key-based door lock using hap-nodejs. I have successfully replicated the part of adding accessories in hap-nodejs. Now, I would like to know what steps I should take next.

Firstly, I would like some guidance on selecting an NFC hardware for my project, specifically the esp32. Could you recommend a few models for me to consider?

Additionally, I would like to know how I can receive NFC data using hap-nodejs, authenticate the data, and use it to unlock the door. Any advice or suggestions on implementing this functionality would be greatly appreciated.

Thank you!

@kormax
Copy link
Owner

kormax commented Sep 13, 2023

Hello.

Couple of aspects you should understand in advance:

  1. HAP-nodejs cannot run on esp32 or any other microcontroller. For it you need something that runs a proper OS, like a raspberry. You can implement homekey device on that kind of hardware, but you have to find other projects for that.
  2. HAP-nodejs is not responsible for NFC communication in any way.
    For NFC communication, you have to pick an NFC board/chip, implement drivers for that board, and then implement full nfc protocol stack iso1443a+ecp->isodep->homekey.
  3. As for hardware: Any controller/pc is ok for running code. As for NFC frontend, you can look at the info in ECP repository, any of the described ones there will work.
  4. This repo does not have full info on implementing the protocol yet*, only some parts plus puzzle pieces for some more advanced folk. We're working on making a final draft that will have sufficient info for everyone, but I can't give any exact dates right now.

@FlyRenxing
Copy link
Author

Thank you for your response. I think I may have understood. I would like to try using ESP32 and PN532 for serial communication to implement the ECP repository's program. Then, I plan to use the Arduino-HomeKit-ESP32 library to publish the door lock accessory to HomeKit.
However, I have a question regarding how to validate if the NFC data generated by Apple is correct?

@kormax
Copy link
Owner

kormax commented Oct 3, 2023

Full-featured code example is being worked on.

For those who are interested, prepare (buy) a pn532 connected with a usb to uart adapter to PC (or to UART gpio on SBC). Stay tuned.

Gonna close this issue for now.

@kormax kormax closed this as completed Oct 3, 2023
@kormax
Copy link
Owner

kormax commented Nov 26, 2023

Hopefully, this is what you wanted :).

@kormax kormax reopened this Nov 26, 2023
@kormax kormax closed this as completed Nov 26, 2023
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