From 8ca9f69f6f11dfabac29083ecd2fec311c1b5e9a Mon Sep 17 00:00:00 2001 From: RobbStarkAustria Date: Sat, 25 Oct 2025 17:42:27 +0200 Subject: [PATCH] Initial import: clean snapshot from /home/olafn/infoscreen-dev (2025-10-25) --- .git.legacy_backup.1761406947 | 1 + .git.legacy_backup/COMMIT_EDITMSG | 1 + .git.legacy_backup/HEAD | 1 + .git.legacy_backup/config | 5 + .git.legacy_backup/description | 1 + .../hooks/applypatch-msg.sample | 15 + .git.legacy_backup/hooks/commit-msg.sample | 24 + .../hooks/fsmonitor-watchman.sample | 174 +++ .git.legacy_backup/hooks/post-update.sample | 8 + .../hooks/pre-applypatch.sample | 14 + .git.legacy_backup/hooks/pre-commit.sample | 49 + .../hooks/pre-merge-commit.sample | 13 + .git.legacy_backup/hooks/pre-push.sample | 53 + .git.legacy_backup/hooks/pre-rebase.sample | 169 +++ .git.legacy_backup/hooks/pre-receive.sample | 24 + .../hooks/prepare-commit-msg.sample | 42 + .../hooks/push-to-checkout.sample | 78 ++ .git.legacy_backup/hooks/update.sample | 128 ++ .git.legacy_backup/index | Bin 0 -> 4106 bytes .git.legacy_backup/info/exclude | 6 + .../01/0457920254697451146f4f42e7840de6436b9b | Bin 0 -> 508 bytes .../02/597dc08efe99978c8ee96bb702bc56886fd2dd | Bin 0 -> 2762 bytes .../02/730b6639e0d0a18e5562840c2c1493a701929b | Bin 0 -> 1282 bytes .../03/145d9c887573bcfb210da615ad2873619610a1 | Bin 0 -> 3459 bytes .../06/8751ce3ed59174c8d833c64e94e4b07e691f49 | Bin 0 -> 590 bytes .../11/80fac0edbe982c13f96beba8a6594477182b52 | 2 + .../14/921ca9fa399923d4ec2d697580c248ad653fbf | Bin 0 -> 1044 bytes .../1b/a0cb9a365dbdc55c6f75613187656c171ec29a | Bin 0 -> 585 bytes .../1e/164fd22d16c52e87c877ff9e05138bdec3fb52 | Bin 0 -> 909 bytes .../29/281c7902f6008f791c7a543fb0d363fb50329a | Bin 0 -> 2300 bytes .../2f/cd35546ec1ea64264f6f2184e040ff08349bd2 | Bin 0 -> 14749 bytes .../31/61c94d983daf107ef341ba0acf7ffe1225da35 | Bin 0 -> 8277 bytes .../31/a7997a2e127418ddb7777158cf2e27b254e27a | Bin 0 -> 1765 bytes .../31/bc9bd8589c57a7c8b60a60cec86f3dddd6bb30 | Bin 0 -> 97 bytes .../35/e32cfaa3f05d6851106800adb7f785c45aaf21 | Bin 0 -> 2721 bytes .../36/c3c46b15ca782ef97216b3000aa561a1583d9d | Bin 0 -> 598 bytes .../3d/e6506a69389f3b73137debe01821bedb1d3c52 | Bin 0 -> 553 bytes .../3e/80068606a4de04d63018f1bd18e13282e4668c | Bin 0 -> 1055 bytes .../45/a4a477ea4fc3581598dd1bec64d41f5b6a3f91 | Bin 0 -> 484 bytes .../4b/e8874dc38463929a3fc7d664574f129e14a0b1 | Bin 0 -> 1761 bytes .../4d/4d94f03bca62bb0675d1373c3073c19c83b4d6 | Bin 0 -> 676 bytes .../51/9a5207dde4f99146397b78ce30089e6ffa3666 | Bin 0 -> 9096 bytes .../54/4c3d769ee73c1b5d5562f4d176417969e4da24 | Bin 0 -> 8571 bytes .../58/cfa94809f582eb959e3771e79d2974cd6e0455 | Bin 0 -> 2766 bytes .../65/4298d4c891e0e04e80125f17d0113b47c890ff | Bin 0 -> 1370 bytes .../67/5cb84421ec8428c32c0dca96a32efadc9e530c | Bin 0 -> 2364 bytes .../82/b38f40d3673cb9d5a63f57b111babfb9fdbfbe | 3 + .../83/3d60a1ea07a6dea979b8a866cca968245dee2f | Bin 0 -> 1274 bytes .../88/8930ac2e3692865b9f74f1a49fbdaf54604a35 | 3 + .../89/c2aa414fe8a90c6541d1f1cefeaf7d47f31052 | Bin 0 -> 3086 bytes .../8e/35d15d0cba406dd108d67545fe3e2963fc7150 | 2 + .../90/d210f0cfa46b14b2d797a156c94163de7b3af3 | 2 + .../a6/5e860bf0be2eabb47ad53371a096e9e6d95df5 | Bin 0 -> 3332 bytes .../af/dacf26f4c9719ba6d1be6615f5e179e119cbdc | Bin 0 -> 1705 bytes .../b2/58706e00579e1150ce0abddf2bdc0c7776a029 | Bin 0 -> 455 bytes .../b2/69ce62a7c9054690472d191d9424583ba86b82 | Bin 0 -> 67 bytes .../b3/ff4fb897629e729ff7ba3491bfeac220b26c4b | Bin 0 -> 5191 bytes .../b5/af47bc5ffab98ad51dfb058ddc70914203288d | Bin 0 -> 3680 bytes .../b8/d2fa01a860287e734c8eb37dee90c6dbb59672 | Bin 0 -> 1052 bytes .../c6/a7f80737de32a446fca59c3dc93395f9c2d063 | Bin 0 -> 492 bytes .../d5/ff46a0d92f28bae6613b14c875296a98d2b647 | Bin 0 -> 2654 bytes .../d7/1df4449558c5dcc3cf100330abf55be39f2da6 | Bin 0 -> 810 bytes .../d9/3c1a7fd26446a032e68817362ebdf54dcb54a4 | Bin 0 -> 534 bytes .../da/43f2b29ecf071e9b4ffc2fa03482e25d7cf0c6 | 1 + .../e3/48498f7802ad858dd957f0124f5267b33e4611 | Bin 0 -> 1505 bytes .../ec/41cff2525c5e573c1a6f04a8ccb7029911a67f | Bin 0 -> 115 bytes .../f4/414895b2fc70f6cbda62f96a4b7d121598e248 | Bin 0 -> 89 bytes .../fb/d18a6c088ffa700c3f8cfe6de36904b4071506 | Bin 0 -> 1740 bytes .git.legacy_backup/refs/heads/master | 1 + .github/copilot-instructions.md | 393 ++++++ .gitignore | 64 + CLEANUP_SUMMARY.md | 195 +++ IMPRESSIVE_INTEGRATION.md | 272 ++++ PROGRESS_BAR_IMPLEMENTATION.md | 258 ++++ QUICK_REFERENCE.md | 192 +++ README.md | 612 +++++++++ SCHEDULER_FIELDS_SUPPORT.md | 202 +++ TODO.md | 40 + WORKSPACE_STATUS.txt | 193 +++ scripts/infoscreen-display.service | 36 + scripts/present-pdf-auto-advance.sh | 163 +++ scripts/start-dev.sh | 5 + scripts/start-display-manager.sh | 43 + scripts/test-display-manager.sh | 210 +++ scripts/test-impressive-loop.sh | 92 ++ scripts/test-impressive.sh | 115 ++ scripts/test-mqtt.sh | 9 + scripts/test-progress-bars.sh | 174 +++ scripts/test-scheduler-fields.sh | 143 ++ scripts/test-screenshot.sh | 27 + scripts/test-utc-timestamps.sh | 149 +++ scripts/test_cdp.py | 75 ++ scripts/test_cdp_origins.py | 76 ++ src/.dockerignore | 23 + src/.env.production.template | 23 + src/.env.template | 27 + src/.gitignore | 96 ++ src/CONTAINER_TRANSITION.md | 168 +++ src/DISPLAY_MANAGER.md | 457 +++++++ src/Dockerfile.production | 31 + src/IMPLEMENTATION_SUMMARY.md | 317 +++++ src/README.md | 274 ++++ src/chrome_autoscroll/content_script.js | 25 + src/chrome_autoscroll/manifest.json | 15 + src/convert-to-container.sh | 213 +++ src/dev-workflow.sh | 107 ++ src/display_manager.py | 1147 +++++++++++++++++ src/docker-compose.production.yml | 65 + src/pi-dev-setup.sh | 319 +++++ src/requirements.txt | 6 + src/simclient.py | 741 +++++++++++ 111 files changed, 8612 insertions(+) create mode 160000 .git.legacy_backup.1761406947 create mode 100644 .git.legacy_backup/COMMIT_EDITMSG create mode 100644 .git.legacy_backup/HEAD create mode 100644 .git.legacy_backup/config create mode 100644 .git.legacy_backup/description create mode 100755 .git.legacy_backup/hooks/applypatch-msg.sample create mode 100755 .git.legacy_backup/hooks/commit-msg.sample create mode 100755 .git.legacy_backup/hooks/fsmonitor-watchman.sample create mode 100755 .git.legacy_backup/hooks/post-update.sample create mode 100755 .git.legacy_backup/hooks/pre-applypatch.sample create mode 100755 .git.legacy_backup/hooks/pre-commit.sample create mode 100755 .git.legacy_backup/hooks/pre-merge-commit.sample create mode 100755 .git.legacy_backup/hooks/pre-push.sample create mode 100755 .git.legacy_backup/hooks/pre-rebase.sample create mode 100755 .git.legacy_backup/hooks/pre-receive.sample create mode 100755 .git.legacy_backup/hooks/prepare-commit-msg.sample create mode 100755 .git.legacy_backup/hooks/push-to-checkout.sample create mode 100755 .git.legacy_backup/hooks/update.sample create mode 100644 .git.legacy_backup/index create mode 100644 .git.legacy_backup/info/exclude create mode 100644 .git.legacy_backup/objects/01/0457920254697451146f4f42e7840de6436b9b create mode 100644 .git.legacy_backup/objects/02/597dc08efe99978c8ee96bb702bc56886fd2dd create mode 100644 .git.legacy_backup/objects/02/730b6639e0d0a18e5562840c2c1493a701929b create mode 100644 .git.legacy_backup/objects/03/145d9c887573bcfb210da615ad2873619610a1 create mode 100644 .git.legacy_backup/objects/06/8751ce3ed59174c8d833c64e94e4b07e691f49 create mode 100644 .git.legacy_backup/objects/11/80fac0edbe982c13f96beba8a6594477182b52 create mode 100644 .git.legacy_backup/objects/14/921ca9fa399923d4ec2d697580c248ad653fbf create mode 100644 .git.legacy_backup/objects/1b/a0cb9a365dbdc55c6f75613187656c171ec29a create mode 100644 .git.legacy_backup/objects/1e/164fd22d16c52e87c877ff9e05138bdec3fb52 create mode 100644 .git.legacy_backup/objects/29/281c7902f6008f791c7a543fb0d363fb50329a create mode 100644 .git.legacy_backup/objects/2f/cd35546ec1ea64264f6f2184e040ff08349bd2 create mode 100644 .git.legacy_backup/objects/31/61c94d983daf107ef341ba0acf7ffe1225da35 create mode 100644 .git.legacy_backup/objects/31/a7997a2e127418ddb7777158cf2e27b254e27a create mode 100644 .git.legacy_backup/objects/31/bc9bd8589c57a7c8b60a60cec86f3dddd6bb30 create mode 100644 .git.legacy_backup/objects/35/e32cfaa3f05d6851106800adb7f785c45aaf21 create mode 100644 .git.legacy_backup/objects/36/c3c46b15ca782ef97216b3000aa561a1583d9d create mode 100644 .git.legacy_backup/objects/3d/e6506a69389f3b73137debe01821bedb1d3c52 create mode 100644 .git.legacy_backup/objects/3e/80068606a4de04d63018f1bd18e13282e4668c create mode 100644 .git.legacy_backup/objects/45/a4a477ea4fc3581598dd1bec64d41f5b6a3f91 create mode 100644 .git.legacy_backup/objects/4b/e8874dc38463929a3fc7d664574f129e14a0b1 create mode 100644 .git.legacy_backup/objects/4d/4d94f03bca62bb0675d1373c3073c19c83b4d6 create mode 100644 .git.legacy_backup/objects/51/9a5207dde4f99146397b78ce30089e6ffa3666 create mode 100644 .git.legacy_backup/objects/54/4c3d769ee73c1b5d5562f4d176417969e4da24 create mode 100644 .git.legacy_backup/objects/58/cfa94809f582eb959e3771e79d2974cd6e0455 create mode 100644 .git.legacy_backup/objects/65/4298d4c891e0e04e80125f17d0113b47c890ff create mode 100644 .git.legacy_backup/objects/67/5cb84421ec8428c32c0dca96a32efadc9e530c create mode 100644 .git.legacy_backup/objects/82/b38f40d3673cb9d5a63f57b111babfb9fdbfbe create mode 100644 .git.legacy_backup/objects/83/3d60a1ea07a6dea979b8a866cca968245dee2f create mode 100644 .git.legacy_backup/objects/88/8930ac2e3692865b9f74f1a49fbdaf54604a35 create mode 100644 .git.legacy_backup/objects/89/c2aa414fe8a90c6541d1f1cefeaf7d47f31052 create mode 100644 .git.legacy_backup/objects/8e/35d15d0cba406dd108d67545fe3e2963fc7150 create mode 100644 .git.legacy_backup/objects/90/d210f0cfa46b14b2d797a156c94163de7b3af3 create mode 100644 .git.legacy_backup/objects/a6/5e860bf0be2eabb47ad53371a096e9e6d95df5 create mode 100644 .git.legacy_backup/objects/af/dacf26f4c9719ba6d1be6615f5e179e119cbdc create mode 100644 .git.legacy_backup/objects/b2/58706e00579e1150ce0abddf2bdc0c7776a029 create mode 100644 .git.legacy_backup/objects/b2/69ce62a7c9054690472d191d9424583ba86b82 create mode 100644 .git.legacy_backup/objects/b3/ff4fb897629e729ff7ba3491bfeac220b26c4b create mode 100644 .git.legacy_backup/objects/b5/af47bc5ffab98ad51dfb058ddc70914203288d create mode 100644 .git.legacy_backup/objects/b8/d2fa01a860287e734c8eb37dee90c6dbb59672 create mode 100644 .git.legacy_backup/objects/c6/a7f80737de32a446fca59c3dc93395f9c2d063 create mode 100644 .git.legacy_backup/objects/d5/ff46a0d92f28bae6613b14c875296a98d2b647 create mode 100644 .git.legacy_backup/objects/d7/1df4449558c5dcc3cf100330abf55be39f2da6 create mode 100644 .git.legacy_backup/objects/d9/3c1a7fd26446a032e68817362ebdf54dcb54a4 create mode 100644 .git.legacy_backup/objects/da/43f2b29ecf071e9b4ffc2fa03482e25d7cf0c6 create mode 100644 .git.legacy_backup/objects/e3/48498f7802ad858dd957f0124f5267b33e4611 create mode 100644 .git.legacy_backup/objects/ec/41cff2525c5e573c1a6f04a8ccb7029911a67f create mode 100644 .git.legacy_backup/objects/f4/414895b2fc70f6cbda62f96a4b7d121598e248 create mode 100644 .git.legacy_backup/objects/fb/d18a6c088ffa700c3f8cfe6de36904b4071506 create mode 100644 .git.legacy_backup/refs/heads/master create mode 100644 .github/copilot-instructions.md create mode 100644 .gitignore create mode 100644 CLEANUP_SUMMARY.md create mode 100644 IMPRESSIVE_INTEGRATION.md create mode 100644 PROGRESS_BAR_IMPLEMENTATION.md create mode 100644 QUICK_REFERENCE.md create mode 100644 README.md create mode 100644 SCHEDULER_FIELDS_SUPPORT.md create mode 100644 TODO.md create mode 100644 WORKSPACE_STATUS.txt create mode 100644 scripts/infoscreen-display.service create mode 100755 scripts/present-pdf-auto-advance.sh create mode 100755 scripts/start-dev.sh create mode 100755 scripts/start-display-manager.sh create mode 100755 scripts/test-display-manager.sh create mode 100755 scripts/test-impressive-loop.sh create mode 100755 scripts/test-impressive.sh create mode 100755 scripts/test-mqtt.sh create mode 100755 scripts/test-progress-bars.sh create mode 100755 scripts/test-scheduler-fields.sh create mode 100755 scripts/test-screenshot.sh create mode 100755 scripts/test-utc-timestamps.sh create mode 100755 scripts/test_cdp.py create mode 100644 scripts/test_cdp_origins.py create mode 100644 src/.dockerignore create mode 100644 src/.env.production.template create mode 100644 src/.env.template create mode 100644 src/.gitignore create mode 100644 src/CONTAINER_TRANSITION.md create mode 100644 src/DISPLAY_MANAGER.md create mode 100644 src/Dockerfile.production create mode 100644 src/IMPLEMENTATION_SUMMARY.md create mode 100644 src/README.md create mode 100644 src/chrome_autoscroll/content_script.js create mode 100644 src/chrome_autoscroll/manifest.json create mode 100755 src/convert-to-container.sh create mode 100755 src/dev-workflow.sh create mode 100644 src/display_manager.py create mode 100644 src/docker-compose.production.yml create mode 100755 src/pi-dev-setup.sh create mode 100644 src/requirements.txt create mode 100644 src/simclient.py diff --git a/.git.legacy_backup.1761406947 b/.git.legacy_backup.1761406947 new file mode 160000 index 0000000..2a4701f --- /dev/null +++ b/.git.legacy_backup.1761406947 @@ -0,0 +1 @@ +Subproject commit 2a4701fc5d760de29e5f91056f584ad0cf76d114 diff --git a/.git.legacy_backup/COMMIT_EDITMSG b/.git.legacy_backup/COMMIT_EDITMSG new file mode 100644 index 0000000..d6f573b --- /dev/null +++ b/.git.legacy_backup/COMMIT_EDITMSG @@ -0,0 +1 @@ +Initial import: clean snapshot from /home/olafn/infoscreen-dev (2025-10-25) diff --git a/.git.legacy_backup/HEAD b/.git.legacy_backup/HEAD new file mode 100644 index 0000000..cb089cd --- /dev/null +++ b/.git.legacy_backup/HEAD @@ -0,0 +1 @@ +ref: refs/heads/master diff --git a/.git.legacy_backup/config b/.git.legacy_backup/config new file mode 100644 index 0000000..515f483 --- /dev/null +++ b/.git.legacy_backup/config @@ -0,0 +1,5 @@ +[core] + repositoryformatversion = 0 + filemode = true + bare = false + logallrefupdates = true diff --git a/.git.legacy_backup/description b/.git.legacy_backup/description new file mode 100644 index 0000000..498b267 --- /dev/null +++ b/.git.legacy_backup/description @@ -0,0 +1 @@ +Unnamed repository; edit this file 'description' to name the repository. diff --git a/.git.legacy_backup/hooks/applypatch-msg.sample b/.git.legacy_backup/hooks/applypatch-msg.sample new file mode 100755 index 0000000..a5d7b84 --- /dev/null +++ b/.git.legacy_backup/hooks/applypatch-msg.sample @@ -0,0 +1,15 @@ +#!/bin/sh +# +# An example hook script to check the commit log message taken by +# applypatch from an e-mail message. +# +# The hook should exit with non-zero status after issuing an +# appropriate message if it wants to stop the commit. The hook is +# allowed to edit the commit message file. +# +# To enable this hook, rename this file to "applypatch-msg". + +. git-sh-setup +commitmsg="$(git rev-parse --git-path hooks/commit-msg)" +test -x "$commitmsg" && exec "$commitmsg" ${1+"$@"} +: diff --git a/.git.legacy_backup/hooks/commit-msg.sample b/.git.legacy_backup/hooks/commit-msg.sample new file mode 100755 index 0000000..b58d118 --- /dev/null +++ b/.git.legacy_backup/hooks/commit-msg.sample @@ -0,0 +1,24 @@ +#!/bin/sh +# +# An example hook script to check the commit log message. +# Called by "git commit" with one argument, the name of the file +# that has the commit message. The hook should exit with non-zero +# status after issuing an appropriate message if it wants to stop the +# commit. The hook is allowed to edit the commit message file. +# +# To enable this hook, rename this file to "commit-msg". + +# Uncomment the below to add a Signed-off-by line to the message. +# Doing this in a hook is a bad idea in general, but the prepare-commit-msg +# hook is more suited to it. +# +# SOB=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p') +# grep -qs "^$SOB" "$1" || echo "$SOB" >> "$1" + +# This example catches duplicate Signed-off-by lines. + +test "" = "$(grep '^Signed-off-by: ' "$1" | + sort | uniq -c | sed -e '/^[ ]*1[ ]/d')" || { + echo >&2 Duplicate Signed-off-by lines. + exit 1 +} diff --git a/.git.legacy_backup/hooks/fsmonitor-watchman.sample b/.git.legacy_backup/hooks/fsmonitor-watchman.sample new file mode 100755 index 0000000..23e856f --- /dev/null +++ b/.git.legacy_backup/hooks/fsmonitor-watchman.sample @@ -0,0 +1,174 @@ +#!/usr/bin/perl + +use strict; +use warnings; +use IPC::Open2; + +# An example hook script to integrate Watchman +# (https://facebook.github.io/watchman/) with git to speed up detecting +# new and modified files. +# +# The hook is passed a version (currently 2) and last update token +# formatted as a string and outputs to stdout a new update token and +# all files that have been modified since the update token. Paths must +# be relative to the root of the working tree and separated by a single NUL. +# +# To enable this hook, rename this file to "query-watchman" and set +# 'git config core.fsmonitor .git/hooks/query-watchman' +# +my ($version, $last_update_token) = @ARGV; + +# Uncomment for debugging +# print STDERR "$0 $version $last_update_token\n"; + +# Check the hook interface version +if ($version ne 2) { + die "Unsupported query-fsmonitor hook version '$version'.\n" . + "Falling back to scanning...\n"; +} + +my $git_work_tree = get_working_dir(); + +my $retry = 1; + +my $json_pkg; +eval { + require JSON::XS; + $json_pkg = "JSON::XS"; + 1; +} or do { + require JSON::PP; + $json_pkg = "JSON::PP"; +}; + +launch_watchman(); + +sub launch_watchman { + my $o = watchman_query(); + if (is_work_tree_watched($o)) { + output_result($o->{clock}, @{$o->{files}}); + } +} + +sub output_result { + my ($clockid, @files) = @_; + + # Uncomment for debugging watchman output + # open (my $fh, ">", ".git/watchman-output.out"); + # binmode $fh, ":utf8"; + # print $fh "$clockid\n@files\n"; + # close $fh; + + binmode STDOUT, ":utf8"; + print $clockid; + print "\0"; + local $, = "\0"; + print @files; +} + +sub watchman_clock { + my $response = qx/watchman clock "$git_work_tree"/; + die "Failed to get clock id on '$git_work_tree'.\n" . + "Falling back to scanning...\n" if $? != 0; + + return $json_pkg->new->utf8->decode($response); +} + +sub watchman_query { + my $pid = open2(\*CHLD_OUT, \*CHLD_IN, 'watchman -j --no-pretty') + or die "open2() failed: $!\n" . + "Falling back to scanning...\n"; + + # In the query expression below we're asking for names of files that + # changed since $last_update_token but not from the .git folder. + # + # To accomplish this, we're using the "since" generator to use the + # recency index to select candidate nodes and "fields" to limit the + # output to file names only. Then we're using the "expression" term to + # further constrain the results. + my $last_update_line = ""; + if (substr($last_update_token, 0, 1) eq "c") { + $last_update_token = "\"$last_update_token\""; + $last_update_line = qq[\n"since": $last_update_token,]; + } + my $query = <<" END"; + ["query", "$git_work_tree", {$last_update_line + "fields": ["name"], + "expression": ["not", ["dirname", ".git"]] + }] + END + + # Uncomment for debugging the watchman query + # open (my $fh, ">", ".git/watchman-query.json"); + # print $fh $query; + # close $fh; + + print CHLD_IN $query; + close CHLD_IN; + my $response = do {local $/; }; + + # Uncomment for debugging the watch response + # open ($fh, ">", ".git/watchman-response.json"); + # print $fh $response; + # close $fh; + + die "Watchman: command returned no output.\n" . + "Falling back to scanning...\n" if $response eq ""; + die "Watchman: command returned invalid output: $response\n" . + "Falling back to scanning...\n" unless $response =~ /^\{/; + + return $json_pkg->new->utf8->decode($response); +} + +sub is_work_tree_watched { + my ($output) = @_; + my $error = $output->{error}; + if ($retry > 0 and $error and $error =~ m/unable to resolve root .* directory (.*) is not watched/) { + $retry--; + my $response = qx/watchman watch "$git_work_tree"/; + die "Failed to make watchman watch '$git_work_tree'.\n" . + "Falling back to scanning...\n" if $? != 0; + $output = $json_pkg->new->utf8->decode($response); + $error = $output->{error}; + die "Watchman: $error.\n" . + "Falling back to scanning...\n" if $error; + + # Uncomment for debugging watchman output + # open (my $fh, ">", ".git/watchman-output.out"); + # close $fh; + + # Watchman will always return all files on the first query so + # return the fast "everything is dirty" flag to git and do the + # Watchman query just to get it over with now so we won't pay + # the cost in git to look up each individual file. + my $o = watchman_clock(); + $error = $output->{error}; + + die "Watchman: $error.\n" . + "Falling back to scanning...\n" if $error; + + output_result($o->{clock}, ("/")); + $last_update_token = $o->{clock}; + + eval { launch_watchman() }; + return 0; + } + + die "Watchman: $error.\n" . + "Falling back to scanning...\n" if $error; + + return 1; +} + +sub get_working_dir { + my $working_dir; + if ($^O =~ 'msys' || $^O =~ 'cygwin') { + $working_dir = Win32::GetCwd(); + $working_dir =~ tr/\\/\//; + } else { + require Cwd; + $working_dir = Cwd::cwd(); + } + + return $working_dir; +} diff --git a/.git.legacy_backup/hooks/post-update.sample b/.git.legacy_backup/hooks/post-update.sample new file mode 100755 index 0000000..ec17ec1 --- /dev/null +++ b/.git.legacy_backup/hooks/post-update.sample @@ -0,0 +1,8 @@ +#!/bin/sh +# +# An example hook script to prepare a packed repository for use over +# dumb transports. +# +# To enable this hook, rename this file to "post-update". + +exec git update-server-info diff --git a/.git.legacy_backup/hooks/pre-applypatch.sample b/.git.legacy_backup/hooks/pre-applypatch.sample new file mode 100755 index 0000000..4142082 --- /dev/null +++ b/.git.legacy_backup/hooks/pre-applypatch.sample @@ -0,0 +1,14 @@ +#!/bin/sh +# +# An example hook script to verify what is about to be committed +# by applypatch from an e-mail message. +# +# The hook should exit with non-zero status after issuing an +# appropriate message if it wants to stop the commit. +# +# To enable this hook, rename this file to "pre-applypatch". + +. git-sh-setup +precommit="$(git rev-parse --git-path hooks/pre-commit)" +test -x "$precommit" && exec "$precommit" ${1+"$@"} +: diff --git a/.git.legacy_backup/hooks/pre-commit.sample b/.git.legacy_backup/hooks/pre-commit.sample new file mode 100755 index 0000000..e144712 --- /dev/null +++ b/.git.legacy_backup/hooks/pre-commit.sample @@ -0,0 +1,49 @@ +#!/bin/sh +# +# An example hook script to verify what is about to be committed. +# Called by "git commit" with no arguments. The hook should +# exit with non-zero status after issuing an appropriate message if +# it wants to stop the commit. +# +# To enable this hook, rename this file to "pre-commit". + +if git rev-parse --verify HEAD >/dev/null 2>&1 +then + against=HEAD +else + # Initial commit: diff against an empty tree object + against=$(git hash-object -t tree /dev/null) +fi + +# If you want to allow non-ASCII filenames set this variable to true. +allownonascii=$(git config --type=bool hooks.allownonascii) + +# Redirect output to stderr. +exec 1>&2 + +# Cross platform projects tend to avoid non-ASCII filenames; prevent +# them from being added to the repository. We exploit the fact that the +# printable range starts at the space character and ends with tilde. +if [ "$allownonascii" != "true" ] && + # Note that the use of brackets around a tr range is ok here, (it's + # even required, for portability to Solaris 10's /usr/bin/tr), since + # the square bracket bytes happen to fall in the designated range. + test $(git diff --cached --name-only --diff-filter=A -z $against | + LC_ALL=C tr -d '[ -~]\0' | wc -c) != 0 +then + cat <<\EOF +Error: Attempt to add a non-ASCII file name. + +This can cause problems if you want to work with people on other platforms. + +To be portable it is advisable to rename the file. + +If you know what you are doing you can disable this check using: + + git config hooks.allownonascii true +EOF + exit 1 +fi + +# If there are whitespace errors, print the offending file names and fail. +exec git diff-index --check --cached $against -- diff --git a/.git.legacy_backup/hooks/pre-merge-commit.sample b/.git.legacy_backup/hooks/pre-merge-commit.sample new file mode 100755 index 0000000..399eab1 --- /dev/null +++ b/.git.legacy_backup/hooks/pre-merge-commit.sample @@ -0,0 +1,13 @@ +#!/bin/sh +# +# An example hook script to verify what is about to be committed. +# Called by "git merge" with no arguments. The hook should +# exit with non-zero status after issuing an appropriate message to +# stderr if it wants to stop the merge commit. +# +# To enable this hook, rename this file to "pre-merge-commit". + +. git-sh-setup +test -x "$GIT_DIR/hooks/pre-commit" && + exec "$GIT_DIR/hooks/pre-commit" +: diff --git a/.git.legacy_backup/hooks/pre-push.sample b/.git.legacy_backup/hooks/pre-push.sample new file mode 100755 index 0000000..4ce688d --- /dev/null +++ b/.git.legacy_backup/hooks/pre-push.sample @@ -0,0 +1,53 @@ +#!/bin/sh + +# An example hook script to verify what is about to be pushed. Called by "git +# push" after it has checked the remote status, but before anything has been +# pushed. If this script exits with a non-zero status nothing will be pushed. +# +# This hook is called with the following parameters: +# +# $1 -- Name of the remote to which the push is being done +# $2 -- URL to which the push is being done +# +# If pushing without using a named remote those arguments will be equal. +# +# Information about the commits which are being pushed is supplied as lines to +# the standard input in the form: +# +# +# +# This sample shows how to prevent push of commits where the log message starts +# with "WIP" (work in progress). + +remote="$1" +url="$2" + +zero=$(git hash-object --stdin &2 "Found WIP commit in $local_ref, not pushing" + exit 1 + fi + fi +done + +exit 0 diff --git a/.git.legacy_backup/hooks/pre-rebase.sample b/.git.legacy_backup/hooks/pre-rebase.sample new file mode 100755 index 0000000..6cbef5c --- /dev/null +++ b/.git.legacy_backup/hooks/pre-rebase.sample @@ -0,0 +1,169 @@ +#!/bin/sh +# +# Copyright (c) 2006, 2008 Junio C Hamano +# +# The "pre-rebase" hook is run just before "git rebase" starts doing +# its job, and can prevent the command from running by exiting with +# non-zero status. +# +# The hook is called with the following parameters: +# +# $1 -- the upstream the series was forked from. +# $2 -- the branch being rebased (or empty when rebasing the current branch). +# +# This sample shows how to prevent topic branches that are already +# merged to 'next' branch from getting rebased, because allowing it +# would result in rebasing already published history. + +publish=next +basebranch="$1" +if test "$#" = 2 +then + topic="refs/heads/$2" +else + topic=`git symbolic-ref HEAD` || + exit 0 ;# we do not interrupt rebasing detached HEAD +fi + +case "$topic" in +refs/heads/??/*) + ;; +*) + exit 0 ;# we do not interrupt others. + ;; +esac + +# Now we are dealing with a topic branch being rebased +# on top of master. Is it OK to rebase it? + +# Does the topic really exist? +git show-ref -q "$topic" || { + echo >&2 "No such branch $topic" + exit 1 +} + +# Is topic fully merged to master? +not_in_master=`git rev-list --pretty=oneline ^master "$topic"` +if test -z "$not_in_master" +then + echo >&2 "$topic is fully merged to master; better remove it." + exit 1 ;# we could allow it, but there is no point. +fi + +# Is topic ever merged to next? If so you should not be rebasing it. +only_next_1=`git rev-list ^master "^$topic" ${publish} | sort` +only_next_2=`git rev-list ^master ${publish} | sort` +if test "$only_next_1" = "$only_next_2" +then + not_in_topic=`git rev-list "^$topic" master` + if test -z "$not_in_topic" + then + echo >&2 "$topic is already up to date with master" + exit 1 ;# we could allow it, but there is no point. + else + exit 0 + fi +else + not_in_next=`git rev-list --pretty=oneline ^${publish} "$topic"` + /usr/bin/perl -e ' + my $topic = $ARGV[0]; + my $msg = "* $topic has commits already merged to public branch:\n"; + my (%not_in_next) = map { + /^([0-9a-f]+) /; + ($1 => 1); + } split(/\n/, $ARGV[1]); + for my $elem (map { + /^([0-9a-f]+) (.*)$/; + [$1 => $2]; + } split(/\n/, $ARGV[2])) { + if (!exists $not_in_next{$elem->[0]}) { + if ($msg) { + print STDERR $msg; + undef $msg; + } + print STDERR " $elem->[1]\n"; + } + } + ' "$topic" "$not_in_next" "$not_in_master" + exit 1 +fi + +<<\DOC_END + +This sample hook safeguards topic branches that have been +published from being rewound. + +The workflow assumed here is: + + * Once a topic branch forks from "master", "master" is never + merged into it again (either directly or indirectly). + + * Once a topic branch is fully cooked and merged into "master", + it is deleted. If you need to build on top of it to correct + earlier mistakes, a new topic branch is created by forking at + the tip of the "master". This is not strictly necessary, but + it makes it easier to keep your history simple. + + * Whenever you need to test or publish your changes to topic + branches, merge them into "next" branch. + +The script, being an example, hardcodes the publish branch name +to be "next", but it is trivial to make it configurable via +$GIT_DIR/config mechanism. + +With this workflow, you would want to know: + +(1) ... if a topic branch has ever been merged to "next". Young + topic branches can have stupid mistakes you would rather + clean up before publishing, and things that have not been + merged into other branches can be easily rebased without + affecting other people. But once it is published, you would + not want to rewind it. + +(2) ... if a topic branch has been fully merged to "master". + Then you can delete it. More importantly, you should not + build on top of it -- other people may already want to + change things related to the topic as patches against your + "master", so if you need further changes, it is better to + fork the topic (perhaps with the same name) afresh from the + tip of "master". + +Let's look at this example: + + o---o---o---o---o---o---o---o---o---o "next" + / / / / + / a---a---b A / / + / / / / + / / c---c---c---c B / + / / / \ / + / / / b---b C \ / + / / / / \ / + ---o---o---o---o---o---o---o---o---o---o---o "master" + + +A, B and C are topic branches. + + * A has one fix since it was merged up to "next". + + * B has finished. It has been fully merged up to "master" and "next", + and is ready to be deleted. + + * C has not merged to "next" at all. + +We would want to allow C to be rebased, refuse A, and encourage +B to be deleted. + +To compute (1): + + git rev-list ^master ^topic next + git rev-list ^master next + + if these match, topic has not merged in next at all. + +To compute (2): + + git rev-list master..topic + + if this is empty, it is fully merged to "master". + +DOC_END diff --git a/.git.legacy_backup/hooks/pre-receive.sample b/.git.legacy_backup/hooks/pre-receive.sample new file mode 100755 index 0000000..a1fd29e --- /dev/null +++ b/.git.legacy_backup/hooks/pre-receive.sample @@ -0,0 +1,24 @@ +#!/bin/sh +# +# An example hook script to make use of push options. +# The example simply echoes all push options that start with 'echoback=' +# and rejects all pushes when the "reject" push option is used. +# +# To enable this hook, rename this file to "pre-receive". + +if test -n "$GIT_PUSH_OPTION_COUNT" +then + i=0 + while test "$i" -lt "$GIT_PUSH_OPTION_COUNT" + do + eval "value=\$GIT_PUSH_OPTION_$i" + case "$value" in + echoback=*) + echo "echo from the pre-receive-hook: ${value#*=}" >&2 + ;; + reject) + exit 1 + esac + i=$((i + 1)) + done +fi diff --git a/.git.legacy_backup/hooks/prepare-commit-msg.sample b/.git.legacy_backup/hooks/prepare-commit-msg.sample new file mode 100755 index 0000000..10fa14c --- /dev/null +++ b/.git.legacy_backup/hooks/prepare-commit-msg.sample @@ -0,0 +1,42 @@ +#!/bin/sh +# +# An example hook script to prepare the commit log message. +# Called by "git commit" with the name of the file that has the +# commit message, followed by the description of the commit +# message's source. The hook's purpose is to edit the commit +# message file. If the hook fails with a non-zero status, +# the commit is aborted. +# +# To enable this hook, rename this file to "prepare-commit-msg". + +# This hook includes three examples. The first one removes the +# "# Please enter the commit message..." help message. +# +# The second includes the output of "git diff --name-status -r" +# into the message, just before the "git status" output. It is +# commented because it doesn't cope with --amend or with squashed +# commits. +# +# The third example adds a Signed-off-by line to the message, that can +# still be edited. This is rarely a good idea. + +COMMIT_MSG_FILE=$1 +COMMIT_SOURCE=$2 +SHA1=$3 + +/usr/bin/perl -i.bak -ne 'print unless(m/^. Please enter the commit message/..m/^#$/)' "$COMMIT_MSG_FILE" + +# case "$COMMIT_SOURCE,$SHA1" in +# ,|template,) +# /usr/bin/perl -i.bak -pe ' +# print "\n" . `git diff --cached --name-status -r` +# if /^#/ && $first++ == 0' "$COMMIT_MSG_FILE" ;; +# *) ;; +# esac + +# SOB=$(git var GIT_COMMITTER_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p') +# git interpret-trailers --in-place --trailer "$SOB" "$COMMIT_MSG_FILE" +# if test -z "$COMMIT_SOURCE" +# then +# /usr/bin/perl -i.bak -pe 'print "\n" if !$first_line++' "$COMMIT_MSG_FILE" +# fi diff --git a/.git.legacy_backup/hooks/push-to-checkout.sample b/.git.legacy_backup/hooks/push-to-checkout.sample new file mode 100755 index 0000000..af5a0c0 --- /dev/null +++ b/.git.legacy_backup/hooks/push-to-checkout.sample @@ -0,0 +1,78 @@ +#!/bin/sh + +# An example hook script to update a checked-out tree on a git push. +# +# This hook is invoked by git-receive-pack(1) when it reacts to git +# push and updates reference(s) in its repository, and when the push +# tries to update the branch that is currently checked out and the +# receive.denyCurrentBranch configuration variable is set to +# updateInstead. +# +# By default, such a push is refused if the working tree and the index +# of the remote repository has any difference from the currently +# checked out commit; when both the working tree and the index match +# the current commit, they are updated to match the newly pushed tip +# of the branch. This hook is to be used to override the default +# behaviour; however the code below reimplements the default behaviour +# as a starting point for convenient modification. +# +# The hook receives the commit with which the tip of the current +# branch is going to be updated: +commit=$1 + +# It can exit with a non-zero status to refuse the push (when it does +# so, it must not modify the index or the working tree). +die () { + echo >&2 "$*" + exit 1 +} + +# Or it can make any necessary changes to the working tree and to the +# index to bring them to the desired state when the tip of the current +# branch is updated to the new commit, and exit with a zero status. +# +# For example, the hook can simply run git read-tree -u -m HEAD "$1" +# in order to emulate git fetch that is run in the reverse direction +# with git push, as the two-tree form of git read-tree -u -m is +# essentially the same as git switch or git checkout that switches +# branches while keeping the local changes in the working tree that do +# not interfere with the difference between the branches. + +# The below is a more-or-less exact translation to shell of the C code +# for the default behaviour for git's push-to-checkout hook defined in +# the push_to_deploy() function in builtin/receive-pack.c. +# +# Note that the hook will be executed from the repository directory, +# not from the working tree, so if you want to perform operations on +# the working tree, you will have to adapt your code accordingly, e.g. +# by adding "cd .." or using relative paths. + +if ! git update-index -q --ignore-submodules --refresh +then + die "Up-to-date check failed" +fi + +if ! git diff-files --quiet --ignore-submodules -- +then + die "Working directory has unstaged changes" +fi + +# This is a rough translation of: +# +# head_has_history() ? "HEAD" : EMPTY_TREE_SHA1_HEX +if git cat-file -e HEAD 2>/dev/null +then + head=HEAD +else + head=$(git hash-object -t tree --stdin &2 + echo " (if you want, you could supply GIT_DIR then run" >&2 + echo " $0 )" >&2 + exit 1 +fi + +if [ -z "$refname" -o -z "$oldrev" -o -z "$newrev" ]; then + echo "usage: $0 " >&2 + exit 1 +fi + +# --- Config +allowunannotated=$(git config --type=bool hooks.allowunannotated) +allowdeletebranch=$(git config --type=bool hooks.allowdeletebranch) +denycreatebranch=$(git config --type=bool hooks.denycreatebranch) +allowdeletetag=$(git config --type=bool hooks.allowdeletetag) +allowmodifytag=$(git config --type=bool hooks.allowmodifytag) + +# check for no description +projectdesc=$(sed -e '1q' "$GIT_DIR/description") +case "$projectdesc" in +"Unnamed repository"* | "") + echo "*** Project description file hasn't been set" >&2 + exit 1 + ;; +esac + +# --- Check types +# if $newrev is 0000...0000, it's a commit to delete a ref. +zero=$(git hash-object --stdin &2 + echo "*** Use 'git tag [ -a | -s ]' for tags you want to propagate." >&2 + exit 1 + fi + ;; + refs/tags/*,delete) + # delete tag + if [ "$allowdeletetag" != "true" ]; then + echo "*** Deleting a tag is not allowed in this repository" >&2 + exit 1 + fi + ;; + refs/tags/*,tag) + # annotated tag + if [ "$allowmodifytag" != "true" ] && git rev-parse $refname > /dev/null 2>&1 + then + echo "*** Tag '$refname' already exists." >&2 + echo "*** Modifying a tag is not allowed in this repository." >&2 + exit 1 + fi + ;; + refs/heads/*,commit) + # branch + if [ "$oldrev" = "$zero" -a "$denycreatebranch" = "true" ]; then + echo "*** Creating a branch is not allowed in this repository" >&2 + exit 1 + fi + ;; + refs/heads/*,delete) + # delete branch + if [ "$allowdeletebranch" != "true" ]; then + echo "*** Deleting a branch is not allowed in this repository" >&2 + exit 1 + fi + ;; + refs/remotes/*,commit) + # tracking branch + ;; + refs/remotes/*,delete) + # delete tracking branch + if [ "$allowdeletebranch" != "true" ]; then + echo "*** Deleting a tracking branch is not allowed in this repository" >&2 + exit 1 + fi + ;; + *) + # Anything else (is there anything else?) + echo "*** Update hook: unknown type of update to ref $refname of type $newrev_type" >&2 + exit 1 + ;; +esac + +# --- Finished +exit 0 diff --git a/.git.legacy_backup/index b/.git.legacy_backup/index new file mode 100644 index 0000000000000000000000000000000000000000..47cd9efbfadfd29944e46fb0b9793939eacae099 GIT binary patch literal 4106 zcmai%2~<;88pkgI0TE^ZgBy!d9R)Q3RJ2wQV+ar-3ok)%l*W*}gh!Sa@?L`IajB(h zJBs4CAlLvSvP{QAi&}SWrCQV$gsN354lYHjwu7Uz!!kHG%M%`wPR_~sa!&Go-~aya zcklNlo{w+=01Wt^k=^$%v&W{CZYly7SB6VDRt7*j{Mz-g{p|~;C%W`yntkqDWJM$J zj3rl_%`Hse&sJk3TZ^jYihNm?T%j=;;6t`ocHfULz0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>QPW!@7}LqRz`+UPDQ60R9NyiQBgfFM_-A2uA_(~ISc@?|cIOZ_$Iw-Hmi2c~1*UEnl zb;8S{^IWe4mR~8En|bEK3fv@*+Kg()hMX?}f3WGL%}!2u3OX+!GCV9OpYbc$o*%SY z8u#gUieB-o61ZQ`Pp$|~9(*C}#ZrVLl<=tu=lA*?sigBGREJ-Qj_=K~7|VV;Ij88{ zlk=16waH+Nl^@TSh*LPrWCD(mlgL9HE#8T4==$I~b2Y_wh;y*F%N7u$*FJ3@7kc)G z;1~pqw{dM{pu)81pxtwF-;pXhck1+`b&02CJtsc89^5-(+Z{vEV%M;3@Lqy?>EqbY zkyt3>}opj}rXfVynQ)C-)9V)Z7b$I-6trkx0dJ=Yfnf)}fa|q{oa_D(n-rIP1 z`=amEF(fJwo+n6iyLvO0h0Pj_Dn(-j>0MUs^hUBze5G$E9Xv*g7Jm z@bKDSc3k}7=pG}y_ux9vxIsUkeIpncIR z&pD;7_BwZr4>D>xv0tfHy`zGeK2)^#cM{q)xX#^6z7KvGzdPf?orY##*T_%0mOm(C zRe?~OUR#|*FLVZ+7+mY@e4W>6Z;`>Q(Zh$@;(OeT| zM0Kzd3HsbTjNV*2SJRbRf_St&>@G@}zh+faq^AY%nX3Z6RxW|*6j}^YZB0dr@OV(} z-@u&NlV*FlxTWu8NHH>%iHjCLD)8yxYD(cVAnNT&QC5?}6r z|HzFu4iA_$Dbg$Ibm`5E{pr<>pL?xrYQ$sPZk&pA{3Qla@cVkKDXaR@h=d)9tntCS zrerLr(QI_IJ`gnr{@_;3g!Qe;gz{M(TgJ|1pXm}@kyiF-dgh&ITaWfuC(J+YUDG<_ IU_i?M0Qv{E^#A|> literal 0 HcmV?d00001 diff --git a/.git.legacy_backup/info/exclude b/.git.legacy_backup/info/exclude new file mode 100644 index 0000000..a5196d1 --- /dev/null +++ b/.git.legacy_backup/info/exclude @@ -0,0 +1,6 @@ +# git ls-files --others --exclude-from=.git/info/exclude +# Lines that start with '#' are comments. +# For a project mostly in C, the following would be a good set of +# exclude patterns (uncomment them if you want to use them): +# *.[oa] +# *~ diff --git a/.git.legacy_backup/objects/01/0457920254697451146f4f42e7840de6436b9b b/.git.legacy_backup/objects/01/0457920254697451146f4f42e7840de6436b9b new file mode 100644 index 0000000000000000000000000000000000000000..ca1eee2b3014cba04410b40c3a85a6b46b83a962 GIT binary patch literal 508 zcmV8Ghi?@GXMewz4Xiyy`0qa#N^8Oq{QUx(gFr8cg8=lWxS8( z#ZP3-kMO#1zU-oi30!eTX%fSx%yUW0PqMmAaMzWTouU$9y&}8G(7?dV!~|?!W_n(J zQ7Xf+F)>9v@EWT`@=rH)my5r z8W%2@_VU@y*soAc0YU!mAYJiJjzRH26MS5KUHwAfI!zzz{961WHX~3VgJJFV@2y9o z)+<7F28Mb%d&dX4y153q`Z>FT?D>7MD~F^1R{@WG&%fNqnJin_McJULgIpb5e8Gwg z6Hofiuw5@u_t|k5*ZKN?LaMh+p^Ac?JzQNveO!a$-8@}=T!Mif4+!uN3IUnT6j^(q z@88VnJ$)~;w=?Yt>&U-!7pg79-^CxSq?kL+^1+3LeW6J$JUSwimorY94OJ5EALJbz z;OOic9}M(dXs}*MMG3>z|85Iz>TB$JmS`<RsQWPuC~ucXj~~AZayjt&u4cyLPDlk55njvO_oFOhkDsGP;x^ zjx^omX{s{gc{@9Fy%5<#iU-fToe7f3MCmXSBB3yrA~6)?M$H2w!yt~Alx9L>ztDuQ zG;!oK?;9`4fPk*dE+z%&8cL6zelXykq#DOXpaxU{vTQ;?Y$9A@+9PKq`@du%X$peJdK4B1#4C* zxn{ME_*gf}=P93kkY=WG1BJy#WLWo(nT6MiE?AEPr8VDvzOvRNQ}Z=b1(~QU8`VtI z^N7gbFn~`l@+@PsvSki*EF(Ve>_a9C!h2@KooyNl)Xrf!zufJl4vZ*vt1z^rLorkn zsCI+{*O{EkB!~-DTwTyaWo#+zWQ90$6a?I3k$^x3m*?~H1WLI1b@ z;OwIR)7{Ha$605ojhIucrp_U3S6FEQy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*XUnP~0Cd*{xxZQQqI zCz5RO;Rt>qv2$8Y(oWDaf%U$VDHt>XN6{M17I)w)u#@CxIxa;6aX{(t4XOhDUikZi zs)mG8$4|^0m$UU$=v*mqnLD5zbWd)xF?>wC*es}qevj|p-F$lg`V^F-Fk8`N=R<1# zQQ6Sjq&psraV{nMBrHJ6prL>klQRaZJ1Kjw5sVy)jE&T&fe0+XTWXOUxHjrsZ*;qK zHU(#5rnm@zPf*bLshK~y6+7+vsgDA7r^VDB(pFLK*gHtsXrt4iNT9yvz?~)dlqtmZ#g|-DkmqAV^j~G!rjHpB!Y>l6KDY9U33NQcg{|YP<#)R#Nx^ ztrbD-(ec3A|Hr9Do+Qhf8blv>BFzVp{GmKvQeFOfOc1y@79$P`!SiYuH#L&njdH!%WQF|?5^BoL69iN{pPO8(zN%3%I>EGAPqXP|!cUnT| z*n96nBGE+flXyA~DYtwe9}q4aGkOc-Kiquye0}x!`LYG9v~JG zIWw@h@Hyz6Q$74r#~_!j>hvR8U-(0fhD0L%2HjDl&a+~GJ1=UlXl&{9}X zZ$!dC>A-!b)3{6q@$MfYDQAC0G=3sq4i~CJn7qe6^0!pweK>AIM8Ctz95VN8NLFJw z3xpn!eKEY8Z(Rc*wJa&(q+vILKYQ)Z_V-`Go;R8IX|tif`@Gcu^=471Eru# z`Ojc8;@&KJ2@P@viV8>h2SMiKJ+r55UfBwZz+&&pEm}}ur}NMOlWzsjz}FVLq{h-L z;YR~c%K-baHwt()F50`W&At5~ujTzT{>pEJ`tIud^7?AgsnP9=4W@11ET!|>xKwEy s@jF45tzAy(bzUKy8>p&k_J%FvHwUW~ot>P$s!mU;vsbf!0NZ0LP6S4KH2?qr literal 0 HcmV?d00001 diff --git a/.git.legacy_backup/objects/03/145d9c887573bcfb210da615ad2873619610a1 b/.git.legacy_backup/objects/03/145d9c887573bcfb210da615ad2873619610a1 new file mode 100644 index 0000000000000000000000000000000000000000..3f42ef3f1b4a58bce8e14f4f781f883c52aab0d3 GIT binary patch literal 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J2i0w~5%kPc4PD8qKbw%Gtui>TdkpZ-S14N*1cQA0vUGD1+ zG+oBmp!PBC)!W=!*ThM^z~0r{opmQDcKz;G^jXdqYRbmCUZ-YbB{1rgR|_tK{)jd; z^yP{UH@!TgsLu^vDb@G?B3ZgOiBs~-5Y+YNoXhH#BFDy!&UT$xl7$9lOssx13x=oc zF&YtXq;FK1LWJsb;7(k*8y5Pv@~FZdfBnAZQk<11L9}SvW4A*CjI$saU^ zX|^HS>nLq-uXjMD>ZHZZ7)P6fXum@beX-yhi*%JUKkXXU>re2_pJ}*~&6@HfS`Rp( z;BRPt+TNK(X(k6n_7NIwXK_K>&t!Px&nlj8^L>fzHHaRLFcZd!)dn`lJnlhpZN#_t zhKt$Zh}t literal 0 HcmV?d00001 diff --git a/.git.legacy_backup/objects/06/8751ce3ed59174c8d833c64e94e4b07e691f49 b/.git.legacy_backup/objects/06/8751ce3ed59174c8d833c64e94e4b07e691f49 new file mode 100644 index 0000000000000000000000000000000000000000..3da07aaf4fbe08266e6ea305bb978f72ad3858f3 GIT binary patch literal 590 zcmV-U0!8v|IBDoEsEd$9ZBWx#Ng4@Nl{K-)%}{5?%#8D( z>K`DnKw^iw;vW#7!w=9;;QEo5Q@pS(-PgJ2oI4KX7;3eXH!n&D)iD>n*&|t9MdO3pZCp0a+6j!EB(1z^zLY!7_N_!q zixB2bBv?<6-+%u7^%XK^xVSBnQ>j#}Jl9e3Bl8R>DNP-A#$dk^G$+iv10KMPD-+WY z5Fb}kOp!8R3$Bqkj9$Y5*a=bV#Voja3ueLu0emuGe|~&{(KCI7G^j}|e4q)4O^>Zw zCuCGJK*gwGzzxi~nbaX#nu!!AU{4{TE`3>9*#eVlB;d&!4bSjdQuxdoM9WxtiL~p% zsl8}kv&+Li??oB{>{Jl&e`Kson~MkqB8px1_v+F+20BJh=efW&BtAY;>{HAY^HZ~* zU3Gv)QOG@NxD>jaX=Z=kKrKLAL^3(5%!jA-<1Hng9>4uwMN-5#?={34jfUdoC00)S z+COvl3Q=+aKAu}Bqtrlnhmn$gj7&>G@Fvjd_xP#XTUie)ueLYV!$FvqDwCc6>c(>> cb9bk)zUR0dAE5%ZBHr6ձv}$pՆ/cn%ÂjNc@ehu,֌ww7~aW}hJ4\"ӪP 8L\.e4EZ*Ke \ No newline at end of file diff --git a/.git.legacy_backup/objects/14/921ca9fa399923d4ec2d697580c248ad653fbf b/.git.legacy_backup/objects/14/921ca9fa399923d4ec2d697580c248ad653fbf new file mode 100644 index 0000000000000000000000000000000000000000..bda244d33caa229046c4839219755bc6327f3978 GIT binary patch literal 1044 zcmV+v1nc{F0hLwTZrer>?K8h(%m|fTlqRIKD5}B^R9h+B7`6&INQ*QuR^(7znA&A` zmy(^^Tl)ch?$_l@IW@paKIkPPE62{~2zW?IUUc8hlUJ9EBkKhWe zgR^yM&|0}c*h-hf`Q_yt);dMl&$I#DpmH|8k=owagCM{p*AO0k@+WLOz@IjG@VM6I zlY<_$9_{Z{E-g4J$AZr^_G#B;Y;!aSF2~lG>!qTElUhNcb!j2d%1Kq}$`*Hrtz8%d zNeb^{sWNR7gQ%huH^F><_3P1KKa(m2Ym)e0xJZdLLip8TS-RU0-a?Kdg=j>`$qZgX z^cuneM+o8751f<=fIc;N$p(;E7dL6fi#iauj%^u78{^W&{_F9M;%0<$HtXa z82kD3r`h$%<@1XxDvRLY@n}Pjk9Qcng_S|dYc5u3Cp-&cdjrEarIE_PVEk@)&~W4B z<+E4ZMKA>U-2?`^BcNpOws$m<^`tDEFf_2MKAoi6ao4xAHf?gUn!s8G(wdUlNZfXh z1a+1g+B$K&x*Menz0%EX!<1$y+AKd`ife%Xda^z@s zukX|U@Ana{Bw~UnngQPFJdN%*(Edt2s!<5 z0?t%846v}cdmZ*n!-Za>%ek&f;cZFyV)~>u=(_INpNq0YMK8IN(%PyY@r>_DC;jtU O<;{Ah@WH<^)UkQUuop`J literal 0 HcmV?d00001 diff --git a/.git.legacy_backup/objects/1b/a0cb9a365dbdc55c6f75613187656c171ec29a b/.git.legacy_backup/objects/1b/a0cb9a365dbdc55c6f75613187656c171ec29a new file mode 100644 index 0000000000000000000000000000000000000000..aad30e61f09933148fc1634e14686ddc24c7bf91 GIT binary patch literal 585 zcmV-P0=E5l0aa5?Z`3dl-t9Yw2hz&mvF(Ja zZ^r=gqP*oy9rHngA9Dz7YqheW_^$mIsu%6$1@|NqIsNIq}q5n&~I=d|$-%#GH5uv6MI8T%;mIJs}wrivH9dijq zsA``<)mKmbO3(#{zblbsE`c^?@n$rM8(DXeAx&^7d!01`@N3P*{-L=#8FEd%Ij+$s z5o5x%V7|QCldB?yJ=L-sn+)9a7*@-$SU7B+LyhlC$}~SUQkVO7pE;7apN?~vRNvJc z2vyG9+rb)L<&Nz_I3g8q)G(wLSy<#?M+i1jg2>i1=+;ESe=~6vF_v1TY-i&vQtFa- X!W?6S)8hXCwDN<$?mzzzo@_>=mFg@J literal 0 HcmV?d00001 diff --git a/.git.legacy_backup/objects/1e/164fd22d16c52e87c877ff9e05138bdec3fb52 b/.git.legacy_backup/objects/1e/164fd22d16c52e87c877ff9e05138bdec3fb52 new file mode 100644 index 0000000000000000000000000000000000000000..58203e8adc5d0b92bef116c64fa5c0837a4a7179 GIT binary patch literal 909 zcmV;819JR$0i{*JlG`>6?O9)ecn^}NYkBQW+NnD3p~?2xG)}gcG^3#<*kV^ARgzlA zlgYmqAZa;HcRNiwKFE}S2jJm>*tB{B%f)wB-&{PI57x{#Qq57_Lw|6MR@cd7GI=$~ z>JFa2_zfIdho*p5T4%utvqO3cRRi9Ob`bO(1lUfrE!fJ)-hou$8icJh)s=WG-wMj^pC#SOW5Pa>go>NtZF4H#|b8~>$P#C)$u&q z9$)-vwMvqt#w~P0s%*+B06239fA~Q0dRUEEIhB~DjdOi5pD&i*=U4Pw6hADN%Q?fP zm*8ZFdT^`jsYmmOVq-ms?Q^!u!Y6!RA#rl!A5tq27Ca5?Lu44KDA>(<{c>GErH8f# zr5$Y1RSi6z1I&J+H1HJOpc@QT%Aj)VF&t%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nKi06{Q3alwB9@4@s*t=Kh0 literal 0 HcmV?d00001 diff --git a/.git.legacy_backup/objects/36/c3c46b15ca782ef97216b3000aa561a1583d9d b/.git.legacy_backup/objects/36/c3c46b15ca782ef97216b3000aa561a1583d9d new file mode 100644 index 0000000000000000000000000000000000000000..2a66a3d3d961868c1172ddbeee5c0da80c3e3505 GIT binary patch literal 598 zcmV-c0;&CY0d zZ_lg^3aQ#0oG7#N_BU^ypKJ9D!RYGx%K#!-DN|@f3A0+Dv@lb$5}Q_YE0lx`cTLSL zdIKsn2e4aVpb|BLRp6uC1D7T6@^@=2?0MZHm6e8rYBdOTysC zH$V73_5(i{jetJHzU6Y$F?V2{jzPUAooL-RuUAPH2IKLSyC@SoAvdRYz`5BfZK*{_ zdeX4{sGkP7@D^;6WK%ZD^5`LB$k_X>a6tYp`^&DAlX16)&ODXh^3|k_(Nw=)zF(wzkF{ zwOa(kcL-ZW`QfJ9@cSNz(2(6Q9*ssrFvQ}HS=;!e5mjVcp}HmYtdB`-fCze}vwpc} za86m|35Ap3)Lok}pW`YdT3; kPNRRI9jTyd>lzd#T#FKi?~G33=JN6c^~RBTZ%CC&BR;$;C;$Ke literal 0 HcmV?d00001 diff --git a/.git.legacy_backup/objects/3d/e6506a69389f3b73137debe01821bedb1d3c52 b/.git.legacy_backup/objects/3d/e6506a69389f3b73137debe01821bedb1d3c52 new file mode 100644 index 0000000000000000000000000000000000000000..ae85e399b207aa4d5d529664e3b0c76870613eea GIT binary patch literal 553 zcmV+^0@nR_0cBHdZ__Xk=5v0lPONFz;ez(^X(daTsUc(I%Jh-sYb`7}> zsK|wF@@<~YE-o`jrT2B$rHv$wfw+x?CFJPQ=4h412q&esx|9Z1E`V~Dq_!ANlkD~j zNKazT2$jzzAsij;PxNl0*uu{Q_~BY8L4*~g_cEkLFBzP8jTFThssaV;X9E9yw8v&Mj8>Ag zvn({n79;9X8O?mUOt0HC2dve;*jbxYdvothRU(wGV(tx(a??Qi#^=-rj69~DUpt>h z6%c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0b1 b/.git.legacy_backup/objects/4b/e8874dc38463929a3fc7d664574f129e14a0b1 new file mode 100644 index 0000000000000000000000000000000000000000..1796c34fb98a539103bf4b3b0494dc88f2f97262 GIT binary patch literal 1761 zcmV<71|Io%0kv35Z`(!??peQLLI;Ty)Oy%f94m1PKjc(}Z3(vH91KICsFk!8#U;q4 z6gBaw=_O5@7Rj+e4m}hodg-mdCx4*%37viLAySThs8i~g{vfvmC&cHlOMTZir*L38W}kS_3ml76=9o6+(_HR&=cv&-Y40|UHjV3f zs|)zsrJiGs2>yM%y>B0*Y%x~_EEEWBA8>g zSST{&>ZkR?llER?zm8N%rjqYjB`fee;_x;Z<8SdBpE*V@N2~z@bQ7tWDNbLvT3JW(+61$dkT{MgJgZAI1QQi zzL&3IM~D*uV}UieE(J>#Lo&!8%k)Wd38*8V3r&XW5g$E(vd{yC=($+4Ob%aQG-5{@ zaPMBdxt9|t4cawou(7f6xwzq!+XU|o8T?j4C`>3HKw~5n`E*PSN$+#hm~-f@i<=;B>9g-eWc;PWzA{@Nb8-y-g;>-6cKo~ zkTBrft(8jTkvVd0Qnc8pB*LS}wc-nTJr`a;SZ2Uk+w6`_#}XL07ZAN7Eof5*HI7Xo zy{Z>%##~K`GA?o#IS~>eE&SZQ8{HZc(s6MEepG1h$WYCO_Mw(1m;QSc5gyv2f?*`Q z=%X7alSy$xhtwrqY8IK-7dgGi-Z93VeU!E9bF4j;(*7q~6|~E&#bg;Vr)zT4=gh;9 z75j|!ZDP9AmzmV(<7FwrU+x6fknoZ()2y^j``h?nJ8+z7apbOrDX$ZyXWBlwg6ACO zq|+o(Z;r@_jYYkYB?iQHg1p1P#Hv0f>M0i8Fa^cc8^LmKwtmd4>og_4Y02mEhxXts z!v^Pffe%PrwiK|pzkUyOQNI-&RZqLM7=@@{GxbZV=uvr5G7Q{5=}J8y)({X#SNE`y z?qSpi51ou&$XSA>tqIziAgbTU>-Ih3N<&gaMR#goSuJ(Rxa0)3eW_*X4jOBZ4OBLu zuUm~>EdTjPYgTC@I3D4F=RjGxL1l*uoc8PM=jpx&sQs{c651al(6Us2LeE~}%^ve2 zce)<4uonKo?^DxZB zZ{&`zuH~S0n$?05=4nZ0P-}M&##A)_IRPP93$bG_+{h|to?@92^jREA&LSxB^ps5v zoxWnSx+0oqVb&r~7Evs39;%t5d08S@Y-rvL3Bv2c0aoq_ z3+ygTSpYU2;^fTatovn1Qz_`}o>q%f2@m{`Yz4{G=-oQ1ALEf=>!i^lP!JqCG4I4igwS3+&6a>=5H&!) z9!ORJ5XWPzj6$IJC=vK4T|!3zzNP4paNI*&p4va6z+6iUi0@}Z5zfs|o&dp;18PVV zic<(GxOLxt_ZviSU1mykzETeNYGG!xW?rCNRw8_x;4ofM1MeLDD{1{<2lx=xnX0fz z>uOr-VH4!L7RX1%X`#Wh`%tN@M(&ONs7SAc8n;bR5E&%>{Bf>LX%I)UOhdw>Exr!n zB#}5eoj0=S{L2q;pRsOdnk1L$6NgW8-%4|f4b^b)bqVe2wiTylDg#l3Jb3;KbIkgi Du~%eR literal 0 HcmV?d00001 diff --git a/.git.legacy_backup/objects/4d/4d94f03bca62bb0675d1373c3073c19c83b4d6 b/.git.legacy_backup/objects/4d/4d94f03bca62bb0675d1373c3073c19c83b4d6 new file mode 100644 index 0000000000000000000000000000000000000000..8f1ead3457756bb571f3ef12f01b50847d8bd776 GIT binary patch literal 676 zcmV;V0$crf0V^p=O;s>AH)Aj~FfcPQQP4}tPtHy)%1qD8FG^*Ya7p09`6byRo32k^ z7X*`5%rDopD$CP0AJd z=q&q*$a>%k%?=;Q7Clv=_p?ZBGXvMs#Dx*Ib72b8GfSXOkX~?lmRaoHqcQoViH7Z| zIpT7MW7BdiuEr#fJnr`UQK2c>4S4<)$!bYRFVFePigal&K1_-*7qkcYqO0 zi;HJ)fRAHjysx95qq}PmNcHCb{yU~8%`2M!eV56^{jUxwY|8P5THpc>i?qy~R3x7= z*ggx$%CwkoT`XMt`hkSvzT2`kK~N2zz5zb2zOF!Lf!q=w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Ezex+Opr()_KwInX$1Y?Ca zShe$N?$gT}@{z zqJMI)w!XQ-C<|OisrVq`r9j-U@Xd4+ulwYXwBo_r%EaYsGJAK4UW0$Z{CV4OSZEa) zh6CBXT}nX1n|RVq4*Z84b33V|x6^mEwmU(xM7wvG#P`vFQar}ius=lrf$oX?TSAA9 z*v{AY>S1c?GJ|`LKN{n1#uF8#l%4b&?MvWa*z0>!>Iz-CsdF2b39#4R{{a_nY5^+U BbGHBh literal 0 HcmV?d00001 diff --git a/.git.legacy_backup/objects/58/cfa94809f582eb959e3771e79d2974cd6e0455 b/.git.legacy_backup/objects/58/cfa94809f582eb959e3771e79d2974cd6e0455 new file mode 100644 index 0000000000000000000000000000000000000000..137daded9afa818873ac5a9451095f8c3534517f GIT binary patch literal 2766 zcmV;<3NiI~0gYK-Z{x-h@3TI|0tOB`pQ*Ebbz2xn0G=&hgvhcY$#=< zI{C$(c&GGjns~kxXOZ;cJQ2fuvGDY&(b(G)KmYX4|B9}c$uuk9pQ%L>$xH^q5m$bu zCQ^&z195zKe9~x)=3y%CN}h8s6%#3A;S+Nl@unHbL*lTIaTdli(LcWsX%q%BovS;M z=1HP-Cho#)F1$Qbju$Mw81hZ?*v~>0dr_FJTEdMY5y(kC6J8vMOfGN?VvA`Q$y7|W zT8L~eg-Wt;5&qVrlOoZ|muV{I-clO5v|OmA3|g%1{f~cOX@;dVokCD^-kOMr_e!(O zy?BNjn;W)xe#&Hf;(`Sln2Syuj<`vE9VS`&lFaHP!PKeh*-Ga(uq;_w%ejox5VDeu zszlH?&9<_NluDe1f;BCpE*^+wYL0)ChZz)y{-M&$M2M|yN{3i3ue~(%H(a$T!&2&S zx?+Vkk6(mvn_z;_H?}lJ;LEkorWnH%W4T0Fw7yPNOja0`Zsq6fTrstxBY2AAey%mn zRZh1io`0Js#N;)9626uQu_Qh43$ zxA6ML1Xslhw>y$WK2xZXLD`nQIb8k-Gcz zli$!2sM1w48@@%lG;Ms^NY6A9HGN(Nt1)YlkYcE!o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pe_^CYX|}P8q>l`iyG%-&5O2Km#vIV#1c73Xc7^vy=UzWj3MvL zf^I)hTD(YF(iaO`@Z5N#tK@uhNpWqSQbBRMJxg&43qsSbXRKaLb$N)Xj?xVC0W;lY z&{B^KRO)hBWkha*<+sq@hZkxu&r(r)d8o_k%K%-c{_^nOl>%9VNEPlImJ$uNM~5oS z#x$IvL>K93Ak~&L77AtRtY5P*w+h0X*)i4n4bwVTlw0Y6$By2Ml*!%C>T>f+&QhCO zOWN#XR+lKV0=ADG?=Aqhd%}iFvHx6Mr5R$OxMiUEfSF1aOyRMNF7l9}O`&~)1(H$6#);?e-8m(MQ{IAONajt-5CMTg4Xvzm#G-app z(u7bL4Ni|=|0C>)iy?C31sr%dB%Luo`Vq`zI<=!kIuPdWHAQJ(=>Mz6{m~g>oca$3{mim8s{OUKnT+PJo z#U-O;JjRJEEdp*!C*S@Kk8J8p`22PCO<%goi7vfku|f4?ke5o8hO|8o9G?Smq@2Sj cq!W&Z&5$_i&hT=AmuGPWQ;~G-KNV8_NTUv)7ytkO literal 0 HcmV?d00001 diff --git a/.git.legacy_backup/objects/67/5cb84421ec8428c32c0dca96a32efadc9e530c b/.git.legacy_backup/objects/67/5cb84421ec8428c32c0dca96a32efadc9e530c new file mode 100644 index 0000000000000000000000000000000000000000..2641eefd2f9cdc5acfcf241ef43909365bec3b49 GIT binary patch literal 2364 zcmV-C3B&ey0kv4&ZX3H1?)5&!WNjbIjkU7lq(GIU130!)8^?dOoTfn<2&-Mn+LK*! zOLA=sj_*z{+5&BX_Nr)+zC&;NJm&?PN9YW>+#f~xX@DajkxX)i^ZU&VC#jggqn|(8 z{>jR{-X!6@NvLMt3PgfmF{!&+bn&MS6V7CyX3&K_y8~wl#O#WtBF`Atpas#`gSe5W zVovLxrDGN z!;{g)?$ObB|L}a^_e8FHNu`SK?VTQpzyJ9&v}jjggd)OrANC{*HG^D=xQKKjIK+u$krpyxs-X_}<|H|J$=Nw5Es?&E zEC>SMQ$;KwdyTB1o1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vTBO01rFh+R03rY>ZtkR~8sGW6)zd>XqB&_fnX%T?RoDDe>|d zPxLEqpJ5eCavH$~qq<{oRc~a8yxl2UYj7#Ue3nFEirA?L3j=h^CBx@{m*v4%-o-p; z1B05(dxp?6Fr%8+=#K_vK_B$Dyx|RtM&#Q;a~4}F{>(dP*finMFue}v%KbTF5j7j$ z%d#PQ^#~y;HfkR+;aRhYl;Mxlq#^s!jQCv0*H{tu%Yl8~ zvSq`>Jy(g!D%6^PTQJv%V`t_iR;RA+%dBprHPR`>Akk6}$>QNt_6bZIbI4jr} zE+>k48Zdj*rdQioWwF^ajk+CFVPfd9v7+ZDJLU9g_QdHRaLk-uIGdI4XoiiU)dnie z^Tp5l@HF9JimdEo485+D&uso8uXk_%^m`fyONJ<6+2x?H*!VEb?ztzr^4q>(m2XP; zhV@T4VK+EppsK20K4#fR!R=uApoz1aJ%BKct>(gLY$iI~F+&}Vh3>Tbeh}a@4Z=Ws z>S;1HEn^);1~fi5h}mo!ln( zPDg!|zXgeLqVP>+zS)o;B0FI@($OrG)Ry3Eȓ86 ">(zm' w7mh=ax`0M$y$#>vUlj&oK{? +nu덤`7&Lvx)fs  F'7gZ`,>?Mphq>Q2' +y{_yX+rUT((OO푚-PBFK(~nu]_)2y \ No newline at end of file diff --git a/.git.legacy_backup/objects/83/3d60a1ea07a6dea979b8a866cca968245dee2f b/.git.legacy_backup/objects/83/3d60a1ea07a6dea979b8a866cca968245dee2f new file mode 100644 index 0000000000000000000000000000000000000000..391d1e63db594c9edb28e3158e87e6356bde656a GIT binary patch literal 1274 zcmV)ai)u8<0NG9YW%J+`Y2pmQGS|%uQlKjWTB0H%G^vr4 z9k1)Y?O*KI?U(FM)C-+-Kx-J5Ox_*uo_p?&3#k`y_~Q>RzI(PaS_m~-Fk3{=;EG!Z zXUo!XYsHE~0`rY4w1WA`DbOlcjvH7DSAb%UL|El?!m<@pDUTwa78>HoSAXJ01L~v4 z;n{TLygjm&`)b3JR-=6eQ3(sI2`s_DdG>|yTD3RVXXjVR*=#G$AAl>q=%2xEL7p4%I3T!ofjpI~Ngt8#V+{c94x>u(vKmS_GE% zw?Wrx#f^jc{OUb8O-YT?4E`Dkm1~8r<>;uA-hB4LYm11GI&U2AsktXD$#FE9=)axV|KU%^CUAascptCy9 z1BSujtLF#k4@PwR=IC;Yz)(qe6q-P5EcT20J^ zawFVCI8RRFI{P)kJCKk*E&e~mxQpdO`L>j`oFUX-K>6tB>Fx2`>)92Cg>VoNTGNNG zx+=pg-x-d6&DkBdW6C;P-^1>w(g@{XaQJz5zhUNwx4(R>yM;l>H^|9(cLbEA-R2J4 zfak=eW5!Vm15(%h^JQW=hLCM{7OGvZ*ggZjoHJKpOB}a*fE{}Fv=76c>iW}8S0p5S zicQ6r0xUL=@tjrCh1TXq=hXbQViKHT$_lEBE-o^1u5}5vDobrT-PQ(j))_5B7cazJ z;ot}x!x~0#Su*781ZMofft4cTtt!Ad&s)I>_5PL6m3=Jq4vkE0%1W~Gt`dO@k(C_t zct|a{#{CKCThr4=rS5dU&{W?e&VBos^#dIH{<4(ZbvgZZLvci<1qqhpiO2w9T5EF;B{w-wo!q>J zz0FANk0Gu%aF+U}6AwrZn*hQZZ@$zz!lC%@KYzpY{qgktd^)?@32B03dZQ}?R?CW* zkAuCRZsGe)v3aD|_=wfnYXHzuZz>^OBGfj^f+~fArS}#~^|9s!mx3*Dj$oI&V76Rv zgUpo-GugmG;~lmh(|gU#Z0-#Eb*MC8$O<(+Y5iTP?aRH*n*u946PeoeG=1$|?-|Uo k*@^|HYa9q`D^9$vUjlH>{KlYO_mj{p`zaXx2gXO0B#kbN#Q*>R literal 0 HcmV?d00001 diff --git a/.git.legacy_backup/objects/88/8930ac2e3692865b9f74f1a49fbdaf54604a35 b/.git.legacy_backup/objects/88/8930ac2e3692865b9f74f1a49fbdaf54604a35 new file mode 100644 index 0000000..ea29064 --- /dev/null +++ b/.git.legacy_backup/objects/88/8930ac2e3692865b9f74f1a49fbdaf54604a35 @@ -0,0 +1,3 @@ +xSj0O1HMCCl +](@ ŞlL)H4!;l'Y]cgF㕶+xoĺ6Uy`QmwAd}? }_<>ڠ*>, PӐ;rPN~8g4ƹpJc>ɒҋ(ϑpEECn17~o(cmʖeL=|U+VƠK[ť)Kڙ6-=dilmJU;JUIyz!ug`C2pfy 1Br*A׈Sko7 H +}:<Ц]ilz@чeH$&$M6[<k+}{/(GX")A9S 2@9iඑ߁8 \ No newline at end of file diff --git a/.git.legacy_backup/objects/89/c2aa414fe8a90c6541d1f1cefeaf7d47f31052 b/.git.legacy_backup/objects/89/c2aa414fe8a90c6541d1f1cefeaf7d47f31052 new file mode 100644 index 0000000000000000000000000000000000000000..73e54b58b47c69384bf17b9ef371a77e2d9f293e GIT binary patch literal 3086 zcmV+p4Ds`L0j*hEZyU!I?(_bNsZ<~mZIYsIaRlf=7AZ@JZXsnEK@iZ(-66Tr?#^as zRx;ztD2ld^4VoBv3Q+XH&+TJ=kN-gX6Z)Mqv)tt+K?_7MOmb(=nKS3|oy(45H4-0p zo;>-@rZ`T=N(Z@=sW^xunHtd)eP3rInddWc5s9w6k+I4WEP39($a1Oi)i;q!g`R06 z6A@U#vC0=o&D1v{P)SmxQQ#Y?#cgD!!WUZRH!>GDkuOd^ySx-ei7?Vx?9UeX>-*Re zN`+594aKb-fm>=w$S4)pkhfBydcKP>C&coLY;x2M}( z@5O#$RD$aSVjRU%gz7epl^<%cRln+7lx?Q_;r+jV`c^a=j#!3s`4d0&Cz7<)XxQUI z8S?Ez(RFt`5zAQ_k%c+kaq+F*Ex{UKP#f(S`4HqGID}V(P@dp80Rf|;`soa zUT6uEEjai2Kx{pE)Eq@-+p4H5^)7D3o87*U|ArOmH%N&9L$x#f%`01*SLNubr6cT zwG)V&m-?v^Et%fnPA{?$Fu;L1eAYkzwAbIG`{6{wgJzTwCwtbTmbjGKIMbE~wA#R` zC^NbZG%?NOYhy^z`QN4`V%eM(;Jn@vnZ-MDQ%CH`s^_KqE>qSafoUCO{W;98VqM+j zaZ8W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ql4fBc?@+|{6>{du7;=3)I4+{BxtDu6oFLfk+G@^-MB~#XkeAaa~oGzH?P}B zo?(&XW;0e2ZPPzBKkQR18ARbq=q+rg58GJlF1a8WOIWhumF|V2TK96;7%h03N7&1i zOz!OL7%!e4&ueU>mf*H!JY{J$y==*mVqPlgGLYTSNE(afx(Tq=5=B&Zj>!;|o*0w& zi!{z&W6VfCZ_H|0H&y`v+lR*zdyD7s2zdj&2HPo`K8$*U1g;&+0)3$=O98vRk#A2669(devt=%gim*Rc%NHU&Q@0oV*|=?@R~yY&r+eU}C^ za1lK$C7g#>G1m?ffY_j6Pa=?Ixpq;d3`ycwBAiQ>@yP@5d`qDKM+(Unf}q_X=v+ZG z_f3F@pU6C$?Uz8b3?eWLGXnEMu&;9s?CHY`@h?K_H;Wh5AweVb^DKSaN1#WKB|?E0 z@ty~lKm$zBzc@V|9G~A3<8<4>QSZ|&vF=&7Wr@&3Bt7R;Aqnw1PRCgKIYWa;1%}5J zS+}r^(5?A8g7!9G|6@z8n29#vOh_-G-PA2i)_ePxz2pAi4B5O<(jegOX0v2ML?nS! zkAXACAgHSB{#{>s4zn8Vkbvh}O=;BndG26y6B)l=*$+{QgMx30=s%I#e^WRGxEoj^ z*J?Q3A<^Qf>6iNo*W^k|*&@9cNQ$+PSN4_sh`N>q1$2^6|Mo}x& zY@&zVit1|itZPW%qj-Fes9>y(9+0}pHH7tFV5*}Dx5?f8lOmM5Wx5v=d}UD& z%VkX5I}=~e36PU2FKR^fkB%Q%ZnwJ|E&m{sk@uG7?>O<3-0P&lh(cB)}@APQ@Rw9IO>0uJK7Td3&j-YQX8`A#(Q<(vNMe<1D literal 0 HcmV?d00001 diff --git a/.git.legacy_backup/objects/b2/58706e00579e1150ce0abddf2bdc0c7776a029 b/.git.legacy_backup/objects/b2/58706e00579e1150ce0abddf2bdc0c7776a029 new file mode 100644 index 0000000000000000000000000000000000000000..0be66357d0f7b86e3492ee9b8281114f3df6090d GIT binary patch literal 455 zcmV;&0XY760cB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>@ND0_uVHkiUcSc6K+G}nLj3yUPFO2w+k(MXiWs!w}HYQ)k}!-3TBRbf%Nx~$o4 zQO%sm$>r>ZnPWjIbzyy*=h|LhqLAkhzc)3wI0kXwe$K2IRtJYPI)qZrdrcxo43&bF zhMW&>+sSEbNoQ^vq9|JxePNh>jySAlNM6RJj(uzs|8Ln4PRW{`dYQQfHMJ+kMG1#8 z&)j|}IHNNgs2t=?3K-Kx)L|t@G)iExz}!oF-dT#n zDkJ(7lnj*Ia$k)aL2hG@0fUjdS#cNloYqwKc=?6zd}L*AUnN_>eR0Pg!|v@4Lq2k= zZz1Y_ZF*-P{WbejTF})vk{{wl1{7qxk%5;X5FpUXi@ujeEJct7@1&{C77kuX!FgLR zwM3oD%|kxw@L*gV4=S>F1)sMPB|#rRE>dU{h>ige3=f0MBfSa4cL+WUB%DT}W#0*= zQE)oeoNjgidj@RBKqh&I`_*swedqfGsA@kg{MpcvHa}9%d)2 zA6q+c?gKrSoaN>fug1la1s5r9<&IDk2V3nM0@Tv)%{yl2X^!SOeE=v{Xn#ri11==w zX+fBnx}zaKyd_7G_GF{KqM8GOZv)$ z{vFbEA4d!oA0VyHNBalIqy91!fCS9Ts8og|s3N?10m`Y%3h$w)HRE0R{{dAu%_D(l B16%+A literal 0 HcmV?d00001 diff --git a/.git.legacy_backup/objects/b5/af47bc5ffab98ad51dfb058ddc70914203288d b/.git.legacy_backup/objects/b5/af47bc5ffab98ad51dfb058ddc70914203288d new file mode 100644 index 0000000000000000000000000000000000000000..0dee9ee6d0bd4a3de211928b03752854431376af GIT binary patch literal 3680 zcmV-m4xjOO0mWL~ZX3rH?lqrcAT=<>h@@mkO{=yj6iSX&OSWPvc8egemb*i7qTQX% z&MqmoO%McVuX+&_Mw*L0La%$(r}2~YJ7;G0hc;z9c2L8KrQMk`bAIN`_notoSWm>S zKKyX!XPe?snJf;L;xtHuOPPz~B#UJt(;_I8PQ|!Pk|1ApI-8r~$t)dH^{vl4(B$p4TQx(DwNrv}EbhE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|(gpWA zKI)L1D3ETDz_O~wj*nR4GJ<^ElPH?-$2URaQvzF&Hm!;~@{6yy6D6;|9+53`u}Z)h z^g#(^pUh@>fht%H&?S8KS4*r+SARG>9qnL(Km&=`eiDw4q1#GlA+ yQ=9x{EBT+}<0@xc&YtiC4^~McBmO#w@G0`qM5C&{x@zshCQ>qk&i??X_Ke}%0~s&? literal 0 HcmV?d00001 diff --git a/.git.legacy_backup/objects/b8/d2fa01a860287e734c8eb37dee90c6dbb59672 b/.git.legacy_backup/objects/b8/d2fa01a860287e734c8eb37dee90c6dbb59672 new file mode 100644 index 0000000000000000000000000000000000000000..6fe315fe5b435bf2a81988d87d71bba114464be2 GIT binary patch literal 1052 zcmV+%1mpX70fko0j@(2L=Ip1acvs387<<`--_gQhcL_mScC)*J145%7yJy_O)9rM( zXVzkoIKYJvMbRP-2o!OEXUOy91;`^%-EDi?<3!A1GjPd`6Cyqq50 zKR*a}KRZ1+P8gpHl}bwa82=guX$Il0=NAS6O>+U^%V&>o;C|-~M_!_@8X#fgd+@&> z47&rLRy@^AaL@u&F4lmktH3->&C@7??*hP&0}y)87qpQtC=l-|KGUb@Jfy5>mlAf4ULU^kB}2Mn%`1~59*vUuyzu##dGq7I+N34`(6 zlEq7ckzxPi1ji@gRZ+n8b;H;%gms0Q>bFgA5x&kTIBYOyQelY^pT@>cH%uF%d~V5T zP;R_hK6dEh1dXiJDlzfK8&8ynF3a+v*2DOJb@8{D{JP*Kj33r#_aOXlfB*aZNteNQ z#S-Hnye^6F*(6&qEEG=0Aji!=uNt5(GO8L9!x9BUG;`+Zi9cy)riTU64#z*u313k4 z35@E5N6t%9lEGNwl&Up~su3tQhp$mK-AM=s5Y{1lGcn!f*1UIM{|!(?$gb75VkYRxm7Y`kK)dMpYSV zuQjH+Flu3G+TRK`@s=n08L8TGL|jX!KiDRtQUh2wKf{H!Y?KK`rqc>;KfFDhxm=6V zTvwo8O^sd+B072*Ju?^eC9S)qJ>+yfZnO@@*g+rs_WasE5Uojyn^k+aG*EWn1Y3ur zjmXwHD=27L(FtV26{_7|_E*am+@Yw|_Q-yvL{Zpvrx@R!8J6Jka(!)7VlwGWxUf1U z1MeJn)s}+zR@_n6YDU&S$HipN{VDV9xRTmw^N(>4Z86Wc;{NIP-#6mc>AL8j!A literal 0 HcmV?d00001 diff --git a/.git.legacy_backup/objects/c6/a7f80737de32a446fca59c3dc93395f9c2d063 b/.git.legacy_backup/objects/c6/a7f80737de32a446fca59c3dc93395f9c2d063 new file mode 100644 index 0000000000000000000000000000000000000000..8009044c588ebfb03df208d133b69369fc75ac1e GIT binary patch literal 492 zcmVkJ~T|?W|ux;5xJhA{Xe=jt!FGfPM@)+)@;VEHO44SyCn0f$!Is zl6#i}x>zFh_{{gn-ufOsefa$54&*?Y2InKf*+(FE_DM%Xw==lF)yGQ;N~5@g`wgZ2 zGdC%BGe5iW><+yKeXQS%Qtmmo)_FK7f)?$?YvCJg*wpare; zh@$JlT5ny~ibjU@r}pNTXx@fZYO7KzrH>TztSq2gD0(-c%SkL8wL)%3y&u0nwgql{ z<`}HkT;msvkqr0p&Z1fnWO<`At7lXu@07JG6s43in)jjrWG&vV&8wi$fAvGEUc{N} zr+-p~<#dt2r${tuOHBWNB%8uea{zw^hlwRXiW+#-Fkx0kWhFS#mf_33LaR$hL)pjn{%~Xy6T6P=CL5)Sh&1<> zrR{Dzam$71f1}O?bqz(#kJC17ArGhS#H1)5#(C;(S(74o`e}qT1bo i4d_*R9us%{$5O_RjM&=yMoDwfs|$apH}j5?jiL}vyrp>6@%C~r zl!(BF(V|6N6lv1f4G<(K(0(XTpx^s@^at9X&}Vk<$UBPk_t1tZTX!?Fv%9l1&pgWu zUtZAO?*9Jn&u-tny?yufPyFw9mD_jU(A__0-TqUnXVguqw@jlm=uy4f?zK$YyemsE zvBr!R?hX@qAtKt_rv2Uh!xa|PBW>pUpZJO*B7Uq?Zh!b49XC5hi>z*IU^ly+BWg~< zNW`%>71V1SQxCt0Ai=s^d&!uLG?6vKojSo#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P5k=HFYg7;MBsn-vI-c6$<4i&zuMMv zjAYNV<%LiZr6PNy%Z$gMdFuFhx3`Kbu_jqHfvN3SM2JTO z)spa{rGg~?q7LSg^qGt>SR{PUxxiswMr7=-h4#%C+u&3Xy7)j)0Cj<=s4}Yby#P>d z8t;JJ+`X^aybMlihj11%@TYrR)edU}sAh-v8hQcjgd%W7F!V&MUe%d|Ag913Z2rL@ zg@?$pjlQi9z`CEC)v^5ZUu2t>T|yD6ob5b7Wng^#K!MS_lmzEpRYS*8#)4$1NU(jX z)+6D7U1RcW&epLFO%f_L@B7!;O85HR#-OgKYPM&K2#vSn)7}vc(KJUu>z`0KOU5!d zpduq#lHOk>oq1f~92JlFS0DwWK_xO#O<0ph++Q3i5zQi2hhPgMF$Vp>t&yS%RlRNq z5t55%;Mms@g&)ANA>K&4Y1z&Cd#Ut|;?f_B5t=Vjc`^+-dKmk?dbCT~nV~A0Q9pG- zA`yB^-R?2R2@amC8uxUZj($C7pDs)N-MQfKk-l~@O2QAVE@%do@xV=#ZR_Q-ntN##8u)fGbud-JEaIO9!2%XtQRT#6-gi z8d}pNrJt+(|MciC>0MGP{IW{_vm*~^V0j?0DIno#aPOA9+EFTCe9TsIJl@_53oHW5upkF z0B*Zy}U`AUQ}+X;{MzJ}6uL>O=5ju=>F MK9S1*0rg^9$dXA@oB#j- literal 0 HcmV?d00001 diff --git a/.git.legacy_backup/objects/d7/1df4449558c5dcc3cf100330abf55be39f2da6 b/.git.legacy_backup/objects/d7/1df4449558c5dcc3cf100330abf55be39f2da6 new file mode 100644 index 0000000000000000000000000000000000000000..9ca56cdf852ae5aa60043ffe2057ecd90e224f96 GIT binary patch literal 810 zcmV+_1J(R^0d-YvZ`v>r-e-Qr2`bS_gwnEB%o874$XYbs29z(;ghFxztBD=i4jroY z-)B1^guZ+M`~2K<&z;Ygb;Q?jb^ERLWrspi&Ir`o%}%{iktlZ5M@cFGlx?^lQDn;O z0M;pu0s?jo;B%(%uOiUQ4FUI`QEX_01p39gnFt=FzS2P~t_BkUsYFNwI)+gJjlB@F z5Vd>*d!7nMU`VAB`^%D&v)83Nn-3;q;zXW8ss347qsF5Q#fo{c7I5^i$3g==p~a>w zLMa`oc#>dX&yek?;4Cik1gOEZPz|MXiwAJP9WT3Y5;Nw$d;j#X8cq6cw^d+=lZVyN zUAn{WVEki}oAbXKjD9T^(Bo`F!&G=hnGBmbTHVhkKiygP?6tJZQZ69V$!u`|m^E>( zI-T|bR75JJMD^8)ofpYM94}S;pujTic$CIj!U)Vwb<~D^KDJ>&pchE+SO7|ROvY3lujQ?XOpB$=B$N$;zf~|b zuUjfz4HNI!VsQTSH0U=V6g*8}(7*UJ>&z{Sm9O6?I^?0W1&ukQiVMm@n@@o2Gz|6b zQ~F4IX5@BtO3hHcaPe$sk-1vOzG`hPr&)s;NDznadqAKkm5R{usk(* zL@&}!>2J}0wx+E$*!@A6nR5hwS9_y=wE@*+ueO|-mE)UV8Yf&RkY?zr@A-dIcb^`R zD}8GW?fgAIub+;QdINGpX>43HK+za^s=7B9)jxT*hlxR;-8!^q4kK_?m;@?8^<#u~ o?q|pDDnUWH{&alRz)JaA&6w8vEYCnt{W&7A7BmR)KhN0lG}vR0N&o-= literal 0 HcmV?d00001 diff --git a/.git.legacy_backup/objects/d9/3c1a7fd26446a032e68817362ebdf54dcb54a4 b/.git.legacy_backup/objects/d9/3c1a7fd26446a032e68817362ebdf54dcb54a4 new file mode 100644 index 0000000000000000000000000000000000000000..8728d26e7383724e1c13d3b650b05787eda3df06 GIT binary patch literal 534 zcmV+x0_pvD0V^p=O;s>6H)1d}FfcPQQOL|o%P&p_3g+piWEL0XBv$GbrxulECZ{rN ziYUlq2%jeyaE@#5eeF9u(7x$%!etlT^Q1bL0sJ7yg#G(@2l+-eix;KvJKLy3ah1*Ewv#dC? zooS}vvU*f?5clZjCgvrkrxtiW-4Gx<+p0J6G*qWpA_OLUVGi;6)S442QW(i19?xVyc)Fyg$P`lgUaRmd8OlQU9N zN^??+bkj0Zb5g*19(#E9S1_$@?Y$ZPLC8NSeY2gLAgUfvR2OIDgPkPU@aw?aeKT}~ ze`dd4u`JT1TtYhtS#@bivTjLcE-+*ha|^)cr#j8Ja$@3x2YwAg@!}T*t=&&d_>ZI` zJ~^d8ub`4aPR#$3uGmq%_7mm*=dlWR-#h#pWH2bff#M0IEIz*|Gd(k}7^K{;fvt^g Y$vu{91`;3lN<1`bdXm-y0NC3MWW2ZtX8-^I literal 0 HcmV?d00001 diff --git a/.git.legacy_backup/objects/da/43f2b29ecf071e9b4ffc2fa03482e25d7cf0c6 b/.git.legacy_backup/objects/da/43f2b29ecf071e9b4ffc2fa03482e25d7cf0c6 new file mode 100644 index 0000000..2cd49f0 --- /dev/null +++ b/.git.legacy_backup/objects/da/43f2b29ecf071e9b4ffc2fa03482e25d7cf0c6 @@ -0,0 +1 @@ +xAN0EY;v, nF=3ӓ[,9uÝ G֑{rƐO~ ͒_0#ZfZFa C˶B[$vt\lZc[ik.&U' \ No newline at end of file diff --git a/.git.legacy_backup/objects/e3/48498f7802ad858dd957f0124f5267b33e4611 b/.git.legacy_backup/objects/e3/48498f7802ad858dd957f0124f5267b33e4611 new file mode 100644 index 0000000000000000000000000000000000000000..042813801e660b675633b29fa09235a91feef071 GIT binary patch literal 1505 zcmV<71s?i%0i9QEZ`(Ey-e>)at7^b0R!e?qhsA|4q>hpm^WxTaS`=Af$P#6%l|)6P z(glfs#XjuIe%*e_j-+IXekt4;K@yX9&+(3T&m9*LUBHXZ=}$jAePS=d#9p{;Wjuu$ zVH}v3g((M4;f`csaE}Ws;^z^`AP7n1GdM}zC7GugU1o%_=iug?ZoWPPHzSbZ4$1C_ zZy3Z|Q7{Kbf6PK-x-om9%)V8aE)QuUk6KC|4Lv9|Oar|g(uigZ0-6EMd75+Ma^g5w zgXSOYUhk&;s@IL1#z$u~8h6JxCu|;iYjbrWJSC$5C-u3 zyV(pD8U2EB3>kPd3BqNbVT5q=23i4FmTi&b4nDmCz9NYM_+d29JW_7SB>^=5bv&I7 z8V~aS*OT#Y&ZOUpsOLs2%J|wK5hGi|n_VLai%V${FdGlb!}T=_lV$yseJJpSt##w! zYPiWT+If}2Rw}#`eq+aPfwqVFVyq$EF+0W<}{dV zTg!~*saonvSswC;psp!xI+e}s95JOh<8H=hs*=l$2XVz)=+v4X(`CG}6L>x#- zb-JxyXV&fYU!LMmT`D7+gJxI-LgQlMyc?XKy%~K}KsAxWm`YR@M#5zhBb0~>27}+H z5|~AyPuPlnmBP3oOUw1|T#OTn^DHOAMck31^DyC9W^ROgownK$yW(SNRjMf~ffBwf zWKF~j!iX?jx{>CfIH?3q+*qELBVAaj9~6g`dwC|#Vy-w(`?f7PAnX6!ZnteW4Q&Z( zZ}bZ2wfy@Df3J;ovt*2p1yhWs$V#CA-$*qns zqhbpuBKSa&`P?W%7E=@l3paaKSJfC#Q%ytyeU!bDNM9s6@^N{_6Jc{m1awu7+ri)yOnt#KEi}~b>i$ZN* zU1p&s@`n5wa_CglWR}i$E%@MuTx5YDYLx_tvJgFniW3lDUOS5jNugV2PpRLtU??b9 z0H`|Va|vR7X4pmq=5~M6vdEAGHotf?at0D!{PO0;#>`#`J3}2JlHN^X=C4_Zf4??W{$A2 z#U;|jo;BTqs(7=ZU5N<;>_OOD4yJ2G0s7r+<~+<<4e|&|(2?Sh$q57tGE6**qk+c{ zfQkV|5|`P~F8+Jm(C@qMh6Z_r8#>YfH}-+n+|bfXx`AWT5tp%(QFTW&&?6k#0XyK! zKHQowRSru>Y7OoX7gou&oxXKM{*#rFs0Dg@mE;M7)UhadJuj zqQm0+6G5xn#y(IPdjx#KrO$;mIbv$X*8%2Shy^OLhvOLUWSGE?(P>}(D7%z&x@>>?ZGNzf~N literal 0 HcmV?d00001 diff --git a/.git.legacy_backup/objects/fb/d18a6c088ffa700c3f8cfe6de36904b4071506 b/.git.legacy_backup/objects/fb/d18a6c088ffa700c3f8cfe6de36904b4071506 new file mode 100644 index 0000000000000000000000000000000000000000..3d76e15574a2a615579d6e843706771fe2506aef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$Wxw#IR6U7md-*6EH&*_x-$U5Z&>&9S} z(H}?4OyPu0>&8eV4LfKu!yU4%wA;nrfbdluOQYgAd>UOhuWXI84Peb(utT2RwHaY6 zpm%w7lqwl!m_j%$5w-`9dYv<`cXaUZcKzV~gZe@JV1GY9>2`Ykqk{(z?l`Ajv)6y* zHT#41W#8*vHP4Uk>^pv|=Xsa@X=i2o{=ReE_PgiJ=Y!U%*E(A=+^d3jEQ5?JFQVr{ zt=99J#}{5b4r?`h!(i*e(a&(0WH=?jPL7)?zG!x_6xC|&i*C>J{q~h-#Xs&f`|ZwU z$-Q32I2C7Y*;?mb^YUqT;6J^%X!f3$^v|ZuU_@Cm;i08_*6E%3-Db-h`2A-8sZS2J zc3lab;cG@0uPAD`XM6!CoS6(~PRF_a@Y{MfTuoRFUQ@X;w+9XaNrSEAd&B^S+fUry4nLA?{*9N z{4Hl~0}Ce~gOuULYBg+08ZmQ-jyMqsdcl`bMks=vPGIB+li>FL?RzAtR?FFlmORp} z5Qpzl7GjY^5^5GaB$6J}DYB~tbOqeoqrV*=9!dFPE>)b%D|8WgyLuAYw`&n?RF4+p ij7GLzax8>X9;M%scvJ}$z5rbw*jAhu#(w~~E+xh7R%eL- literal 0 HcmV?d00001 diff --git a/.git.legacy_backup/refs/heads/master b/.git.legacy_backup/refs/heads/master new file mode 100644 index 0000000..efe902d --- /dev/null +++ b/.git.legacy_backup/refs/heads/master @@ -0,0 +1 @@ +da43f2b29ecf071e9b4ffc2fa03482e25d7cf0c6 diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md new file mode 100644 index 0000000..544c3d7 --- /dev/null +++ b/.github/copilot-instructions.md @@ -0,0 +1,393 @@ +# Copilot Instructions - Infoscreen Client + +## Project Overview +This is an **Infoscreen Client** system for Raspberry Pi that creates digital signage displays. The client communicates with a server via MQTT to display presentations, videos, and web content in kiosk mode. It's designed for educational/research environments where multiple displays need to be centrally managed. + +## Architecture & Technology Stack + +### Core Technologies +- **Python 3.x** - Main application language +- **MQTT (paho-mqtt)** - Real-time messaging with server +- **Impressive** - PDF presenter with native auto-advance and loop support +- **LibreOffice** - PPTX to PDF conversion (headless mode) +- **Environment Variables** - Configuration management via `.env` files +- **JSON** - Data exchange format for events and configuration +- **Base64** - Screenshot transmission encoding +- **Threading** - Background services (screenshot monitoring) + +### System Components +- **Main Client** (`simclient.py`) - Core MQTT client and event processor +- **Display Manager** (`display_manager.py`) - Controls display applications (presentations, videos, web) +- **Discovery System** - Automatic client registration with server +- **Heartbeat Monitoring** - Regular status updates and keepalive +- **Event Processing** - Handles presentation/content switching commands +- **Screenshot Service** - Dashboard monitoring via image capture +- **File Management** - Downloads and manages presentation files +- **Group Management** - Supports organizing clients into groups + +## Key Features & Functionality + +### MQTT Communication Patterns +- **Discovery**: `infoscreen/discovery` → `infoscreen/{client_id}/discovery_ack` +- **Heartbeat**: Regular `infoscreen/{client_id}/heartbeat` messages +- **Dashboard**: Screenshot transmission via `infoscreen/{client_id}/dashboard` +- **Group Assignment**: Server sends group via `infoscreen/{client_id}/group_id` +- **Events**: Content commands via `infoscreen/events/{group_id}` + +### Event Types Supported +```json +{ + "presentation": { + "files": [{"url": "https://server/file.pptx", "filename": "file.pptx"}], + "auto_advance": true, + "slide_interval": 10, + "loop": true + }, + "web": { + "url": "https://example.com" + }, + "video": { + "url": "https://server/video.mp4", + "loop": false, + "autoplay": true, + "volume": 0.8 + } +} +``` + +### Presentation System (Impressive-Based) +- **PDF files** are displayed natively with Impressive PDF presenter (no conversion needed) +- **PPTX files** are automatically converted to PDF using LibreOffice headless +- **Auto-advance**: Native Impressive `--auto` parameter (no xdotool needed) +- **Loop mode**: Impressive `--wrap` parameter for infinite looping +- **Auto-quit**: Impressive `--autoquit` parameter to exit after last slide +- **Virtual Environment**: Uses venv with pygame + pillow for reliable operation +- **Reliable**: Works consistently on Raspberry Pi without window focus issues + +### Client Identification +- **Hardware Token**: SHA256 hash of serial number + MAC addresses +- **Persistent UUID**: Stored in `config/client_uuid.txt` +- **Group Membership**: Persistent group assignment in `config/last_group_id.txt` + +## Directory Structure +``` +~/infoscreen-dev/ +├── .env # Environment configuration +├── README.md # Complete project documentation +├── IMPRESSIVE_INTEGRATION.md # Presentation system details +├── QUICK_REFERENCE.md # Quick command reference +├── .github/ # GitHub configuration +│ └── copilot-instructions.md +├── src/ # Source code +│ ├── simclient.py # MQTT client (event management) +│ ├── display_manager.py # Display controller (Impressive integration) +│ ├── current_event.json # Current active event (runtime) +│ ├── config/ # Persistent client data +│ │ ├── client_uuid.txt +│ │ └── last_group_id.txt +│ ├── presentation/ # Downloaded presentation files & PDFs +│ └── screenshots/ # Screenshot captures for monitoring +├── scripts/ # Production & testing utilities +│ ├── start-dev.sh # Start development client +│ ├── start-display-manager.sh # Start Display Manager +│ ├── test-display-manager.sh # Interactive testing menu +│ ├── test-impressive.sh # Test Impressive (auto-quit) +│ ├── test-impressive-loop.sh # Test Impressive (loop mode) +│ ├── test-mqtt.sh # MQTT connectivity test +│ ├── test-screenshot.sh # Screenshot capture test +│ └── present-pdf-auto-advance.sh # PDF presentation wrapper +├── logs/ # Application logs +│ ├── simclient.log +│ └── display_manager.log +└── venv/ # Python virtual environment +``` + +## Configuration & Environment Variables + +### Development vs Production +- **Development**: `ENV=development`, verbose logging, frequent heartbeats +- **Production**: `ENV=production`, minimal logging, longer intervals + +### Key Environment Variables +```bash +# Environment +ENV=development|production +DEBUG_MODE=1|0 +LOG_LEVEL=DEBUG|INFO|WARNING|ERROR + +# MQTT Configuration +MQTT_BROKER=192.168.1.100 # Primary MQTT broker +MQTT_PORT=1883 # MQTT port +MQTT_BROKER_FALLBACKS=host1,host2 # Fallback brokers + +# Timing (seconds) +HEARTBEAT_INTERVAL=10 # Status update frequency +SCREENSHOT_INTERVAL=30 # Dashboard screenshot frequency + +# File/API Server (used to download presentation files) +# Defaults to the same host as MQTT_BROKER, port 8000, scheme http. +# If incoming event URLs use host 'server' (or are host-less), simclient rewrites them to this server. +FILE_SERVER_HOST= # optional; if empty, defaults to MQTT_BROKER +FILE_SERVER_PORT=8000 # default API port +FILE_SERVER_SCHEME=http # http or https +# FILE_SERVER_BASE_URL= # optional full override, e.g., http://192.168.1.100:8000 +``` + +### File Server URL Resolution +- The MQTT client (`simclient.py`) downloads presentation files listed in events. +- To avoid DNS issues when event URLs use `http://server:8000/...`, the client normalizes such URLs to the configured file server. +- By default, the file server host is the same as `MQTT_BROKER`, with port `8000` and scheme `http`. +- You can override behavior using `.env` variables above; `FILE_SERVER_BASE_URL` takes precedence over individual host/port/scheme. +- Inline comments in `.env` are supported; keep comments after a space and `#` so values stay clean. + +## Development Patterns & Best Practices + +### Error Handling +- Robust MQTT connection with fallbacks and retries +- Graceful degradation when services unavailable +- Comprehensive logging with rotating file handlers +- Exception handling for all external operations + +### State Management +- Event state persisted in `current_event.json` +- Client configuration persisted across restarts +- Group membership maintained with server synchronization +- Clean state transitions (delete old events on group changes) + +### Threading Architecture +- Main thread: MQTT communication and heartbeat +- Background thread: Screenshot monitoring service +- Thread-safe operations for shared resources + +### File Operations +- Automatic directory creation for all output paths +- Safe file operations with proper exception handling +- Atomic writes for configuration files +- Automatic cleanup of temporary/outdated files + +## Development Workflow + +### Local Development Setup +1. Clone repository to `~/infoscreen-dev` +2. Create virtual environment: `python3 -m venv venv` +3. Install dependencies: `pip install -r src/requirements.txt` (includes pygame + pillow for PDF slideshows) +4. Configure `.env` file with MQTT broker settings +5. Use `./scripts/start-dev.sh` for MQTT client or `./scripts/start-display-manager.sh` for display manager +6. **Important**: Virtual environment must include pygame and pillow for PDF auto-advance to work + +### Testing Components +- `./scripts/test-mqtt.sh` - MQTT connectivity +- `./scripts/test-screenshot.sh` - Screenshot capture +- `./scripts/test-display-manager.sh` - Interactive testing menu +- `./scripts/test-impressive.sh` - Test auto-quit presentation mode +- `./scripts/test-impressive-loop.sh` - Test loop presentation mode +- `./scripts/test-utc-timestamps.sh` - Event timing validation +- Manual event testing via mosquitto_pub or test-display-manager.sh + +### Production Deployment +- Docker containerization available (`docker-compose.production.yml`) +- Systemd service integration for auto-start +- Resource limits and health checks configured +- Persistent volume mounts for data + +## Code Style & Conventions + +### Python Code Standards +- Environment variable parsing with fallback defaults +- Comprehensive docstrings for complex functions +- Logging at appropriate levels (DEBUG/INFO/WARNING/ERROR) +- Type hints where beneficial for clarity +- Exception handling with specific error types + +### Configuration Management +- Environment-first configuration (12-factor app principles) +- Support for inline comments in environment values +- Graceful handling of missing/invalid configuration +- Multiple environment file locations for flexibility + +### MQTT Message Handling +- JSON message format validation +- Robust payload parsing with fallbacks +- Topic-specific message handlers +- Retained message support where appropriate + +## Hardware Considerations + +### Target Platform +- **Primary**: Raspberry Pi 4/5 with desktop environment +- **Storage**: SSD recommended for performance +- **Display**: HDMI output for presentation display +- **Network**: WiFi or Ethernet connectivity required + +### System Dependencies +- Python 3.x runtime +- Network connectivity for MQTT +- Display server (X11) for screenshot capture +- **Impressive** - PDF presenter with auto-advance (primary presentation tool) +- **pygame** - Required for Impressive (installed in venv) +- **Pillow/PIL** - Required for Impressive PDF rendering (installed in venv) +- **LibreOffice** - PPTX to PDF conversion (headless mode) +- Chromium/Chrome - Web content display (kiosk mode) +- VLC or MPV - Video playbook + +### Video playback details (python-vlc) + +- The Display Manager now prefers using python-vlc (libvlc) when available for video playback. This enables programmatic control (autoplay, loop, volume) and cleaner termination/cleanup. If python-vlc is not available, the external `vlc` binary is used as a fallback. +- Supported video event fields: `url`, `autoplay` (boolean), `loop` (boolean), `volume` (float 0.0-1.0). The manager converts `volume` to VLC's 0-100 scale. +- URLs using the placeholder host `server` (for example `http://server:8000/...`) are rewritten to the configured file server before playback. The resolution priority is: `FILE_SERVER_BASE_URL` > `FILE_SERVER_HOST` (or `MQTT_BROKER`) + `FILE_SERVER_PORT` + `FILE_SERVER_SCHEME`. +- Hardware-accelerated decoding errors (e.g., `h264_v4l2m2m`) may appear when the platform does not expose a V4L2 M2M device. To avoid these errors the Display Manager can be configured to disable hw-decoding (see README env var `VLC_HW_ACCEL`). By default the manager will attempt hw-acceleration when libvlc supports it. +- Fullscreen / kiosk: the manager will attempt to make libVLC windows fullscreen (remove decorations) when using python-vlc, and the README contains recommended system-level kiosk/session setup for a truly panel-free fullscreen experience. + + +## Security & Privacy + +### Data Protection +- Hardware identification via cryptographic hash +- No sensitive data in plain text logs +- Local storage of minimal required data only +- Secure MQTT communication (configurable) + +### Network Security +- Configurable MQTT authentication (if broker requires) +- Firewall-friendly design (outbound connections only) +- Multiple broker fallback for reliability + +## Presentation System Architecture + +### How It Works +1. **PDF File Received** → Event contains PDF file reference → Use directly (no conversion) +2. **PPTX File Received** → Event contains PPTX file reference +3. **Convert to PDF** → LibreOffice headless: `libreoffice --headless --convert-to pdf` +4. **Cache PDF** → Converted PDF stored in `presentation/` directory +5. **Display with Impressive** → Launch with venv environment and parameters: + - `--fullscreen` - Full screen mode + - `--nooverview` - No slide overview + - `--auto N` - Auto-advance every N seconds + - `--wrap` - Loop infinitely (if `loop: true`) + - `--autoquit` - Exit after last slide (if `loop: false`) + +### Key Parameters +| Parameter | Type | Default | Description | +|-----------|------|---------|-------------| +| `auto_advance` | boolean | `false` | Enable automatic slide advancement | +| `slide_interval` | integer | `10` | Seconds between slides | +| `loop` | boolean | `false` | Loop presentation vs. quit after last slide | + +### Why Impressive? +- ✅ **Native auto-advance** - No xdotool or window management hacks +- ✅ **Built-in loop support** - Reliable `--wrap` parameter +- ✅ **Works on Raspberry Pi** - No focus/window issues +- ✅ **Simple integration** - Clean command-line interface +- ✅ **Maintainable** - ~50 lines of code vs. 200+ with xdotool approaches + +### Implementation Location +- **File**: `src/display_manager.py` +- **Method**: `start_presentation()` +- **Key Logic**: + 1. Check if PDF file (use directly) or PPTX (needs conversion) + 2. Convert PPTX to PDF if needed (cached for reuse) + 3. Set up virtual environment for Impressive (pygame + pillow) + 4. Build Impressive command with appropriate parameters + 5. Launch process and monitor + +## Common Development Tasks + +When working on this codebase: + +1. **Adding new event types**: Extend the event processing logic in `display_manager.py` → `start_display_for_event()` +2. **Modifying presentation behavior**: Update `display_manager.py` → `start_presentation()` +3. **Configuration changes**: Update environment variable parsing and validation +4. **MQTT topics**: Follow the established `infoscreen/` namespace pattern +5. **Error handling**: Always include comprehensive logging and graceful fallbacks +6. **State persistence**: Use the established `config/` directory pattern +7. **Testing**: Use `./scripts/test-display-manager.sh` for interactive testing +8. **Presentation testing**: Use `./scripts/test-impressive*.sh` scripts +9. **File download host resolution**: If the API server differs from the MQTT broker or uses HTTPS, set `FILE_SERVER_*` in `.env` or adjust `resolve_file_url()` in `src/simclient.py`. + +## Troubleshooting Guidelines + +### Common Issues +- **MQTT Connection**: Check broker reachability, try fallback brokers +- **Screenshots**: Verify display environment and permissions +- **File Downloads**: Check network connectivity and disk space + - If event URLs use host `server` and DNS fails, the client rewrites to `MQTT_BROKER` by default. + - Ensure `MQTT_BROKER` points to the correct server IP; if the API differs, set `FILE_SERVER_HOST` or `FILE_SERVER_BASE_URL`. + - Match scheme/port via `FILE_SERVER_SCHEME`/`FILE_SERVER_PORT` for HTTPS or non-default ports. +- **Group Changes**: Monitor log for group assignment messages +- **Service Startup**: Check systemd logs and environment configuration + +### Debugging Tools +- Log files in `logs/simclient.log` and `logs/display_manager.log` with rotation +- MQTT message monitoring with mosquitto_sub +- Interactive testing menu: `./scripts/test-display-manager.sh` +- Component test scripts: `test-impressive*.sh`, `test-mqtt.sh`, etc. +- Process monitoring: Check for `impressive`, `libreoffice`, `chromium`, `vlc` processes + +### File download URL troubleshooting +- Symptoms: + - `Failed to resolve 'server'` or `NameResolutionError` when downloading files + - `Invalid URL 'http # http or https://...'` in `simclient.log` +- What to check: + - Look for lines like `Lade Datei herunter von:` in `logs/simclient.log` to see the effective URL used + - Ensure the URL host is the MQTT broker IP (or your configured file server), not `server` + - Verify `.env` values don’t include inline comments as part of the value (e.g., keep `FILE_SERVER_SCHEME=http` on its own line) +- Fixes: + - If your API is on the same host as the broker: leave `FILE_SERVER_HOST` empty (defaults to `MQTT_BROKER`), keep `FILE_SERVER_PORT=8000`, and set `FILE_SERVER_SCHEME=http` or `https` + - To override fully, set `FILE_SERVER_BASE_URL` (e.g., `http://192.168.1.100:8000`); this takes precedence + - After changing `.env`, restart the simclient process +- Expected healthy log sequence: + - `Lade Datei herunter von: http://:8000/...` + - Followed by `"GET /... HTTP/1.1" 200` and `Datei erfolgreich heruntergeladen:` + +## Important Notes for AI Assistants + +### Virtual Environment Requirements (Critical) +- **pygame and pillow MUST be installed in venv** - Required for Impressive to work +- **Display manager uses venv context** - Ensures Impressive has access to dependencies +- **Installation command**: `pip install pygame pillow` (already in requirements.txt) +- **If pygame missing**: Impressive will fail with "No module named 'pygame'" error + +### Presentation System +- **ALWAYS use Impressive** for PDF presentations (primary solution) +- **DO NOT suggest xdotool approaches** - they failed on Raspberry Pi due to window focus issues +- **DO NOT suggest video conversion** - adds complexity, had black screen issues +- **PDF files are supported natively** - no conversion needed +- **PPTX conversion is automatic** - LibreOffice headless handles PPTX→PDF +- **Virtual environment is required** - pygame + pillow must be available for Impressive +- **Loop mode uses `--wrap`** - not custom scripts or workarounds +- **Auto-quit uses `--autoquit`** - native Impressive parameter + +### Testing Approach +- Use `./scripts/test-display-manager.sh` for interactive testing +- Use `./scripts/test-impressive-loop.sh` to verify loop functionality +- Test individual components with specific test scripts +- Always check logs in `logs/` directory for debugging + +### Code Changes +- Display logic is in `src/display_manager.py`, not `simclient.py` +- MQTT client (`simclient.py`) writes events to `current_event.json` +- Display Manager reads `current_event.json` and launches appropriate applications +- Two separate processes: simclient.py (MQTT) + display_manager.py (display control) + +### Documentation +- **README.md** - Start here for comprehensive overview +- **IMPRESSIVE_INTEGRATION.md** - Deep dive into presentation system +- **QUICK_REFERENCE.md** - Quick commands and examples +- Source code has extensive comments and logging + +This system is designed for reliability and ease of maintenance in educational environments with multiple deployed clients. The Impressive-based presentation solution provides native auto-advance and loop support without complex window management hacks. + +## Recent changes (Oct 2025) + +Summary of additions since the last Copilot instructions update: + +- Added `event_type` handling for scheduler events: `presentation`, `webuntis`, `webpage`, `website`. The display manager now uses `event_type` when available to pick the correct display path. +- Implemented auto-scroll for long websites. Two strategies are available: + - CDP injection via DevTools websocket using `websocket-client` and `requests`. The injector attempts to evaluate an auto-scroll script inside the page context. Default duration: 60s. + - Local Chrome extension fallback (`src/chrome_autoscroll`) loaded with `--load-extension` when CDP handshake is blocked (403), ensuring reliable autoscroll operation. +- New helper scripts for debugging DevTools handshake: `scripts/test_cdp.py` and `scripts/test_cdp_origins.py`. +- Updated `requirements.txt` to include `websocket-client`. + +Notes for Copilot: +- When adding or modifying display logic, prefer Impressive for PDF presentations and avoid xdotool approaches for slideshow control. +- For web events, ensure autoscroll is only activated for `event_type: "website"` and keep the CDP injection optional/fallback-only when feasible. \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c6a7f80 --- /dev/null +++ b/.gitignore @@ -0,0 +1,64 @@ +# .gitignore for infoscreen-dev workspace +# Ignore common python and workspace artifacts while keeping source files tracked + +# Byte-compiled / cache +__pycache__/ +*.py[cod] +*$py.class + +# Virtual environments +venv/ +.venv/ +env/ +ENV/ + +# dotenv local overrides (leave .env if intentionally committed) +.env.local +.env.*.local +.env + +# Logs and runtime files +logs/ +*.log +simclient.log +simclient.log.* + +# Screenshots and large runtime artifacts +screenshots/ +presentation/*.cache + +# Backup of nested src git metadata +src/.git.backup/ + +# Editor/IDE +.vscode/ +.idea/ +*.sublime-workspace +*.sublime-project +*.swp + +# OS files +.DS_Store +Thumbs.db + +# Test / coverage +.pytest_cache/ +.coverage +htmlcov/ + +# Build / packaging +build/ +dist/ +*.egg-info/ + +# Archives +*.tar.gz +*.zip + +# Database files +*.sqlite3 +*.db + +# Misc +*.bak +*.old diff --git a/CLEANUP_SUMMARY.md b/CLEANUP_SUMMARY.md new file mode 100644 index 0000000..58cfa94 --- /dev/null +++ b/CLEANUP_SUMMARY.md @@ -0,0 +1,195 @@ +# Workspace Cleanup Summary + +## 🧹 Latest Cleanup Completed - October 2, 2025 + +This workspace has been cleaned after implementing PDF slideshow support with auto-advance functionality. All debug and temporary files from the optimization process have been removed. + +## ✅ PDF Slideshow Implementation Cleanup + +### Latest Changes (October 2, 2025): + +#### Files Removed: +- `scripts/test-pdf-auto-advance.sh` - Comprehensive PDF auto-advance test +- `scripts/test-pdf-loop-modes.sh` - Loop vs auto-quit behavior test +- `scripts/test-pdf-slideshow.sh` - Basic PDF slideshow test +- `scripts/verify-pdf-slideshow.sh` - Final verification script +- `src/test_pdf_event.json` - Temporary event file for testing +- `src/current_event.json.backup` - Backup created during testing +- All `__pycache__/` directories and `*.pyc` files + +#### Files Updated: +- `src/requirements.txt` - Added pygame>=2.0.0 and pillow>=8.0.0 +- Log files cleaned (removed debug traces) + +## ✅ Final Complete Solution Overview + +**Presentation System:** +- **PDF files:** Native support with auto-advance +- **PPTX files:** PPTX → PDF (LibreOffice) → Impressive (with auto-advance & loop) +- **Virtual Environment:** pygame + pillow installed for impressive support + +**Why This Works:** +- ✅ Native auto-advance (no xdotool hacks) +- ✅ Reliable loop support (`--wrap` parameter) +- ✅ Clean auto-quit (`--autoquit` parameter) +- ✅ Works consistently on Raspberry Pi +- ✅ Simple, maintainable code + +## 📁 Files Retained + +### Core Application +- `src/simclient.py` - MQTT client (event management, heartbeat, discovery) +- `src/display_manager.py` - Display controller (✨ **Updated for Impressive**) +- `src/requirements.txt` - Python dependencies + +### Documentation +- `README.md` - Complete project documentation (✨ **New comprehensive guide**) +- `IMPRESSIVE_INTEGRATION.md` - Detailed presentation system documentation +- `src/DISPLAY_MANAGER.md` - Display Manager architecture +- `src/IMPLEMENTATION_SUMMARY.md` - Implementation overview +- `src/README.md` - MQTT client documentation +- `src/CONTAINER_TRANSITION.md` - Docker deployment guide + +### Scripts (Production & Testing) +- `scripts/start-dev.sh` - Start development client +- `scripts/start-display-manager.sh` - Start Display Manager +- `scripts/test-display-manager.sh` - Interactive testing menu +- `scripts/test-impressive.sh` - Test Impressive (auto-quit mode) +- `scripts/test-impressive-loop.sh` - Test Impressive (loop mode) +- `scripts/test-mqtt.sh` - Test MQTT connectivity +- `scripts/test-screenshot.sh` - Test screenshot capture +- `scripts/test-utc-timestamps.sh` - Test event timing +- `scripts/present-pdf-auto-advance.sh` - PDF presentation wrapper +- `scripts/infoscreen-display.service` - Systemd service file + +### Configuration +- `.env` - Environment variables +- `.github/copilot-instructions.md` - AI assistant context + +## 🗑️ Files Removed + +### Obsolete Auto-Advance Scripts (xdotool approach - FAILED) +- ❌ `scripts/auto-advance-slides.sh` (v1) +- ❌ `scripts/auto-advance-slides-v2.sh` (enhanced window management) +- ❌ `scripts/auto-advance-slides-v3.sh` (end detection) +- ❌ `scripts/auto-advance-slides-v4.sh` (active window approach) +- ❌ `scripts/auto-advance-slides-v5.sh` (hybrid approach) + +### Obsolete Test Scripts +- ❌ `scripts/quick-test-autoadvance.sh` +- ❌ `scripts/quick-test-autoadvance-v3.sh` +- ❌ `scripts/quick-test-v4.sh` +- ❌ `scripts/quick-test-v5.sh` +- ❌ `scripts/quick-start.sh` +- ❌ `scripts/test-auto-advance.sh` +- ❌ `scripts/test-slideshow-start.sh` +- ❌ `scripts/test-pdf-approach.sh` +- ❌ `scripts/test-aggressive-focus.sh` +- ❌ `scripts/test-manual-vs-xdotool.sh` +- ❌ `scripts/test-show-parameter.sh` +- ❌ `scripts/test-presentation.sh` +- ❌ `scripts/test-modified-presentation.sh` +- ❌ `scripts/test-option1-modified-pptx.sh` +- ❌ `scripts/test-video-conversion.sh` + +### Obsolete Diagnostic Scripts +- ❌ `scripts/debug-window-focus.sh` +- ❌ `scripts/diagnose-evince-keyboard.sh` +- ❌ `scripts/diagnose-f5-issue.sh` +- ❌ `scripts/diagnose-libreoffice-show.sh` +- ❌ `scripts/compare-v2-v3.sh` + +### Failed Alternative Approaches +- ❌ `scripts/add_slide_timings.py` (modify PPTX timings - FAILED) +- ❌ `scripts/present-as-video.sh` (video conversion - FAILED) +- ❌ `scripts/play-test-video.sh` +- ❌ `scripts/present-with-pympress.sh` (alternative presenter - FAILED) +- ❌ `scripts/present-with-impressive.sh` (redundant, replaced by present-pdf-auto-advance.sh) + +### Obsolete Documentation +- ❌ `AUTO_ADVANCE_QUICKREF.txt` +- ❌ `AUTO_ADVANCE_V3_QUICKREF.txt` +- ❌ `SLIDESHOW_FIX_QUICKREF.txt` +- ❌ `UTC_FIX_QUICKREF.txt` +- ❌ `IMPRESSIVE_SOLUTION.txt` (merged into IMPRESSIVE_INTEGRATION.md) +- ❌ `QUICK_START_GUIDE.md` (replaced by comprehensive README.md) +- ❌ `src/AUTO_ADVANCE_V3.md` +- ❌ `src/SLIDES_NOT_ADVANCING_FIX.md` +- ❌ `src/FULLSCREEN_AUTOADVANCE_FIX.md` +- ❌ `src/ALTERNATIVE_APPROACHES.md` +- ❌ `src/UTC_FIX.md` +- ❌ `src/AUTO_ADVANCE_FIX.md` +- ❌ `src/PDF_PRESENTATION_SOLUTION.md` +- ❌ `src/SLIDESHOW_FIX.md` + +## 📊 Statistics + +- **Total files removed:** ~50+ obsolete files +- **Scripts removed:** ~35 scripts +- **Documentation removed:** ~15 files +- **Final script count:** 10 essential scripts +- **Final documentation:** 6 comprehensive guides + +## 🎯 Result + +The workspace now contains: +- ✅ **Clean, production-ready code** +- ✅ **Working Impressive integration** +- ✅ **Comprehensive documentation** +- ✅ **Essential testing scripts only** +- ✅ **No obsolete or failed approaches** + +## 🚀 Next Steps + +1. **Test the solution:** + ```bash + ./scripts/test-display-manager.sh + ``` + +2. **Start production services:** + ```bash + # Terminal 1: MQTT client + cd src && python3 simclient.py + + # Terminal 2: Display Manager + cd src && python3 display_manager.py + ``` + +3. **Deploy to production:** + - Review systemd service: `scripts/infoscreen-display.service` + - Enable auto-start on boot + - Configure `.env` for production + +## 📚 Documentation Structure + +``` +README.md ← Start here (comprehensive guide) +├── IMPRESSIVE_INTEGRATION.md ← Presentation system details +└── src/ + ├── DISPLAY_MANAGER.md ← Display Manager architecture + ├── IMPLEMENTATION_SUMMARY.md ← Implementation overview + ├── README.md ← MQTT client details + └── CONTAINER_TRANSITION.md ← Docker deployment +``` + +## ✨ Key Improvements in Final Solution + +### Before (Failed Approaches) +- ❌ xdotool + LibreOffice (5 versions, all failed) +- ❌ Window focus management issues +- ❌ Complex wrapper scripts +- ❌ Unreliable slide advancement +- ❌ No native loop support + +### After (Impressive Solution) +- ✅ Native auto-advance (no hacks) +- ✅ Built-in loop support +- ✅ Clean codebase +- ✅ Reliable on Raspberry Pi +- ✅ Simple maintenance + +--- + +**Cleanup Date:** October 1, 2025 +**Status:** ✅ Complete +**Result:** Production-ready workspace with final solution only diff --git a/IMPRESSIVE_INTEGRATION.md b/IMPRESSIVE_INTEGRATION.md new file mode 100644 index 0000000..a65e860 --- /dev/null +++ b/IMPRESSIVE_INTEGRATION.md @@ -0,0 +1,272 @@ +# Impressive Integration - Display Manager + +## Overview + +The Display Manager now uses **Impressive** as the primary presentation tool for auto-advancing slideshows. This provides a robust, reliable solution for kiosk-mode presentations with native loop and auto-quit support. + +## Why Impressive? + +After testing multiple approaches (xdotool + LibreOffice, video conversion, etc.), Impressive proved to be the best solution: + +✅ **Native auto-advance** - No need for xdotool hacks or window management +✅ **Loop support** - Built-in `--wrap` parameter for infinite looping +✅ **Auto-quit** - Built-in `--autoquit` parameter to exit after last slide +✅ **Reliable** - Works consistently on Raspberry Pi without focus issues +✅ **Simple** - Clean command-line interface, no complex scripting needed + +## How It Works + +### 1. File Conversion (PPTX → PDF) + +When a PPTX/PPT/ODP file is detected: +```bash +libreoffice --headless --convert-to pdf --outdir presentation/ file.pptx +``` + +The converted PDF is cached and reused if the source file hasn't changed. + +### 2. Impressive Presentation + +For loop mode (most events): +```bash +impressive --fullscreen --nooverview --auto 5 --wrap presentation.pdf +``` + +For single playthrough: +```bash +impressive --fullscreen --nooverview --auto 5 --autoquit presentation.pdf +``` + +## Event JSON Format + +### Looping Presentation (Typical for Events) +```json +{ + "id": "event_123", + "start": "2025-10-01 14:00:00", + "end": "2025-10-01 16:00:00", + "presentation": { + "files": [ + { + "name": "slides.pptx", + "url": "https://server/files/slides.pptx" + } + ], + "auto_advance": true, + "slide_interval": 10, + "loop": true + } +} +``` + +**Result:** Slides advance every 10 seconds, presentation loops infinitely until event end time. + +### Single Playthrough +```json +{ + "id": "event_456", + "presentation": { + "files": [{"name": "welcome.pptx"}], + "auto_advance": true, + "slide_interval": 5, + "loop": false + } +} +``` + +**Result:** Slides advance every 5 seconds, Impressive exits after last slide. + +### Manual Advance (No Auto-Advance) +```json +{ + "presentation": { + "files": [{"name": "manual.pptx"}], + "auto_advance": false + } +} +``` + +**Result:** Presentation displays but doesn't auto-advance (manual control only). + +## Parameters Reference + +| Parameter | Type | Default | Description | +|-----------|------|---------|-------------| +| `auto_advance` | boolean | `false` | Enable automatic slide advancement | +| `slide_interval` | integer | `10` | Seconds between slides (when auto_advance=true) | +| `loop` | boolean | `false` | Loop presentation (vs. quit after last slide) | + +## Display Manager Implementation + +### Code Location +`src/display_manager.py` - `start_presentation()` method + +### Key Features + +1. **Smart Caching**: Checks if PDF exists and is newer than source PPTX +2. **Automatic Conversion**: Uses LibreOffice headless mode for PPTX→PDF +3. **Fallback Support**: Falls back to evince/okular if Impressive not installed +4. **Comprehensive Logging**: Logs all operations for debugging + +### Process Flow +``` +1. Receive presentation event +2. Check file type (.pptx, .pdf, etc.) +3. If PPTX: + a. Check if PDF cache exists and is current + b. Convert to PDF if needed (LibreOffice headless) +4. Build Impressive command: + - Always: --fullscreen --nooverview + - If auto_advance: --auto + - If loop: --wrap + - If not loop: --autoquit +5. Start Impressive process +6. Monitor process and event timing +``` + +## Testing + +### Test Scripts Available + +1. **test-impressive.sh** - Test Impressive with auto-quit (single playthrough) + ```bash + ./scripts/test-impressive.sh + ``` + +2. **test-impressive-loop.sh** - Test Impressive with loop mode + ```bash + ./scripts/test-impressive-loop.sh + ``` + +3. **test-display-manager.sh** - Interactive testing with Display Manager + ```bash + ./scripts/test-display-manager.sh + ``` + Then select option 2 (Create PRESENTATION test event) + +### Manual Testing + +Create a test event: +```bash +cat > src/current_event.json <60s to convert +- Check disk space: `df -h` +- Monitor conversion: `tail -f logs/display_manager.log` + +## Abandoned Approaches + +For historical context, these approaches were tried but didn't work reliably on Raspberry Pi: + +❌ **xdotool + LibreOffice** (5 versions tested) + - Problem: Window focus issues prevented reliable slide advancement + - Versions: v1 (basic), v2 (enhanced focus), v3 (end detection), v4 (active window), v5 (hybrid) + +❌ **Video Conversion** + - Problem: Black screen issues, complex conversion process + - Tool tested: LibreOffice export to video + +❌ **evince + xdotool** + - Problem: Same focus issues as LibreOffice approach + +❌ **Modified PPTX Timings** + - Problem: LibreOffice --show parameter doesn't work properly in fullscreen + +## Architecture Benefits + +### Separation of Concerns +- **Display Manager**: Event timing, process management, file management +- **LibreOffice**: PPTX→PDF conversion (headless, no GUI) +- **Impressive**: Presentation display with native features + +### Reliability +- No window management hacks (xdotool) +- No timing-dependent scripts +- Native features = fewer failure points + +### Maintainability +- Simple, clean code in Display Manager +- Well-documented Impressive parameters +- Easy to debug with comprehensive logging + +## Future Enhancements + +Possible improvements for future versions: + +1. **Slide Timing Metadata**: Extract slide timings from PPTX and pass to Impressive +2. **Multi-Screen Support**: Extend for multiple display outputs +3. **Transition Effects**: Utilize Impressive's transition capabilities +4. **Remote Control**: Add MQTT commands to control presentation (pause/resume) +5. **Thumbnail Cache**: Pre-generate thumbnails for dashboard previews + +## References + +- **Impressive Homepage**: http://impressive.sourceforge.net/ +- **Impressive Manual**: `man impressive` or `impressive --help` +- **LibreOffice Headless**: https://help.libreoffice.org/Common/Starting_in_Headless_Mode +- **Display Manager Code**: `src/display_manager.py` +- **Test Scripts**: `scripts/test-impressive*.sh` + +--- + +**Last Updated:** October 2025 +**Status:** ✅ Production Ready +**Tested On:** Raspberry Pi 5, Raspberry Pi OS (Bookworm) diff --git a/PROGRESS_BAR_IMPLEMENTATION.md b/PROGRESS_BAR_IMPLEMENTATION.md new file mode 100644 index 0000000..35e32cf --- /dev/null +++ b/PROGRESS_BAR_IMPLEMENTATION.md @@ -0,0 +1,258 @@ +# Progress Bar Implementation Summary + +## Overview + +The Display Manager now supports the scheduler's `page_progress` and `auto_progress` fields to control Impressive's progress bar features during presentations. + +## Implementation Details + +### Fields Supported + +| Field | Type | Impressive Option | Description | +|-------|------|-------------------|-------------| +| `page_progress` | boolean | `--page-progress` (or `-q`) | Shows overall progress bar indicating position in presentation | +| `auto_progress` | boolean | `--auto-progress` (or `-k`) | Shows per-page countdown progress during auto-advance | + +### Event Flow + +1. **Scheduler sends event** with `page_progress` and `auto_progress` fields +2. **simclient.py receives** and stores complete event in `current_event.json` (no filtering) +3. **display_manager.py reads** event and extracts progress settings +4. **Impressive launches** with appropriate `--page-progress` and/or `--auto-progress` options + +## Code Changes + +### simclient.py + +Enhanced documentation in `save_event_to_json()` to explicitly mention progress bar fields are preserved: + +```python +def save_event_to_json(event_data): + """Speichert eine Event-Nachricht in der Datei current_event.json + + This function preserves ALL fields from the incoming event data, + including scheduler-specific fields like: + - page_progress: Show overall progress bar in presentation + - auto_progress: Show per-page auto-advance countdown + - And any other fields sent by the scheduler + """ +``` + +### display_manager.py + +Added support for reading and using progress fields in `start_presentation()`: + +```python +# Get scheduler-specific progress display settings +page_progress = event.get('page_progress', False) # Show overall progress bar +auto_progress = event.get('auto_progress', False) # Show per-page auto-advance progress + +# Later in Impressive command building: +if page_progress: + cmd.append('--page-progress') + logging.info("Page progress bar enabled (shows overall position in presentation)") + +if auto_progress: + cmd.append('--auto-progress') + logging.info("Auto-progress bar enabled (shows per-page countdown during auto-advance)") +``` + +## Example Events + +### With Page Progress Only + +```json +{ + "id": 100, + "group_id": 2, + "page_progress": true, + "auto_progress": false, + "presentation": { + "auto_advance": true, + "slide_interval": 10, + "loop": true, + "files": [{"name": "slides.pdf"}] + } +} +``` + +**Result:** Impressive shows overall progress bar at bottom: `[=====> ] 50%` + +### With Auto-Progress Only + +```json +{ + "id": 101, + "group_id": 2, + "page_progress": false, + "auto_progress": true, + "presentation": { + "auto_advance": true, + "slide_interval": 10, + "files": [{"name": "slides.pdf"}] + } +} +``` + +**Result:** Impressive shows countdown bar for each slide during auto-advance + +### With Both Progress Bars + +```json +{ + "id": 102, + "group_id": 2, + "page_progress": true, + "auto_progress": true, + "presentation": { + "auto_advance": true, + "slide_interval": 10, + "loop": true, + "files": [{"name": "slides.pdf"}] + } +} +``` + +**Result:** Both progress indicators visible simultaneously + +### No Progress Bars (Default) + +```json +{ + "id": 103, + "group_id": 2, + "presentation": { + "auto_advance": true, + "slide_interval": 10, + "files": [{"name": "slides.pdf"}] + } +} +``` + +**Result:** Clean presentation without progress indicators (fields default to `false`) + +## Testing + +### Interactive Test Script + +```bash +cd ~/infoscreen-dev/scripts +./test-progress-bars.sh +``` + +This interactive script allows you to: +1. Select a progress bar configuration (none, page only, auto only, or both) +2. Sends test event to MQTT +3. Verifies Display Manager processes it correctly +4. Shows expected behavior + +### Manual Testing with mosquitto_pub + +```bash +# Test with both progress bars +mosquitto_pub -h localhost -t "infoscreen/events/2" -m '{ + "id": 999, + "page_progress": true, + "auto_progress": true, + "presentation": { + "auto_advance": true, + "slide_interval": 5, + "loop": true, + "files": [{"name": "test.pdf"}] + } +}' +``` + +### Verification + +1. **Check Display Manager Log:** + ```bash + tail -f ~/infoscreen-dev/logs/display_manager.log + ``` + + Look for: + ``` + Page progress bar enabled (shows overall position in presentation) + Auto-progress bar enabled (shows per-page countdown during auto-advance) + ``` + +2. **Check Impressive Command:** + ```bash + ps aux | grep impressive + ``` + + Should show command with appropriate options: + ``` + impressive --fullscreen --nooverview --auto 5 --wrap --page-progress --auto-progress /path/to/file.pdf + ``` + +3. **Visual Verification:** + - Watch the presentation on the display + - Page progress: Bar at bottom showing position + - Auto-progress: Countdown overlay on each slide + +## Impressive Command Examples + +```bash +# No progress bars (default) +impressive --fullscreen --auto 10 --wrap presentation.pdf + +# Page progress only +impressive --fullscreen --auto 10 --wrap --page-progress presentation.pdf +impressive --fullscreen --auto 10 --wrap -q presentation.pdf # Short form + +# Auto-progress only +impressive --fullscreen --auto 10 --wrap --auto-progress presentation.pdf +impressive --fullscreen --auto 10 --wrap -k presentation.pdf # Short form + +# Both progress bars +impressive --fullscreen --auto 10 --wrap --page-progress --auto-progress presentation.pdf +impressive --fullscreen --auto 10 --wrap -q -k presentation.pdf # Short form +``` + +## Benefits + +1. **User Feedback**: Viewers know where they are in the presentation +2. **Time Awareness**: Auto-progress shows how long until next slide +3. **Professional Look**: Progress indicators enhance presentation quality +4. **Flexible Control**: Scheduler can enable/disable per event +5. **Backward Compatible**: Fields default to `false`, existing events work unchanged + +## Compatibility + +- ✅ **Impressive**: Full support for both progress bar features +- ⚠️ **Evince/Okular**: Fallback viewers don't support progress bars (features ignored) +- ✅ **PDF Files**: Native support with no conversion needed +- ✅ **PPTX Files**: Automatic conversion to PDF, then progress bars work + +## Documentation Updates + +- ✅ README.md - Added progress bar field documentation +- ✅ SCHEDULER_FIELDS_SUPPORT.md - Updated with implementation details +- ✅ Code comments - Enhanced docstrings +- ✅ Test scripts - Created test-progress-bars.sh +- ✅ This summary document + +## Logging + +With `LOG_LEVEL=DEBUG`, you'll see: + +``` +[INFO] Event page_progress = true +[INFO] Event auto_progress = true +[INFO] Starting presentation: slides.pdf +[INFO] Auto-advance enabled (interval: 10s) +[INFO] Loop mode enabled (presentation will restart after last slide) +[INFO] Page progress bar enabled (shows overall position in presentation) +[INFO] Auto-progress bar enabled (shows per-page countdown during auto-advance) +[DEBUG] Full command: impressive --fullscreen --nooverview --auto 10 --wrap --page-progress --auto-progress /path/to/slides.pdf +``` + +## Summary + +✅ **Implementation complete** - Progress bar fields are now fully supported +✅ **Backward compatible** - Existing events without these fields work unchanged +✅ **Well documented** - README, code comments, and test scripts updated +✅ **Tested** - Interactive test script available +✅ **Flexible** - Both options can be used independently or together +✅ **Clean code** - Minimal changes, follows existing patterns diff --git a/QUICK_REFERENCE.md b/QUICK_REFERENCE.md new file mode 100644 index 0000000..fbd18a6 --- /dev/null +++ b/QUICK_REFERENCE.md @@ -0,0 +1,192 @@ +# 🚀 Infoscreen Client - Quick Reference + +## One-Line Summary +**PPTX → PDF (LibreOffice) → Impressive (auto-advance + loop) = Perfect Kiosk Presentations** + +## Essential Commands + +### Start Services +```bash +# MQTT Client +cd ~/infoscreen-dev/src && python3 simclient.py + +# Display Manager +cd ~/infoscreen-dev/src && python3 display_manager.py +``` + +### Testing +```bash +# Interactive testing menu +./scripts/test-display-manager.sh + +# Test Impressive (single playthrough) +./scripts/test-impressive.sh + +# Test Impressive (loop mode) +./scripts/test-impressive-loop.sh + +# Test MQTT +./scripts/test-mqtt.sh +``` + +### Logs +```bash +tail -f ~/infoscreen-dev/logs/display_manager.log +tail -f ~/infoscreen-dev/logs/simclient.log +``` + +## Event JSON Examples + +### Loop Presentation (Most Common) +```json +{ + "presentation": { + "files": [{"name": "slides.pptx"}], + "auto_advance": true, + "slide_interval": 10, + "loop": true + } +} +``` + +### Single Playthrough +```json +{ + "presentation": { + "files": [{"name": "welcome.pptx"}], + "auto_advance": true, + "slide_interval": 5, + "loop": false + } +} +``` + +### Webpage +```json +{ + "web": { + "url": "https://dashboard.example.com" + } +} +``` + +### Video +```json +{ + "video": { + "url": "https://server/video.mp4", + "loop": true + } +} +``` + +## Parameters + +| Parameter | Type | Default | Description | +|-----------|------|---------|-------------| +| `auto_advance` | bool | `false` | Enable auto-advance | +| `slide_interval` | int | `10` | Seconds per slide | +| `loop` | bool | `false` | Loop vs. quit | + +## Impressive Commands + +```bash +# Auto-advance + loop +impressive --fullscreen --nooverview --auto 10 --wrap file.pdf + +# Auto-advance + quit after last slide +impressive --fullscreen --nooverview --auto 10 --autoquit file.pdf +``` + +## Troubleshooting + +### Presentation doesn't start +```bash +which impressive # Should show path +which libreoffice # Should show path +tail -f logs/display_manager.log # Check errors +``` + +### Slides don't advance +- Verify `auto_advance: true` in event JSON +- Check `slide_interval` is set +- Test: `./scripts/test-impressive.sh` + +### Presentation doesn't loop +- Verify `loop: true` in event JSON +- Test: `./scripts/test-impressive-loop.sh` + +### MQTT issues +```bash +./scripts/test-mqtt.sh # Test connectivity +``` + +## File Locations + +``` +~/infoscreen-dev/ +├── src/ +│ ├── simclient.py # MQTT client +│ ├── display_manager.py # Display controller +│ ├── current_event.json # Current event +│ └── presentation/ # Downloaded files +├── logs/ +│ ├── simclient.log +│ └── display_manager.log +├── scripts/ +│ └── *.sh # All test/start scripts +└── .env # Configuration +``` + +## Installation + +```bash +# System dependencies +sudo apt-get install python3 python3-pip python3-venv \ + libreoffice impressive chromium-browser vlc + +# Python dependencies +cd ~/infoscreen-dev +python3 -m venv venv +source venv/bin/activate +pip install -r src/requirements.txt +``` + +## Configuration (.env) + +```bash +ENV=production +MQTT_BROKER=192.168.1.100 +MQTT_PORT=1883 +HEARTBEAT_INTERVAL=30 +SCREENSHOT_INTERVAL=60 +DISPLAY_CHECK_INTERVAL=5 +``` + +## Documentation + +- **README.md** - Complete guide (start here) +- **IMPRESSIVE_INTEGRATION.md** - Presentation details +- **CLEANUP_SUMMARY.md** - What changed +- **WORKSPACE_STATUS.txt** - Visual summary + +## Key Features + +✅ Auto-advance presentations +✅ Loop mode for events +✅ MQTT-controlled display +✅ Group management +✅ Heartbeat monitoring +✅ Multi-content (presentations, video, web) +✅ Kiosk mode + +## Status + +**Version:** Final Solution (October 2025) +**Status:** ✅ Production Ready +**Tested:** Raspberry Pi 5, Pi OS Bookworm +**Solution:** Impressive PDF Presenter + +--- + +**Need help?** Read README.md or check logs/ diff --git a/README.md b/README.md new file mode 100644 index 0000000..3161c94 --- /dev/null +++ b/README.md @@ -0,0 +1,612 @@ +# Infoscreen Client - Display Manager + +Digital signage system for Raspberry Pi that displays presentations, videos, and web content in kiosk mode. Centrally managed via MQTT with automatic client discovery and heartbeat monitoring. + +## 🎯 Key Features + +- **Automatic Presentation Display** - PPTX files converted to PDF and displayed with Impressive +- **Auto-Advance Slideshows** - Configurable timing for automatic slide progression +- **Loop Mode** - Presentations can loop infinitely or quit after last slide +- **MQTT Integration** - Real-time event management from central server +- **Group Management** - Organize clients into groups for targeted content +- **Heartbeat Monitoring** - Regular status updates and screenshot dashboard +- **Multi-Content Support** - Presentations, videos, and web pages +- **Kiosk Mode** - Full-screen display with automatic startup + +## 📋 System Requirements + +### Hardware +- Raspberry Pi 4/5 (or compatible) +- HDMI display +- Network connectivity (WiFi or Ethernet) +- SSD storage recommended + +### Software +- Raspberry Pi OS (Bookworm or newer) +- Python 3.x +- LibreOffice (for PPTX→PDF conversion) +- Impressive (PDF presenter with auto-advance) +- Chromium browser (for web content) +- VLC or MPV (for video playback) + +## 🚀 Quick Start + +### 1. Installation + +```bash +# Clone repository +cd ~/ +git clone infoscreen-dev +cd infoscreen-dev + +# Install system dependencies +sudo apt-get update +sudo apt-get install -y \ + python3 python3-pip python3-venv \ + libreoffice impressive \ + chromium-browser vlc + +# Create Python virtual environment +python3 -m venv venv +source venv/bin/activate + +# Install Python dependencies +pip install -r src/requirements.txt +``` + +### 2. Configuration + +Create `.env` file in project root: + +```bash +# Environment +ENV=production +LOG_LEVEL=INFO + +# MQTT Configuration +MQTT_BROKER=192.168.1.100 +MQTT_PORT=1883 +MQTT_BROKER_FALLBACKS=192.168.1.101,192.168.1.102 + +# Timing (seconds) +HEARTBEAT_INTERVAL=30 +SCREENSHOT_INTERVAL=60 +DISPLAY_CHECK_INTERVAL=5 + +# File/API Server (used to download presentation files) +# Defaults to the same host as MQTT_BROKER, port 8000, scheme http. +# If incoming event URLs use host 'server' (or are host-less), simclient rewrites them to this server. +FILE_SERVER_HOST= # optional; if empty, defaults to MQTT_BROKER +FILE_SERVER_PORT=8000 # default API port +# http or https +FILE_SERVER_SCHEME=http +# FILE_SERVER_BASE_URL= # optional full override, e.g., http://192.168.1.100:8000 +``` + +### 3. Start Services + +```bash +# Start MQTT client (handles events, heartbeat, discovery) +cd ~/infoscreen-dev/src +python3 simclient.py + +# In another terminal: Start Display Manager +cd ~/infoscreen-dev/src +python3 display_manager.py +``` + +Or use the startup script: +```bash +./scripts/start-display-manager.sh +``` + +## 📊 Presentation System + +### How It Works + +The system uses **Impressive** as the PDF presenter with native auto-advance and loop support: + +1. **PPTX files** are automatically converted to PDF using LibreOffice headless +2. **PDF files** are displayed directly with Impressive +3. **Auto-advance** uses Impressive's built-in `--auto` parameter +4. **Loop mode** uses Impressive's `--wrap` parameter (infinite loop) +5. **Auto-quit** uses Impressive's `--autoquit` parameter (exit after last slide) + +### Event JSON Format + +#### Looping Presentation (Typical for Events) +```json +{ + "id": "event_123", + "start": "2025-10-01 14:00:00", + "end": "2025-10-01 16:00:00", + "presentation": { + "files": [ + { + "name": "slides.pptx", + "url": "https://server/files/slides.pptx" + } + ], + "auto_advance": true, + "slide_interval": 10, + "loop": true + } +} +``` + +**Result:** Slides advance every 10 seconds, presentation loops infinitely until event ends. + +#### Single Playthrough +```json +{ + "presentation": { + "files": [{"name": "welcome.pptx"}], + "auto_advance": true, + "slide_interval": 5, + "loop": false + } +} +``` + +**Result:** Slides advance every 5 seconds, exits after last slide. + +### Presentation Parameters + +| Parameter | Type | Default | Description | +|-----------|------|---------|-------------| +| `auto_advance` | boolean | `false` | Enable automatic slide advancement | +| `slide_interval` | integer | `10` | Seconds between slides | +| `loop` | boolean | `false` | Loop presentation vs. quit after last slide | + +### Scheduler-Specific Fields + +The scheduler may send additional fields that are preserved in `current_event.json`: + +| Field | Type | Description | +|-------|------|-------------| +| `page_progress` | boolean | Show overall progress bar in presentation (Impressive `--page-progress`). Can be provided at `presentation.page_progress` (preferred) or top-level. | +| `auto_progress` | boolean | Show per-page auto-advance countdown (Impressive `--auto-progress`). Can be provided at `presentation.auto_progress` (preferred) or top-level. | +| `occurrence_of_id` | integer | Original event ID for recurring events | +| `recurrence_rule` | string | iCal recurrence rule (RRULE format) | +| `recurrence_end` | string | End date for recurring events | + +**Note:** All fields from the scheduler are automatically preserved when events are stored in `current_event.json`. The client does not filter or modify scheduler-specific metadata. + +#### Progress Bar Display + +When using Impressive PDF presenter: +- `page_progress: true` - Shows a progress bar at the bottom indicating position in the presentation +- `auto_progress: true` - Shows a countdown progress bar for each slide during auto-advance +- Both options can be enabled simultaneously for maximum visual feedback + +## 🎥 Video Events + +```json +{ + "video": { + "url": "https://server/videos/intro.mp4", + "loop": true, + "autoplay": true, + "volume": 0.8 + } +} +``` + +Notes: +- The Display Manager prefers `python-vlc` (libvlc) when available. This gives programmatic control over playback (autoplay, loop, volume) and ensures the player is cleanly stopped and released when events end. +- Supported video event fields: + - `url` (string): HTTP/HTTPS or streaming URL. URLs using the placeholder host `server` are rewritten to the configured file server (see File/API Server configuration). + - `autoplay` (boolean): start playback automatically when the event becomes active (default: true). + - `loop` (boolean): loop playback indefinitely. + - `volume` (float): 0.0–1.0 (mapped internally to VLC's 0–100 volume scale). +- If `python-vlc` is not installed, the Display Manager will fall back to launching the external `vlc` binary. +- The manager attempts to make the player window fullscreen and remove window decorations. For a truly panel-free fullscreen (no taskbar), run the Display Manager inside a minimal kiosk X session or a dedicated user session without a desktop panel (see the kiosk notes below). + +## 🌐 Web Events + +```json +{ + "web": { + "url": "https://dashboard.example.com" + } +} +``` + +Opens webpage in Chromium kiosk mode (fullscreen, no UI). + +## 🗂️ Project Structure + +``` +infoscreen-dev/ +├── .env # Environment configuration +├── README.md # This file +├── IMPRESSIVE_INTEGRATION.md # Detailed presentation system docs +├── src/ +│ ├── simclient.py # MQTT client (events, heartbeat, discovery) +│ ├── display_manager.py # Display controller (manages applications) +│ ├── requirements.txt # Python dependencies +│ ├── current_event.json # Current active event (runtime) +│ ├── config/ # Persistent client data +│ │ ├── client_uuid.txt +│ │ └── last_group_id.txt +│ ├── presentation/ # Downloaded presentation files +│ └── screenshots/ # Dashboard screenshots +├── scripts/ +│ ├── start-dev.sh # Start development client +│ ├── start-display-manager.sh # Start Display Manager +│ ├── test-display-manager.sh # Interactive testing +│ ├── test-impressive.sh # Test Impressive (auto-quit mode) +│ ├── test-impressive-loop.sh # Test Impressive (loop mode) +│ ├── test-mqtt.sh # Test MQTT connectivity +│ ├── test-screenshot.sh # Test screenshot capture +│ ├── test-utc-timestamps.sh # Test event timing +│ └── present-pdf-auto-advance.sh # PDF presentation wrapper +└── logs/ # Application logs +``` + +## 🧪 Testing + +### Test Display Manager + +```bash +./scripts/test-display-manager.sh +``` + +Interactive menu for testing: +- Check Display Manager status +- Create test events (presentation, video, webpage) +- View active processes +- Cycle through different event types + +### Test Impressive Presentation + +**Single playthrough (auto-quit):** +```bash +./scripts/test-impressive.sh +``` + +**Loop mode (infinite):** +```bash +./scripts/test-impressive-loop.sh +``` + +### Test MQTT Communication + +```bash +./scripts/test-mqtt.sh +``` + +Verifies MQTT broker connectivity and topics. + +### Test Screenshot Capture + +```bash +./scripts/test-screenshot.sh +``` + +Captures test screenshot for dashboard monitoring. + +## 🔧 Configuration Details + +### Environment Variables + +#### Environment +- `ENV` - `development` or `production` +- `DEBUG_MODE` - Enable debug output (1=on, 0=off) +- `LOG_LEVEL` - `DEBUG`, `INFO`, `WARNING`, `ERROR` + +#### MQTT +- `MQTT_BROKER` - Primary MQTT broker IP/hostname +- `MQTT_PORT` - MQTT port (default: 1883) +- `MQTT_BROKER_FALLBACKS` - Comma-separated fallback brokers +- `MQTT_USERNAME` - Optional authentication +- `MQTT_PASSWORD` - Optional authentication + +#### Timing +- `HEARTBEAT_INTERVAL` - Status update frequency (seconds) +- `SCREENSHOT_INTERVAL` - Dashboard screenshot frequency (seconds) +- `DISPLAY_CHECK_INTERVAL` - Event check frequency (seconds) + +#### File/API Server +- `FILE_SERVER_HOST` - Host/IP of the file server; defaults to `MQTT_BROKER` when empty +- `FILE_SERVER_PORT` - Port of the file server (default: 8000) +- `FILE_SERVER_SCHEME` - `http` or `https` (default: http) +- `FILE_SERVER_BASE_URL` - Optional full override, e.g., `https://api.example.com:443` + +### File Server URL Resolution +- The MQTT client (`src/simclient.py`) downloads presentation files listed in events. +- If an event contains URLs with host `server` (e.g., `http://server:8000/...`) or a missing host, the client rewrites them to the configured file server. +- By default, the file server host is the same as `MQTT_BROKER`, with port `8000` and scheme `http`. +- You can override this behavior using the `.env` variables above; `FILE_SERVER_BASE_URL` takes precedence over the individual host/port/scheme. +- Tip: When editing `.env`, keep comments after a space and `#` so values stay clean. + +### MQTT Topics + +#### Client → Server +- `infoscreen/discovery` - Initial client announcement +- `infoscreen/{client_id}/heartbeat` - Regular status updates +- `infoscreen/{client_id}/dashboard` - Screenshot images (base64) + +#### Server → Client +- `infoscreen/{client_id}/discovery_ack` - Server response with client ID +- `infoscreen/{client_id}/group_id` - Group assignment +- `infoscreen/events/{group_id}` - Event commands for group + +### Client Identification + +**Hardware Token:** SHA256 hash of: +- CPU serial number +- MAC addresses (all network interfaces) + +**Persistent UUID:** Stored in `src/config/client_uuid.txt` + +**Group Membership:** Stored in `src/config/last_group_id.txt` + +## 🔍 Troubleshooting + +### Display Manager doesn't start presentations + +**Check Impressive installation:** +```bash +which impressive +# If not found: sudo apt-get install impressive +``` + +**Check LibreOffice installation:** +```bash +which libreoffice +# If not found: sudo apt-get install libreoffice +``` + +**Check logs:** +```bash +tail -f logs/display_manager.log +``` + +### Presentations don't convert from PPTX + +**Verify LibreOffice headless:** +```bash +libreoffice --headless --convert-to pdf --outdir /tmp presentation.pptx +ls -l /tmp/*.pdf +``` + +**Check disk space:** +```bash +df -h +``` + +### Slides don't auto-advance + +**Verify event JSON:** +- `auto_advance: true` is set +- `slide_interval` is specified (default: 10) + +**Test Impressive directly:** +```bash +./scripts/test-impressive.sh +``` + +### Presentation doesn't loop + +**Verify event JSON:** +- `loop: true` is set + +**Test loop mode:** +```bash +./scripts/test-impressive-loop.sh +``` + +### File downloads fail + +Symptoms: +- `Failed to resolve 'server'` or `NameResolutionError` when downloading files +- `Invalid URL 'http # http or https://...'` in `logs/simclient.log` + +What to check: +- Look for lines like `Lade Datei herunter von:` in `logs/simclient.log` to see the effective URL used +- Ensure the URL host is the MQTT broker IP (or your configured file server), not `server` +- Verify `.env` values don’t include inline comments as part of the value (e.g., keep `FILE_SERVER_SCHEME=http` on its own line) + +Fixes: +- If your API is on the same host as the broker: leave `FILE_SERVER_HOST` empty (defaults to `MQTT_BROKER`), keep `FILE_SERVER_PORT=8000`, and set `FILE_SERVER_SCHEME=http` or `https` +- To override fully, set `FILE_SERVER_BASE_URL` (e.g., `http://192.168.1.100:8000`); this takes precedence over host/port/scheme +- After changing `.env`, restart the simclient process + +Expected healthy log sequence: +- `Lade Datei herunter von: http://:8000/...` +- Followed by `"GET /... HTTP/1.1" 200` and `Datei erfolgreich heruntergeladen:` + +### VLC hardware decode / renderer issues + +If you see messages like: + +``` +[h264_v4l2m2m @ ...] Could not find a valid device +[h264_v4l2m2m @ ...] can't configure decoder +[... ] avcodec decoder error: cannot start codec (h264_v4l2m2m) +``` + +that indicates libVLC / ffmpeg attempted to use the platform V4L2 M2M hardware decoder but the kernel/device isn't available. Options to resolve: + +- Enable the V4L2 M2M codec driver on the system (platform-specific; on Raspberry Pi ensure correct kernel/firmware and codec modules are loaded). Check `v4l2-ctl --list-devices` and `ls /dev/video*` after installing `v4l-utils`. +- Disable hardware decoding so libVLC/ffmpeg uses software decoding (reliable but higher CPU). You can test this by launching the `vlc` binary with: + +```bash +vlc --avcodec-hw=none 'http://' +``` + +Or modify `src/display_manager.py` to create the libVLC instance with software-decoding forced: + +```python +instance = vlc.Instance('--avcodec-hw=none', '--no-video-title-show', '--no-video-deco') +``` + +This is the fastest workaround if hardware decode is not required or not available on the device. + +### MQTT connection issues + +**Test broker connectivity:** +```bash +./scripts/test-mqtt.sh +``` + +**Check broker status:** +```bash +# On server +sudo systemctl status mosquitto +``` + +**Try fallback brokers:** +Edit `.env` and add `MQTT_BROKER_FALLBACKS` + +### Screenshots not uploading + +**Test screenshot capture:** +```bash +./scripts/test-screenshot.sh +ls -l screenshots/ +``` + +**Check DISPLAY variable:** +```bash +echo $DISPLAY # Should be :0 +``` + +## 📚 Documentation + +- **IMPRESSIVE_INTEGRATION.md** - Detailed presentation system documentation +- **src/DISPLAY_MANAGER.md** - Display Manager architecture +- **src/IMPLEMENTATION_SUMMARY.md** - Implementation overview +- **src/README.md** - MQTT client documentation + +## 🔐 Security + +- Hardware-based client identification (non-spoofable) +- Configurable MQTT authentication +- Local-only file storage +- No sensitive data in logs + +## 🚢 Production Deployment + +### Systemd Service + +Create `/etc/systemd/system/infoscreen-display.service`: + +```ini +[Unit] +Description=Infoscreen Display Manager +After=network.target + +[Service] +Type=simple +User=olafn +WorkingDirectory=/home/olafn/infoscreen-dev/src +Environment="DISPLAY=:0" +Environment="XAUTHORITY=/home/olafn/.Xauthority" +ExecStart=/home/olafn/infoscreen-dev/venv/bin/python3 /home/olafn/infoscreen-dev/src/display_manager.py +Restart=always +RestartSec=10 + +[Install] +WantedBy=multi-user.target +``` + +Enable and start: +```bash +sudo systemctl daemon-reload +sudo systemctl enable infoscreen-display +sudo systemctl start infoscreen-display +sudo systemctl status infoscreen-display +``` + +### Auto-start on Boot + +Both services (simclient.py and display_manager.py) should start automatically: + +1. **simclient.py** - MQTT communication, event management +2. **display_manager.py** - Display application controller + +Create similar systemd service for simclient.py. + +### Docker Deployment (Alternative) + +```bash +docker-compose -f src/docker-compose.production.yml up -d +``` + +See `src/CONTAINER_TRANSITION.md` for details. + +## 📝 Development + +### Development Mode + +Set in `.env`: +```bash +ENV=development +DEBUG_MODE=1 +LOG_LEVEL=DEBUG +HEARTBEAT_INTERVAL=10 +``` + +### Start Development Client + +```bash +./scripts/start-dev.sh +``` + +### View Logs + +```bash +# Display Manager +tail -f logs/display_manager.log + +# MQTT Client +tail -f logs/simclient.log + +# Both +tail -f logs/*.log +``` + +## 🤝 Contributing + +1. Test changes with `./scripts/test-display-manager.sh` +2. Verify MQTT communication with `./scripts/test-mqtt.sh` +3. Update documentation +4. Submit pull request + +## 📄 License + +[Add your license here] + +## 🆘 Support + +For issues or questions: +1. Check logs in `logs/` directory +2. Review troubleshooting section +3. Test individual components with test scripts +4. Check MQTT broker connectivity + +--- + +**Last Updated:** October 2025 +**Status:** ✅ Production Ready +**Tested On:** Raspberry Pi 5, Raspberry Pi OS (Bookworm) + +## Recent changes (Oct 2025) + +The following notable changes were added after the previous release and are included in this branch: + +- Event handling: support for scheduler-provided `event_type` values (new types: `presentation`, `webuntis`, `webpage`, `website`). The display manager now prefers `event_type` when selecting which renderer to start. +- Web display: Chromium is launched in kiosk mode for web events. `website` events (scheduler) and legacy `web` keys are both supported and normalized. +- Auto-scroll feature: automatic scrolling for long websites implemented. Two mechanisms are available: + - CDP injection: The display manager attempts to inject a small auto-scroll script via Chrome DevTools Protocol (DevTools websocket) when possible (uses `websocket-client` and `requests`). Default injection duration: 60s. + - Extension fallback: When DevTools websocket handshakes are blocked (403), a tiny local Chrome extension (`src/chrome_autoscroll`) is loaded via `--load-extension` to run a content script that performs the auto-scroll reliably. +- Autoscroll enabled only for scheduler events with `event_type: "website"` (not for general `web` or `webpage`). The extension and CDP injection are only used when autoscroll is requested for that event type. +- New test utilities: + - `scripts/test_cdp.py` — quick DevTools JSON listing + Runtime.evaluate tester + - `scripts/test_cdp_origins.py` — tries several Origin headers to diagnose 403 handshakes +- Dependencies: `src/requirements.txt` updated to include `websocket-client` (used by the CDP injector). +- Small refactors and improved logging in `src/display_manager.py` to make event dispatch and browser injection more robust. + +If you rely on autoscroll in production, review the security considerations around `--remote-debugging-port` (DevTools) and prefer the extension fallback if your Chromium build enforces strict websocket Origin policies. diff --git a/SCHEDULER_FIELDS_SUPPORT.md b/SCHEDULER_FIELDS_SUPPORT.md new file mode 100644 index 0000000..02597dc --- /dev/null +++ b/SCHEDULER_FIELDS_SUPPORT.md @@ -0,0 +1,202 @@ +# Scheduler Fields Support + +## Overview + +The infoscreen client automatically preserves all fields sent by the scheduler in the event database, including scheduler-specific metadata fields like `page_progress` and `auto_progress`. + +## How It Works + +### Event Storage (`simclient.py`) + +When an event is received via MQTT on the `infoscreen/events/{group_id}` topic: + +1. **Full Preservation**: The `save_event_to_json()` function stores the complete event data using `json.dump()` without filtering +2. **No Data Loss**: All fields from the scheduler are preserved, including: + - `page_progress` - Current page/slide progress tracking + - `auto_progress` - Auto-progression state + - `occurrence_of_id` - Original event ID for recurring events + - `recurrence_rule` - iCal recurrence rule (RRULE format) + - `recurrence_end` - End date for recurring events + - Any other scheduler-specific fields + +3. **Debug Logging**: When `LOG_LEVEL=DEBUG`, the system logs the presence of `page_progress` and `auto_progress` fields + +### Event Processing (`display_manager.py`) + +The Display Manager: +- Uses scheduler-specific fields to control presentation behavior: + - `page_progress`: Controls Impressive's `--page-progress` option (overall progress bar) + - `auto_progress`: Controls Impressive's `--auto-progress` option (per-page countdown) +- Other scheduler-specific fields are preserved but not actively used by display logic + +## Example Event with Scheduler Fields + +```json +{ + "id": 57, + "occurrence_of_id": 57, + "group_id": 2, + "title": "2. Wiederholung", + "start": "2025-10-19T05:00:00+00:00", + "end": "2025-10-19T05:30:00+00:00", + "recurrence_rule": "FREQ=WEEKLY;BYDAY=MO,TU,WE,TH,FR,SA,SU;UNTIL=20251101T225959Z", + "recurrence_end": "2025-11-01T22:59:59", + "page_progress": true, + "auto_progress": true, + "presentation": { + "type": "slideshow", + "auto_advance": true, + "slide_interval": 10, + "files": [ + { + "name": "slides.pdf", + "url": "http://server:8000/api/files/slides.pdf", + "checksum": null, + "size": null + } + ] + } +} +``` + +## Implementation Details + +### Storage Function (simclient.py) + +```python +def save_event_to_json(event_data): + """Speichert eine Event-Nachricht in der Datei current_event.json + + This function preserves ALL fields from the incoming event data, + including scheduler-specific fields like: + - page_progress: Current page/slide progress tracking + - auto_progress: Auto-progression state + - And any other fields sent by the scheduler + """ +``` + +### Display Manager Implementation (display_manager.py) + +The Display Manager reads `page_progress` and `auto_progress` fields and translates them to Impressive command-line options: + +```python +# In start_presentation() method: + +# Get scheduler-specific progress display settings +page_progress = event.get('page_progress', False) # Show overall progress bar +auto_progress = event.get('auto_progress', False) # Show per-page auto-advance progress + +# Later, when building Impressive command: +if page_progress: + cmd.append('--page-progress') + logging.info("Page progress bar enabled (shows overall position in presentation)") + +if auto_progress: + cmd.append('--auto-progress') + logging.info("Auto-progress bar enabled (shows per-page countdown during auto-advance)") +``` + +### Impressive Command Line Options + +| Event Field | Impressive Option | Short Form | Description | +|-------------|-------------------|------------|-------------| +| `page_progress: true` | `--page-progress` | `-q` | Shows a progress bar at the bottom indicating position in presentation | +| `auto_progress: true` | `--auto-progress` | `-k` | Shows a countdown progress bar for each page during auto-advance | + +**Example Commands:** + +```bash +# With page progress only +impressive --fullscreen --auto 10 --wrap --page-progress presentation.pdf + +# With auto progress only +impressive --fullscreen --auto 10 --wrap --auto-progress presentation.pdf + +# With both progress bars +impressive --fullscreen --auto 10 --wrap --page-progress --auto-progress presentation.pdf +``` + +### Storage Function (simclient.py) + +```python +def save_event_to_json(event_data): + """Speichert eine Event-Nachricht in der Datei current_event.json + + This function preserves ALL fields from the incoming event data, + including scheduler-specific fields like: + - page_progress: Show overall progress bar in presentation + - auto_progress: Show per-page auto-advance countdown + - And any other fields sent by the scheduler + """ + try: + json_path = os.path.join(os.path.dirname(__file__), "current_event.json") + with open(json_path, "w", encoding="utf-8") as f: + json.dump(event_data, f, ensure_ascii=False, indent=2) + logging.info(f"Event-Nachricht in {json_path} gespeichert") + + # Log if scheduler-specific fields are present (DEBUG level) + if isinstance(event_data, list): + for idx, event in enumerate(event_data): + if isinstance(event, dict): + if 'page_progress' in event: + logging.debug(f"Event {idx}: page_progress = {event['page_progress']}") + if 'auto_progress' in event: + logging.debug(f"Event {idx}: auto_progress = {event['auto_progress']}") + elif isinstance(event_data, dict): + if 'page_progress' in event_data: + logging.debug(f"Event page_progress = {event_data['page_progress']}") + if 'auto_progress' in event_data: + logging.debug(f"Event auto_progress = {event_data['auto_progress']}") + except Exception as e: + logging.error(f"Fehler beim Speichern der Event-Nachricht: {e}") +``` + +## Verification + +To verify that scheduler fields are being stored correctly: + +1. **Check the log file** (with `LOG_LEVEL=DEBUG`): + ```bash + tail -f ~/infoscreen-dev/logs/simclient.log + ``` + + Look for: + ``` + Event page_progress = 0 + Event auto_progress = true + ``` + +2. **Inspect current_event.json directly**: + ```bash + cat ~/infoscreen-dev/src/current_event.json | jq + ``` + + All scheduler fields should be present in the output. + +3. **Test with MQTT message**: + ```bash + mosquitto_pub -h localhost -t "infoscreen/events/2" -m '{ + "id": 99, + "page_progress": 5, + "auto_progress": true, + "presentation": { + "files": [{"name": "test.pdf"}], + "auto_advance": true, + "slide_interval": 10 + } + }' + ``` + + Then check that `page_progress` and `auto_progress` appear in `current_event.json`. + +## Future Use + +If the Display Manager needs to use these scheduler fields in the future (e.g., to resume presentations at a specific page), the fields are already available in the event data without any code changes needed in `simclient.py`. + +## Summary + +✅ **No changes required** - The current implementation already preserves all scheduler fields +✅ **Automatic preservation** - Uses `json.dump()` which saves complete data structure +✅ **Debug logging added** - Logs presence of `page_progress` and `auto_progress` fields +✅ **Documentation updated** - README now documents scheduler-specific fields +✅ **Future-proof** - Any new scheduler fields will be automatically preserved diff --git a/TODO.md b/TODO.md new file mode 100644 index 0000000..02730b6 --- /dev/null +++ b/TODO.md @@ -0,0 +1,40 @@ +# Project TODOs + +This file tracks higher-level todos and design notes for the infoscreen client. + +## Video playback (Raspberry Pi) + +- Remove taskbar / window decorations in VLC window + - Goal: show video truly fullscreen without window title bar or OS panel/taskbar overlapping. + - Ideas / approaches: + - Use libVLC options from python-vlc: `--no-video-deco`, `--no-video-title-show`, `--video-on-top`, and call `player.set_fullscreen(True)` after playback starts. + - Run the Display Manager in a dedicated kiosk X session (no panel/desktop environment) or minimal window manager (openbox/matchbox) to avoid taskbar. + - Use `wmctrl` as a fallback to force fullscreen/above: `wmctrl -r -b add,fullscreen,above`. + - Add an env var toggle, e.g. `VLC_KIOSK=1`, to enable these options from runtime. + - Acceptance criteria: + - Video occupies the full display area with no visible window controls or panels on top. + - Behaviour toggleable via env var. + +- Add possibility to adjust sound level by HDMI-CEC using Python + - Goal: allow remote/automatic volume control over HDMI using CEC-capable hardware. + - Ideas / approaches: + - Use `libcec` bindings (e.g. `pycec` / `cec` packages) or call `cec-client` from shell to send volume commands to the TV/AVR. + - Map event volume (0.0-1.0) to CEC volume commands (some devices support absolute volume or key presses like `VOLUME_UP`/`VOLUME_DOWN`). + - Provide a small adapter module `src/hdmi_cec.py` that exposes `set_volume(level: float)` and `volume_step(up: bool)` used by `display_manager.py` when starting/stopping videos or on explicit volume events. + - Acceptance criteria: + - `set_volume()` issues appropriate CEC commands and returns success/failure. + - Document any platform limitations (some TVs don't support absolute volume via CEC). + +## Next-high-level items + +- Add environment-controlled libVLC hw-accel toggle (`VLC_HW_ACCEL=1|0`) to `display_manager.py` so software decode can be forced when necessary. +- Add automated tests for video start/stop lifecycle (mock python-vlc) to ensure resources are released on event end. + + +## Notes + +- Keep all changes backward-compatible: external `vlc` binary fallback should still work. +- Document any new env vars in `README.md` and `.github/copilot-instructions.md` if added. + +--- +Generated: 2025-10-25 diff --git a/WORKSPACE_STATUS.txt b/WORKSPACE_STATUS.txt new file mode 100644 index 0000000..d5ff46a --- /dev/null +++ b/WORKSPACE_STATUS.txt @@ -0,0 +1,193 @@ +╔════════════════════════════════════════════════════════════════╗ +║ WORKSPACE CLEANUP COMPLETE ║ +║ October 1, 2025 ║ +╚════════════════════════════════════════════════════════════════╝ + +✅ FINAL SOLUTION: Impressive PDF Presenter with Auto-Advance & Loop + +╔════════════════════════════════════════════════════════════════╗ +║ WHAT REMAINS ║ +╚════════════════════════════════════════════════════════════════╝ + +📂 CORE APPLICATION (2 files) + ├── src/simclient.py ................. MQTT client & event manager + └── src/display_manager.py ........... Display controller (Impressive) + +📂 DOCUMENTATION (6 files) + ├── README.md ........................ Complete project guide ⭐ + ├── IMPRESSIVE_INTEGRATION.md ........ Presentation system details + ├── CLEANUP_SUMMARY.md ............... This cleanup report + ├── src/DISPLAY_MANAGER.md ........... Architecture documentation + ├── src/IMPLEMENTATION_SUMMARY.md .... Implementation overview + └── src/README.md .................... MQTT client details + +📂 SCRIPTS (10 files) + Production: + ├── start-dev.sh ..................... Start development mode + ├── start-display-manager.sh ......... Start Display Manager + └── present-pdf-auto-advance.sh ...... PDF presentation wrapper + + Testing: + ├── test-display-manager.sh .......... Interactive test menu + ├── test-impressive.sh ............... Test auto-quit mode + ├── test-impressive-loop.sh .......... Test loop mode + ├── test-mqtt.sh ..................... Test MQTT connectivity + ├── test-screenshot.sh ............... Test screenshot capture + └── test-utc-timestamps.sh ........... Test event timing + + Deployment: + └── infoscreen-display.service ....... Systemd service file + +╔════════════════════════════════════════════════════════════════╗ +║ WHAT WAS REMOVED ║ +╚════════════════════════════════════════════════════════════════╝ + +🗑️ REMOVED: ~50 obsolete files + +❌ Failed xdotool Approaches (5 versions) + • auto-advance-slides.sh (v1, v2, v3, v4, v5) + • All had window focus issues on Raspberry Pi + +❌ Alternative Approaches That Failed + • Video conversion (present-as-video.sh) + • Modified PPTX timings (add_slide_timings.py) + • PyMpress presenter (present-with-pympress.sh) + • evince + xdotool approach + +❌ Diagnostic & Debug Scripts (~15 files) + • debug-window-focus.sh + • diagnose-evince-keyboard.sh + • diagnose-f5-issue.sh + • diagnose-libreoffice-show.sh + • test-aggressive-focus.sh + • And more... + +❌ Old Documentation (~15 files) + • AUTO_ADVANCE_QUICKREF.txt + • AUTO_ADVANCE_V3_QUICKREF.txt + • SLIDESHOW_FIX_QUICKREF.txt + • UTC_FIX_QUICKREF.txt + • IMPRESSIVE_SOLUTION.txt + • src/AUTO_ADVANCE_V3.md + • src/SLIDES_NOT_ADVANCING_FIX.md + • And more... + +╔════════════════════════════════════════════════════════════════╗ +║ HOW THE SOLUTION WORKS ║ +╚════════════════════════════════════════════════════════════════╝ + +1️⃣ PPTX FILE RECEIVED + ↓ +2️⃣ LibreOffice (headless) → Converts to PDF + ↓ +3️⃣ Impressive Presenter → Displays with: + • --auto 10 ............... Auto-advance (10s per slide) + • --wrap .................. Loop infinitely OR + • --autoquit .............. Exit after last slide + • --fullscreen ............ Fullscreen kiosk mode + • --nooverview ............ No slide overview + +📊 EVENT JSON EXAMPLE (Loop Mode): +{ + "presentation": { + "files": [{"name": "slides.pptx"}], + "auto_advance": true, + "slide_interval": 10, + "loop": true + } +} + +╔════════════════════════════════════════════════════════════════╗ +║ WHY THIS WORKS ║ +╚════════════════════════════════════════════════════════════════╝ + +✅ Native auto-advance (no xdotool hacks needed) +✅ Built-in loop support (--wrap parameter) +✅ Built-in auto-quit (--autoquit parameter) +✅ Works reliably on Raspberry Pi +✅ Simple, maintainable code (~50 lines vs. 200+ with xdotool) +✅ No window management issues +✅ No timing dependencies +✅ Clean architecture + +╔════════════════════════════════════════════════════════════════╗ +║ QUICK START ║ +╚════════════════════════════════════════════════════════════════╝ + +🧪 TEST THE SOLUTION: + ./scripts/test-display-manager.sh + → Choose option 2 (Create PRESENTATION test event) + +🚀 START PRODUCTION: + Terminal 1: cd src && python3 simclient.py + Terminal 2: cd src && python3 display_manager.py + +📖 READ DOCUMENTATION: + Start with: README.md (comprehensive guide) + Deep dive: IMPRESSIVE_INTEGRATION.md + +╔════════════════════════════════════════════════════════════════╗ +║ STATISTICS ║ +╚════════════════════════════════════════════════════════════════╝ + +Before Cleanup: + • ~60 scripts (including 5 failed versions of auto-advance) + • ~20 documentation files (fragmented, outdated) + • Multiple failed approaches mixed with working code + +After Cleanup: + • 10 essential scripts (tested, working) + • 6 comprehensive documentation files + • 1 proven solution (Impressive) + +Result: + 📉 83% fewer scripts + 📉 70% less documentation (but more comprehensive) + 📈 100% focused on working solution + +╔════════════════════════════════════════════════════════════════╗ +║ STATUS ║ +╚════════════════════════════════════════════════════════════════╝ + +Cleanup Date: October 1, 2025 +Status: ✅ COMPLETE +Solution: ✅ PRODUCTION READY +Tested On: ✅ Raspberry Pi 5, Pi OS (Bookworm) +Documentation: ✅ COMPREHENSIVE +Code Quality: ✅ CLEAN & MAINTAINABLE + +╔════════════════════════════════════════════════════════════════╗ +║ JOURNEY TO SOLUTION ║ +╚════════════════════════════════════════════════════════════════╝ + +Attempt 1: xdotool + LibreOffice v1 ................ ❌ Failed +Attempt 2: xdotool + LibreOffice v2 (focus fix) .... ❌ Failed +Attempt 3: xdotool + LibreOffice v3 (end detect) ... ❌ Failed +Attempt 4: xdotool + LibreOffice v4 (active win) ... ❌ Failed +Attempt 5: xdotool + LibreOffice v5 (hybrid) ....... ❌ Failed +Attempt 6: Modified PPTX timings ................... ❌ Failed +Attempt 7: Video conversion ........................ ❌ Failed +Attempt 8: PDF + evince + xdotool .................. ❌ Failed +Attempt 9: PDF + Impressive ........................ ✅ SUCCESS! + +Lessons Learned: + • Don't fight the system (window focus is hard) + • Use native features when available + • Simpler is better + • The right tool makes all the difference + +╔════════════════════════════════════════════════════════════════╗ +║ FINAL CHECKLIST ║ +╚════════════════════════════════════════════════════════════════╝ + +✅ All obsolete files removed +✅ Working solution documented +✅ Test scripts validated +✅ README.md comprehensive and up-to-date +✅ IMPRESSIVE_INTEGRATION.md detailed +✅ Cleanup summary created +✅ Production ready + +🎉 WORKSPACE IS CLEAN AND PRODUCTION-READY! 🎉 + +For next steps, see: README.md diff --git a/scripts/infoscreen-display.service b/scripts/infoscreen-display.service new file mode 100644 index 0000000..b258706 --- /dev/null +++ b/scripts/infoscreen-display.service @@ -0,0 +1,36 @@ +[Unit] +Description=Infoscreen Display Manager +Documentation=https://github.com/RobbStarkAustria/infoscreen_client_2025 +After=network.target graphical.target +Wants=network-online.target + +[Service] +Type=simple +User=olafn +Group=olafn +WorkingDirectory=/home/olafn/infoscreen-dev +Environment="DISPLAY=:0" +Environment="XAUTHORITY=/home/olafn/.Xauthority" +Environment="ENV=production" + +# Start display manager +ExecStart=/home/olafn/infoscreen-dev/scripts/start-display-manager.sh + +# Restart on failure +Restart=on-failure +RestartSec=10 + +# Logging +StandardOutput=journal +StandardError=journal +SyslogIdentifier=infoscreen-display + +# Security settings +NoNewPrivileges=true +PrivateTmp=true + +# Resource limits +LimitNOFILE=65536 + +[Install] +WantedBy=graphical.target diff --git a/scripts/present-pdf-auto-advance.sh b/scripts/present-pdf-auto-advance.sh new file mode 100755 index 0000000..afdacf2 --- /dev/null +++ b/scripts/present-pdf-auto-advance.sh @@ -0,0 +1,163 @@ +#!/bin/bash +# PDF Presentation with Auto-Advance +# Works for both native PDF and converted PPTX files + +PDF_FILE="$1" +INTERVAL="${2:-10}" +LOOP="${3:-false}" + +if [ -z "$PDF_FILE" ]; then + echo "Usage: $0 <file.pdf> [interval-seconds] [loop:true|false]" + exit 1 +fi + +if [ ! -f "$PDF_FILE" ]; then + echo "Error: File not found: $PDF_FILE" + exit 1 +fi + +echo "==========================================" +echo " PDF Presentation Mode" +echo "==========================================" +echo "" +echo "File: $(basename "$PDF_FILE")" +echo "Auto-advance: ${INTERVAL}s per slide" +echo "Loop: $LOOP" +echo "" + +# Count pages in PDF +PAGE_COUNT=$(pdfinfo "$PDF_FILE" 2>/dev/null | grep "Pages:" | awk '{print $2}') + +if [ -z "$PAGE_COUNT" ] || [ "$PAGE_COUNT" -eq 0 ]; then + echo "Warning: Could not determine page count, assuming 10 pages" + PAGE_COUNT=10 +else + echo "Detected $PAGE_COUNT pages" +fi + +echo "" + +# Check for required tools +if ! command -v xdotool &> /dev/null; then + echo "Error: xdotool not installed" + echo "Install with: sudo apt-get install xdotool" + exit 1 +fi + +# Choose best PDF viewer (prefer Impressive for auto-advance) +PDF_VIEWER="" +PDF_VIEWER_CMD="" + +if command -v impressive &> /dev/null; then + PDF_VIEWER="impressive" + PDF_VIEWER_CMD="impressive --fullscreen --nooverview --auto $INTERVAL" + + if [ "$LOOP" = "true" ]; then + PDF_VIEWER_CMD="$PDF_VIEWER_CMD --wrap" + else + PDF_VIEWER_CMD="$PDF_VIEWER_CMD --autoquit" + fi + + # Impressive handles auto-advance natively, no xdotool needed! + echo "Using Impressive (built-in auto-advance)..." + $PDF_VIEWER_CMD "$PDF_FILE" + exit 0 + +elif command -v evince &> /dev/null; then + PDF_VIEWER="evince" + PDF_VIEWER_CMD="evince --presentation" +elif command -v okular &> /dev/null; then + PDF_VIEWER="okular" + PDF_VIEWER_CMD="okular --presentation" +else + echo "Error: No suitable PDF viewer found" + echo "Install impressive: sudo apt-get install impressive" + exit 1 +fi + +echo "Using PDF viewer: $PDF_VIEWER" +echo "Starting presentation mode..." +echo "" + +# Start PDF viewer in presentation mode +$PDF_VIEWER_CMD "$PDF_FILE" & +VIEWER_PID=$! + +echo "Viewer PID: $VIEWER_PID" +echo "Waiting for viewer to start..." +sleep 5 + +# Verify it's still running +if ! ps -p $VIEWER_PID > /dev/null 2>&1; then + echo "Error: PDF viewer exited unexpectedly" + exit 1 +fi + +echo "Starting auto-advance..." +echo "Press Ctrl+C to stop" +echo "" + +# Auto-advance loop +CURRENT_PAGE=1 +MAX_LOOPS=0 + +if [ "$LOOP" = "false" ]; then + # Calculate total slides to advance (pages - 1, since we start on page 1) + MAX_ADVANCES=$((PAGE_COUNT - 1)) +else + # Infinite loop + MAX_ADVANCES=999999 +fi + +ADVANCE_COUNT=0 + +while ps -p $VIEWER_PID > /dev/null 2>&1 && [ $ADVANCE_COUNT -lt $MAX_ADVANCES ]; do + sleep $INTERVAL + + # Find the PDF viewer window + VIEWER_WINDOW=$(xdotool search --pid $VIEWER_PID 2>/dev/null | tail -1) + + if [ -z "$VIEWER_WINDOW" ]; then + # Fallback: search by window name + VIEWER_WINDOW=$(xdotool search --name "$(basename "$PDF_FILE")" 2>/dev/null | tail -1) + fi + + if [ -n "$VIEWER_WINDOW" ]; then + # Ensure window is focused + xdotool windowactivate --sync "$VIEWER_WINDOW" 2>/dev/null + sleep 0.2 + + # Send Right Arrow or Page Down (both work in most PDF viewers) + xdotool key --clearmodifiers --window "$VIEWER_WINDOW" Right + + CURRENT_PAGE=$((CURRENT_PAGE + 1)) + ADVANCE_COUNT=$((ADVANCE_COUNT + 1)) + + echo "[$(date '+%H:%M:%S')] Advanced to page $CURRENT_PAGE" + + # Check if we've reached the end + if [ $CURRENT_PAGE -gt $PAGE_COUNT ]; then + if [ "$LOOP" = "true" ]; then + echo "Reached end, looping back to start..." + CURRENT_PAGE=1 + else + echo "" + echo "Reached end of presentation (page $PAGE_COUNT)" + echo "Keeping viewer open..." + # Keep viewer running, just stop advancing + wait $VIEWER_PID + exit 0 + fi + fi + else + # Fallback: send key to active window + xdotool key --clearmodifiers Right + CURRENT_PAGE=$((CURRENT_PAGE + 1)) + ADVANCE_COUNT=$((ADVANCE_COUNT + 1)) + echo "[$(date '+%H:%M:%S')] Advanced (fallback) #$ADVANCE_COUNT" + fi +done + +echo "" +echo "Presentation ended" +exit 0 diff --git a/scripts/start-dev.sh b/scripts/start-dev.sh new file mode 100755 index 0000000..ec41cff --- /dev/null +++ b/scripts/start-dev.sh @@ -0,0 +1,5 @@ +#!/bin/bash +cd "$(dirname "$0")/.." +source venv/bin/activate +export $(cat .env | xargs) +python3 src/simclient.py diff --git a/scripts/start-display-manager.sh b/scripts/start-display-manager.sh new file mode 100755 index 0000000..068751c --- /dev/null +++ b/scripts/start-display-manager.sh @@ -0,0 +1,43 @@ +#!/bin/bash +# Start Display Manager - Controls display software for infoscreen events + +set -e + +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +PROJECT_ROOT="$(dirname "$SCRIPT_DIR")" +VENV_PATH="$PROJECT_ROOT/venv" +DISPLAY_MANAGER="$PROJECT_ROOT/src/display_manager.py" + +echo "🖥️ Starting Display Manager..." +echo "Project root: $PROJECT_ROOT" + +# Check if virtual environment exists +if [ ! -d "$VENV_PATH" ]; then + echo "❌ Virtual environment not found at: $VENV_PATH" + echo "Please create it with: python3 -m venv venv" + exit 1 +fi + +# Activate virtual environment +source "$VENV_PATH/bin/activate" + +# Check if display_manager.py exists +if [ ! -f "$DISPLAY_MANAGER" ]; then + echo "❌ Display manager not found at: $DISPLAY_MANAGER" + exit 1 +fi + +# Make sure DISPLAY is set (required for GUI applications) +if [ -z "$DISPLAY" ]; then + export DISPLAY=:0 + echo "📺 DISPLAY not set, using: $DISPLAY" +fi + +# Check if we're in development or production +ENV="${ENV:-development}" +echo "Environment: $ENV" + +# Start display manager +echo "Starting display manager..." +echo "---" +python3 "$DISPLAY_MANAGER" diff --git a/scripts/test-display-manager.sh b/scripts/test-display-manager.sh new file mode 100755 index 0000000..4be8874 --- /dev/null +++ b/scripts/test-display-manager.sh @@ -0,0 +1,210 @@ +#!/bin/bash +# Test Display Manager functionality + +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +PROJECT_ROOT="$(dirname "$SCRIPT_DIR")" +EVENT_FILE="$PROJECT_ROOT/src/current_event.json" + +echo "🧪 Testing Display Manager" +echo "=========================" +echo "" + +# Function to create test event +create_test_event() { + local event_type=$1 + echo "📝 Creating test event: $event_type" + + case $event_type in + "presentation") + cat > "$EVENT_FILE" <<EOF +{ + "id": 999, + "title": "Test Presentation with Impressive", + "start": "2025-01-01 00:00:00", + "end": "2025-12-31 23:59:59", + "presentation": { + "type": "slideshow", + "files": [ + { + "name": "LPUV4I_Folien_Nowitzki_Bewertungskriterien.pptx", + "url": "http://example.com/test.pptx" + } + ], + "auto_advance": true, + "slide_interval": 5, + "loop": true + } +} +EOF + ;; + "webpage") + cat > "$EVENT_FILE" <<EOF +{ + "id": 998, + "title": "Test Webpage", + "start": "2025-01-01 00:00:00", + "end": "2025-12-31 23:59:59", + "web": { + "url": "https://www.wikipedia.org" + } +} +EOF + ;; + "video") + cat > "$EVENT_FILE" <<EOF +{ + "id": 997, + "title": "Test Video", + "start": "2025-01-01 00:00:00", + "end": "2025-12-31 23:59:59", + "video": { + "url": "https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4", + "loop": false + } +} +EOF + ;; + "none") + echo "📝 Removing event file (no active event)" + rm -f "$EVENT_FILE" + ;; + esac + + if [ -f "$EVENT_FILE" ]; then + echo "✅ Event file created:" + cat "$EVENT_FILE" + fi + echo "" +} + +# Function to check if display manager is running +check_display_manager() { + if pgrep -f "display_manager.py" > /dev/null; then + echo "✅ Display Manager is running" + echo " PID: $(pgrep -f display_manager.py)" + return 0 + else + echo "❌ Display Manager is NOT running" + return 1 + fi +} + +# Function to check for display processes +check_display_processes() { + echo "🔍 Active display processes:" + + # Check for LibreOffice + if pgrep -f "libreoffice.*impress" > /dev/null; then + echo " 📊 LibreOffice Impress: PID $(pgrep -f 'libreoffice.*impress')" + fi + + # Check for browsers + if pgrep -f "chromium.*kiosk" > /dev/null; then + echo " 🌐 Chromium (kiosk): PID $(pgrep -f 'chromium.*kiosk')" + fi + + # Check for video players + if pgrep -f "vlc" > /dev/null; then + echo " 🎬 VLC: PID $(pgrep -f 'vlc')" + fi + + if pgrep -f "mpv" > /dev/null; then + echo " 🎬 MPV: PID $(pgrep -f 'mpv')" + fi + + # Check for PDF viewers + if pgrep -f "evince" > /dev/null; then + echo " 📄 Evince: PID $(pgrep -f 'evince')" + fi + + # Check for Impressive + if pgrep -f "impressive" > /dev/null; then + echo " 📊 Impressive: PID $(pgrep -f 'impressive')" + fi + + echo "" +} + +# Main menu +echo "Display Manager Test Menu" +echo "=========================" +echo "" +echo "What would you like to test?" +echo "1) Check Display Manager status" +echo "2) Create PRESENTATION test event" +echo "3) Create WEBPAGE test event" +echo "4) Create VIDEO test event" +echo "5) Remove event (no display)" +echo "6) Check active display processes" +echo "7) View current event file" +echo "8) Interactive test (cycle through events)" +echo "9) Exit" +echo "" + +read -p "Enter choice [1-9]: " choice + +case $choice in + 1) + check_display_manager + check_display_processes + ;; + 2) + create_test_event "presentation" + echo "⏱️ Display Manager will pick this up within 5 seconds..." + ;; + 3) + create_test_event "webpage" + echo "⏱️ Display Manager will pick this up within 5 seconds..." + ;; + 4) + create_test_event "video" + echo "⏱️ Display Manager will pick this up within 5 seconds..." + ;; + 5) + create_test_event "none" + echo "⏱️ Display Manager will stop display within 5 seconds..." + ;; + 6) + check_display_manager + check_display_processes + ;; + 7) + if [ -f "$EVENT_FILE" ]; then + echo "📄 Current event file:" + cat "$EVENT_FILE" + else + echo "❌ No event file found" + fi + ;; + 8) + echo "🔄 Interactive test - cycling through event types" + echo " Display Manager must be running for this test!" + echo "" + check_display_manager || exit 1 + + echo "1️⃣ Testing PRESENTATION (10 seconds)..." + create_test_event "presentation" + sleep 10 + + echo "2️⃣ Testing WEBPAGE (10 seconds)..." + create_test_event "webpage" + sleep 10 + + echo "3️⃣ Testing NO EVENT (5 seconds)..." + create_test_event "none" + sleep 5 + + echo "4️⃣ Back to PRESENTATION..." + create_test_event "presentation" + + echo "✅ Interactive test complete!" + ;; + 9) + echo "👋 Goodbye!" + exit 0 + ;; + *) + echo "❌ Invalid choice" + exit 1 + ;; +esac diff --git a/scripts/test-impressive-loop.sh b/scripts/test-impressive-loop.sh new file mode 100755 index 0000000..14921ca --- /dev/null +++ b/scripts/test-impressive-loop.sh @@ -0,0 +1,92 @@ +#!/bin/bash +# Test Impressive with LOOP mode (for events/kiosks) + +echo "==========================================" +echo " Test: Impressive with LOOP" +echo "==========================================" +echo "" +echo "This tests kiosk/event mode where the" +echo "presentation loops continuously." +echo "" + +cd ~/infoscreen-dev +PPTX=$(find src/presentation -name "*.pptx" | head -1) + +if [ -z "$PPTX" ]; then + echo "Error: No PPTX file found" + exit 1 +fi + +# Convert to PDF +PDF="/tmp/impressive_loop_test.pdf" +echo "Converting PPTX to PDF..." +libreoffice --headless --convert-to pdf --outdir /tmp "$PPTX" > /dev/null 2>&1 + +PPTX_BASE=$(basename "$PPTX" .pptx) +ACTUAL_PDF="/tmp/${PPTX_BASE}.pdf" + +if [ -f "$ACTUAL_PDF" ]; then + cp "$ACTUAL_PDF" "$PDF" +fi + +if [ ! -f "$PDF" ]; then + echo "Error: PDF conversion failed" + exit 1 +fi + +PAGE_COUNT=$(pdfinfo "$PDF" 2>/dev/null | grep "Pages:" | awk '{print $2}') +echo "[OK] PDF ready: $PAGE_COUNT pages" +echo "" + +echo "Starting Impressive in LOOP mode..." +echo "" +echo "Settings:" +echo " - Auto-advance: 3 seconds per slide" +echo " - Loop: YES (--wrap)" +echo " - Will go: Slide 1 → 2 → 3 → 4 → 5 → 1 → 2 → ..." +echo "" +echo "What to watch for:" +echo " ✅ Advances through all $PAGE_COUNT slides" +echo " ✅ After slide $PAGE_COUNT, goes back to slide 1" +echo " ✅ Continues looping forever" +echo "" +echo "Press 'Q' or Escape to quit" +echo "" + +sleep 2 + +# Start with --wrap for loop mode +impressive \ + --fullscreen \ + --nooverview \ + --auto 3 \ + --wrap \ + --nologo \ + "$PDF" + +echo "" +echo "==========================================" +echo " Test Complete" +echo "==========================================" +echo "" +read -p "Did it loop back to slide 1 after slide $PAGE_COUNT? (y/n): " worked + +if [ "$worked" = "y" ]; then + echo "" + echo "✅ Perfect! Impressive loop mode works!" + echo "" + echo "This is ideal for:" + echo " - Event displays (loop presentation during event)" + echo " - Kiosk mode (continuous display)" + echo " - Information screens (repeat content)" + echo "" + echo "Event JSON should use:" + echo ' "loop": true' +else + echo "" + echo "Something unexpected?" + read -p "What happened?: " issue + echo "Issue: $issue" +fi + +rm -f "$PDF" diff --git a/scripts/test-impressive.sh b/scripts/test-impressive.sh new file mode 100755 index 0000000..833d60a --- /dev/null +++ b/scripts/test-impressive.sh @@ -0,0 +1,115 @@ +#!/bin/bash +# Test Impressive - Python PDF presenter with native auto-advance + +echo "==========================================" +echo " Test: Impressive PDF Presenter" +echo "==========================================" +echo "" +echo "Impressive is a Python-based PDF presenter with" +echo "BUILT-IN auto-advance. No xdotool needed!" +echo "" + +# Check if impressive is installed +if ! command -v impressive &> /dev/null; then + echo "Impressive not installed. Installing..." + echo "" + sudo apt-get update + sudo apt-get install -y impressive + + if [ $? -ne 0 ]; then + echo "Error: Could not install impressive" + exit 1 + fi +fi + +echo "Impressive installed: $(which impressive)" +echo "" + +# Convert PPTX to PDF +cd ~/infoscreen-dev +PPTX=$(find src/presentation -name "*.pptx" | head -1) + +if [ -z "$PPTX" ]; then + echo "Error: No PPTX file found" + exit 1 +fi + +PDF="/tmp/impressive_test.pdf" +echo "Converting PPTX to PDF..." +libreoffice --headless --convert-to pdf --outdir /tmp "$PPTX" > /dev/null 2>&1 + +PPTX_BASE=$(basename "$PPTX" .pptx) +ACTUAL_PDF="/tmp/${PPTX_BASE}.pdf" + +if [ -f "$ACTUAL_PDF" ]; then + cp "$ACTUAL_PDF" "$PDF" +fi + +if [ ! -f "$PDF" ]; then + echo "Error: PDF conversion failed" + exit 1 +fi + +PAGE_COUNT=$(pdfinfo "$PDF" 2>/dev/null | grep "Pages:" | awk '{print $2}') +echo "[OK] PDF ready: $PAGE_COUNT pages" +echo "" + +echo "Starting Impressive with 3-second auto-advance..." +echo "" +echo "Impressive features:" +echo " - Native auto-advance (no xdotool!)" +echo " - Fullscreen by default" +echo " - Professional transitions" +echo " - Loop support" +echo "" +echo "Controls:" +echo " Right Arrow / Space = Next slide" +echo " Left Arrow = Previous slide" +echo " Q / Escape = Quit" +echo "" + +sleep 2 + +# Start Impressive with auto-advance +# --auto 3 = auto-advance every 3 seconds +# --fullscreen = fullscreen mode +# --nooverview = skip overview at start +# --autoquit = quit after last slide (for non-loop mode) + +impressive \ + --fullscreen \ + --auto 3 \ + --nooverview \ + --autoquit \ + "$PDF" + +echo "" +echo "==========================================" +echo " Test Complete" +echo "==========================================" +echo "" +read -p "Did it work perfectly? (y/n): " worked + +if [ "$worked" = "y" ]; then + echo "" + echo "✅ EXCELLENT! Impressive is your solution!" + echo "" + echo "Why Impressive is perfect:" + echo " ✅ Built-in auto-advance (no xdotool hacks)" + echo " ✅ Reliable on Raspberry Pi" + echo " ✅ Professional presenter tool" + echo " ✅ Supports loop mode natively" + echo " ✅ Fast and lightweight" + echo "" + echo "Next steps:" + echo " 1. Update Display Manager to use Impressive" + echo " 2. Simple command: impressive --auto N --fullscreen file.pdf" + echo " 3. Works for both PPTX (convert to PDF) and PDF files" +else + echo "" + echo "What didn't work?" + read -p "Describe the issue: " issue + echo "Issue: $issue" +fi + +rm -f "$PDF" diff --git a/scripts/test-mqtt.sh b/scripts/test-mqtt.sh new file mode 100755 index 0000000..8e35d15 --- /dev/null +++ b/scripts/test-mqtt.sh @@ -0,0 +1,9 @@ +#!/bin/bash +source "$(dirname "$0")/../.env" + +echo "Testing MQTT connection to $MQTT_BROKER:$MQTT_PORT" +echo "Publishing test message..." +mosquitto_pub -h "$MQTT_BROKER" -p "$MQTT_PORT" -t "infoscreen/test" -m "Hello from Pi development setup" + +echo "Subscribing to test topic (press Ctrl+C to stop)..." +mosquitto_sub -h "$MQTT_BROKER" -p "$MQTT_PORT" -t "infoscreen/test" diff --git a/scripts/test-progress-bars.sh b/scripts/test-progress-bars.sh new file mode 100755 index 0000000..31a7997 --- /dev/null +++ b/scripts/test-progress-bars.sh @@ -0,0 +1,174 @@ +#!/bin/bash +# Test script for page_progress and auto_progress features in presentations + +echo "==========================================" +echo "Progress Bar Features Test" +echo "==========================================" +echo "" + +# Colors for output +GREEN='\033[0;32m' +YELLOW='\033[1;33m' +BLUE='\033[0;34m' +NC='\033[0m' # No Color + +# Check if MQTT broker is configured +if [ -f ../.env ]; then + source ../.env + MQTT_HOST=${MQTT_BROKER:-localhost} +else + MQTT_HOST=localhost +fi + +echo -e "${YELLOW}Using MQTT broker: ${MQTT_HOST}${NC}" +echo "" + +# Menu for testing different progress bar configurations +echo "Select a test configuration:" +echo "" +echo "1. No progress bars (default)" +echo "2. Page progress only (overall position)" +echo "3. Auto-progress only (per-page countdown)" +echo "4. Both progress bars (maximum feedback)" +echo "" +read -p "Enter choice (1-4): " choice + +case $choice in + 1) + PAGE_PROG=false + AUTO_PROG=false + DESC="No progress bars" + ;; + 2) + PAGE_PROG=true + AUTO_PROG=false + DESC="Page progress only (--page-progress)" + ;; + 3) + PAGE_PROG=false + AUTO_PROG=true + DESC="Auto-progress only (--auto-progress)" + ;; + 4) + PAGE_PROG=true + AUTO_PROG=true + DESC="Both progress bars" + ;; + *) + echo "Invalid choice" + exit 1 + ;; +esac + +echo "" +echo -e "${BLUE}Configuration: $DESC${NC}" +echo " page_progress: $PAGE_PROG" +echo " auto_progress: $AUTO_PROG" +echo "" + +# Create test event with progress bar settings +TEST_EVENT=$(cat <<EOF +{ + "id": 888, + "group_id": 2, + "title": "Progress Bar Test Event", + "start": "2025-01-01T00:00:00+00:00", + "end": "2025-12-31T23:59:59+00:00", + "presentation": { + "type": "slideshow", + "auto_advance": true, + "slide_interval": 5, + "loop": true, + "page_progress": $PAGE_PROG, + "auto_progress": $AUTO_PROG, + "files": [ + { + "name": "Wissenschaftliches Arbeiten Literaturrecherche.pdf", + "url": "http://server:8000/api/files/test.pdf" + } + ] + } +} +EOF +) + +echo "Sending test event to MQTT..." +echo "" + +mosquitto_pub -h "$MQTT_HOST" -t "infoscreen/events/2" -m "$TEST_EVENT" + +if [ $? -eq 0 ]; then + echo -e "${GREEN}✓ Event sent successfully${NC}" +else + echo -e "${RED}✗ Failed to send event${NC}" + exit 1 +fi + +echo "" +echo "Waiting for Display Manager to process event..." +sleep 3 + +echo "" +echo "Checking Display Manager log for progress bar settings..." +echo "" + +LOG_FILE="../logs/display_manager.log" + +if [ -f "$LOG_FILE" ]; then + echo -e "${YELLOW}Recent log entries:${NC}" + tail -30 "$LOG_FILE" | grep -E "(progress|Progress|Impressive)" | tail -10 +else + echo -e "${YELLOW}Log file not found: $LOG_FILE${NC}" +fi + +echo "" +echo "==========================================" +echo "Expected Behavior" +echo "==========================================" +echo "" + +case $choice in + 1) + echo "• No progress indicators visible" + echo "• Clean presentation display" + ;; + 2) + echo "• Progress bar at bottom of screen" + echo "• Shows current position: [=====> ] 50%" + echo "• Updates as slides change" + ;; + 3) + echo "• Countdown bar for each slide" + echo "• Shows time remaining until next slide" + echo "• Resets on each slide transition" + ;; + 4) + echo "• Overall progress bar at bottom" + echo "• Per-slide countdown overlay" + echo "• Both indicators update in real-time" + ;; +esac + +echo "" +echo "==========================================" +echo "Impressive Command Options" +echo "==========================================" +echo "" +echo "The Display Manager translates event fields to Impressive options:" +echo "" +echo "Event Field → Impressive Option" +echo "-------------------- → ------------------" +echo "page_progress: true → --page-progress (or -q)" +echo "auto_progress: true → --auto-progress (or -k)" +echo "" +echo "Check the impressive.out.log for the exact command used:" +echo " tail -20 ../logs/impressive.out.log" +echo "" + +echo -e "${GREEN}Test complete!${NC}" +echo "" +echo "Tips:" +echo " • Press 'q' to quit the presentation" +echo " • Run this script again to test different configurations" +echo " • Check logs/display_manager.log for detailed output" +echo "" diff --git a/scripts/test-scheduler-fields.sh b/scripts/test-scheduler-fields.sh new file mode 100755 index 0000000..e348498 --- /dev/null +++ b/scripts/test-scheduler-fields.sh @@ -0,0 +1,143 @@ +#!/bin/bash +# Test script to verify scheduler fields (page_progress, auto_progress) are preserved + +echo "==========================================" +echo "Scheduler Fields Preservation Test" +echo "==========================================" +echo "" + +# Colors for output +GREEN='\033[0;32m' +YELLOW='\033[1;33m' +RED='\033[0;31m' +NC='\033[0m' # No Color + +# Check if MQTT broker is configured +if [ -f ../.env ]; then + source ../.env + MQTT_HOST=${MQTT_BROKER:-localhost} +else + MQTT_HOST=localhost +fi + +echo -e "${YELLOW}Using MQTT broker: ${MQTT_HOST}${NC}" +echo "" + +# Test event with scheduler fields +TEST_EVENT='{ + "id": 999, + "occurrence_of_id": 999, + "group_id": 2, + "title": "Test Event with Scheduler Fields", + "start": "2025-01-01T10:00:00+00:00", + "end": "2025-12-31T23:59:59+00:00", + "recurrence_rule": "FREQ=DAILY", + "recurrence_end": "2025-12-31T23:59:59", + "presentation": { + "type": "slideshow", + "auto_advance": true, + "slide_interval": 10, + "page_progress": true, + "auto_progress": true, + "files": [ + { + "name": "test.pdf", + "url": "http://server:8000/api/files/test.pdf" + } + ] + } +}' + +echo "1. Sending test event with scheduler fields to MQTT..." +echo "" +echo "Event contains:" +echo " - page_progress: true (show overall progress bar)" +echo " - auto_progress: true (show per-page countdown)" +echo " - recurrence_rule: FREQ=DAILY" +echo " - occurrence_of_id: 999" +echo "" + +mosquitto_pub -h "$MQTT_HOST" -t "infoscreen/events/2" -m "$TEST_EVENT" + +if [ $? -eq 0 ]; then + echo -e "${GREEN}✓ Event sent successfully${NC}" +else + echo -e "${RED}✗ Failed to send event${NC}" + exit 1 +fi + +echo "" +echo "2. Waiting for event to be processed..." +sleep 2 + +echo "" +echo "3. Checking current_event.json for scheduler fields..." +echo "" + +EVENT_FILE="../src/current_event.json" + +if [ ! -f "$EVENT_FILE" ]; then + echo -e "${RED}✗ Event file not found: $EVENT_FILE${NC}" + exit 1 +fi + +echo -e "${YELLOW}Current event content:${NC}" +cat "$EVENT_FILE" | jq '.' +echo "" + +# Check for specific fields +echo "4. Verifying scheduler fields are preserved..." +echo "" + +PAGE_PROGRESS=$(cat "$EVENT_FILE" | jq -r '.[0].page_progress // .page_progress // "not_found"') +AUTO_PROGRESS=$(cat "$EVENT_FILE" | jq -r '.[0].auto_progress // .auto_progress // "not_found"') +OCCURRENCE_ID=$(cat "$EVENT_FILE" | jq -r '.[0].occurrence_of_id // .occurrence_of_id // "not_found"') +RECURRENCE=$(cat "$EVENT_FILE" | jq -r '.[0].recurrence_rule // .recurrence_rule // "not_found"') + +if [ "$PAGE_PROGRESS" = "true" ]; then + echo -e "${GREEN}✓ page_progress preserved: $PAGE_PROGRESS${NC}" +else + echo -e "${RED}✗ page_progress missing or incorrect: $PAGE_PROGRESS${NC}" +fi + +if [ "$AUTO_PROGRESS" = "true" ]; then + echo -e "${GREEN}✓ auto_progress preserved: $AUTO_PROGRESS${NC}" +else + echo -e "${RED}✗ auto_progress missing or incorrect: $AUTO_PROGRESS${NC}" +fi + +if [ "$OCCURRENCE_ID" = "999" ]; then + echo -e "${GREEN}✓ occurrence_of_id preserved: $OCCURRENCE_ID${NC}" +else + echo -e "${RED}✗ occurrence_of_id missing or incorrect: $OCCURRENCE_ID${NC}" +fi + +if [ "$RECURRENCE" = "FREQ=DAILY" ]; then + echo -e "${GREEN}✓ recurrence_rule preserved: $RECURRENCE${NC}" +else + echo -e "${RED}✗ recurrence_rule missing or incorrect: $RECURRENCE${NC}" +fi + +echo "" +echo "5. Checking simclient log for debug messages..." +echo "" + +LOG_FILE="../logs/simclient.log" + +if [ -f "$LOG_FILE" ]; then + echo -e "${YELLOW}Recent log entries mentioning scheduler fields:${NC}" + tail -20 "$LOG_FILE" | grep -E "page_progress|auto_progress" || echo " (no debug messages - set LOG_LEVEL=DEBUG to see them)" +else + echo -e "${YELLOW}Log file not found: $LOG_FILE${NC}" +fi + +echo "" +echo "==========================================" +echo -e "${GREEN}Test Complete${NC}" +echo "==========================================" +echo "" +echo "Summary:" +echo " - Scheduler fields (page_progress, auto_progress) should be preserved in current_event.json" +echo " - All metadata from the scheduler is automatically stored without filtering" +echo " - Set LOG_LEVEL=DEBUG in .env to see field logging in simclient.log" +echo "" diff --git a/scripts/test-screenshot.sh b/scripts/test-screenshot.sh new file mode 100755 index 0000000..1180fac --- /dev/null +++ b/scripts/test-screenshot.sh @@ -0,0 +1,27 @@ +#!/bin/bash +SCREENSHOT_DIR="$(dirname "$0")/../screenshots" +mkdir -p "$SCREENSHOT_DIR" + +# Ensure DISPLAY is set for screenshot capture +if [ -z "$DISPLAY" ]; then + export DISPLAY=:0 +fi + +# Test screenshot capture +echo "Testing screenshot capture with DISPLAY=$DISPLAY" +if scrot "$SCREENSHOT_DIR/test_$(date +%Y%m%d_%H%M%S).png" 2>/dev/null; then + echo "✅ Screenshot captured successfully" + echo "📁 Screenshot saved to: $SCREENSHOT_DIR" + ls -la "$SCREENSHOT_DIR"/test_*.png | tail -1 +else + echo "❌ Screenshot failed with scrot, trying imagemagick..." + if import -window root "$SCREENSHOT_DIR/test_$(date +%Y%m%d_%H%M%S).png" 2>/dev/null; then + echo "✅ Screenshot captured with imagemagick" + echo "📁 Screenshot saved to: $SCREENSHOT_DIR" + ls -la "$SCREENSHOT_DIR"/test_*.png | tail -1 + else + echo "❌ Screenshot capture failed. Check DISPLAY variable and X11 access." + echo "💡 Try: export DISPLAY=:0" + echo "💡 Or run from local Pi terminal instead of SSH" + fi +fi diff --git a/scripts/test-utc-timestamps.sh b/scripts/test-utc-timestamps.sh new file mode 100755 index 0000000..654298d --- /dev/null +++ b/scripts/test-utc-timestamps.sh @@ -0,0 +1,149 @@ +#!/bin/bash +# Test UTC timestamp handling in Display Manager + +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +PROJECT_ROOT="$(dirname "$SCRIPT_DIR")" +EVENT_FILE="$PROJECT_ROOT/src/current_event.json" + +echo "🕐 UTC Timestamp Test for Display Manager" +echo "==========================================" +echo "" + +# Get current UTC and local times +UTC_NOW=$(date -u '+%Y-%m-%d %H:%M:%S') +LOCAL_NOW=$(date '+%Y-%m-%d %H:%M:%S') +TIMEZONE=$(date +%Z) +UTC_OFFSET=$(date +%z) + +echo "📅 Current Time Information:" +echo " UTC Time: $UTC_NOW" +echo " Local Time: $LOCAL_NOW" +echo " Timezone: $TIMEZONE (UTC$UTC_OFFSET)" +echo "" + +# Calculate timestamps for testing +# Start: 1 minute ago (UTC) +START_TIME=$(date -u -d '1 minute ago' '+%Y-%m-%d %H:%M:%S') +# End: 10 minutes from now (UTC) +END_TIME=$(date -u -d '10 minutes' '+%Y-%m-%d %H:%M:%S') + +echo "🧪 Test Scenarios:" +echo "" +echo "1️⃣ Test Active Event (should display NOW)" +echo " Create event with:" +echo " - Start: $START_TIME UTC (1 minute ago)" +echo " - End: $END_TIME UTC (in 10 minutes)" +echo "" + +read -p "Press Enter to create test event..." + +cat > "$EVENT_FILE" <<EOF +{ + "id": 998, + "title": "UTC Test - Active Event", + "start": "$START_TIME", + "end": "$END_TIME", + "web": { + "url": "https://www.timeanddate.com/worldclock/timezone/utc" + } +} +EOF + +echo "✅ Created test event:" +cat "$EVENT_FILE" | jq . +echo "" +echo "⏱️ Display Manager should detect this as ACTIVE and start displaying" +echo " Check the logs with: tail -f logs/display_manager.log" +echo "" + +read -p "Press Enter to continue to next test..." +echo "" + +# Test 2: Event in the future +FUTURE_START=$(date -u -d '5 minutes' '+%Y-%m-%d %H:%M:%S') +FUTURE_END=$(date -u -d '15 minutes' '+%Y-%m-%d %H:%M:%S') + +echo "2️⃣ Test Future Event (should NOT display yet)" +echo " Create event with:" +echo " - Start: $FUTURE_START UTC (in 5 minutes)" +echo " - End: $FUTURE_END UTC (in 15 minutes)" +echo "" + +read -p "Press Enter to create future event..." + +cat > "$EVENT_FILE" <<EOF +{ + "id": 997, + "title": "UTC Test - Future Event", + "start": "$FUTURE_START", + "end": "$FUTURE_END", + "web": { + "url": "https://www.timeanddate.com/worldclock/timezone/utc" + } +} +EOF + +echo "✅ Created future event:" +cat "$EVENT_FILE" | jq . +echo "" +echo "⏱️ Display Manager should detect this as NOT ACTIVE YET" +echo " It should stop any current display" +echo " Check logs: tail -f logs/display_manager.log" +echo "" + +read -p "Press Enter to continue to next test..." +echo "" + +# Test 3: Event in the past +PAST_START=$(date -u -d '30 minutes ago' '+%Y-%m-%d %H:%M:%S') +PAST_END=$(date -u -d '20 minutes ago' '+%Y-%m-%d %H:%M:%S') + +echo "3️⃣ Test Past Event (should NOT display - already ended)" +echo " Create event with:" +echo " - Start: $PAST_START UTC (30 minutes ago)" +echo " - End: $PAST_END UTC (20 minutes ago)" +echo "" + +read -p "Press Enter to create past event..." + +cat > "$EVENT_FILE" <<EOF +{ + "id": 996, + "title": "UTC Test - Past Event", + "start": "$PAST_START", + "end": "$PAST_END", + "web": { + "url": "https://www.timeanddate.com/worldclock/timezone/utc" + } +} +EOF + +echo "✅ Created past event:" +cat "$EVENT_FILE" | jq . +echo "" +echo "⏱️ Display Manager should detect this as ALREADY ENDED" +echo " It should stop any current display" +echo " Check logs: tail -f logs/display_manager.log" +echo "" + +read -p "Press Enter to clean up..." + +# Clean up +rm -f "$EVENT_FILE" +echo "" +echo "🧹 Cleaned up test event file" +echo "" +echo "📊 Summary:" +echo "===========" +echo "" +echo "✅ Test 1: Active event (past start, future end) → Should DISPLAY" +echo "✅ Test 2: Future event (future start, future end) → Should NOT display yet" +echo "✅ Test 3: Past event (past start, past end) → Should NOT display" +echo "" +echo "📝 The Display Manager should now correctly handle UTC timestamps!" +echo "" +echo "💡 Tips for debugging:" +echo " • Watch logs: tail -f logs/display_manager.log" +echo " • Check timezone: date; date -u" +echo " • The Display Manager logs show both UTC and comparison times" +echo "" diff --git a/scripts/test_cdp.py b/scripts/test_cdp.py new file mode 100755 index 0000000..1e164fd --- /dev/null +++ b/scripts/test_cdp.py @@ -0,0 +1,75 @@ +#!/usr/bin/env python3 +"""Quick CDP tester: lists targets and evaluates a small script in the first target. + +Usage: + python3 scripts/test_cdp.py + +Requires: requests, websocket-client +""" +import requests +import websocket +import json + + +def main(): + try: + resp = requests.get('http://127.0.0.1:9222/json', timeout=3) + tabs = resp.json() + except Exception as e: + print('ERROR: could not fetch http://127.0.0.1:9222/json ->', e) + return + + if not tabs: + print('No targets returned') + return + + print('Found targets:') + for i, t in enumerate(tabs): + print(i, t.get('type'), t.get('url'), '-', t.get('title')) + + target = tabs[0] + ws_url = target.get('webSocketDebuggerUrl') + print('\nUsing target[0]:', target.get('url')) + print('webSocketDebuggerUrl:', ws_url) + + if not ws_url: + print('No webSocketDebuggerUrl for target') + return + + try: + # Some Chromium builds require an Origin header to avoid 403 during the websocket handshake + try: + ws = websocket.create_connection(ws_url, timeout=5, header=["Origin: http://127.0.0.1"]) + except TypeError: + # older websocket-client accepts origin kw instead + ws = websocket.create_connection(ws_url, timeout=5, origin="http://127.0.0.1") + except Exception as e: + print('ERROR: could not open websocket to', ws_url, '->', e) + return + + idn = 1 + # Enable runtime + msg = {'id': idn, 'method': 'Runtime.enable'} + ws.send(json.dumps(msg)) + idn += 1 + try: + print('Runtime.enable =>', ws.recv()) + except Exception as e: + print('No response to Runtime.enable:', e) + + # Evaluate a script that logs and returns a value + script = "console.log('cdp-test-log'); 12345" + msg = {'id': idn, 'method': 'Runtime.evaluate', 'params': {'expression': script, 'returnByValue': True}} + ws.send(json.dumps(msg)) + idn += 1 + try: + resp = ws.recv() + print('Runtime.evaluate =>', resp) + except Exception as e: + print('No response to Runtime.evaluate:', e) + + ws.close() + + +if __name__ == '__main__': + main() diff --git a/scripts/test_cdp_origins.py b/scripts/test_cdp_origins.py new file mode 100644 index 0000000..3e80068 --- /dev/null +++ b/scripts/test_cdp_origins.py @@ -0,0 +1,76 @@ +#!/usr/bin/env python3 +# scripts/test_cdp_origins.py +# Tries several Origin headers when connecting to Chromium DevTools websocket +import requests, websocket, json, sys, time + +def try_origin(ws_url, origin_header): + try: + # websocket-client accepts header=[...] or origin=... depending on version + try: + ws = websocket.create_connection(ws_url, timeout=5, header=[f"Origin: {origin_header}"]) + except TypeError: + ws = websocket.create_connection(ws_url, timeout=5, origin=origin_header) + return True, "connected" + except Exception as e: + return False, str(e) + +def main(): + try: + tabs = requests.get('http://127.0.0.1:9222/json', timeout=3).json() + except Exception as e: + print("ERROR: could not fetch DevTools json:", e) + return + + if not tabs: + print("No DevTools targets found") + return + + target = tabs[0] + ws_url = target.get('webSocketDebuggerUrl') + print("Using target url:", target.get('url')) + print("DevTools websocket:", ws_url) + if not ws_url: + print("No webSocketDebuggerUrl found in target") + return + + # candidate origins to try + candidates = [ + "http://127.0.0.1", + "http://localhost", + "https://www.computerbase.de", # page origin (use the exact scheme + host of the page) + "https://computerbase.de", + "null", + "chrome-devtools://devtools", + "" + ] + + print("\nTrying origins (may need to match page origin exactly):") + for orig in candidates: + ok, msg = try_origin(ws_url, orig) + print(f"Origin={repr(orig):30} -> {ok} : {msg}") + + # If one of them connected, try to send a Runtime.evaluate to confirm: + # (try the first that succeeded) + for orig in candidates: + try: + try: + ws = websocket.create_connection(ws_url, timeout=5, header=[f"Origin: {orig}"]) + except TypeError: + ws = websocket.create_connection(ws_url, timeout=5, origin=orig) + print("\nConnected with origin:", orig) + msg_id = 1 + payload = {"id": msg_id, "method": "Runtime.enable"} + ws.send(json.dumps(payload)) + print("Runtime.enable ->", ws.recv()) + msg_id += 1 + payload = {"id": msg_id, "method": "Runtime.evaluate", "params": {"expression": "1+2", "returnByValue": True}} + ws.send(json.dumps(payload)) + print("Runtime.evaluate ->", ws.recv()) + ws.close() + break + except Exception as e: + # try next origin + continue + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/src/.dockerignore b/src/.dockerignore new file mode 100644 index 0000000..90d210f --- /dev/null +++ b/src/.dockerignore @@ -0,0 +1,23 @@ +# Docker ignore file for production builds +.git +.gitignore +*.md +.env* +.vscode/ +.devcontainer/ +dev-workflow.sh +pi-dev-setup.sh + +# Development artifacts +screenshots/ +logs/ +config/ +presentation/ + +# Python cache +__pycache__/ +*.pyc +*.pyo +*.pyd +.Python +*.so \ No newline at end of file diff --git a/src/.env.production.template b/src/.env.production.template new file mode 100644 index 0000000..45a4a47 --- /dev/null +++ b/src/.env.production.template @@ -0,0 +1,23 @@ +# Production Environment Template +# Copy this file to .env and customize for your production deployment + +# Client Configuration +CLIENT_ID=client-001 +VERSION=latest + +# MQTT Broker +MQTT_BROKER=192.168.1.100 +MQTT_PORT=1883 + +# Timing (production values) +HEARTBEAT_INTERVAL=60 +SCREENSHOT_INTERVAL=300 + +# File/API Server (used to download presentation files) +# Defaults to the same host as MQTT_BROKER, port 8000, scheme http. +# If incoming event URLs use host 'server' (or are host-less), simclient rewrites them to this server. +FILE_SERVER_HOST= # optional: e.g., 192.168.1.100 +FILE_SERVER_PORT=8000 # default API port +# http or https +FILE_SERVER_SCHEME=http +# FILE_SERVER_BASE_URL= # optional full override, e.g., https://api.example.com:443 \ No newline at end of file diff --git a/src/.env.template b/src/.env.template new file mode 100644 index 0000000..36c3c46 --- /dev/null +++ b/src/.env.template @@ -0,0 +1,27 @@ +# Infoscreen Client Configuration Template +# Copy this file to .env and adjust values for your setup + +# Development Environment +ENV=development +DEBUG_MODE=1 +LOG_LEVEL=DEBUG + +# MQTT Broker Configuration +MQTT_BROKER=192.168.1.100 # Change to your MQTT server IP +MQTT_PORT=1883 + +# Timing Configuration (shorter intervals for development) +HEARTBEAT_INTERVAL=10 # Heartbeat frequency in seconds +SCREENSHOT_INTERVAL=30 # Screenshot capture frequency in seconds + +# Display Manager +DISPLAY_CHECK_INTERVAL=5 # Display Manager event check frequency in seconds + +# File/API Server (used to download presentation files) +# Defaults to the same host as MQTT_BROKER, port 8000, scheme http. +# If incoming event URLs use host 'server' (or are host-less), simclient rewrites them to this server. +FILE_SERVER_HOST= # optional: e.g., 192.168.1.100 +FILE_SERVER_PORT=8000 # default API port +# http or https +FILE_SERVER_SCHEME=http +# FILE_SERVER_BASE_URL= # optional full override, e.g., http://192.168.1.100:8000 diff --git a/src/.gitignore b/src/.gitignore new file mode 100644 index 0000000..1ba0cb9 --- /dev/null +++ b/src/.gitignore @@ -0,0 +1,96 @@ +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# C extensions +*.so + +# Distribution / packaging +.Python +env/ +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +*.egg-info/ +.installed.cfg +*.egg +MANIFEST + +# Virtual environments +venv/ +ENV/ +env.bak/ +venv.bak/ + +# Jupyter Notebook checkpoints +.ipynb_checkpoints + +# VS Code settings +.vscode/ + +# Devcontainer settings +.devcontainer/ + +# Docker +*.log +docker-compose.override.yml + +# Unit test / coverage reports +htmlcov/ +.tox/ +.nox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*.cover +*.py,cover +.hypothesis/ +.pytest_cache/ + +# mypy +.mypy_cache/ +.dmypy.json + +# Pyre type checker +.pyre/ + +# Profiling data +.prof + +# CSV/Excel/other data files +*.csv +*.tsv +*.xls +*.xlsx + +# Misc +*.swp +*.swo +*.bak +*.tmp + +# System files +.DS_Store +Thumbs.db + +# own modifications +.env +sync.ffs_db +config/ +presentation/ +screenshots/ +logs/ +simclient.log* +current_event.json +last_event.json diff --git a/src/CONTAINER_TRANSITION.md b/src/CONTAINER_TRANSITION.md new file mode 100644 index 0000000..29281c7 --- /dev/null +++ b/src/CONTAINER_TRANSITION.md @@ -0,0 +1,168 @@ +# Container Transition Guide + +## Converting Pi Development to Container + +Your `simclient.py` is already well-prepared for containerization! Here are the minimal changes needed: + +## ✅ Already Container-Ready Features + +1. **Multi-path Environment Loading**: Already supports container paths +2. **Volume-friendly File Handling**: Uses relative paths for shared directories +3. **Screenshot Service**: Designed to read from shared volume +4. **Configuration**: Environment variable based +5. **Logging**: Configurable output (file + console) + +## 🔧 Required Changes + +### 1. Minimal Code Adjustments (Optional) + +The current code will work in containers as-is, but you can optimize it: + +```python +# Current multi-path approach (already works): +env_paths = [ + "/workspace/simclient/.env", # Container path + os.path.join(os.path.dirname(__file__), ".env"), # Same directory + os.path.join(os.path.expanduser("~"), "infoscreen-dev", ".env"), # Development path +] + +# For production container, you could simplify to: +# load_dotenv() # Just use environment variables +``` + +### 2. Container Files Needed + +Create these files for containerization: + +#### Dockerfile +```dockerfile +FROM python:3.11-slim + +WORKDIR /app + +# Install system dependencies (no GUI tools needed in container) +RUN apt-get update && apt-get install -y \\ + && rm -rf /var/lib/apt/lists/* + +# Copy requirements and install Python packages +COPY requirements.txt . +RUN pip install --no-cache-dir -r requirements.txt + +# Copy application code +COPY simclient.py . + +# Create directories for volumes +RUN mkdir -p /app/presentation /app/screenshots /app/config /app/logs + +# Run the application +CMD ["python", "simclient.py"] +``` + +#### docker-compose.yml +```yaml +version: '3.8' + +services: + infoclient: + build: . + container_name: infoclient + restart: unless-stopped + environment: + - ENV=production + - MQTT_BROKER=${MQTT_BROKER} + - MQTT_PORT=${MQTT_PORT} + - HEARTBEAT_INTERVAL=60 + - SCREENSHOT_INTERVAL=300 + volumes: + # Shared with host OS for presentation files + - /opt/infoscreen/presentations:/app/presentation:rw + # Screenshots from host OS + - /opt/infoscreen/screenshots:/app/screenshots:ro + # Persistent config + - /opt/infoscreen/config:/app/config:rw + # Logs for monitoring + - /opt/infoscreen/logs:/app/logs:rw + networks: + - infonet + +networks: + infonet: + driver: bridge +``` + +## 🚀 Transition Strategy + +### Phase 1: Test Container Locally +```bash +# On your Pi, test the container version +cd ~/infoscreen-dev/src +docker build -t infoclient . +docker run --rm -e MQTT_BROKER=192.168.1.100 infoclient +``` + +### Phase 2: Hybrid Setup (Recommended) +Keep your current architecture but containerize the communication part: + +``` +┌─────────────────────────────────────────┐ +│ Raspberry Pi │ +├─────────────────────────────────────────┤ +│ ┌─────────────────┐ ┌─────────────────┐│ +│ │ Container │ │ Host OS ││ +│ │ │ │ ││ +│ │ • simclient.py │ │ • Presentation ││ +│ │ • MQTT Client │ │ • Screenshots ││ +│ │ • File Download │ │ • Display Mgmt ││ +│ └─────────────────┘ └─────────────────┘│ +│ ↕ Shared Volumes ↕ │ +└─────────────────────────────────────────┘ +``` + +### Phase 3: Production Deployment +Use the container for easy updates across multiple Pis: + +```bash +# Build and push to registry +docker build -t your-registry/infoclient:v1.0 . +docker push your-registry/infoclient:v1.0 + +# Deploy to all Pis +ansible all -i inventory -m shell -a "docker-compose pull && docker-compose up -d" +``` + +## 📋 Containerization Checklist + +### Code Changes Needed: ❌ None (already compatible!) + +### Files to Create: +- [ ] `Dockerfile` +- [ ] `docker-compose.yml` +- [ ] `.dockerignore` +- [ ] Production environment template + +### Host OS Services Needed: +- [ ] Screenshot capture service +- [ ] Presentation handler service +- [ ] Shared volume directories + +## 🎯 Zero Code Changes Required! + +Your current `simclient.py` will run in a container without any modifications because: + +1. ✅ **Environment Loading**: Already supports container environment paths +2. ✅ **File Paths**: Uses container-friendly relative paths +3. ✅ **Volume Mounting**: Presentation/screenshot directories are already externalized +4. ✅ **Configuration**: Fully environment variable based +5. ✅ **Logging**: Already outputs to both file and console +6. ✅ **Screenshot Reading**: Reads from shared volume (not capturing directly) + +## 🚀 Deployment Benefits + +Container deployment will give you: +- **Easy Updates**: `docker-compose pull && docker-compose up -d` +- **Consistency**: Same runtime across all Pis +- **Rollback**: Quick version switching +- **Monitoring**: Health checks and centralized logging +- **Isolation**: Container issues don't affect host presentation + +The transition will be seamless! 🎉 \ No newline at end of file diff --git a/src/DISPLAY_MANAGER.md b/src/DISPLAY_MANAGER.md new file mode 100644 index 0000000..b3ff4fb --- /dev/null +++ b/src/DISPLAY_MANAGER.md @@ -0,0 +1,457 @@ +# Display Manager - Event Display Controller + +## Overview + +The **Display Manager** is a daemon process that monitors `current_event.json` and automatically controls display software (LibreOffice, Chromium, VLC) to show the appropriate content based on scheduled events. + +## Architecture + +``` +MQTT Server → simclient.py → current_event.json → display_manager.py → Display Software + ├─ LibreOffice (presentations) + ├─ Chromium (web pages) + └─ VLC/MPV (videos) +``` + +### How It Works + +1. **Event Reception**: `simclient.py` receives events via MQTT and writes them to `current_event.json` +2. **File Monitoring**: `display_manager.py` continuously monitors this file for changes +3. **Event Processing**: When changes detected, manager determines what to display +4. **Time-based Activation**: Respects event `start` and `end` times +5. **Process Management**: Starts appropriate display software and manages its lifecycle +6. **Clean Transitions**: Gracefully terminates old software before starting new + +## Supported Event Types + +**⚠️ Important: Timestamps are in UTC** + +All event `start` and `end` times must be in **UTC format** (as stored in the server database). The Display Manager automatically converts these to the local timezone for comparison. + +Example format: `"2025-10-01 08:00:00"` (interpreted as UTC) + +### 1. Presentation Events (PowerPoint/PDF) + +```json +{ + "id": 1, + "title": "Company Overview", + "start": "2025-10-01 08:00:00", + "end": "2025-10-01 18:00:00", + "presentation": { + "type": "slideshow", + "files": [ + { + "name": "presentation.pptx", + "url": "http://server/files/presentation.pptx" + } + ], + "slide_interval": 10, + "auto_advance": true + } +} +``` + +**Supported Formats:** +- `.pptx`, `.ppt` (Microsoft PowerPoint) → LibreOffice Impress +- `.odp` (OpenDocument Presentation) → LibreOffice Impress +- `.pdf` (PDF documents) → Evince or Okular + +**Display Behavior:** +- Fullscreen/presentation mode +- Auto-advance slides (if supported by viewer) +- Loops through presentation continuously + +### 2. Web Page Events + +```json +{ + "id": 2, + "title": "Dashboard Display", + "start": "2025-10-01 08:00:00", + "end": "2025-10-01 18:00:00", + "web": { + "url": "https://dashboard.example.com" + } +} +``` + +**Display Behavior:** +- Kiosk mode (fullscreen, no UI) +- Uses Chromium/Chrome browser +- Disables session restore and crash bubbles + +### 3. Video Events + +```json +{ + "id": 3, + "title": "Promotional Video", + "start": "2025-10-01 08:00:00", + "end": "2025-10-01 18:00:00", + "video": { + "url": "http://server/videos/promo.mp4", + "loop": true + } +} +``` + +**Supported Formats:** +- Local files or HTTP URLs +- All formats supported by VLC/MPV (mp4, avi, mkv, etc.) + +**Display Behavior:** +- Fullscreen playback +- Optional looping +- Uses VLC or MPV player + +## Installation & Setup + +### Development Setup + +1. **Install dependencies:** +```bash +# Already in requirements.txt, but ensure these system packages are installed: +sudo apt-get update +sudo apt-get install -y \ + libreoffice-impress \ + chromium-browser \ + vlc \ + evince +``` + +2. **Start Display Manager:** +```bash +./scripts/start-display-manager.sh +``` + +### Production Setup (Systemd Service) + +1. **Copy systemd service file:** +```bash +sudo cp scripts/infoscreen-display.service /etc/systemd/system/ +sudo systemctl daemon-reload +``` + +2. **Enable and start service:** +```bash +sudo systemctl enable infoscreen-display.service +sudo systemctl start infoscreen-display.service +``` + +3. **Check status:** +```bash +sudo systemctl status infoscreen-display.service +sudo journalctl -u infoscreen-display.service -f +``` + +## Configuration + +Configure via `.env` file: + +```bash +# Display Manager Settings +DISPLAY_CHECK_INTERVAL=5 # How often to check for event changes (seconds) +LOG_LEVEL=INFO # Logging level (DEBUG, INFO, WARNING, ERROR) +ENV=production # Environment (development, production) + +# Display environment +DISPLAY=:0 # X11 display (usually :0) +``` + +## Usage + +### Starting the Display Manager + +**Development:** +```bash +./scripts/start-display-manager.sh +``` + +**Production (systemd):** +```bash +sudo systemctl start infoscreen-display.service +``` + +### Testing + +Run the interactive test script: +```bash +./scripts/test-display-manager.sh +``` + +**Test menu options:** +1. Check Display Manager status +2. Create PRESENTATION test event +3. Create WEBPAGE test event +4. Create VIDEO test event +5. Remove event (no display) +6. Check active display processes +7. View current event file +8. Interactive test (cycle through events) + +### Manual Testing + +Create a test event file: +```bash +cat > src/current_event.json <<EOF +{ + "id": 999, + "title": "Test Presentation", + "start": "2025-01-01 00:00:00", + "end": "2025-12-31 23:59:59", + "presentation": { + "files": [{"name": "test.pptx"}] + } +} +EOF +``` + +Display Manager will detect the change within 5 seconds and start the presentation. + +### Stopping Display + +Remove the event file: +```bash +rm src/current_event.json +``` + +Or create an empty event: +```bash +echo "{}" > src/current_event.json +``` + +## Best Practices Implemented + +### ✅ 1. Separation of Concerns +- **MQTT Client** (`simclient.py`): Handles network communication +- **Display Manager** (`display_manager.py`): Handles display control +- Communication via file: `current_event.json` + +### ✅ 2. Robust Process Management +- Clean process lifecycle (start → monitor → terminate) +- Graceful termination with fallback to force kill +- Process health monitoring and automatic restart +- PID tracking for debugging + +### ✅ 3. Event State Machine +- Clear states: NO_EVENT → EVENT_ACTIVE → DISPLAY_RUNNING +- Proper state transitions +- Event change detection via file modification time +- Event deduplication (same event doesn't restart display) + +### ✅ 4. Time-based Scheduling +- Respects event `start` and `end` times +- Automatically stops display when event expires +- Handles timezone-aware timestamps + +### ✅ 5. Application Lifecycle Management + +**Starting Applications:** +- Detects available software (LibreOffice, Chromium, VLC) +- Uses appropriate command-line flags for kiosk/fullscreen +- Sets correct environment variables (DISPLAY, XAUTHORITY) + +**Stopping Applications:** +- First attempts graceful termination (SIGTERM) +- Waits 5 seconds for clean shutdown +- Falls back to force kill (SIGKILL) if needed +- Cleans up zombie processes + +### ✅ 6. Error Handling & Logging +- Comprehensive error logging with context +- Rotating log files (2MB per file, 5 backups) +- Different log levels for development/production +- Exception handling around all external operations + +### ✅ 7. File Watching Strategy +- Efficient: Only re-reads when file changes (mtime check) +- Handles missing files gracefully +- JSON parsing with error recovery +- Non-blocking I/O + +### ✅ 8. Graceful Shutdown +- Signal handlers (SIGTERM, SIGINT) +- Stops current display before exiting +- Clean resource cleanup + +### ✅ 9. Development Experience +- Test scripts for all functionality +- Interactive testing mode +- Verbose logging in development +- Easy manual testing + +### ✅ 10. Production Readiness +- Systemd service integration +- Auto-restart on failure +- Resource limits and security settings +- Journal logging + +## Troubleshooting + +### Display Manager not starting +```bash +# Check logs +tail -f logs/display_manager.log + +# Check if virtual environment activated +source venv/bin/activate + +# Verify Python can import required modules +python3 -c "import paho.mqtt.client; print('OK')" +``` + +### Display software not appearing +```bash +# Check DISPLAY variable +echo $DISPLAY + +# Verify X11 authentication +xhost +local: + +# Check if software is installed +which libreoffice chromium-browser vlc + +# Check running processes +ps aux | grep -E 'libreoffice|chromium|vlc' +``` + +### Events not triggering display changes +```bash +# Verify event file exists and is valid JSON +cat src/current_event.json | jq . + +# Check file modification time +stat src/current_event.json + +# Check Display Manager is running +pgrep -f display_manager.py + +# Watch logs in real-time +tail -f logs/display_manager.log +``` + +### Display software crashes +```bash +# Check for error messages +journalctl -xe | grep -E 'libreoffice|chromium|vlc' + +# Verify files exist +ls -la src/presentation/ + +# Test manual start +libreoffice --impress --show src/presentation/test.pptx +``` + +### Timezone / Event timing issues + +**Problem**: Events not displaying at the expected time + +**Cause**: Event times are in UTC, but you're thinking in local time + +**Solution**: +```bash +# Check current UTC time +date -u + +# Check current local time +date + +# Check timezone offset +date +%Z +date +%z + +# Test with UTC timestamp script +./scripts/test-utc-timestamps.sh + +# View Display Manager timezone info in logs +tail -f logs/display_manager.log | grep -i "time\|utc" +``` + +**Understanding UTC timestamps:** +- Server stores times in UTC (database standard) +- Display Manager compares with current UTC time +- Events display correctly regardless of client timezone + +**Example**: +- Event start: `2025-10-01 08:00:00` (UTC) +- Your timezone: CEST (UTC+2) +- Event will display at: 10:00:00 local time + +**Debugging timing issues:** +1. Check Display Manager logs for time comparisons +2. Logs show: "Current time (UTC): ..." and "Event start time (UTC): ..." +3. Use test script: `./scripts/test-utc-timestamps.sh` +4. Verify server sends UTC timestamps (not local times) + +## Architecture Decisions + +### Why separate processes? +- **Fault isolation**: Display crash doesn't affect MQTT client +- **Independent lifecycle**: Can restart display without losing connection +- **Simpler debugging**: Separate logs and process monitoring + +### Why file-based communication? +- **Simplicity**: No IPC complexity (sockets, pipes, queues) +- **Persistence**: Event survives process restarts +- **Debuggability**: Can inspect/modify events manually +- **Atomic operations**: File writes are atomic + +### Why polling instead of inotify? +- **Portability**: Works on all systems +- **Simplicity**: No external dependencies +- **Reliability**: Catches events even if filesystem events missed +- **Performance**: 5-second interval is sufficient + +### Why subprocess instead of libraries? +- **Flexibility**: Can use any display software +- **Reliability**: Process isolation +- **Feature completeness**: Full application features (vs. library subset) +- **Maintainability**: No need to update when apps change + +## Performance Characteristics + +- **CPU Usage**: Minimal when idle (<1%) +- **Memory**: ~20-30MB for manager + display software memory +- **Startup Time**: <1 second +- **Event Detection**: ~5 seconds average, max 5 seconds +- **Display Transition**: 1-3 seconds for clean shutdown + start + +## Future Enhancements + +Potential improvements: + +1. **Multi-display support**: Handle multiple screens +2. **Playlist support**: Cycle through multiple presentations +3. **Transition effects**: Fade between content +4. **Health checks**: Verify display is rendering correctly +5. **Remote control**: MQTT commands to pause/resume +6. **Screenshot monitoring**: Send actual display output to server +7. **Performance metrics**: Track frame rates, response times +8. **Fallback content**: Default display when no events active + +## Integration with MQTT Client + +The Display Manager integrates seamlessly with `simclient.py`: + +``` +Server MQTT → simclient.py → current_event.json → display_manager.py → Screen + ↓ + Downloads files + to presentation/ +``` + +**simclient.py responsibilities:** +- MQTT communication +- Event file downloads +- Writing `current_event.json` + +**display_manager.py responsibilities:** +- Reading `current_event.json` +- Time-based event activation +- Display software control + +## License & Support + +Part of the Infoscreen Client 2025 project. +See main README.md for license and contribution guidelines. diff --git a/src/Dockerfile.production b/src/Dockerfile.production new file mode 100644 index 0000000..3de6506 --- /dev/null +++ b/src/Dockerfile.production @@ -0,0 +1,31 @@ +FROM python:3.11-slim + +# Set working directory +WORKDIR /app + +# Install system dependencies (minimal for container) +RUN apt-get update && apt-get install -y \ + && rm -rf /var/lib/apt/lists/* + +# Copy requirements and install Python packages +COPY requirements.txt . +RUN pip install --no-cache-dir -r requirements.txt + +# Copy application code +COPY simclient.py . + +# Create directories for volume mounts +RUN mkdir -p /app/presentation /app/screenshots /app/config /app/logs + +# Create non-root user for security +RUN useradd -r -s /bin/false infoclient && \ + chown -R infoclient:infoclient /app + +USER infoclient + +# Health check +HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \ + CMD python -c "import socket; socket.create_connection(('${MQTT_BROKER:-localhost}', ${MQTT_PORT:-1883}), timeout=5)" || exit 1 + +# Run the application +CMD ["python", "simclient.py"] \ No newline at end of file diff --git a/src/IMPLEMENTATION_SUMMARY.md b/src/IMPLEMENTATION_SUMMARY.md new file mode 100644 index 0000000..b5af47b --- /dev/null +++ b/src/IMPLEMENTATION_SUMMARY.md @@ -0,0 +1,317 @@ +# Display Manager Implementation Summary + +## What Was Implemented + +A complete **Event Display Management System** for the Infoscreen Client with the following components: + +### 1. Core Display Manager (`display_manager.py`) +- **Event Monitoring**: Watches `current_event.json` for changes +- **Time-based Scheduling**: Respects event start/end times +- **Process Management**: Clean lifecycle for display applications +- **Application Mapping**: Routes events to appropriate software + - Presentations → LibreOffice Impress (pptx, ppt, odp) or Evince/Okular (pdf) + - Web pages → Chromium/Chrome (kiosk mode) + - Videos → VLC or MPV (fullscreen) +- **Graceful Transitions**: Terminates old software before starting new +- **Error Handling**: Comprehensive logging and recovery + +### 2. Supporting Scripts +- `start-display-manager.sh` - Start the display manager +- `test-display-manager.sh` - Interactive testing tool +- `quick-start.sh` - Complete system setup and startup +- `infoscreen-display.service` - Systemd service for production + +### 3. Documentation +- `DISPLAY_MANAGER.md` - Complete technical documentation +- Updated `README.md` - Integration with main docs +- Inline code documentation + +## Architecture + +``` +┌─────────────────┐ ┌──────────────────┐ ┌─────────────────┐ +│ MQTT Server │────────▶│ simclient.py │────────▶│ current_event │ +│ (Events) │ │ (MQTT Client) │ │ .json │ +└─────────────────┘ └──────────────────┘ └────────┬────────┘ + │ + │ monitors + │ + ┌──────────────────┐ ┌────────▼────────┐ + │ Display Screen │◀────────│ display_manager │ + │ │ │ .py │ + └──────────────────┘ └─────────────────┘ + │ + ┌───────────────────┼───────────────────┐ + │ │ │ + ┌────▼──────┐ ┌────▼──────┐ ┌────▼──────┐ + │ LibreOffice│ │ Chromium │ │ VLC │ + │ Impress │ │ (kiosk) │ │ (video) │ + └────────────┘ └───────────┘ └───────────┘ +``` + +## Best Practices Implemented + +### ✅ 1. Separation of Concerns +- **MQTT Client** handles network communication +- **Display Manager** handles screen control +- Clean interface via JSON file + +### ✅ 2. Robust Process Management +- Graceful termination (SIGTERM) with fallback to force kill (SIGKILL) +- Process health monitoring +- Automatic restart on crashes +- PID tracking for debugging + +### ✅ 3. Event State Machine +- Clear state transitions +- Event change detection via file modification time +- Deduplication (same event doesn't restart display) + +### ✅ 4. Time-based Scheduling +- Respects event start/end times +- Automatic display stop when event expires +- Handles timezone-aware timestamps + +### ✅ 5. Error Handling +- Comprehensive logging with context +- Graceful degradation +- Recovery from failures +- Missing file handling + +### ✅ 6. Development Experience +- Interactive test scripts +- Multiple startup modes (tmux, daemon, manual) +- Verbose logging in development +- Easy manual testing + +### ✅ 7. Production Ready +- Systemd service integration +- Auto-restart on failure +- Resource limits +- Security settings + +## How to Use + +### Quick Start +```bash +cd ~/infoscreen-dev +./scripts/quick-start.sh +``` + +### Manual Start (Two Terminals) + +**Terminal 1: MQTT Client** +```bash +cd ~/infoscreen-dev +source venv/bin/activate +./scripts/start-dev.sh +``` + +**Terminal 2: Display Manager** +```bash +cd ~/infoscreen-dev +source venv/bin/activate +./scripts/start-display-manager.sh +``` + +### Testing +```bash +./scripts/test-display-manager.sh +``` + +Choose from test menu: +- Create test events (presentation, webpage, video) +- Check running processes +- Interactive cycling test + +### Production Deployment +```bash +# Install services +sudo cp scripts/infoscreen-display.service /etc/systemd/system/ +sudo systemctl daemon-reload + +# Enable and start +sudo systemctl enable infoscreen-display.service +sudo systemctl start infoscreen-display.service + +# Check status +sudo systemctl status infoscreen-display.service +``` + +## Event Format Examples + +### Presentation Event +```json +{ + "id": 1, + "title": "Company Overview", + "start": "2025-10-01 08:00:00", + "end": "2025-10-01 18:00:00", + "presentation": { + "files": [ + { + "name": "presentation.pptx", + "url": "http://server/files/presentation.pptx" + } + ] + } +} +``` + +### Web Page Event +```json +{ + "id": 2, + "title": "Dashboard", + "start": "2025-10-01 08:00:00", + "end": "2025-10-01 18:00:00", + "web": { + "url": "https://dashboard.example.com" + } +} +``` + +### Video Event +```json +{ + "id": 3, + "title": "Promo Video", + "start": "2025-10-01 08:00:00", + "end": "2025-10-01 18:00:00", + "video": { + "url": "https://server/videos/promo.mp4", + "loop": true + } +} +``` + +### No Event (Stop Display) +```json +{} +``` +or delete `current_event.json` + +## Key Design Decisions + +### Why Two Processes? +1. **Fault Isolation**: Display crash doesn't affect MQTT +2. **Independent Lifecycle**: Can restart display without losing connection +3. **Simpler Debugging**: Separate logs and monitoring + +### Why File-based Communication? +1. **Simplicity**: No IPC complexity +2. **Persistence**: Events survive restarts +3. **Debuggability**: Can inspect/modify manually +4. **Atomic Operations**: File writes are atomic + +### Why Polling (5s) vs inotify? +1. **Portability**: Works everywhere +2. **Simplicity**: No external dependencies +3. **Reliability**: Catches events even if filesystem events missed +4. **Performance**: 5-second interval is sufficient + +### Why subprocess vs Libraries? +1. **Flexibility**: Can use any display software +2. **Reliability**: Process isolation +3. **Feature Complete**: Full application features +4. **Maintainability**: Apps update independently + +## Configuration + +Add to `.env`: +```bash +DISPLAY_CHECK_INTERVAL=5 # How often to check for event changes (seconds) +``` + +## Troubleshooting + +### Display Manager not starting +```bash +# Check logs +tail -f logs/display_manager.log + +# Verify Python environment +source venv/bin/activate +python3 -c "import paho.mqtt.client; print('OK')" +``` + +### Display not appearing +```bash +# Check DISPLAY variable +echo $DISPLAY # Should be :0 + +# Test X11 access +xhost +local: + +# Verify software installed +which libreoffice chromium-browser vlc +``` + +### Events not triggering +```bash +# Verify event file +cat src/current_event.json | jq . + +# Check Display Manager running +pgrep -f display_manager.py + +# Watch logs +tail -f logs/display_manager.log +``` + +## Performance + +- **CPU**: <1% idle, 3-5% during transitions +- **Memory**: ~30MB manager + display app memory +- **Startup**: <1 second +- **Event Detection**: Average 2.5s, max 5s +- **Transition Time**: 1-3 seconds + +## Next Steps / Future Enhancements + +1. **Multi-display support**: Handle multiple screens +2. **Playlist mode**: Cycle through multiple presentations +3. **Transition effects**: Fade between content +4. **Health monitoring**: Verify display is rendering +5. **Remote control**: MQTT commands to pause/resume +6. **Performance metrics**: Track frame rates, response times + +## Files Created/Modified + +### New Files +- `src/display_manager.py` - Main display manager +- `src/DISPLAY_MANAGER.md` - Documentation +- `scripts/start-display-manager.sh` - Startup script +- `scripts/test-display-manager.sh` - Testing tool +- `scripts/quick-start.sh` - Complete setup script +- `scripts/infoscreen-display.service` - Systemd service + +### Modified Files +- `src/README.md` - Updated with Display Manager info +- `.env` - Added DISPLAY_CHECK_INTERVAL + +## Testing Checklist + +- [x] Start/stop Display Manager +- [x] Create presentation event +- [x] Create webpage event +- [x] Create video event +- [x] Remove event (stop display) +- [x] Event time validation +- [x] Process lifecycle (start/terminate) +- [x] Graceful transitions +- [x] Error handling +- [x] Logging + +## Summary + +This implementation provides a **production-ready, maintainable, and robust** system for managing display content on infoscreen clients. It follows software engineering best practices including: + +- Clean architecture with separation of concerns +- Comprehensive error handling and logging +- Thorough documentation +- Multiple testing approaches +- Easy development and deployment +- Extensible design for future enhancements + +The system is ready for immediate use in both development and production environments. diff --git a/src/README.md b/src/README.md new file mode 100644 index 0000000..89c2aa4 --- /dev/null +++ b/src/README.md @@ -0,0 +1,274 @@ +# Infoscreen Client - Raspberry Pi Development + +A presentation system client for Raspberry Pi that communicates with a server via MQTT to display presentations, videos, and web content in kiosk mode. + +## Features + +- 📡 MQTT communication with server +- 📥 Automatic file downloads (presentations, videos) +- 🖥️ **Automated display management** with dedicated Display Manager +- 🎯 Event-driven content switching (presentations, videos, web pages) +- ⏰ Time-based event scheduling with automatic start/stop +- 🔄 Graceful application transitions (LibreOffice, Chromium, VLC) +- 📸 Screenshot capture for dashboard monitoring +- 👥 Group-based content management +- 💖 Heartbeat monitoring + +## Quick Setup + +### 1. Flash Raspberry Pi OS +- Use **Raspberry Pi OS (64-bit) with Desktop** +- Enable SSH and configure WiFi in Pi Imager +- Boot Pi and connect to network + +### 2. Install Development Environment +```bash +# Run on your Raspberry Pi: +curl -sSL https://raw.githubusercontent.com/RobbStarkAustria/infoscreen_client_2025/main/pi-dev-setup.sh | bash +``` + +### 3. Configure MQTT Broker +```bash +cd ~/infoscreen-dev +nano .env +# Update MQTT_BROKER=your-server-ip +``` + +### 4. Test Setup +```bash +./scripts/test-mqtt.sh # Test MQTT connection +./scripts/test-screenshot.sh # Test screenshot capture +./scripts/test-presentation.sh # Test presentation tools +``` + +### 5. Start Development +```bash +# Terminal 1: Start MQTT client (receives events) +./scripts/start-dev.sh + +# Terminal 2: Start Display Manager (controls screen) +./scripts/start-display-manager.sh + +# Or use interactive menu: +./dev-workflow.sh +``` + +**Important**: You need **both** processes running: +- `simclient.py` - Handles MQTT communication and writes events +- `display_manager.py` - Reads events and controls display software + +See [DISPLAY_MANAGER.md](DISPLAY_MANAGER.md) for detailed documentation. + +## Development Workflow + +### Daily Development +```bash +cd ~/infoscreen-dev +./dev-workflow.sh # Interactive menu with all options +``` + +**Menu Options:** +1. Start development client (MQTT) +2. Start Display Manager +3. View live logs +4. Test Display Manager +5. Test screenshot capture +6. Test MQTT connection +7. Test presentation tools +8. Git status and sync +9. Restart systemd services +10. Monitor system resources +11. Open tmux session + +### Remote Development (Recommended) +```bash +# From your main computer: +# Add to ~/.ssh/config +Host pi-dev + HostName YOUR_PI_IP + User pi + +# Connect with VS Code +code --remote ssh-remote+pi-dev ~/infoscreen-dev +``` + +## File Structure + +``` +~/infoscreen-dev/ +├── .env # Configuration +├── src/ # Source code (this repository) +│ ├── simclient.py # MQTT client (event receiver) +│ ├── display_manager.py # Display controller (NEW!) +│ ├── current_event.json # Current active event +│ ├── DISPLAY_MANAGER.md # Display Manager documentation +│ └── config/ # Client UUID and group ID +├── venv/ # Python virtual environment +├── presentation/ # Downloaded presentation files +├── screenshots/ # Screenshot captures +├── logs/ # Application logs +│ ├── simclient.log # MQTT client logs +│ └── display_manager.log # Display Manager logs +└── scripts/ # Development helper scripts + ├── start-dev.sh # Start MQTT client + ├── start-display-manager.sh # Start Display Manager (NEW!) + ├── test-display-manager.sh # Test display events (NEW!) + ├── test-mqtt.sh # Test MQTT connection + ├── test-screenshot.sh # Test screenshot capture + └── test-presentation.sh # Test presentation tools +``` + +## Configuration + +### Environment Variables (.env) +```bash +# Development settings +ENV=development +DEBUG_MODE=1 +LOG_LEVEL=DEBUG + +# MQTT Configuration +MQTT_BROKER=192.168.1.100 # Your MQTT server IP +MQTT_PORT=1883 + +# Intervals (seconds) +HEARTBEAT_INTERVAL=10 # Heartbeat frequency +SCREENSHOT_INTERVAL=30 # Screenshot capture frequency +DISPLAY_CHECK_INTERVAL=5 # Display Manager event check frequency +``` + +## MQTT Topics + +### Client → Server +- `infoscreen/discovery` - Client registration +- `infoscreen/{client_id}/heartbeat` - Regular heartbeat +- `infoscreen/{client_id}/dashboard` - Screenshot + status + +### Server → Client +- `infoscreen/{client_id}/discovery_ack` - Registration acknowledgment +- `infoscreen/{client_id}/group_id` - Group assignment +- `infoscreen/events/{group_id}` - Event messages with content + +## Event Format + +The Display Manager supports three event types: + +**Presentation Event:** +```json +{ + "id": 1, + "title": "Company Overview", + "start": "2025-10-01 08:00:00", + "end": "2025-10-01 18:00:00", + "presentation": { + "files": [ + { + "url": "https://server/presentations/slide.pptx", + "name": "slide.pptx" + } + ], + "slide_interval": 10, + "auto_advance": true + } +} +``` + +**Web Page Event:** +```json +{ + "id": 2, + "title": "Dashboard", + "start": "2025-10-01 08:00:00", + "end": "2025-10-01 18:00:00", + "web": { + "url": "https://dashboard.example.com" + } +} +``` + +**Video Event:** +```json +{ + "id": 3, + "title": "Promo Video", + "start": "2025-10-01 08:00:00", + "end": "2025-10-01 18:00:00", + "video": { + "url": "https://server/videos/promo.mp4", + "loop": true + } +} +``` + +See [DISPLAY_MANAGER.md](DISPLAY_MANAGER.md) for complete event documentation. + +## Debugging + +### View Logs +```bash +tail -f ~/infoscreen-dev/logs/simclient.log +``` + +### MQTT Debugging +```bash +# Subscribe to all infoscreen topics +mosquitto_sub -h YOUR_BROKER_IP -t "infoscreen/+/+" + +# Publish test event +mosquitto_pub -h YOUR_BROKER_IP -t "infoscreen/events/test-group" -m '{"web":{"url":"https://google.com"}}' +``` + +### System Service (Optional) +```bash +# Enable automatic startup +sudo systemctl enable infoscreen-dev +sudo systemctl start infoscreen-dev + +# View service logs +sudo journalctl -u infoscreen-dev -f +``` + +## Hardware Requirements + +- **Raspberry Pi 4 or 5** (recommended Pi 5 for best performance) +- **SSD storage** (much faster than SD card) +- **Display** connected via HDMI +- **Network connection** (WiFi or Ethernet) + +## Troubleshooting + +### Display Issues +```bash +export DISPLAY=:0 +echo $DISPLAY +``` + +### Screenshot Issues +```bash +# Test screenshot manually +scrot ~/test.png +# Check permissions +sudo usermod -a -G video pi +``` + +### MQTT Connection Issues +```bash +# Test broker connectivity +telnet YOUR_BROKER_IP 1883 +# Check firewall +sudo ufw status +``` + +## Development vs Production + +This setup is optimized for **development**: +- ✅ Fast iteration (edit → save → restart) +- ✅ Native debugging and logging +- ✅ Direct hardware access +- ✅ Remote development friendly + +For **production deployment** with multiple clients, consider containerization for easier updates and management. + +## License + +This project is part of the infoscreen presentation system for educational/research purposes. \ No newline at end of file diff --git a/src/chrome_autoscroll/content_script.js b/src/chrome_autoscroll/content_script.js new file mode 100644 index 0000000..888930a --- /dev/null +++ b/src/chrome_autoscroll/content_script.js @@ -0,0 +1,25 @@ +(function(){ + // Simple autoscroll: scroll down over 10s, then back to top, repeat + try{ + var duration = 60000; // 60s + var stepMs = 50; + var totalScroll = Math.max(document.documentElement.scrollHeight, document.body.scrollHeight) - window.innerHeight; + if(totalScroll <= 0) return; + var steps = Math.max(1, Math.round(duration/stepMs)); + var stepPx = totalScroll/steps; + var step = 0; + if(window.__infoscreen_autoscroll) { + clearInterval(window.__infoscreen_autoscroll); + window.__infoscreen_autoscroll = null; + } + window.__infoscreen_autoscroll = setInterval(function(){ + window.scrollBy(0, stepPx); + step++; + if(step>=steps){ + window.scrollTo(0,0); + step = 0; + } + }, stepMs); + console.info('Infoscreen autoscroll started'); + }catch(e){console.error('Autoscroll error', e);} +})(); diff --git a/src/chrome_autoscroll/manifest.json b/src/chrome_autoscroll/manifest.json new file mode 100644 index 0000000..82b38f4 --- /dev/null +++ b/src/chrome_autoscroll/manifest.json @@ -0,0 +1,15 @@ +{ + "manifest_version": 3, + "name": "Infoscreen AutoScroll", + "version": "1.0", + "description": "Automatically scroll pages for kiosk displays (10s default).", + "permissions": ["storage", "scripting"], + "host_permissions": ["<all_urls>"], + "content_scripts": [ + { + "matches": ["<all_urls>"], + "js": ["content_script.js"], + "run_at": "document_idle" + } + ] +} diff --git a/src/convert-to-container.sh b/src/convert-to-container.sh new file mode 100755 index 0000000..675cb84 --- /dev/null +++ b/src/convert-to-container.sh @@ -0,0 +1,213 @@ +#!/bin/bash +# convert-to-container.sh - Convert Pi development to container deployment + +set -e + +echo "🐳 Converting Infoscreen Client to Container Deployment" +echo "=====================================================" + +# Colors +GREEN='\033[0;32m' +YELLOW='\033[1;33m' +BLUE='\033[0;34m' +NC='\033[0m' + +INSTALL_DIR="/opt/infoscreen" +COMPOSE_DIR="$HOME/infoscreen-container" + +print_step() { + echo -e "${BLUE}📋 $1${NC}" +} + +print_success() { + echo -e "${GREEN}✅ $1${NC}" +} + +print_warning() { + echo -e "${YELLOW}⚠️ $1${NC}" +} + +# Step 1: Create production directories +print_step "Creating production directory structure..." +sudo mkdir -p "$INSTALL_DIR"/{presentations,screenshots,config,logs} +sudo chown -R $USER:$USER "$INSTALL_DIR" +print_success "Production directories created in $INSTALL_DIR" + +# Step 2: Set up container deployment directory +print_step "Setting up container deployment..." +mkdir -p "$COMPOSE_DIR" +cd "$COMPOSE_DIR" + +# Copy necessary files from development +if [ -d "$HOME/infoscreen-dev/src" ]; then + cp "$HOME/infoscreen-dev/src/simclient.py" . + cp "$HOME/infoscreen-dev/src/requirements.txt" . + cp "$HOME/infoscreen-dev/src/Dockerfile.production" ./Dockerfile + cp "$HOME/infoscreen-dev/src/docker-compose.production.yml" ./docker-compose.yml + cp "$HOME/infoscreen-dev/src/.env.production.template" ./.env.template + + print_success "Container files copied to $COMPOSE_DIR" +else + print_warning "Development directory not found. Please ensure you've run the Pi setup first." + exit 1 +fi + +# Step 3: Configure environment +print_step "Configuring production environment..." +if [ ! -f ".env" ]; then + cp .env.template .env + echo "Please edit .env to configure your MQTT broker and client ID:" + echo "nano $COMPOSE_DIR/.env" + print_warning "Environment file created from template - requires configuration" +else + print_success "Environment file already exists" +fi + +# Step 4: Install host services for presentation and screenshots +print_step "Installing host services..." + +# Screenshot service +cat > /tmp/screenshot-service.sh << 'EOF' +#!/bin/bash +SCREENSHOT_DIR="/opt/infoscreen/screenshots" +INTERVAL=30 +MAX_FILES=10 + +mkdir -p "$SCREENSHOT_DIR" + +while true; do + if [ -n "$DISPLAY" ]; then + TIMESTAMP=$(date +"%Y%m%d_%H%M%S") + FILENAME="screenshot_${TIMESTAMP}.png" + + # Capture screenshot + scrot "$SCREENSHOT_DIR/$FILENAME" 2>/dev/null || { + # Fallback to imagemagick + import -window root "$SCREENSHOT_DIR/$FILENAME" 2>/dev/null + } + + # Cleanup old files + cd "$SCREENSHOT_DIR" + ls -t *.png 2>/dev/null | tail -n +$((MAX_FILES + 1)) | xargs -r rm + fi + + sleep "$INTERVAL" +done +EOF + +sudo cp /tmp/screenshot-service.sh "$INSTALL_DIR/" +sudo chmod +x "$INSTALL_DIR/screenshot-service.sh" + +# Presentation handler (simplified version) +cat > /tmp/presentation-handler.py << 'EOF' +#!/usr/bin/env python3 +import json +import os +import subprocess +import time +import logging +from pathlib import Path +from watchdog.observers import Observer +from watchdog.events import FileSystemEventHandler + +class EventHandler(FileSystemEventHandler): + def on_modified(self, event): + if event.src_path.endswith('current_event.json'): + self.handle_event() + + def handle_event(self): + event_file = Path("/opt/infoscreen/presentations/current_event.json") + if event_file.exists(): + with open(event_file) as f: + data = json.load(f) + # Handle presentation logic here + print(f"Event received: {data}") + +if __name__ == "__main__": + observer = Observer() + observer.schedule(EventHandler(), "/opt/infoscreen/presentations", recursive=False) + observer.start() + try: + while True: + time.sleep(1) + except KeyboardInterrupt: + observer.stop() + observer.join() +EOF + +sudo cp /tmp/presentation-handler.py "$INSTALL_DIR/" +sudo chmod +x "$INSTALL_DIR/presentation-handler.py" + +# Create systemd services +sudo tee /etc/systemd/system/screenshot-service.service << EOF +[Unit] +Description=Screenshot Capture Service +After=graphical-session.target + +[Service] +Type=simple +User=$USER +Environment=DISPLAY=:0 +ExecStart=$INSTALL_DIR/screenshot-service.sh +Restart=always +RestartSec=30 + +[Install] +WantedBy=graphical-session.target +EOF + +sudo tee /etc/systemd/system/presentation-handler.service << EOF +[Unit] +Description=Presentation Handler Service +After=graphical-session.target + +[Service] +Type=simple +User=$USER +Environment=DISPLAY=:0 +WorkingDirectory=$INSTALL_DIR +ExecStart=/usr/bin/python3 $INSTALL_DIR/presentation-handler.py +Restart=always +RestartSec=10 + +[Install] +WantedBy=graphical-session.target +EOF + +sudo systemctl daemon-reload +sudo systemctl enable screenshot-service presentation-handler +print_success "Host services installed and enabled" + +rm /tmp/screenshot-service.sh /tmp/presentation-handler.py + +# Step 5: Build container +print_step "Building container image..." +docker build -t infoclient:latest . +print_success "Container image built" + +# Step 6: Final instructions +echo "" +print_success "🎉 Container conversion complete!" +echo "" +echo -e "${YELLOW}📝 Next steps:${NC}" +echo "1. Configure environment:" +echo " cd $COMPOSE_DIR" +echo " nano .env" +echo "" +echo "2. Start host services:" +echo " sudo systemctl start screenshot-service presentation-handler" +echo "" +echo "3. Start container:" +echo " docker-compose up -d" +echo "" +echo "4. Monitor services:" +echo " docker-compose logs -f" +echo " sudo systemctl status screenshot-service presentation-handler" +echo "" +echo -e "${YELLOW}📊 Deployment structure:${NC}" +echo "Container: Communication, file download, MQTT" +echo "Host OS: Presentation display, screenshot capture" +echo "Shared: $INSTALL_DIR/ (volumes)" +echo "" +echo -e "${YELLOW}🔄 Updates (future):${NC}" +echo "docker-compose pull && docker-compose up -d" \ No newline at end of file diff --git a/src/dev-workflow.sh b/src/dev-workflow.sh new file mode 100755 index 0000000..b8d2fa0 --- /dev/null +++ b/src/dev-workflow.sh @@ -0,0 +1,107 @@ +#!/bin/bash +# dev-workflow.sh - Daily development workflow helper + +PROJECT_DIR="$HOME/infoscreen-dev" +cd "$PROJECT_DIR" + +echo "🍓 Infoscreen Development Workflow" +echo "==================================" + +# Function to show menu +show_menu() { + echo "" + echo "Select an option:" + echo "1) Start development client" + echo "2) View live logs" + echo "3) Test screenshot capture" + echo "4) Test MQTT connection" + echo "5) Test presentation tools" + echo "6) Git status and sync" + echo "7) Restart systemd service" + echo "8) Monitor system resources" + echo "9) Open tmux session" + echo "0) Exit" + echo "" +} + +# Function implementations +start_client() { + echo "🚀 Starting development client..." + source venv/bin/activate + export $(cat .env | xargs) + python3 src/simclient.py +} + +view_logs() { + echo "📋 Viewing live logs (Ctrl+C to exit)..." + tail -f logs/simclient.log 2>/dev/null || echo "No logs yet, start the client first" +} + +test_screenshot() { + echo "📸 Testing screenshot capture..." + ./scripts/test-screenshot.sh +} + +test_mqtt() { + echo "📡 Testing MQTT connection..." + ./scripts/test-mqtt.sh +} + +test_presentation() { + echo "🖥️ Testing presentation tools..." + ./scripts/test-presentation.sh +} + +git_sync() { + echo "📦 Git status and sync..." + cd src + git status + echo "" + echo "Pull latest changes? (y/n)" + read -r answer + if [ "$answer" = "y" ]; then + git pull origin main + echo "✅ Repository updated" + fi + cd .. +} + +restart_service() { + echo "🔄 Restarting systemd service..." + sudo systemctl restart infoscreen-dev + sudo systemctl status infoscreen-dev +} + +monitor_system() { + echo "📊 System resources (press 'q' to exit)..." + htop +} + +open_tmux() { + echo "🖥️ Opening tmux session..." + tmux new-session -d -s infoscreen 2>/dev/null || tmux attach -t infoscreen +} + +# Main loop +while true; do + show_menu + read -r choice + + case $choice in + 1) start_client ;; + 2) view_logs ;; + 3) test_screenshot ;; + 4) test_mqtt ;; + 5) test_presentation ;; + 6) git_sync ;; + 7) restart_service ;; + 8) monitor_system ;; + 9) open_tmux ;; + 0) echo "👋 Goodbye!"; exit 0 ;; + *) echo "❌ Invalid option" ;; + esac + + echo "" + echo "Press Enter to continue..." + read -r +done \ No newline at end of file diff --git a/src/display_manager.py b/src/display_manager.py new file mode 100644 index 0000000..2fcd355 --- /dev/null +++ b/src/display_manager.py @@ -0,0 +1,1147 @@ +#!/usr/bin/env python3 +""" +Display Manager - Monitors events and controls display software + +This daemon process: +1. Watches current_event.json for changes +2. Manages lifecycle of display applications (LibreOffice, Chromium, VLC) +3. Respects event timing (start/end times) +4. Handles graceful application transitions +""" + +import os +import sys +import json +import time +import logging +import signal +import subprocess +import shutil +from datetime import datetime, timezone +from pathlib import Path +from logging.handlers import RotatingFileHandler +from typing import Optional, Dict, List, IO +from urllib.parse import urlparse +import requests +import json as _json +import threading +import time as _time +from dotenv import load_dotenv + +# Load environment +env_paths = [ + os.path.join(os.path.dirname(__file__), ".env"), + os.path.join(os.path.expanduser("~"), "infoscreen-dev", ".env"), +] +for env_path in env_paths: + if os.path.exists(env_path): + load_dotenv(env_path) + break + +# Configuration +ENV = os.getenv("ENV", "development") +LOG_LEVEL = os.getenv("LOG_LEVEL", "DEBUG" if ENV == "development" else "INFO") +CHECK_INTERVAL = int(os.getenv("DISPLAY_CHECK_INTERVAL", "5")) # seconds +PRESENTATION_DIR = os.path.join(os.path.dirname(__file__), "presentation") +EVENT_FILE = os.path.join(os.path.dirname(__file__), "current_event.json") + +# Setup logging +LOG_PATH = os.path.join(os.path.dirname(__file__), "..", "logs", "display_manager.log") +os.makedirs(os.path.dirname(LOG_PATH), exist_ok=True) + +logging.basicConfig( + level=getattr(logging, LOG_LEVEL.upper(), logging.INFO), + format="%(asctime)s [%(levelname)s] %(message)s", + handlers=[ + RotatingFileHandler(LOG_PATH, maxBytes=2*1024*1024, backupCount=5), + logging.StreamHandler() + ] +) + + +class DisplayProcess: + """Manages a running display application process""" + + def __init__(self, process: Optional[subprocess.Popen] = None, event_type: str = "", event_id: str = "", log_file: Optional[IO[bytes]] = None, log_path: Optional[str] = None, player: Optional[object] = None): + """process: subprocess.Popen when using external binary + player: python-vlc MediaPlayer or MediaListPlayer when using libvlc + """ + self.process = process + self.player = player + self.event_type = event_type + self.event_id = event_id + self.start_time = datetime.now() + self.log_file = log_file + self.log_path = log_path + + def is_running(self) -> bool: + """Check if the underlying display is still running. + + Works for subprocess.Popen-based processes and for python-vlc player objects. + """ + try: + if self.process: + return self.process.poll() is None + if self.player: + # python-vlc MediaPlayer: is_playing() returns 1 while playing + if hasattr(self.player, 'is_playing'): + try: + return bool(self.player.is_playing()) + except Exception: + return False + # MediaListPlayer may not have is_playing - try to inspect media player state + try: + state = None + if hasattr(self.player, 'get_state'): + state = self.player.get_state() + elif hasattr(self.player, 'get_media_player'): + mp = self.player.get_media_player() + if mp and hasattr(mp, 'get_state'): + state = mp.get_state() + # Consider ended/stopped states as not running + import vlc as _vlc + if state is None: + return False + return state not in (_vlc.State.Ended, _vlc.State.Stopped, _vlc.State.Error) + except Exception: + return False + + return False + except Exception: + return False + + def terminate(self, force: bool = False): + """Terminate the display process or player gracefully or forcefully""" + # Always attempt to cleanup both subprocess and python-vlc player resources. + # Do not return early if is_running() is False; there may still be resources to release. + + try: + # If it's an external subprocess, handle as before + if self.process: + pid_info = f" (PID: {getattr(self.process, 'pid', 'unknown')})" + if force: + logging.warning(f"Force killing {self.event_type} process{pid_info}") + try: + self.process.kill() + except Exception: + pass + else: + logging.info(f"Terminating {self.event_type} process gracefully{pid_info}") + try: + self.process.terminate() + except Exception: + pass + + # Wait for process to exit (with timeout) + try: + self.process.wait(timeout=5) + logging.info(f"{self.event_type} process terminated successfully") + except subprocess.TimeoutExpired: + if not force: + logging.warning(f"{self.event_type} didn't terminate gracefully, forcing kill") + try: + self.process.kill() + self.process.wait(timeout=2) + except Exception: + pass + + # If it's a python-vlc player, stop it + # Attempt to stop and release python-vlc players if present + if self.player: + try: + logging.info(f"Stopping vlc player for {self.event_type}") + # Call stop() if available + stop_fn = getattr(self.player, 'stop', None) + if callable(stop_fn): + try: + stop_fn() + except Exception: + pass + + # Try to stop/release underlying media player (MediaListPlayer -> get_media_player) + try: + mp = None + if hasattr(self.player, 'get_media_player'): + mp = self.player.get_media_player() + elif hasattr(self.player, 'get_media'): + # Some wrappers may expose media directly + mp = self.player + + if mp: + try: + if hasattr(mp, 'stop'): + mp.stop() + except Exception: + pass + # Release media player if supported + rel = getattr(mp, 'release', None) + if callable(rel): + try: + rel() + except Exception: + pass + except Exception: + pass + + # Finally, try to release the top-level player object + try: + rel_top = getattr(self.player, 'release', None) + if callable(rel_top): + rel_top() + except Exception: + pass + + # Remove reference to player so GC can collect underlying libvlc resources + self.player = None + except Exception as e: + logging.error(f"Error stopping vlc player: {e}") + + except Exception as e: + logging.error(f"Error terminating process/player: {e}") + finally: + # Close log file handle if open + if self.log_file and not self.log_file.closed: + try: + self.log_file.close() + except Exception: + pass + + +class DisplayManager: + """Main display manager that orchestrates event display""" + + def __init__(self): + self.current_process: Optional[DisplayProcess] = None + self.current_event_data: Optional[Dict] = None + self.last_file_mtime: Optional[float] = None + self.running = True + + # Setup signal handlers for graceful shutdown + signal.signal(signal.SIGTERM, self._signal_handler) + signal.signal(signal.SIGINT, self._signal_handler) + + def _signal_handler(self, signum, frame): + """Handle shutdown signals""" + logging.info(f"Received signal {signum}, shutting down gracefully...") + self.running = False + self.stop_current_display() + sys.exit(0) + + def read_event_file(self) -> Optional[Dict]: + """Read and parse current_event.json""" + try: + if not os.path.exists(EVENT_FILE): + return None + + # Check if file has changed + current_mtime = os.path.getmtime(EVENT_FILE) + if self.last_file_mtime and current_mtime == self.last_file_mtime: + return self.current_event_data # No change + + self.last_file_mtime = current_mtime + + with open(EVENT_FILE, 'r', encoding='utf-8') as f: + data = json.load(f) + + logging.info(f"Event file updated, read: {json.dumps(data, indent=2)}") + return data + + except json.JSONDecodeError as e: + logging.error(f"Invalid JSON in event file: {e}") + return None + except Exception as e: + logging.error(f"Error reading event file: {e}") + return None + + def is_event_active(self, event: Dict) -> bool: + """Check if event should be displayed based on start/end times + + Note: Event times are expected to be in UTC (as sent from server). + We compare them with current UTC time. + """ + # Get current time in UTC + now_utc = datetime.now(timezone.utc) + + try: + # Parse start time if present (assume UTC) + if 'start' in event: + start_str = event['start'].replace(' ', 'T') + # Parse as naive datetime and make it UTC-aware + start_time = datetime.fromisoformat(start_str) + if start_time.tzinfo is None: + start_time = start_time.replace(tzinfo=timezone.utc) + + if now_utc < start_time: + # Calculate time until start + time_until = (start_time - now_utc).total_seconds() + logging.debug(f"Event not started yet. Start: {start_time} UTC, " + f"Now: {now_utc.strftime('%Y-%m-%d %H:%M:%S')} UTC, " + f"Time until start: {int(time_until)}s") + return False + + # Parse end time if present (assume UTC) + if 'end' in event: + end_str = event['end'].replace(' ', 'T') + # Parse as naive datetime and make it UTC-aware + end_time = datetime.fromisoformat(end_str) + if end_time.tzinfo is None: + end_time = end_time.replace(tzinfo=timezone.utc) + + if now_utc > end_time: + # Calculate time since end + time_since = (now_utc - end_time).total_seconds() + logging.debug(f"Event has ended. End: {end_time} UTC, " + f"Now: {now_utc.strftime('%Y-%m-%d %H:%M:%S')} UTC, " + f"Time since end: {int(time_since)}s") + return False + + # Event is active + logging.debug(f"Event is active. Current time: {now_utc.strftime('%Y-%m-%d %H:%M:%S')} UTC") + return True + + except Exception as e: + logging.error(f"Error parsing event times: {e}") + # If we can't parse times, assume event is active + return True + + def get_event_identifier(self, event: Dict) -> str: + """Generate unique identifier for an event""" + # Use event ID if available + if 'id' in event: + return f"event_{event['id']}" + + # Prefer explicit event_type when present + etype = event.get('event_type') + if etype: + if etype == 'presentation' and 'presentation' in event: + files = event['presentation'].get('files', []) + if files: + return f"presentation_{files[0].get('name', 'unknown')}" + return f"presentation_unknown" + if etype in ('webpage', 'webuntis', 'website'): + # webuntis/webpage may include website or web key + url = None + if 'website' in event and isinstance(event['website'], dict): + url = event['website'].get('url') + if 'web' in event and isinstance(event['web'], dict): + url = url or event['web'].get('url') + return f"{etype}_{url or 'unknown'}" + + # Fallback to previous content-based identifiers + if 'presentation' in event: + files = event['presentation'].get('files', []) + if files: + return f"presentation_{files[0].get('name', 'unknown')}" + elif 'web' in event: + return f"web_{event['web'].get('url', 'unknown')}" + elif 'video' in event: + return f"video_{event['video'].get('url', 'unknown')}" + + return f"unknown_{abs(hash(json.dumps(event))) }" + + def stop_current_display(self): + """Stop the currently running display process""" + if self.current_process: + logging.info(f"Stopping current display: {self.current_process.event_type}") + self.current_process.terminate() + + # If process didn't terminate, force kill + time.sleep(1) + if self.current_process.is_running(): + self.current_process.terminate(force=True) + + self.current_process = None + self.current_event_data = None + + def start_presentation(self, event: Dict) -> Optional[DisplayProcess]: + """Start presentation display (PDF/PowerPoint/LibreOffice) using Impressive + + This method supports: + 1. Native PDF files - used directly as slideshows + 2. PPTX/PPT/ODP files - converted to PDF using LibreOffice headless + 3. Auto-advance and loop support via Impressive PDF presenter + 4. Falls back to evince/okular if Impressive not available + + All presentation types support the same slideshow features: + - auto_advance: Enable automatic slide progression + - slide_interval: Seconds between slides (when auto_advance=true) + - loop: Restart presentation after last slide vs. exit + """ + try: + presentation = event.get('presentation', {}) + files = presentation.get('files', []) + + if not files: + logging.error("No presentation files specified") + return None + + # Get first file + file_info = files[0] + filename = file_info.get('name') or file_info.get('filename') + + if not filename: + logging.error("No filename in presentation event") + return None + + file_path = os.path.join(PRESENTATION_DIR, filename) + + if not os.path.exists(file_path): + logging.error(f"Presentation file not found: {file_path}") + return None + + logging.info(f"Starting presentation: {filename}") + + # Determine file type and get absolute path + file_ext = os.path.splitext(filename)[1].lower() + abs_file_path = os.path.abspath(file_path) + + # Get presentation settings + auto_advance = presentation.get('auto_advance', False) + slide_interval = presentation.get('slide_interval', 10) + loop_enabled = presentation.get('loop', False) + + # Get scheduler-specific progress display settings + # Prefer values under presentation, fallback to top-level for backward compatibility + page_progress = presentation.get('page_progress', event.get('page_progress', False)) + auto_progress = presentation.get('auto_progress', event.get('auto_progress', False)) + logging.debug(f"Resolved progress flags: page_progress={page_progress}, auto_progress={auto_progress}") + if auto_progress and not auto_advance: + logging.warning("auto_progress is true but auto_advance is false; Impressive's auto-progress is most useful with --auto") + + # For timed events (with end time), default to loop mode to keep showing + # until the event expires, unless explicitly set to not loop + if not loop_enabled and 'end' in event: + logging.info("Event has end time - enabling loop mode to keep presentation active") + loop_enabled = True + + # Handle different presentation file types + if file_ext == '.pdf': + # PDF files are used directly (no conversion needed) + logging.info(f"Using PDF file directly: {filename}") + + elif file_ext in ['.pptx', '.ppt', '.odp']: + # Convert PPTX/PPT/ODP to PDF for Impressive + logging.info(f"Converting {file_ext} to PDF for Impressive...") + pdf_path = abs_file_path.rsplit('.', 1)[0] + '.pdf' + + # Check if PDF already exists and is newer than source + pdf_exists = os.path.exists(pdf_path) + if pdf_exists: + pdf_mtime = os.path.getmtime(pdf_path) + source_mtime = os.path.getmtime(abs_file_path) + if pdf_mtime >= source_mtime: + logging.info(f"Using existing PDF: {os.path.basename(pdf_path)}") + abs_file_path = pdf_path + file_ext = '.pdf' + else: + logging.info("Source file newer than PDF, reconverting...") + pdf_exists = False + + # Convert if needed + if not pdf_exists: + try: + convert_cmd = [ + 'libreoffice', + '--headless', + '--convert-to', 'pdf', + '--outdir', PRESENTATION_DIR, + abs_file_path + ] + logging.debug(f"Conversion command: {' '.join(convert_cmd)}") + result = subprocess.run( + convert_cmd, + stdout=subprocess.PIPE, + stderr=subprocess.PIPE, + timeout=60, + check=True + ) + + if os.path.exists(pdf_path): + logging.info(f"Converted to PDF: {os.path.basename(pdf_path)}") + abs_file_path = pdf_path + file_ext = '.pdf' + else: + logging.error("PDF conversion failed - file not created") + return None + + except subprocess.TimeoutExpired: + logging.error("PDF conversion timed out after 60s") + return None + except subprocess.CalledProcessError as e: + logging.error(f"PDF conversion failed: {e.stderr.decode()}") + return None + except Exception as e: + logging.error(f"PDF conversion error: {e}") + return None + else: + # Unsupported file format + logging.error(f"Unsupported presentation format: {file_ext}") + logging.info("Supported formats: PDF (native), PPTX, PPT, ODP (converted to PDF)") + return None + + # At this point we have a PDF file (either native or converted) + if file_ext != '.pdf': + logging.error(f"Internal error: Expected PDF but got {file_ext}") + return None + + # Use impressive with venv environment (where pygame is installed) + if self._command_exists('impressive'): + impressive_bin = shutil.which('impressive') or 'impressive' + cmd = [impressive_bin, '--fullscreen', '--nooverview'] + + # Add auto-advance if requested + if auto_advance: + cmd.extend(['--auto', str(slide_interval)]) + logging.info(f"Auto-advance enabled (interval: {slide_interval}s)") + + # Add loop or autoquit based on setting + if loop_enabled: + cmd.append('--wrap') + logging.info("Loop mode enabled (presentation will restart after last slide)") + else: + cmd.append('--autoquit') + logging.info("Auto-quit enabled (will exit after last slide)") + + # Add progress bar options from scheduler + if page_progress: + cmd.append('--page-progress') + logging.info("Page progress bar enabled (shows overall position in presentation)") + + if auto_progress: + cmd.append('--auto-progress') + logging.info("Auto-progress bar enabled (shows per-page countdown during auto-advance)") + + cmd.append(abs_file_path) + logging.info(f"Using Impressive PDF presenter with auto-advance support") + + # Fallback to evince or okular without auto-advance + elif self._command_exists('evince'): + cmd = ['evince', '--presentation', abs_file_path] + logging.warning("Impressive not available, using evince (no auto-advance support)") + if auto_advance: + logging.warning(f"Auto-advance requested ({slide_interval}s) but evince doesn't support it") + if loop_enabled: + logging.warning("Loop mode requested but evince doesn't support it") + + elif self._command_exists('okular'): + cmd = ['okular', '--presentation', abs_file_path] + logging.warning("Impressive not available, using okular (no auto-advance support)") + if auto_advance: + logging.warning(f"Auto-advance requested ({slide_interval}s) but okular doesn't support it") + if loop_enabled: + logging.warning("Loop mode requested but okular doesn't support it") + + else: + logging.error("No PDF viewer found (impressive, evince, or okular)") + logging.info("Install Impressive: sudo apt install impressive") + return None + + logging.debug(f"Full command: {' '.join(cmd)}") + + # Start the process, redirect output to log file to avoid PIPE buffer issues + impressive_log_path = os.path.join(os.path.dirname(LOG_PATH), 'impressive.out.log') + os.makedirs(os.path.dirname(impressive_log_path), exist_ok=True) + impressive_log = open(impressive_log_path, 'ab', buffering=0) + # Set up environment to use venv where pygame is installed + env_vars = dict(os.environ) + + # Ensure venv is activated for impressive (which needs pygame) + venv_path = os.path.join(os.path.dirname(__file__), '..', 'venv') + if os.path.exists(venv_path): + venv_bin = os.path.join(venv_path, 'bin') + # Prepend venv bin to PATH so impressive uses venv's python + current_path = env_vars.get('PATH', '') + env_vars['PATH'] = f"{venv_bin}:{current_path}" + env_vars['VIRTUAL_ENV'] = os.path.abspath(venv_path) + logging.debug(f"Using venv for impressive: {venv_path}") + + # Set display + env_vars['DISPLAY'] = os.environ.get('DISPLAY', ':0') + process = subprocess.Popen( + cmd, + stdout=impressive_log, + stderr=subprocess.STDOUT, + env=env_vars, + preexec_fn=os.setsid # Create new process group for better cleanup + ) + + event_id = self.get_event_identifier(event) + logging.info(f"Presentation started with PID: {process.pid}") + + return DisplayProcess(process, 'presentation', event_id, log_file=impressive_log, log_path=impressive_log_path) + + except Exception as e: + logging.error(f"Error starting presentation: {e}") + return None + + def start_video(self, event: Dict) -> Optional[DisplayProcess]: + """Start video playback""" + try: + video = event.get('video', {}) + video_url = video.get('url') + + if not video_url: + logging.error("No video URL specified") + return None + + # Normalize file-server host alias (e.g., http://server:8000/...) -> configured FILE_SERVER + video_url = self._resolve_file_url(video_url) + logging.info(f"Starting video: {video_url}") + # Prefer using python-vlc (libvlc) for finer control + try: + import vlc + except Exception: + vlc = None + + if not vlc: + # Fallback to launching external vlc binary + if self._command_exists('vlc'): + cmd = [ + 'vlc', + '--fullscreen', + '--no-video-title-show', + '--loop' if video.get('loop', False) else '--play-and-exit', + video_url + ] + video_log_path = os.path.join(os.path.dirname(LOG_PATH), 'video_player.out.log') + os.makedirs(os.path.dirname(video_log_path), exist_ok=True) + video_log = open(video_log_path, 'ab', buffering=0) + env_vars = {} + for k in ['PATH', 'HOME', 'USER', 'LOGNAME', 'SHELL', 'TERM', 'LANG', 'LC_ALL']: + if k in os.environ: + env_vars[k] = os.environ[k] + env_vars['DISPLAY'] = os.environ.get('DISPLAY', ':0') + process = subprocess.Popen( + cmd, + stdout=video_log, + stderr=subprocess.STDOUT, + env=env_vars, + preexec_fn=os.setsid + ) + event_id = self.get_event_identifier(event) + logging.info(f"Video started with PID: {process.pid} (external vlc)") + return DisplayProcess(process=process, event_type='video', event_id=event_id, log_file=video_log, log_path=video_log_path) + else: + logging.error("No video player found (python-vlc or vlc binary)") + return None + + # Use libvlc via python-vlc + try: + instance = vlc.Instance() + + autoplay = bool(video.get('autoplay', True)) + loop_flag = bool(video.get('loop', False)) + + # Handle volume: expected 0.0-1.0 float in event -> convert to 0-100 + vol = video.get('volume') + if vol is None: + vol_pct = 100 + else: + try: + vol_pct = int(float(vol) * 100) + vol_pct = max(0, min(100, vol_pct)) + except Exception: + vol_pct = 100 + + if loop_flag: + # Use MediaListPlayer for looped playback + mlp = vlc.MediaListPlayer() + mp = instance.media_player_new() + mlp.set_media_player(mp) + # Create media list with the single URL + try: + ml = instance.media_list_new([video_url]) + except Exception: + # Fallback: create empty and add media + ml = instance.media_list_new() + m = instance.media_new(video_url) + ml.add_media(m) + + mlp.set_media_list(ml) + try: + # Set loop playback mode if available + mlp.set_playback_mode(vlc.PlaybackMode.loop) + except Exception: + pass + + # Set volume on underlying media player + try: + mp.audio_set_volume(vol_pct) + except Exception: + logging.debug("Could not set volume on media player") + + if autoplay: + try: + mlp.play() + except Exception as e: + logging.error(f"Failed to play media list: {e}") + event_id = self.get_event_identifier(event) + logging.info("Video started via python-vlc (MediaListPlayer)" ) + return DisplayProcess(process=None, event_type='video', event_id=event_id, log_file=None, log_path=None, player=mlp) + + else: + # Single-play MediaPlayer + mp = instance.media_player_new() + media = instance.media_new(video_url) + mp.set_media(media) + try: + mp.audio_set_volume(vol_pct) + except Exception: + logging.debug("Could not set volume on media player") + + if autoplay: + try: + mp.play() + except Exception as e: + logging.error(f"Failed to start media player: {e}") + + event_id = self.get_event_identifier(event) + logging.info("Video started via python-vlc (MediaPlayer)") + return DisplayProcess(process=None, event_type='video', event_id=event_id, log_file=None, log_path=None, player=mp) + + except Exception as e: + logging.error(f"Error starting video with python-vlc: {e}") + return None + + except Exception as e: + logging.error(f"Error starting video: {e}") + return None + + def _resolve_file_url(self, url: str) -> str: + """Resolve URLs that use the special host 'server' to the configured file server. + + Priority: + - If FILE_SERVER_BASE_URL is set, use that as the base and append path/query + - Otherwise use FILE_SERVER_HOST (or default to MQTT_BROKER) + FILE_SERVER_PORT + FILE_SERVER_SCHEME + + Examples: + http://server:8000/api/... -> http://<FILE_SERVER_HOST>:<PORT>/api/... + """ + try: + if not url: + return url + + # Parse the incoming URL + parsed = urlparse(url) + hostname = (parsed.hostname or '').lower() + + # Only rewrite when hostname is exactly 'server' + if hostname != 'server': + return url + + # Helper to read env var and strip inline comments/whitespace + def _clean_env(name: str) -> Optional[str]: + v = os.getenv(name) + if v is None: + return None + # Remove inline comment starting with '#' + if '#' in v: + v = v.split('#', 1)[0] + v = v.strip() + return v or None + + # FILE_SERVER_BASE_URL takes precedence + base = _clean_env('FILE_SERVER_BASE_URL') + if base: + # Ensure no trailing slash on base and preserve path + base = base.rstrip('/') + path = parsed.path or '' + if not path.startswith('/'): + path = '/' + path + new_url = base + path + if parsed.query: + new_url = new_url + '?' + parsed.query + logging.info(f"Rewriting 'server' URL using FILE_SERVER_BASE_URL: {new_url}") + return new_url + + # Otherwise build from components + file_host = _clean_env('FILE_SERVER_HOST') or _clean_env('MQTT_BROKER') + file_port = _clean_env('FILE_SERVER_PORT') + file_scheme = _clean_env('FILE_SERVER_SCHEME') or 'http' + + if not file_host: + logging.warning("FILE_SERVER_HOST and MQTT_BROKER are not set; leaving URL unchanged") + return url + + netloc = file_host + if file_port: + netloc = f"{file_host}:{file_port}" + + # Rebuild URL + new_url = f"{file_scheme}://{netloc}{parsed.path or ''}" + if parsed.query: + new_url = new_url + '?' + parsed.query + logging.info(f"Rewriting 'server' URL to: {new_url}") + return new_url + + except Exception as e: + logging.debug(f"Error resolving file url '{url}': {e}") + return url + + def start_webpage(self, event: Dict, autoscroll_enabled: bool = False) -> Optional[DisplayProcess]: + """Start webpage display in kiosk mode""" + try: + # Support both legacy 'web' key and scheduler-provided 'website' object + web = event.get('web', {}) if isinstance(event.get('web', {}), dict) else {} + website = event.get('website', {}) if isinstance(event.get('website', {}), dict) else {} + + # website.url takes precedence + url = website.get('url') or web.get('url') + + # Resolve any 'server' host placeholders to configured file server + url = self._resolve_file_url(url) + + # Normalize URL: if scheme missing, assume http + if url: + parsed = urlparse(url) + if not parsed.scheme: + logging.info(f"Normalizing URL by adding http:// scheme: {url} -> http://{url}") + url = f"http://{url}" + + if not url: + logging.error("No web URL specified") + return None + + logging.info(f"Starting webpage: {url}") + + # Use Chromium in kiosk mode + if self._command_exists('chromium-browser'): + browser = 'chromium-browser' + elif self._command_exists('chromium'): + browser = 'chromium' + elif self._command_exists('google-chrome'): + browser = 'google-chrome' + else: + logging.error("No browser found (chromium or chrome)") + return None + + cmd = [browser, '--remote-debugging-port=9222'] + + # If autoscroll is requested, load the small local extension that injects autoscroll + if autoscroll_enabled: + autoscroll_ext = os.path.join(os.path.dirname(__file__), 'chrome_autoscroll') + cmd.append(f"--load-extension={autoscroll_ext}") + + # Common kiosk flags + cmd.extend([ + '--kiosk', + '--no-first-run', + '--disable-infobars', + '--disable-session-crashed-bubble', + '--disable-restore-session-state', + url + ]) + + browser_log_path = os.path.join(os.path.dirname(LOG_PATH), 'browser.out.log') + os.makedirs(os.path.dirname(browser_log_path), exist_ok=True) + browser_log = open(browser_log_path, 'ab', buffering=0) + env_vars = {} + # Only keep essential environment variables + for k in ['PATH', 'HOME', 'USER', 'LOGNAME', 'SHELL', 'TERM', 'LANG', 'LC_ALL']: + if k in os.environ: + env_vars[k] = os.environ[k] + + # Set display settings + env_vars['DISPLAY'] = os.environ.get('DISPLAY', ':0') + process = subprocess.Popen( + cmd, + stdout=browser_log, + stderr=subprocess.STDOUT, + env=env_vars, + preexec_fn=os.setsid + ) + + event_id = self.get_event_identifier(event) + logging.info(f"Webpage started with PID: {process.pid}") + + # Inject auto-scroll JS via Chrome DevTools Protocol (CDP) if enabled and available + if autoscroll_enabled: + try: + # Run injection in background thread so it doesn't block the main loop + t = threading.Thread(target=self._inject_autoscroll_cdp, args=(process.pid, url, 60), daemon=True) + t.start() + except Exception as e: + logging.debug(f"Autoscroll injection thread failed to start: {e}") + + return DisplayProcess(process, 'webpage', event_id, log_file=browser_log, log_path=browser_log_path) + + except Exception as e: + logging.error(f"Error starting webpage: {e}") + return None + + def start_display_for_event(self, event: Dict) -> Optional[DisplayProcess]: + """Start appropriate display software for the given event""" + # First, respect explicit event_type if provided by scheduler + etype = event.get('event_type') + if etype: + etype = etype.lower() + if etype == 'presentation': + return self.start_presentation(event) + if etype in ('webuntis', 'webpage', 'website'): + # webuntis and webpage both show a browser kiosk + # Ensure the URL is taken from 'website.url' or 'web.url' + # Normalize event to include a 'web' key so start_webpage can use it + if 'website' in event and isinstance(event['website'], dict): + # copy into 'web' for compatibility + event.setdefault('web', {}) + if 'url' not in event['web']: + event['web']['url'] = event['website'].get('url') + # Only enable autoscroll for explicit scheduler event_type 'website' + autoscroll_flag = (etype == 'website') + return self.start_webpage(event, autoscroll_enabled=autoscroll_flag) + + # Fallback to legacy keys + if 'presentation' in event: + return self.start_presentation(event) + elif 'video' in event: + return self.start_video(event) + elif 'web' in event: + return self.start_webpage(event) + else: + logging.error(f"Unknown event type/structure: {list(event.keys())}") + return None + + def _command_exists(self, command: str) -> bool: + """Check if a command exists in PATH""" + try: + subprocess.run( + ['which', command], + stdout=subprocess.PIPE, + stderr=subprocess.PIPE, + check=True + ) + return True + except subprocess.CalledProcessError: + return False + + def _inject_autoscroll_cdp(self, browser_pid: int, url: str, duration_seconds: int = 10): + """Connect to Chrome DevTools Protocol and inject an auto-scroll JS for duration_seconds. + + This function assumes Chromium was started with --remote-debugging-port=9222. + It is non-blocking when called from a background thread. + """ + try: + # Lazy import websocket to keep runtime optional + try: + import websocket + except Exception: + logging.info("websocket-client not installed; skipping autoscroll injection") + return + + # Discover DevTools targets (retry a few times; Chromium may not have opened the port yet) + targets = None + for attempt in range(5): + try: + resp = requests.get('http://127.0.0.1:9222/json', timeout=2) + targets = resp.json() + if targets: + break + except Exception as e: + logging.debug(f"Attempt {attempt+1}: could not fetch DevTools targets: {e}") + _time.sleep(0.5) + + if not targets: + logging.debug('No DevTools targets discovered; skipping autoscroll') + return + + # Try to find the matching target by URL (prefer exact match), then by substring, then fallback to first + target_ws = None + for t in targets: + turl = t.get('url', '') + if url and (turl == url or turl.startswith(url) or url in turl): + target_ws = t.get('webSocketDebuggerUrl') + logging.debug(f"Matched DevTools target by url: {turl}") + break + + if not target_ws and targets: + target_ws = targets[0].get('webSocketDebuggerUrl') + logging.debug(f"Falling back to first DevTools target: {targets[0].get('url')}") + + if not target_ws: + logging.debug('No DevTools websocket URL found; skipping autoscroll') + return + + # Build the auto-scroll JS: scroll down over duration_seconds then jump back to top and repeat + dur_ms = int(duration_seconds * 1000) + js_template = ( + "(function(){{" + "var duration = {duration_ms};" + "var stepMs = 50;" + "try{{" + " if(window.__autoScrollInterval){{ clearInterval(window.__autoScrollInterval); delete window.__autoScrollInterval; }}" + " var totalScroll = Math.max(document.documentElement.scrollHeight, document.body.scrollHeight) - window.innerHeight;" + " if(totalScroll <= 0){{ return; }}" + " var steps = Math.max(1, Math.round(duration/stepMs));" + " var stepPx = totalScroll/steps;" + " var step = 0;" + " window.__autoScrollInterval = setInterval(function(){{ window.scrollBy(0, stepPx); step++; if(step>=steps){{ window.scrollTo(0,0); step=0; }} }}, stepMs);" + " console.info('Auto-scroll started');" + "}}catch(e){{ console.error('Auto-scroll error', e); }}" + "}})();" + ) + js = js_template.format(duration_ms=dur_ms) + + # Connect via websocket and send Runtime.enable + Runtime.evaluate + # Some Chromium builds require a sensible Origin header during the websocket handshake + # to avoid a 403 Forbidden response. Use localhost origin which is safe for local control. + try: + ws = websocket.create_connection(target_ws, timeout=5, header=["Origin: http://127.0.0.1"]) + except TypeError: + # Older websocket-client versions accept 'origin' keyword instead + ws = websocket.create_connection(target_ws, timeout=5, origin="http://127.0.0.1") + msg_id = 1 + + def send_recv(method, params=None): + nonlocal msg_id + payload = {"id": msg_id, "method": method} + if params: + payload["params"] = params + ws.send(_json.dumps(payload)) + msg_id += 1 + try: + return ws.recv() + except Exception as ex: + logging.debug(f"No response from DevTools for {method}: {ex}") + return None + + # Enable runtime (some pages may require it) + send_recv('Runtime.enable') + # Evaluate the autoscroll script + resp = send_recv('Runtime.evaluate', {"expression": js, "awaitPromise": False}) + logging.debug(f"DevTools evaluate response: {resp}") + try: + ws.close() + except Exception: + pass + logging.info(f"Attempted autoscroll injection for {duration_seconds}s into page {url}") + + except Exception as e: + logging.debug(f"Error injecting autoscroll via CDP: {e}") + + def process_events(self): + """Main processing loop - check for event changes and manage display""" + + event_data = self.read_event_file() + + # No event file or empty event - stop current display + if not event_data: + if self.current_process: + logging.info("No active event - stopping current display") + self.stop_current_display() + return + + # Handle event arrays (take first event) + events_to_process = event_data if isinstance(event_data, list) else [event_data] + + if not events_to_process: + if self.current_process: + logging.info("Empty event list - stopping current display") + self.stop_current_display() + return + + # Process first active event + active_event = None + for event in events_to_process: + if self.is_event_active(event): + active_event = event + break + + if not active_event: + if self.current_process: + logging.info("No active events in time window - stopping current display") + self.stop_current_display() + return + + # Get event identifier + event_id = self.get_event_identifier(active_event) + + # Check if this is a new/different event + if self.current_process: + if self.current_process.event_id == event_id: + # Same event - check if process is still running + if not self.current_process.is_running(): + exit_code = None + if getattr(self.current_process, 'process', None): + try: + exit_code = self.current_process.process.returncode + except Exception: + exit_code = None + logging.warning(f"Display process exited (exit code: {exit_code})") + # Try to surface last lines of the related log file, if any + if getattr(self.current_process, 'log_path', None): + try: + with open(self.current_process.log_path, 'rb') as lf: + lf.seek(0, os.SEEK_END) + size = lf.tell() + lf.seek(max(0, size - 4096), os.SEEK_SET) + tail = lf.read().decode('utf-8', errors='ignore') + logging.warning("Last output from process log:\n" + tail.splitlines()[-20:][0] if tail else "(no output)") + except Exception as e: + logging.debug(f"Could not read process log tail: {e}") + + # Consider exit code 0 as normal if presentation used autoquit explicitly (no loop) + if self.current_process.event_type == 'presentation' and exit_code == 0: + logging.info("Presentation process ended with exit code 0 (likely normal completion).") + self.current_process = None + return + + logging.info("Restarting display process...") + self.current_process = None + else: + # Everything is fine, continue + return + else: + # Different event - stop current and start new + logging.info(f"Event changed from {self.current_process.event_id} to {event_id}") + self.stop_current_display() + + # Start new display + logging.info(f"Starting display for event: {event_id}") + # Log event timing information for debugging + if 'start' in active_event: + logging.info(f" Event start time (UTC): {active_event['start']}") + if 'end' in active_event: + logging.info(f" Event end time (UTC): {active_event['end']}") + + new_process = self.start_display_for_event(active_event) + + if new_process: + self.current_process = new_process + self.current_event_data = active_event + logging.info(f"Display started successfully for {event_id}") + else: + logging.error(f"Failed to start display for {event_id}") + + def run(self): + """Main run loop""" + logging.info("Display Manager starting...") + logging.info(f"Monitoring event file: {EVENT_FILE}") + logging.info(f"Check interval: {CHECK_INTERVAL}s") + + # Log timezone information for debugging + now_utc = datetime.now(timezone.utc) + now_local = datetime.now() + logging.info(f"Current time (UTC): {now_utc.strftime('%Y-%m-%d %H:%M:%S %Z')}") + logging.info(f"Current time (Local): {now_local.strftime('%Y-%m-%d %H:%M:%S')}") + logging.info("Note: Event times are expected in UTC format") + + while self.running: + try: + self.process_events() + time.sleep(CHECK_INTERVAL) + + except Exception as e: + logging.error(f"Error in main loop: {e}", exc_info=True) + time.sleep(CHECK_INTERVAL) + + logging.info("Display Manager stopped") + + +def main(): + """Entry point""" + manager = DisplayManager() + manager.run() + + +if __name__ == "__main__": + main() diff --git a/src/docker-compose.production.yml b/src/docker-compose.production.yml new file mode 100644 index 0000000..d71df44 --- /dev/null +++ b/src/docker-compose.production.yml @@ -0,0 +1,65 @@ +version: '3.8' + +services: + infoclient: + build: + context: . + dockerfile: Dockerfile.production + # Or use pre-built image: + # image: your-registry/infoclient:${VERSION:-latest} + container_name: infoclient + restart: unless-stopped + environment: + # Production environment + - ENV=production + - DEBUG_MODE=0 + - LOG_LEVEL=INFO + + # MQTT Configuration + - MQTT_BROKER=${MQTT_BROKER} + - MQTT_PORT=${MQTT_PORT:-1883} + + # Production intervals + - HEARTBEAT_INTERVAL=${HEARTBEAT_INTERVAL:-60} + - SCREENSHOT_INTERVAL=${SCREENSHOT_INTERVAL:-300} + + # Client identification + - CLIENT_ID=${CLIENT_ID:-auto} + + volumes: + # Presentation files - shared with host for presentation display + - /opt/infoscreen/presentations:/app/presentation:rw + + # Screenshots - host captures, container reads and transmits + - /opt/infoscreen/screenshots:/app/screenshots:ro + + # Persistent configuration (UUID, group ID) + - /opt/infoscreen/config:/app/config:rw + + # Logs for monitoring and debugging + - /opt/infoscreen/logs:/app/logs:rw + + networks: + - infonet + + # Resource limits for Pi + deploy: + resources: + limits: + memory: 256M + cpus: '0.5' + reservations: + memory: 128M + cpus: '0.2' + + # Health check + healthcheck: + test: ["CMD", "python", "-c", "import socket; socket.create_connection(('${MQTT_BROKER}', ${MQTT_PORT:-1883}), timeout=5)"] + interval: 30s + timeout: 10s + retries: 3 + start_period: 40s + +networks: + infonet: + driver: bridge \ No newline at end of file diff --git a/src/pi-dev-setup.sh b/src/pi-dev-setup.sh new file mode 100755 index 0000000..03145d9 --- /dev/null +++ b/src/pi-dev-setup.sh @@ -0,0 +1,319 @@ +#!/bin/bash +# pi-dev-setup.sh - Complete development environment setup for Raspberry Pi + +set -e + +echo "🍓 Setting up Raspberry Pi development environment for infoscreen client..." + +# Colors for output +RED='\033[0;31m' +GREEN='\033[0;32m' +YELLOW='\033[1;33m' +BLUE='\033[0;34m' +NC='\033[0m' # No Color + +# Configuration +PROJECT_DIR="$HOME/infoscreen-dev" +VENV_DIR="$PROJECT_DIR/venv" + +print_step() { + echo -e "${BLUE}📋 $1${NC}" +} + +print_success() { + echo -e "${GREEN}✅ $1${NC}" +} + +print_warning() { + echo -e "${YELLOW}⚠️ $1${NC}" +} + +# Step 1: System Update +print_step "Updating system packages..." +sudo apt update && sudo apt upgrade -y +print_success "System updated" + +# Step 2: Install development tools +print_step "Installing development tools..." +sudo apt install -y \ + git \ + vim \ + nano \ + htop \ + curl \ + wget \ + tmux \ + screen \ + tree \ + unzip +print_success "Development tools installed" + +# Step 3: Install Python and development dependencies +print_step "Installing Python development environment..." +sudo apt install -y \ + python3 \ + python3-pip \ + python3-venv \ + python3-dev \ + build-essential +print_success "Python environment installed" + +# Step 4: Install presentation and display tools +print_step "Installing presentation tools..." +sudo apt install -y \ + chromium-browser \ + libreoffice \ + vlc \ + feh \ + scrot \ + imagemagick \ + xdotool \ + wmctrl +print_success "Presentation tools installed" + +# Step 5: Install MQTT tools for debugging +print_step "Installing MQTT tools..." +sudo apt install -y mosquitto-clients +print_success "MQTT tools installed" + +# Step 6: Create project directory +print_step "Setting up project directory..." +mkdir -p "$PROJECT_DIR"/{config,presentation,logs,screenshots,scripts} +cd "$PROJECT_DIR" +print_success "Project directory created: $PROJECT_DIR" + +# Step 7: Create Python virtual environment +print_step "Creating Python virtual environment..." +python3 -m venv "$VENV_DIR" +source "$VENV_DIR/bin/activate" +pip install --upgrade pip +print_success "Virtual environment created" + +# Step 8: Install Python packages +print_step "Installing Python packages..." +pip install \ + paho-mqtt \ + requests \ + python-dotenv \ + watchdog +print_success "Python packages installed" + +# Step 9: Install Docker (optional, for testing containers) +print_step "Installing Docker..." +if ! command -v docker &> /dev/null; then + curl -fsSL https://get.docker.com -o get-docker.sh + sudo sh get-docker.sh + sudo usermod -aG docker $USER + rm get-docker.sh + print_success "Docker installed (requires logout/login)" +else + print_success "Docker already installed" +fi + +# Step 10: Configure Git (if not already configured) +print_step "Configuring Git..." +if [ -z "$(git config --global user.name 2>/dev/null)" ]; then + echo "Enter your Git username:" + read -r git_username + git config --global user.name "$git_username" +fi + +if [ -z "$(git config --global user.email 2>/dev/null)" ]; then + echo "Enter your Git email:" + read -r git_email + git config --global user.email "$git_email" +fi +print_success "Git configured" + +# Step 11: Clone your repository +print_step "Cloning infoscreen client repository..." +if [ ! -d "$PROJECT_DIR/src" ]; then + git clone https://github.com/RobbStarkAustria/infoscreen_client_2025.git "$PROJECT_DIR/src" + print_success "Repository cloned to $PROJECT_DIR/src" + + # Copy environment template and create .env + if [ -f "$PROJECT_DIR/src/.env.template" ]; then + cp "$PROJECT_DIR/src/.env.template" "$PROJECT_DIR/.env" + print_success "Environment template copied to .env" + fi +else + print_warning "Source directory already exists" +fi + +# Step 12: Customize environment file +print_step "Customizing environment file..." +if [ -f "$PROJECT_DIR/.env" ]; then + # Update MQTT broker IP if needed + echo "Current MQTT broker in .env: $(grep MQTT_BROKER $PROJECT_DIR/.env | cut -d'=' -f2)" + echo "If you need to change the MQTT broker IP, edit: nano $PROJECT_DIR/.env" + print_success "Environment file ready for customization" +else + print_warning "Environment file not found, you may need to create it manually" +fi + +# Step 13: Create development scripts +print_step "Creating development helper scripts..." + +# Start development script +cat > "$PROJECT_DIR/scripts/start-dev.sh" << 'EOF' +#!/bin/bash +cd "$(dirname "$0")/.." +source venv/bin/activate +export $(cat .env | xargs) +python3 src/simclient.py +EOF +chmod +x "$PROJECT_DIR/scripts/start-dev.sh" + +# Screenshot test script +cat > "$PROJECT_DIR/scripts/test-screenshot.sh" << 'EOF' +#!/bin/bash +SCREENSHOT_DIR="$(dirname "$0")/../screenshots" +mkdir -p "$SCREENSHOT_DIR" + +# Ensure DISPLAY is set for screenshot capture +if [ -z "$DISPLAY" ]; then + export DISPLAY=:0 +fi + +# Test screenshot capture +echo "Testing screenshot capture with DISPLAY=$DISPLAY" +if scrot "$SCREENSHOT_DIR/test_$(date +%Y%m%d_%H%M%S).png" 2>/dev/null; then + echo "✅ Screenshot captured successfully" + echo "📁 Screenshot saved to: $SCREENSHOT_DIR" + ls -la "$SCREENSHOT_DIR"/test_*.png | tail -1 +else + echo "❌ Screenshot failed with scrot, trying imagemagick..." + if import -window root "$SCREENSHOT_DIR/test_$(date +%Y%m%d_%H%M%S).png" 2>/dev/null; then + echo "✅ Screenshot captured with imagemagick" + echo "📁 Screenshot saved to: $SCREENSHOT_DIR" + ls -la "$SCREENSHOT_DIR"/test_*.png | tail -1 + else + echo "❌ Screenshot capture failed. Check DISPLAY variable and X11 access." + echo "💡 Try: export DISPLAY=:0" + echo "💡 Or run from local Pi terminal instead of SSH" + fi +fi +EOF +chmod +x "$PROJECT_DIR/scripts/test-screenshot.sh" + +# MQTT test script +cat > "$PROJECT_DIR/scripts/test-mqtt.sh" << 'EOF' +#!/bin/bash +source "$(dirname "$0")/../.env" + +echo "Testing MQTT connection to $MQTT_BROKER:$MQTT_PORT" +echo "Publishing test message..." +mosquitto_pub -h "$MQTT_BROKER" -p "$MQTT_PORT" -t "infoscreen/test" -m "Hello from Pi development setup" + +echo "Subscribing to test topic (press Ctrl+C to stop)..." +mosquitto_sub -h "$MQTT_BROKER" -p "$MQTT_PORT" -t "infoscreen/test" +EOF +chmod +x "$PROJECT_DIR/scripts/test-mqtt.sh" + +# Presentation test script +cat > "$PROJECT_DIR/scripts/test-presentation.sh" << 'EOF' +#!/bin/bash +PRES_DIR="$(dirname "$0")/../presentation" +mkdir -p "$PRES_DIR" + +echo "Testing presentation capabilities..." + +# Test LibreOffice +if command -v libreoffice &> /dev/null; then + echo "✅ LibreOffice available" +else + echo "❌ LibreOffice not found" +fi + +# Test Chromium +if command -v chromium-browser &> /dev/null; then + echo "✅ Chromium available" + echo "Testing kiosk mode (will open for 5 seconds)..." + chromium-browser --kiosk --app=https://www.google.com & + CHROME_PID=$! + sleep 5 + kill $CHROME_PID 2>/dev/null || true +else + echo "❌ Chromium not found" +fi + +# Test VLC +if command -v vlc &> /dev/null; then + echo "✅ VLC available" +else + echo "❌ VLC not found" +fi + +echo "Presentation test complete" +EOF +chmod +x "$PROJECT_DIR/scripts/test-presentation.sh" + +print_success "Development scripts created" + +# Step 14: Create systemd service for development (optional) +print_step "Creating systemd service template..." +sudo tee /etc/systemd/system/infoscreen-dev.service << EOF +[Unit] +Description=Infoscreen Development Client +After=network.target + +[Service] +Type=simple +User=pi +WorkingDirectory=$PROJECT_DIR +Environment=PATH=$VENV_DIR/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin +ExecStart=$VENV_DIR/bin/python $PROJECT_DIR/src/simclient.py +Restart=on-failure +RestartSec=5 + +[Install] +WantedBy=multi-user.target +EOF + +print_success "Systemd service created (disabled by default)" + +# Step 15: Set up remote development access +print_step "Configuring SSH for remote development..." +# Enable SSH if not already enabled +sudo systemctl enable ssh +sudo systemctl start ssh + +# Create SSH key if it doesn't exist +if [ ! -f "$HOME/.ssh/id_rsa" ]; then + ssh-keygen -t rsa -b 4096 -f "$HOME/.ssh/id_rsa" -N "" + print_success "SSH key generated" +fi + +print_success "SSH configured for remote access" + +# Final summary +echo "" +echo -e "${GREEN}🎉 Development environment setup complete!${NC}" +echo "" +echo -e "${YELLOW}📂 Project structure:${NC}" +tree -L 2 "$PROJECT_DIR" 2>/dev/null || ls -la "$PROJECT_DIR" +echo "" +echo -e "${YELLOW}🚀 Quick start commands:${NC}" +echo " cd $PROJECT_DIR" +echo " source venv/bin/activate" +echo " ./scripts/start-dev.sh" +echo "" +echo -e "${YELLOW}🧪 Test commands:${NC}" +echo " ./scripts/test-screenshot.sh # Test screenshot capture" +echo " ./scripts/test-mqtt.sh # Test MQTT connection" +echo " ./scripts/test-presentation.sh # Test presentation tools" +echo "" +echo -e "${YELLOW}🔧 Development workflow:${NC}" +echo " 1. Edit code in: $PROJECT_DIR/src/" +echo " 2. Test with: ./scripts/start-dev.sh" +echo " 3. View logs in: $PROJECT_DIR/logs/" +echo "" +echo -e "${YELLOW}🌐 Remote development:${NC}" +echo " SSH: ssh pi@$(hostname -I | awk '{print $1}')" +echo " VS Code Remote-SSH recommended" +echo "" +if groups $USER | grep -q docker; then + echo -e "${GREEN}✅ Docker available for container testing${NC}" +else + echo -e "${YELLOW}⚠️ Logout and login again to use Docker${NC}" +fi \ No newline at end of file diff --git a/src/requirements.txt b/src/requirements.txt new file mode 100644 index 0000000..f441489 --- /dev/null +++ b/src/requirements.txt @@ -0,0 +1,6 @@ +paho-mqtt +dotenv +requests +pygame>=2.0.0 +pillow>=8.0.0 +websocket-client>=1.6.0 diff --git a/src/simclient.py b/src/simclient.py new file mode 100644 index 0000000..519a520 --- /dev/null +++ b/src/simclient.py @@ -0,0 +1,741 @@ +# simclient/simclient.py + +from logging.handlers import RotatingFileHandler +import time +import uuid +import json +import socket +import hashlib +import paho.mqtt.client as mqtt +import os +import shutil +import re +import platform +import logging +from dotenv import load_dotenv +import requests +import base64 +from datetime import datetime +import threading +from urllib.parse import urlsplit, urlunsplit, unquote + +# ENV laden - support both container and native development +env_paths = [ + "/workspace/simclient/.env", # Container path + os.path.join(os.path.dirname(__file__), ".env"), # Same directory + os.path.join(os.path.expanduser("~"), "infoscreen-dev", ".env"), # Development path +] + +for env_path in env_paths: + if os.path.exists(env_path): + load_dotenv(env_path) + break + +def _env_int(name, default): + """Parse an int from environment variable, tolerating inline comments. + Examples: + - "10 # seconds" -> 10 + - " 300ms" -> 300 + - invalid or empty -> default + """ + raw = os.getenv(name) + if raw is None or str(raw).strip() == "": + return default + try: + # Remove inline comments + sanitized = str(raw).split('#', 1)[0].strip() + # Extract first integer occurrence + m = re.search(r"-?\d+", sanitized) + if m: + return int(m.group(0)) + except Exception: + pass + return default + + +def _env_bool(name, default=False): + raw = os.getenv(name) + if raw is None: + return default + return str(raw).strip().lower() in ("1", "true", "yes", "on") + +def _env_host(name, default): + """Parse a hostname/IP from env, stripping inline comments and whitespace. + Example: "192.168.1.10 # comment" -> "192.168.1.10" + """ + raw = os.getenv(name) + if raw is None: + return default + # Remove inline comments and extra spaces + sanitized = str(raw).split('#', 1)[0].strip() + # If any whitespace remains, take the first token as host + if not sanitized: + return default + return sanitized.split()[0] + + +def _env_str_clean(name, default=""): + """Parse a generic string from env, removing inline comments and trimming. + Returns the first whitespace-delimited token to avoid accidental comment tails. + """ + raw = os.getenv(name) + if raw is None: + return default + sanitized = str(raw).split('#', 1)[0].strip() + if not sanitized: + return default + return sanitized.split()[0] + + +# Konfiguration aus ENV +ENV = os.getenv("ENV", "development") +HEARTBEAT_INTERVAL = _env_int("HEARTBEAT_INTERVAL", 5 if ENV == "development" else 60) +SCREENSHOT_INTERVAL = _env_int("SCREENSHOT_INTERVAL", 30 if ENV == "development" else 300) +LOG_LEVEL = os.getenv("LOG_LEVEL", "DEBUG" if ENV == "development" else "INFO") +# Default to localhost in development, 'mqtt' (Docker compose service) otherwise +MQTT_BROKER = _env_host("MQTT_BROKER", "localhost" if ENV == "development" else "mqtt") +MQTT_PORT = _env_int("MQTT_PORT", 1883) +DEBUG_MODE = _env_bool("DEBUG_MODE", ENV == "development") +MQTT_BROKER_FALLBACKS = [] +_fallbacks_raw = os.getenv("MQTT_BROKER_FALLBACKS", "") +if _fallbacks_raw: + for item in _fallbacks_raw.split(","): + host = item.split('#', 1)[0].strip() + if host: + # Only take the first whitespace-delimited token + MQTT_BROKER_FALLBACKS.append(host.split()[0]) + +# File server/API configuration +# Defaults: use same host as MQTT broker, port 8000, http scheme +FILE_SERVER_BASE_URL = _env_str_clean("FILE_SERVER_BASE_URL", "") +_scheme_raw = _env_str_clean("FILE_SERVER_SCHEME", "http").lower() +FILE_SERVER_SCHEME = _scheme_raw if _scheme_raw in ("http", "https") else "http" +FILE_SERVER_HOST = _env_host("FILE_SERVER_HOST", MQTT_BROKER) +FILE_SERVER_PORT = _env_int("FILE_SERVER_PORT", 8000) + +# Logging-Konfiguration +LOG_PATH = os.path.join(os.path.dirname(__file__), "simclient.log") +os.makedirs(os.path.dirname(LOG_PATH), exist_ok=True) +log_handlers = [] +log_handlers.append(RotatingFileHandler( + LOG_PATH, maxBytes=2*1024*1024, backupCount=5, encoding="utf-8")) +if DEBUG_MODE: + log_handlers.append(logging.StreamHandler()) +logging.basicConfig( + level=getattr(logging, LOG_LEVEL.upper(), logging.INFO), + format="%(asctime)s [%(levelname)s] %(message)s", + handlers=log_handlers +) + + +discovered = False + + +def save_event_to_json(event_data): + """Speichert eine Event-Nachricht in der Datei current_event.json + + This function preserves ALL fields from the incoming event data, + including scheduler-specific fields like: + - page_progress: Current page/slide progress tracking + - auto_progress: Auto-progression state + - And any other fields sent by the scheduler + """ + try: + json_path = os.path.join(os.path.dirname(__file__), "current_event.json") + with open(json_path, "w", encoding="utf-8") as f: + json.dump(event_data, f, ensure_ascii=False, indent=2) + logging.info(f"Event message saved to {json_path}") + + # Log if scheduler-specific fields are present + if isinstance(event_data, list): + for idx, event in enumerate(event_data): + if isinstance(event, dict): + if 'page_progress' in event: + logging.debug(f"Event {idx}: page_progress = {event['page_progress']}") + if 'auto_progress' in event: + logging.debug(f"Event {idx}: auto_progress = {event['auto_progress']}") + elif isinstance(event_data, dict): + if 'page_progress' in event_data: + logging.debug(f"Event page_progress = {event_data['page_progress']}") + if 'auto_progress' in event_data: + logging.debug(f"Event auto_progress = {event_data['auto_progress']}") + + except Exception as e: + logging.error(f"Error saving event message: {e}") + + +def delete_event_file(): + """Löscht die current_event.json Datei wenn kein Event aktiv ist""" + try: + json_path = os.path.join(os.path.dirname(__file__), "current_event.json") + if os.path.exists(json_path): + # Copy to last_event.json first so we keep a record of the last event + try: + last_path = os.path.join(os.path.dirname(__file__), "last_event.json") + # Use atomic replace: write to temp then replace + tmp_path = last_path + ".tmp" + shutil.copyfile(json_path, tmp_path) + os.replace(tmp_path, last_path) + logging.info(f"Copied {json_path} to {last_path} (last event)") + except Exception as e: + logging.warning(f"Could not copy current_event.json to last_event.json: {e}") + + os.remove(json_path) + logging.info(f"Event file {json_path} deleted - no active event") + except Exception as e: + logging.error(f"Error deleting event file: {e}") + + +def is_empty_event(event_data): + """Prüft ob eine Event-Nachricht bedeutet, dass kein Event aktiv ist""" + if event_data is None: + return True + + # Verschiedene Möglichkeiten für "kein Event": + # 1. Leeres Dictionary + if not event_data: + return True + + # 2. Explizite "null" oder "empty" Werte + if isinstance(event_data, dict): + # Event ist null/None + if event_data.get("event") is None or event_data.get("event") == "null": + return True + # Event ist explizit als "empty" oder "none" markiert + if str(event_data.get("event", "")).lower() in ["empty", "none", ""]: + return True + # Status zeigt an dass kein Event aktiv ist + status = str(event_data.get("status", "")).lower() + if status in ["inactive", "none", "empty", "cleared"]: + return True + + # 3. String-basierte Events + if isinstance(event_data, str) and event_data.lower() in ["null", "none", "empty", ""]: + return True + + return False + + +def on_message(client, userdata, msg, properties=None): + global discovered + logging.info(f"Received: {msg.topic} {msg.payload.decode()}") + if msg.topic.startswith("infoscreen/events/"): + event_payload = msg.payload.decode() + logging.info(f"Event message from scheduler received: {event_payload}") + + try: + event_data = json.loads(event_payload) + + if is_empty_event(event_data): + logging.info("No active event - deleting event file") + delete_event_file() + else: + save_event_to_json(event_data) + + # Check if event_data is a list or a dictionary + if isinstance(event_data, list): + for event in event_data: + presentation_files = event.get("presentation", {}).get("files", []) + for file in presentation_files: + file_url = file.get("url") + if file_url: + download_presentation_file(file_url) + elif isinstance(event_data, dict): + presentation_files = event_data.get("presentation", {}).get("files", []) + for file in presentation_files: + file_url = file.get("url") + if file_url: + download_presentation_file(file_url) + + except json.JSONDecodeError as e: + logging.error(f"Invalid JSON in event message: {e}") + if event_payload.strip().lower() in ["null", "none", "empty", ""]: + logging.info("Empty event message received - deleting event file") + delete_event_file() + else: + event_data = {"raw_message": event_payload, "error": "Invalid JSON format"} + save_event_to_json(event_data) + + if msg.topic.endswith("/discovery_ack"): + discovered = True + logging.info("Discovery ACK received. Starting heartbeat.") + + +def get_mac_addresses(): + macs = set() + try: + for root, dirs, files in os.walk('/sys/class/net/'): + for iface in dirs: + try: + with open(f'/sys/class/net/{iface}/address') as f: + mac = f.read().strip() + if mac and mac != '00:00:00:00:00:00': + macs.add(mac) + except Exception: + continue + break + except Exception: + pass + return sorted(macs) + + +def get_board_serial(): + # Raspberry Pi: /proc/cpuinfo, andere: /sys/class/dmi/id/product_serial + serial = None + try: + with open('/proc/cpuinfo') as f: + for line in f: + if line.lower().startswith('serial'): + serial = line.split(':')[1].strip() + break + except Exception: + pass + if not serial: + try: + with open('/sys/class/dmi/id/product_serial') as f: + serial = f.read().strip() + except Exception: + pass + return serial or "unknown" + + +def get_ip(): + # Versucht, die lokale IP zu ermitteln (nicht 127.0.0.1) + try: + s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) + s.connect(("8.8.8.8", 80)) + ip = s.getsockname()[0] + s.close() + return ip + except Exception: + return "unknown" + + +def get_hardware_token(): + serial = get_board_serial() + macs = get_mac_addresses() + token_raw = serial + "_" + "_".join(macs) + # Hashen für Datenschutz + token_hash = hashlib.sha256(token_raw.encode()).hexdigest() + return token_hash + + +def get_model(): + # Versucht, das Modell auszulesen (z.B. Raspberry Pi, PC, etc.) + try: + if os.path.exists('/proc/device-tree/model'): + with open('/proc/device-tree/model') as f: + return f.read().strip() + elif os.path.exists('/sys/class/dmi/id/product_name'): + with open('/sys/class/dmi/id/product_name') as f: + return f.read().strip() + except Exception: + pass + return "unknown" + + +SOFTWARE_VERSION = "1.0.0" # Optional: Anpassen bei neuen Releases + + +def send_discovery(client, client_id, hardware_token, ip_addr): + macs = get_mac_addresses() + discovery_msg = { + "uuid": client_id, + "hardware_token": hardware_token, + "ip": ip_addr, + "type": "infoscreen", + "hostname": socket.gethostname(), + "os_version": platform.platform(), + "software_version": SOFTWARE_VERSION, + "macs": macs, + "model": get_model(), + } + client.publish("infoscreen/discovery", json.dumps(discovery_msg)) + logging.info(f"Discovery message sent: {discovery_msg}") + + +def get_persistent_uuid(uuid_path=None): + if uuid_path is None: + uuid_path = os.path.join(os.path.dirname(__file__), "config", "client_uuid.txt") + # Prüfe, ob die Datei existiert + if os.path.exists(uuid_path): + with open(uuid_path, "r") as f: + return f.read().strip() + # Generiere neue UUID und speichere sie + new_uuid = str(uuid.uuid4()) + os.makedirs(os.path.dirname(uuid_path), exist_ok=True) + with open(uuid_path, "w") as f: + f.write(new_uuid) + return new_uuid + + + +def load_last_group_id(path): + try: + with open(path, 'r') as f: + return f.read().strip() + except Exception: + return None + +def save_last_group_id(path, group_id): + try: + os.makedirs(os.path.dirname(path), exist_ok=True) + with open(path, 'w') as f: + f.write(str(group_id)) + except Exception as e: + logging.error(f"Error saving group_id: {e}") + +def download_presentation_file(url): + """Downloads the presentation file from the given URL.""" + try: + # Resolve URL to correct API host (same IP as MQTT broker by default) + resolved_url = resolve_file_url(url) + + # Create the presentation directory if it doesn't exist + presentation_dir = os.path.join(os.path.dirname(__file__), "presentation") + os.makedirs(presentation_dir, exist_ok=True) + + # Extract the filename from the (possibly encoded) URL + filename = unquote(urlsplit(resolved_url).path.split("/")[-1]) or "downloaded_file" + file_path = os.path.join(presentation_dir, filename) + + # Check if the file already exists + if os.path.exists(file_path): + logging.info(f"File already exists: {file_path}") + return + + # Download the file + logging.info(f"Downloading file from: {resolved_url}") + response = requests.get(resolved_url, timeout=20) + response.raise_for_status() # Raise an error for bad responses + + # Save the file + with open(file_path, "wb") as f: + f.write(response.content) + + logging.info(f"File downloaded successfully: {file_path}") + except Exception as e: + logging.error(f"Error downloading file: {e}") + + +def resolve_file_url(original_url: str) -> str: + """Resolve/normalize a file URL to point to the configured file server. + + Rules: + - If FILE_SERVER_BASE_URL is set, force scheme/host/port from it. + - Else default to FILE_SERVER_HOST (defaults to MQTT_BROKER) and FILE_SERVER_PORT (8000). + - Only rewrite host when incoming URL host is missing or equals 'server'. + - Preserve path and query. + """ + try: + parts = urlsplit(original_url) + + # Determine target base + target_scheme = FILE_SERVER_SCHEME + target_host = FILE_SERVER_HOST + target_port = FILE_SERVER_PORT + + if FILE_SERVER_BASE_URL: + base = urlsplit(FILE_SERVER_BASE_URL) + # Only assign if present to allow partial base definitions + if base.scheme: + target_scheme = base.scheme + if base.hostname: + target_host = base.hostname + if base.port: + target_port = base.port + + # Decide whether to rewrite + incoming_host = parts.hostname + should_rewrite = (incoming_host is None) or (incoming_host.lower() == "server") + + if should_rewrite: + # Build netloc with port (always include port to be explicit) + netloc = f"{target_host}:{target_port}" if target_port else target_host + new_parts = ( + target_scheme, + netloc, + parts.path or "/", + parts.query, + parts.fragment, + ) + return urlunsplit(new_parts) + else: + # Keep original if it's already a proper absolute URL + return original_url + except Exception as e: + logging.warning(f"Could not resolve URL, using original: {original_url} (error: {e})") + return original_url + + +def get_latest_screenshot(): + """Get the latest screenshot from the host OS shared folder""" + try: + screenshot_dir = os.path.join(os.path.dirname(__file__), "screenshots") + if not os.path.exists(screenshot_dir): + return None + + # Find the most recent screenshot file + screenshot_files = [f for f in os.listdir(screenshot_dir) + if f.lower().endswith(('.png', '.jpg', '.jpeg'))] + + if not screenshot_files: + return None + + # Get the most recent file + latest_file = max(screenshot_files, + key=lambda f: os.path.getmtime(os.path.join(screenshot_dir, f))) + + screenshot_path = os.path.join(screenshot_dir, latest_file) + + # Read and encode screenshot + with open(screenshot_path, "rb") as f: + screenshot_data = base64.b64encode(f.read()).decode('utf-8') + + # Get file info + file_stats = os.stat(screenshot_path) + + return { + "filename": latest_file, + "data": screenshot_data, + "timestamp": datetime.fromtimestamp(file_stats.st_mtime).isoformat(), + "size": file_stats.st_size + } + + except Exception as e: + logging.error(f"Error reading screenshot: {e}") + return None + + +def send_screenshot_heartbeat(client, client_id): + """Send heartbeat with screenshot to server for dashboard monitoring""" + try: + screenshot_info = get_latest_screenshot() + + heartbeat_data = { + "timestamp": datetime.now().isoformat(), + "client_id": client_id, + "status": "alive", + "screenshot": screenshot_info, + "system_info": { + "hostname": socket.gethostname(), + "ip": get_ip(), + "uptime": time.time() # Could be replaced with actual uptime + } + } + + # Send to dashboard monitoring topic + dashboard_topic = f"infoscreen/{client_id}/dashboard" + client.publish(dashboard_topic, json.dumps(heartbeat_data)) + + if screenshot_info: + logging.info(f"Screenshot heartbeat sent: {screenshot_info['filename']} ({screenshot_info['size']} bytes)") + else: + logging.debug("Heartbeat sent without screenshot") + + except Exception as e: + logging.error(f"Error sending screenshot heartbeat: {e}") + + +def screenshot_service_thread(client, client_id): + """Background thread for screenshot monitoring and transmission""" + logging.info(f"Screenshot service started with {SCREENSHOT_INTERVAL}s interval") + + while True: + try: + send_screenshot_heartbeat(client, client_id) + time.sleep(SCREENSHOT_INTERVAL) + except Exception as e: + logging.error(f"Screenshot service error: {e}") + time.sleep(60) # Wait a minute before retrying + + +def main(): + global discovered + logging.info("Client starting - deleting old event file if present") + delete_event_file() + + client_id = get_persistent_uuid() + hardware_token = get_hardware_token() + ip_addr = get_ip() + + # Persistenz für group_id (needed in on_connect) + group_id_path = os.path.join(os.path.dirname(__file__), "config", "last_group_id.txt") + current_group_id = load_last_group_id(group_id_path) + event_topic = None + + # paho-mqtt v2: opt into latest callback API to avoid deprecation warnings. + client_kwargs = {"protocol": mqtt.MQTTv311} + try: + # Use enum when available (paho-mqtt >= 2.0) + if hasattr(mqtt, "CallbackAPIVersion"): + client_kwargs["callback_api_version"] = mqtt.CallbackAPIVersion.VERSION2 + except Exception: + pass + client = mqtt.Client(**client_kwargs) + client.on_message = on_message + + # Define subscribe_event_topic BEFORE on_connect so it can be called from the callback + def subscribe_event_topic(new_group_id): + nonlocal event_topic, current_group_id + + # Check if group actually changed to handle cleanup + group_changed = new_group_id != current_group_id + + if group_changed: + if current_group_id is not None: + logging.info(f"Group change from {current_group_id} to {new_group_id} - deleting old event file") + delete_event_file() + if event_topic: + client.unsubscribe(event_topic) + logging.info(f"Unsubscribed from event topic: {event_topic}") + + # Always ensure the event topic is subscribed + new_event_topic = f"infoscreen/events/{new_group_id}" + + # Only subscribe if we don't already have this topic subscribed + if event_topic != new_event_topic: + if event_topic: + client.unsubscribe(event_topic) + logging.info(f"Unsubscribed from event topic: {event_topic}") + + event_topic = new_event_topic + client.subscribe(event_topic) + logging.info(f"Subscribing to event topic: {event_topic} for group_id: {new_group_id}") + else: + logging.info(f"Event topic already subscribed: {event_topic}") + + # Update current group_id and save it + if group_changed: + current_group_id = new_group_id + save_last_group_id(group_id_path, new_group_id) + + # on_connect callback: Subscribe to all topics after connection is established + def on_connect(client, userdata, flags, rc, properties=None): + if rc == 0: + logging.info("MQTT connected successfully - subscribing to topics...") + # Discovery-ACK-Topic abonnieren + ack_topic = f"infoscreen/{client_id}/discovery_ack" + client.subscribe(ack_topic) + logging.info(f"Subscribed to: {ack_topic}") + + # Config topic + client.subscribe(f"infoscreen/{client_id}/config") + logging.info(f"Subscribed to: infoscreen/{client_id}/config") + + # group_id Topic abonnieren (retained) + group_id_topic = f"infoscreen/{client_id}/group_id" + client.subscribe(group_id_topic) + logging.info(f"Subscribed to: {group_id_topic}") + + # Wenn beim Start eine group_id vorhanden ist, sofort Event-Topic abonnieren + if current_group_id: + logging.info(f"Subscribing to event topic for saved group_id: {current_group_id}") + subscribe_event_topic(current_group_id) + else: + logging.error(f"MQTT connection failed with code: {rc}") + + client.on_connect = on_connect + + # Robust MQTT connect with fallbacks and retries + broker_candidates = [MQTT_BROKER] + # Add environment-provided fallbacks + broker_candidates.extend([b for b in MQTT_BROKER_FALLBACKS if b not in broker_candidates]) + # Add common local fallbacks + for alt in ("127.0.0.1", "localhost", "mqtt"): + if alt not in broker_candidates: + broker_candidates.append(alt) + + connect_ok = False + last_error = None + for attempt in range(1, 6): # up to 5 attempts + for host in broker_candidates: + try: + logging.info(f"Connecting to MQTT broker {host}:{MQTT_PORT} (attempt {attempt}/5)...") + client.connect(host, MQTT_PORT) + connect_ok = True + MQTT_HOST_USED = host # noqa: N816 local doc variable + break + except Exception as e: + last_error = e + logging.warning(f"MQTT connection to {host}:{MQTT_PORT} failed: {e}") + if connect_ok: + break + backoff = min(5 * attempt, 20) + logging.info(f"Retrying connection in {backoff}s...") + time.sleep(backoff) + + if not connect_ok: + logging.error(f"MQTT connection failed after multiple attempts: {last_error}") + raise last_error + + # Wait for connection to complete and on_connect callback to fire + # This ensures subscriptions are set up before we start discovery + logging.info("Waiting for on_connect callback and subscription setup...") + for _ in range(10): # Wait up to ~1 second + client.loop(timeout=0.1) + time.sleep(0.1) + logging.info("Subscription setup complete, starting discovery phase") + + # group_id message callback + group_id_topic = f"infoscreen/{client_id}/group_id" + def on_group_id_message(client, userdata, msg, properties=None): + payload = msg.payload.decode().strip() + new_group_id = None + # Versuche, group_id aus JSON zu extrahieren, sonst als String verwenden + try: + data = json.loads(payload) + if isinstance(data, dict) and "group_id" in data: + new_group_id = str(data["group_id"]) + else: + new_group_id = str(data) + except Exception: + new_group_id = payload + new_group_id = new_group_id.strip() + if new_group_id: + if new_group_id != current_group_id: + logging.info(f"New group_id received: {new_group_id}") + else: + logging.info(f"group_id unchanged: {new_group_id}, ensuring event topic is subscribed") + # Always call subscribe_event_topic to ensure subscription + subscribe_event_topic(new_group_id) + else: + logging.warning("Empty group_id received!") + client.message_callback_add(group_id_topic, on_group_id_message) + logging.info(f"Current group_id at start: {current_group_id if current_group_id else 'none'}") + + # Discovery-Phase: Sende Discovery bis ACK empfangen + while not discovered: + send_discovery(client, client_id, hardware_token, ip_addr) + # Check for messages and discovered flag more frequently + for _ in range(int(HEARTBEAT_INTERVAL)): + client.loop(timeout=1.0) + if discovered: + break + time.sleep(1) + if discovered: + break + + # Start screenshot service in background thread + screenshot_thread = threading.Thread( + target=screenshot_service_thread, + args=(client, client_id), + daemon=True + ) + screenshot_thread.start() + logging.info("Screenshot service thread started") + + # Heartbeat-Loop + last_heartbeat = 0 + while True: + current_time = time.time() + if current_time - last_heartbeat >= HEARTBEAT_INTERVAL: + client.publish(f"infoscreen/{client_id}/heartbeat", "alive") + logging.info("Heartbeat sent.") + last_heartbeat = current_time + client.loop(timeout=5.0) + time.sleep(5) + + +if __name__ == "__main__": + main()