diff --git a/README.md b/README.md new file mode 100644 index 0000000..7004ae1 --- /dev/null +++ b/README.md @@ -0,0 +1,14 @@ +# CZI presence detector +Tool to detect the presence of pre-defined devices by their WiFi MAC addresses. + +## How it works +Sets the wifi adapter into monitor mode, then listens to surrounding packets listing all detected devices into `wifi_map.yaml`. Resets the wifi adapter to normal mode for uploading the results, filters the results by the mac addresses in `identities.yaml` and sends all matched identities to the front-end webhook server in `public`. This server stores the presence information locally and displays it with `public/index.php` with a timestamp of the last update. + +## Set-up +Dependencies: Python3, trackerjacker (pip3), php (front-end) +Configs to change: +- wifi adapter in `scan.sh` +- system-specific wifi commands in `scan.sh` +- webhook URL and secret in `upload.py` +- webhook secret in `public/update.php` +- mac-name-identities in `identities.yaml` \ No newline at end of file diff --git a/public/index.php b/public/index.php index c8bead5..5acd6bf 100644 --- a/public/index.php +++ b/public/index.php @@ -5,6 +5,9 @@ $present_file = 'present.json'; $present = json_decode(file_get_contents($present_file), true); +$tz = 'Europe/Berlin'; +$datetime = new DateTime("now", new DateTimeZone($tz)); +$datetime->setTimestamp($present["timestamp"]); ?> @@ -22,7 +25,7 @@ $present = json_decode(file_get_contents($present_file), true);
-

Jetzt gerade im CZI (letztes Update von )


+

Jetzt gerade im CZI (letztes Update von format('H:i:s d.m.Y'); ?>)