Code is run on Python V2.x and Raspberry Pi3 Bluetoothctl environment
To run any of the code, type: "sudo python CODENAME.py" in terminal
-
BLE_SCANNER: Scans all available BLE devices within the proximity. Python fetches Raspberry Pi3 Bluetoothctl environment.
-
BLE_TABLE: Generates a table for each BLE device in MySQL. If you notice that the name of the device is a little changed, this was necessary in order to store make it sql-syntax friendly. However, not much is changed.
-
BLE_DATA: Compiles all the BLE code above into one (calling this file will execute all functions above automatically). Stores the present date, time, mac address and presence (detected or non-detected) string upon scan real-time. It dynamically retrieves the BLE device every call, hence detects whether a new BLE device is present, or if a pre-existing device disappears.
Note: From experiment it seems the maximum presence detection is within 15-20 [meters]. Enough to detect any BLE device in a single room.
- Raspberry Pi3
- Python V2.x
- pymysql python module