Access Control System
Architecture Design
Current
Current
In short, I used Home Assistant to bind Raspberry Pi and HomeKit service, link rolling door with relay by GPIO.
To prevent error opening, lock operating in LAN by HomeKit
Next
- Android Support
- Slack Message Integration
- No VPN anymore
- Very easy
⇢ Decoupling HomeKit
⇢ Add more location awareness authorization
Location Awareness
GPS
GPS
Location Awareness
LAN / Mac Address
Use VPN / Mac Address is changable
Location Awareness
built in @ Raspberry Pi 3 / 4
Future
issue OTP
Request open with OTP
Generic Access Profile
Role
Peripheral
Central
mostly low power devices
mostly smart phone
Exchangable
Connection
https://learn.adafruit.com/introduction-to-bluetooth-low-energy?view=all#gatt
Advertising Message
- Connectionless
- Unreliable
- Asynchronous
- Broadcast
- Unidirectional
Broadcast
One peripheral device can broadcast message to unlimited central devices
https://learn.adafruit.com/introduction-to-bluetooth-low-energy?view=all#gatt
Pairing / Connection
- Reliable
- Bidirectional
- Unicast
Piconet
Each peripheral device connected to one central at same time. Up to 7 peripheral devices in a piconet, but each peripheral device can be another piconet central.
https://learn.adafruit.com/introduction-to-bluetooth-low-energy?view=all#gatt
GATT
Profile
Service
Characteristic
https://www.bluetooth.com/zh-cn/specifications/gatt/
GATT Example
Web Bluetooth
挖個坑
https://github.com/WebBluetoothCG/web-bluetooth/blob/gh-pages/implementation-status.md
Support
Scan
navigator.bluetooth.requestLEScan({
keepRepeatedDevices: true
}).then(() => {
navigator.bluetooth.addEventListener('advertisementreceived', event => {
const appleData = event.manufacturerData.get(0x004C);
if (appleData.byteLength != 23) {
// Isn’t an iBeacon.
return;
}
const major = appleData.getUint16(18, false);
const minor = appleData.getUint16(20, false);
const txPowerAt1m = -appleData.getInt8(22);
const pathLossVs1m = txPowerAt1m - event.rssi;
recordNearbyBeacon(major, minor, pathLossVs1m);
});
})
And more...
BLE / JS / gyro / temp / light / button
Спасибо
Access Control System
By Chia Yu Pai
Access Control System
- 328