Add README; use german timezone in frontend

This commit is contained in:
JonOfUs 2023-08-12 17:50:52 +02:00
parent dee770c395
commit 0957dcf927
2 changed files with 18 additions and 1 deletions

14
README.md Normal file
View file

@ -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`

View file

@ -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);
<span class="navbar-brand mb-0 h1" style="padding-left: 1rem"><?php echo $page_title; ?></span>
</nav>
<div id="content" style="padding: 2rem;">
<h2>Jetzt gerade im CZI <small>(letztes Update von <?php echo date('H:i:s d.m.Y', $present["timestamp"]); ?>)</small></h2><br>
<h2>Jetzt gerade im CZI <small>(letztes Update von <?php echo $datetime->format('H:i:s d.m.Y'); ?>)</small></h2><br>
<table class="table">
<thead>
<tr>