summaryrefslogtreecommitdiffstats
path: root/_log/fpm-door-lock-rf.md
diff options
context:
space:
mode:
Diffstat (limited to '_log/fpm-door-lock-rf.md')
-rw-r--r--_log/fpm-door-lock-rf.md20
1 files changed, 4 insertions, 16 deletions
diff --git a/_log/fpm-door-lock-rf.md b/_log/fpm-door-lock-rf.md
index 7c2b9ef..e29f733 100644
--- a/_log/fpm-door-lock-rf.md
+++ b/_log/fpm-door-lock-rf.md
@@ -6,7 +6,7 @@ project: true
thumbnail: thumb_sm.jpeg
---
-Wanted to unlock door with fingerprint, wirelessly to avoid drilling.
+Wanted to unlock the door with fingerprint, wirelessly to avoid drilling.
2024-11: Started with basic 433MHz RF modules and two Arduinos. Connected data
lines of the transceivers to UART RXD/TXDs of the MCUs. Unreliable--constant
@@ -20,22 +20,10 @@ ATmega328P runs at 5V; RFM69 3.3V. Suspect logic-level converter (LLC) issues.
High resistance; Not enough swing.
2025-04: Ditched RFM69s. Switched to NRF24L01+ modules--data pins 5V tolerant,
-no LLC required. Spent six weekends writing a clean-room driver from scratch.
-Works like a charm.
+no LLC required. Spent six weekends writing a clean-room driver. Works like a
+charm.
-Basic security via xor cipher--good enough for a door behind a guard post and
-a gate:
-
-```
-void xor(const char *k, const char *s, char *d, uint8_t n)
-{
- int i;
- for (i = 0; i < n; i++)
- d[i] = s[i] ^ k[i];
-}
-```
-
-Resists replay attacks by cycling the key:
+XOR cipher encrypts RF channel. Key cycled to resist replay attacks:
```
static inline void keygen(char *buf, uint8_t n)