Skip to content

Commit 0a7ef28

Browse files
committed
www/SpectrumKNX: added new port version 1.16.0
a nice KNX monitor with a searchable history. asyncpg must be downgraded due to a regresion in version 0.31.0: MagicStack/asyncpg#1334 Check for more details: https://github.com/martinhoefling/SpectrumKNX
1 parent 703f5a4 commit 0a7ef28

10 files changed

Lines changed: 278 additions & 2 deletions

File tree

‎GIDs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ rtorrent:*:397:
342342
tiarra:*:398:
343343
# free: 399
344344
evcc:*:400:
345-
# free: 401
345+
spectrumknx:*:401:
346346
# free: 402
347347
# free: 403
348348
# free: 404

‎UIDs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ rtorrent:*:397:397::0:0:rtorrent Daemon User:/nonexistent:/usr/sbin/nologin
347347
tiarra:*:398:398::0:0:Tiarra IRC Proxy:/nonexistent:/usr/sbin/nologin
348348
# free: 399
349349
evcc:*:400:400::0:0:evcc Daemon:/nonexistent:/usr/sbin/nologin
350-
# free: 401
350+
spectrumknx:*:401:401::0:0:SpectrumKNX Daemon:/var/db/spectrumknx:/usr/sbin/nologin
351351
# free: 402
352352
# free: 403
353353
# free: 404

‎www/Makefile‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
SUBDIR += R-cran-webshot
2626
SUBDIR += R-cran-webutils
2727
SUBDIR += SNIP
28+
SUBDIR += SpectrumKNX
2829
SUBDIR += UniversalFeedCreator
2930
SUBDIR += access-log-exporter
3031
SUBDIR += adguardhome

‎www/SpectrumKNX/Makefile‎

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
PORTNAME= SpectrumKNX
2+
PORTVERSION= 1.16.0
3+
DISTVERSIONPREFIX= v
4+
CATEGORIES= www
5+
MASTER_SITES= LOCAL/mfechner/${PORTNAME}/:npmcache
6+
DISTFILES= ${PORTNAME}-npm-cache-${DISTVERSION}${EXTRACT_SUFX}:npmcache
7+
8+
MAINTAINER= [email protected]
9+
COMMENT= KNX bus and telegram monitor with storage
10+
WWW= https://github.com/martinhoefling/SpectrumKNX
11+
12+
LICENSE= GPLv3
13+
LICENSE_FILE= ${WRKSRC}/LICENSE
14+
15+
ONLY_FOR_ARCHS= amd64
16+
ONLY_FOR_ARCHS_REASON= Npm cache only for amd64 generated
17+
18+
BUILD_DEPENDS= npm>=0:www/npm \
19+
git>=0:devel/git
20+
RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}pip>=22.2.2:devel/py-pip@${PY_FLAVOR} \
21+
cargo-cbuild:devel/cargo-c \
22+
rust>0:lang/rust
23+
24+
USES= compiler:c++17-lang gmake nodejs python shebangfix
25+
26+
USE_GITHUB= yes
27+
GH_ACCOUNT= martinhoefling
28+
USE_RC_SUBR= spectrumknx
29+
30+
# Required for node-gyp to work
31+
MAKE_ENV+= npm_config_build_from_source=true
32+
MAKE_ENV+= npm_config_nodedir=${PREFIX}
33+
MAKE_ENV+= npm_config_node_gyp=${LOCALBASE}/bin/node-gyp
34+
MAKE_ENV+= PYTHON=${PYTHON_CMD}
35+
MAKE_ENV+= COREPACK_ENABLE_DOWNLOAD_PROMPT=0
36+
MAKE_ENV+= npm_config_offline=true
37+
MAKE_ENV+= VITE_APP_VERSION=${PORTVERSION}
38+
CPPFLAGS+= -I${LOCALBASE}/include
39+
CXXFLAGS+= -I${LOCALBASE}/include
40+
41+
WWWDIR= ${PREFIX}/www/${PORTNAME}
42+
SUB_FILES= pkg-message
43+
SUB_LIST= SPECTRUMKNX_USER=${USERS} \
44+
SPECTRUMKNX_GROUP=${GROUPS} \
45+
PYTHON_CMD="${PYTHON_CMD}" \
46+
APP_VERSION="${PORTVERSION}"
47+
USERS= spectrumknx
48+
GROUPS= spectrumknx
49+
50+
pre-build:
51+
cd ${WRKSRC}/frontend && ${SETENV} ${MAKE_ENV} npm ci --legacy-peer-deps
52+
53+
do-build:
54+
@cd ${WRKSRC}/frontend && ${SETENV} ${MAKE_ENV} npm run build
55+
56+
do-install:
57+
${FIND} ${WRKSRC} -name '*.orig' -delete
58+
59+
# Install backend
60+
(cd ${WRKSRC}/backend && ${COPYTREE_SHARE} . ${STAGEDIR}${WWWDIR})
61+
# Install frontend
62+
(cd ${WRKSRC}/frontend/dist && ${COPYTREE_SHARE} . ${STAGEDIR}${WWWDIR}/static)
63+
64+
# Configuration
65+
${INSTALL_DATA} ${FILESDIR}/spectrumknx.conf.sample ${STAGEDIR}${PREFIX}/etc/spectrumknx.conf.sample
66+
67+
# User Home directory
68+
@${MKDIR} ${STAGEDIR}/var/db/spectrumknx
69+
70+
post-install:
71+
${FIND} -s ${STAGEDIR}${WWWDIR} -not -type d | ${SORT} | \
72+
${SED} -e 's#^${STAGEDIR}${PREFIX}/##' | \
73+
${SED} -E -e '/sample$$/ s#^#@sample #; \
74+
/spectrumknx.conf.sample$$/ s#^@sample #@sample(spectrumknx,wheel,0600) #;' >> ${TMPPLIST}
75+
@${ECHO_CMD} "@sample(spectrumknx,wheel,0600) etc/spectrumknx.conf.sample" >> ${TMPPLIST}
76+
@${ECHO_CMD} "@owner spectrumknx" >> ${TMPPLIST}
77+
@${ECHO_CMD} "@group spectrumknx" >> ${TMPPLIST}
78+
@${ECHO_CMD} "@dir /var/db/spectrumknx" >> ${TMPPLIST}
79+
80+
# To update
81+
# 1. comment DISTFILES
82+
# 2. Run 'make makesum'
83+
# 3. Run 'make make-npm-cache'
84+
# 4. Upload npm cache
85+
# 5. Uncomment DITSFILES
86+
# 6. Run 'make makesum'
87+
make-npm-cache: patch
88+
${RM} -r ${WRKDIR}/npm-offline-cache
89+
#cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true yarn --frozen-lockfile --ignore-scripts
90+
cd ${WRKSRC}/frontend && ${SETENV} HOME=${WRKDIR} npm ci --legacy-peer-deps
91+
cd ${WRKDIR} && ${TAR} -c --zstd -f ${PORTNAME}-npm-cache-${DISTVERSION}${EXTRACT_SUFX} .npm
92+
@${ECHO_CMD} upload ${PORTNAME}-npm-cache-${DISTVERSION}${EXTRACT_SUFX}
93+
@${ECHO_CMD} "Please upload the file: scp ${WRKDIR}/${PORTNAME}-npm-cache-${DISTVERSION}${EXTRACT_SUFX} [email protected]:public_distfiles/${PORTNAME}/"
94+
95+
.include <bsd.port.mk>

‎www/SpectrumKNX/distinfo‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
TIMESTAMP = 1784613243
2+
SHA256 (SpectrumKNX-npm-cache-1.16.0.tar.gz) = cd57d52fd69670845760225caa1c4a97221a73666dfe72fb9878d88b72ec0903
3+
SIZE (SpectrumKNX-npm-cache-1.16.0.tar.gz) = 41298804
4+
SHA256 (martinhoefling-SpectrumKNX-v1.16.0_GH0.tar.gz) = 7252f11d7b18c5449cb720c0dde05192191989a6288f75664b3fb580d5aa3070
5+
SIZE (martinhoefling-SpectrumKNX-v1.16.0_GH0.tar.gz) = 10853737
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
--- backend/requirements.txt.orig 2026-07-22 06:06:04 UTC
2+
+++ backend/requirements.txt
3+
@@ -3,7 +3,7 @@ anyio==4.14.2
4+
annotated-doc==0.0.4
5+
annotated-types==0.7.0
6+
anyio==4.14.2
7+
-asyncpg==0.31.0
8+
+asyncpg<0.31
9+
cffi==2.1.0
10+
click==8.4.2
11+
cryptography==49.0.0
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
[
2+
{
3+
message: <<EOM
4+
SpectrumKNX installed successfully.
5+
6+
Please configure SpectrumKNX using export commands in:
7+
%%PREFIX%%/etc/spectrumknx.conf
8+
9+
for more details check the configuration options (some useful ones are already define or must be changed):
10+
https://github.com/martinhoefling/SpectrumKNX/blob/main/DEPLOYMENT.md
11+
12+
Create postgres DB, user and enable timescaledb (make sure you have postgresql18-server and timescaledb installed and configured):
13+
psql -U postgres
14+
CREATE ROLE knxuser LOGIN PASSWORD 'knxpassword';
15+
CREATE DATABASE knx_analyzer OWNER knxuser;
16+
\c knx_analyzer
17+
CREATE EXTENSION IF NOT EXISTS timescaledb CASCADE;
18+
\q
19+
20+
To enable SpectrumKNX on startup:
21+
sysrc spectrumknx_enable="YES"
22+
23+
You should put a reverse proxy like nginx in front of it.
24+
In the default configuration SpectrumKNX listens on http://localhost:8095/
25+
26+
You can modify this with:
27+
sysrc spectrumknx_listen_ip="localhost"
28+
sysrc spectrumknx_listen_port="8095"
29+
30+
To start SpectrumKNX:
31+
service spectrumknx start
32+
33+
Logfile are on:
34+
/var/log/spectrumknx/spectrumknx.log
35+
36+
EOM
37+
type: install
38+
}
39+
{
40+
message: <<EOM
41+
To apply required python lib upgrade, restart SpectrumKNX:
42+
43+
service spectrumknx restart
44+
45+
EOM
46+
type: upgrade
47+
}
48+
]
49+
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Please check this site for more details:
2+
# https://github.com/martinhoefling/SpectrumKNX/blob/main/DEPLOYMENT.md
3+
4+
# Logging verbosity (DEBUG, INFO, WARNING, ERROR, CRITICAL).
5+
export LOG_LEVEL="INFO"
6+
7+
# DB Connection
8+
#export POSTGRES_USER="knxuser"
9+
export POSTGRES_PASSWORD=""
10+
#export POSTGRES_DB="knx_analyser"
11+
#export POSTGRES_HOST="localhost"
12+
#export POSTGRES_PORT="5432"
13+
14+
# KNX Settings (normally no change required)
15+
# IP address of your KNX IP Gateway/Router. Use AUTO to scan the network automatically
16+
export KNX_GATEWAY_IP="AUTO"
17+
#Port of your KNX IP Gateway
18+
export KNX_GATEWAY_PORT="3671"
19+
# Password for the ETS project file
20+
export KNX_PASSWORD=""
21+
# Local IP or interface name to bind to
22+
export KNX_LOCAL_IP=""
23+
# Individual address (e.g. 1.1.100)
24+
export KNX_INDIVIDUAL_ADDRESS=""
25+
# Multicast group for routing
26+
export KNX_MULTICAST_GROUP="224.0.23.12"
27+
# Multicast port for routing
28+
export KNX_MULTICAST_PORT="3671"
29+
# Path to the .knxkeys file (auto-detected at /project/knx_keys.knxkeys if not set) or upload via UI
30+
export KNX_KNXKEYS_FILE=""
31+
# Password for the .knxkeys file or upload via UI
32+
export KNX_KNXKEYS_PASSWORD=""
33+
# User ID for Secure Tunneling
34+
export KNX_SECURE_USER_ID=""
35+
# User Password for Secure Tunneling
36+
export KNX_SECURE_USER_PASSWORD=""
37+
# Device Password for Secure Tunneling
38+
export KNX_SECURE_DEVICE_PASSWORD=""
39+
# Backbone Key (hex) for Secure Routing
40+
export KNX_SECURE_BACKBONE_KEY=""
41+
# Latency in ms for Secure Routing
42+
export KNX_SECURE_LATENCY_MS=""
43+
44+
# Do not change
45+
export KNX_PROJECT_PATH=/var/db/spectrumknx/knx_project.knxproj
46+
47+
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
#!/bin/sh
2+
# PROVIDE: spectrumknx
3+
# REQUIRE: LOGIN
4+
# KEYWORD: shutdown
5+
6+
. /etc/rc.subr
7+
8+
export PATH=$PATH:/usr/local/bin
9+
export HOME=${workingdir}
10+
11+
name="spectrumknx"
12+
rcvar="${name}_enable"
13+
14+
load_rc_config $name
15+
: ${spectrumknx_enable:=no}
16+
: ${spectrumknx_user:="%%SPECTRUMKNX_USER%%"}
17+
: ${spectrumknx_group:="%%SPECTRUMKNX_GROUP%%"}
18+
: ${spectrumknx_listen_ip:="localhost"}
19+
: ${spectrumknx_listen_port:="8765"}
20+
21+
logfile="/var/log/${name}/${name}.log"
22+
pidfile="/var/run/${name}/${name}.pid"
23+
workingdir="%%WWWDIR%%"
24+
venvdir="${workingdir}/venv"
25+
26+
command="/usr/sbin/daemon"
27+
command_args="-H -o ${logfile} -t ${name} -P ${pidfile} \
28+
bash -c 'cd $workingdir && source venv/bin/activate && source /usr/local/etc/spectrumknx.conf && APP_VERSION="%%APP_VERSION%%" uvicorn main:app --host ${spectrumknx_listen_ip} --port ${spectrumknx_listen_port}'"
29+
30+
start_precmd="${name}_precmd"
31+
start_cmd="${name}_start"
32+
33+
spectrumknx_precmd()
34+
{
35+
# Ensure pid directory exists
36+
install -d -g "${spectrumknx_group}" -o "${spectrumknx_user}" "$(dirname "${pidfile}")"
37+
38+
# Ensure log directory exists
39+
install -d -g "${spectrumknx_group}" -o "${spectrumknx_user}" "$(dirname "${logfile}")"
40+
41+
# Ensure DB directory exists
42+
install -d -g "${spectrumknx_group}" -o "${spectrumknx_user}" -m 0750 "/var/db/spectrumknx"
43+
44+
# Ensure virtualenv exists
45+
if [ ! -d "${venvdir}/bin" ]; then
46+
echo "Creating Python virtual environment..."
47+
mkdir -p "${venvdir}"
48+
chown ${spectrumknx_user}:${spectrumknx_group} "${venvdir}"
49+
su -m "${spectrumknx_user}" -c "%%PYTHON_CMD%% -m venv ${venvdir}" || return 1
50+
fi
51+
52+
echo "Installing Python requirements..."
53+
su -m "${spectrumknx_user}" -c "cd ${workingdir} && ${venvdir}/bin/python -m pip install -r ${workingdir}/requirements.txt" || return 1
54+
}
55+
56+
spectrumknx_start()
57+
{
58+
su -m ${spectrumknx_user} -c "${command} ${command_args}"
59+
}
60+
61+
run_rc_command "$1"
62+

‎www/SpectrumKNX/pkg-descr‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
An elegant, high-performance bus traffic monitor and visualizer for KNX Home
2+
Automation.
3+
4+
Spectrum KNX is a dedicated tool to record, store, search, and visualize KNX bus
5+
telegrams indefinitely. Built for speed and reliability, it merges a robust
6+
TimescaleDB backend with a premium, real-time React web interface.

0 commit comments

Comments
 (0)