Door lock (new)
 
 
Go to file
Elia Marcinkiewicz 3b2818f150 add separate PN532 exception handling, print exception messages 2023-07-28 22:07:51 +02:00
esp32 add separate PN532 exception handling, print exception messages 2023-07-28 22:07:51 +02:00
keypad initial 2023-06-20 16:21:00 +02:00
README.md initial 2023-06-20 16:21:00 +02:00

README.md

doorman2: electric boogaloo

  • esp32/ contains the micropython source which talks w/ NFC module and keypad over UART (two channels)
  • keypad/ has some magical Arduino code (sorry)

syncing data from LDAP

big TODO; currently, you need to:

  1. clone the old doorman repo and patch the doorman_ldap_sync file (see my shitty patch attached below)
--- a/admin/bin/doorman_ldap_sync
+++ b/admin/bin/doorman_ldap_sync
@@ -63,14 +63,18 @@ def get_target_cards(c):
 
 if __name__ == "__main__":
     url = argv[1] if len(argv) > 1 else options.url
-    token = get_token()
-    proto = Proto(url)
+    #token = get_token()
+    #proto = Proto(url)
 
     c = ldap.initialize('ldap://ldap.hackerspace.pl')
     c.start_tls_s()
-    c.simple_bind_s('uid=%s,ou=People,dc=hackerspace,dc=pl' % (getpass.getuser(),), getpass.getpass('LDAP password: '))
+    c.simple_bind_s('uid=%s,ou=People,dc=hackerspace,dc=pl' % ('sdomi',), getpass.getpass('LDAP password: '))
     target = get_target_cards(c)
-    cur = get_current_cards(token, proto)
+    pprint.pprint(target)
+    for h, u in target:
+        print(h)
+
+    #cur = get_current_cards(token, proto)
 
     to_remove = cur - target
     to_add = target - cur
  1. launch the script, copy all the lines with the hashes and save them a file
  2. mpremote fs cp hashes :hashes

plans: web UI like vuko's design

esp <-> keypad protocol definition

  • one byte per command, no delimeters, keypad is supposed to be as stateless as possible
  • the keypad can only send numbers and the hash symbol
  • ESP can send the following commands:
    • H ("happy" noise, success; turns on the green LED for a second and turns it back off)
    • S ("sad" failure noise; likewise with the red LED)
    • F ("flush"; turns off LEDs and tries to bring the env to a sane level)
    • G, R ("green", "red"; turns on the specific LEDs)
    • Q ("quiet"; turns on audible keypresses)

i am so sorry