Skip to content

Commit

Permalink
Various improvements and some fixes
Browse files Browse the repository at this point in the history
- Various adaptations for Debian 12 (Bookworm)

- showcase: Move all demo-related parts to a new subproject 'showcase'

- resources: Extend API, make state attribute methods like 'isBusy()' available in 'CResource'
- resources: Add new type 'rcPower'; add 'CRcValueState::ToHuman()'
- resources: Add support for info/warning messages by script drivers; Fix driving for keep-running drivers; Add capturing of stderr

- brownies: Add retry loop to 'IfElvI2cInit()', closes Github pull request #4 ("Retry code for failing ELV-USB-I2C device")
- brownies: Fix permanent 'rcsBusy' state of shades on startup

- mqtt: Correction of mqttWillPayload length (#6)
- mqtt: Add support for JSON payloads

- drivers: Add fingerprint driver (R503) and support tool
- drivers: Add 'fronius' driver

- wallclock: Add energy meter; some cleanup
- wallclock: Upgrade to SDL 2.28.5 and SDL_ttf 2.20.2

- wallclock/floorplan: Improve floorplan and add support for custom icons
- wallclock/floorplan: add tool 'home2l-icon' to prepare custom icons
- wallclock/floorplan: add icons "fingerprint", "security" and "pool"
- wallclock/floorplan: add option "attention" to customize the use state from which attention is drawn
- wallclock/floorplan: improve visibility of busy resources
- wallclock/floorplan, enocean: Make window handles writeable and allow to dismiss attention via UI

- wallclock/music: Add option to update the database on the MPD server.
- wallclock/music: Fix unsorted playlist listing
- wallclock/music: Fix streamer issues and improve error handling

- wallclock/calendar: Improve error handling and fix overflow on remind parsing
- wallclock/calendar: Add time-out for reloading calendars
- wallclock/calendar: Integrate 'patch' into Android app to fix calendar edit failures
- wallclock/calendar: Integrate remind to make calendar run on Android without Linux host

- wallclock/android: Rearrange directory structure for contemporary Android building using Gradle (UNTESTED, no code changes)
- wallclock/android: Make APK building independent from environment settings (ANDROID_...)
- wallclock/android: Cleanup APK code; drop sync2l interface; drop immersive mode
- wallclock/android: Adapt to build with SDK 34 and NDK r25, OpenJDK 17
- wallclock/android: New mechanism for /etc updates without requiring root on Android device
- wallclock/android + home2l-adb: Add resource to support ADB over TCP with remote enabling
- wallclock/android: Upgrade to Gstreamer 1.20.7
  • Loading branch information
gkiefer committed May 25, 2024
1 parent 72d1993 commit eebcfb7
Show file tree
Hide file tree
Showing 1,022 changed files with 39,814 additions and 38,210 deletions.
33 changes: 17 additions & 16 deletions CONTENTS
Original file line number Diff line number Diff line change
Expand Up @@ -13,33 +13,34 @@ Gundolf Kiefer, 2018-11-21

2. Documentation (generated)

README.pdf - PDF version of README.md
home2l-book.pdf - The Home2L Book
home2l-api_python - Python API
home2l-api_c - C/C++ API
home2l-figs - Some nice figures (mainly for README.md)
home2l-demo-vm.tar.gz - VirtualBox VM suitable for running the tutorial
README.pdf - PDF version of README.md
home2l-book.pdf - The Home2L Book
home2l-api_python - Python API
home2l-api_c - C/C++ API
home2l-figs - Some nice figures (mainly for README.md)
home2l-showcase-vbox.tar.gz
- VirtualBox VM suitable for running the tutorial


3. Main Modules

resources/
brownies/
wallclock/
doorman/
3. General Source Files

tools/ - Collection of core tools
showcase/ - Examples and initial configuration files
doc/ - Documentation source files
locales/ - Translations


4. Other Source Files

common/ - Common C source files (base, env, phone, streamer)
drivers/ - Resource drivers (gpio, weather)
external/ - Scripts and notes for external dependencies


4. Main Modules

resources/ - Resources: library and tools
brownies/ - Brownies: firmwares, library and tools
wallclock/ - WallClock application
doorman/ - DoorMan application


5. Build System

Makefile
Expand Down
16 changes: 8 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This file is part of the Home2L project.
#
# (C) 2015-2021 Gundolf Kiefer
# (C) 2015-2024 Gundolf Kiefer
#
# Home2L is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -37,7 +37,7 @@
# To run the image:
# $ xhost +local:
# $ docker run -ti --rm --tmpfs /tmp --name home2l-showcase --hostname home2l-showcase \
# -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix --device /dev/snd \
# -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix --ipc=host --device /dev/snd \
# gkiefer/home2l


Expand Down Expand Up @@ -83,7 +83,7 @@


# Version of the Debian base image ...
ARG DEBIAN_VERSION=bullseye
ARG DEBIAN_VERSION=bookworm


# Build version as reported by the tools ...
Expand Down Expand Up @@ -118,7 +118,7 @@ ARG PHONE_DEBS_BUILD


# Install packages ...
RUN sed -i.bak 's#main\$#main contrib\$#' /etc/apt/sources.list && \
RUN sed -i.bak 's#main\$#main contrib\$#' /etc/apt/sources.list.d/debian.sources && \
apt-get update && \
apt-get -y --no-install-recommends install \
make g++ git \
Expand All @@ -135,7 +135,7 @@ RUN sed -i.bak 's#main\$#main contrib\$#' /etc/apt/sources.list && \
WORKDIR /tmp/src
COPY . .
RUN make -j8 CFG=demo WITH_PHONE=$WITH_PHONE PHONE_LIB=$PHONE_LIB BUILD_VERSION=$BUILD_VERSION install && \
mkdir -p /var/opt/home2l && cp -a doc/showcase/var/* /var/opt/home2l/
mkdir -p /var/opt/home2l && cp -a showcase/var/* /var/opt/home2l/



Expand All @@ -150,7 +150,7 @@ ARG PHONE_DEBS_RUN


# Install packages ...
RUN sed -i.bak 's#main\$#main contrib\$#' /etc/apt/sources.list && \
RUN sed -i.bak 's#main\$#main contrib\$#' /etc/apt/sources.list.d/debian.sources && \
apt-get update && \
apt-get -y --no-install-recommends install \
nano less procps psmisc \
Expand All @@ -177,9 +177,9 @@ RUN adduser --uid=5000 --disabled-password --gecos "User for auto-started Home2L
adduser home2l audio && \
adduser home2l i2c && \
adduser home2l dialout && \
chown -R home2l.home2l /var/opt/home2l && \
chown -R home2l:home2l /var/opt/home2l && \
mkdir -p /run/mosquitto && \
chown home2l.root /var/lib/mosquitto /var/log/mosquitto /run/mosquitto && \
chown home2l:root /var/lib/mosquitto /var/log/mosquitto /run/mosquitto && \
/opt/home2l/bin/home2l-install -y -i && \
echo "export PATH=\$PATH:/opt/home2l/bin:/opt/home2l/bin/`dpkg --print-architecture`" > /home/home2l/.bashrc

Expand Down
1 change: 1 addition & 0 deletions LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ sources, which are NOT part of the Home2L project:
wallclock/icons
wallclock/sounds
wallclock/fonts
drivers/fingerprint

To these files, the terms and conditions of their respective original license
apply.
Expand Down
29 changes: 22 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This file is part of the Home2L project.
#
# (C) 2015-2021 Gundolf Kiefer
# (C) 2015-2024 Gundolf Kiefer
#
# Home2L is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -31,14 +31,14 @@
# In all other cases, the build is performed for the current native architecture.
ifeq ($(CFG),minimal)
# Minimal set ...
MODS ?= tools resources
MODS ?= tools showcase resources
DRVS ?=
ARCHS ?= $(shell dpkg --print-architecture)
export WITH_PYTHON ?= 0
export WITH_READLINE ?= 0
else ifeq ($(CFG),basic)
# Basic set ...
MODS ?= tools resources brownies
MODS ?= tools showcase resources brownies
DRVS ?= gpio mqtt brownies weather
ARCHS ?= $(shell dpkg --print-architecture)
# (the following WallClock settings presently have no effect, since WallClock is excluded from the basic build)
Expand All @@ -49,15 +49,15 @@ else ifeq ($(CFG),basic)
export WITH_GSTREAMER ?= 0
else ifeq ($(CFG),demo)
# Modules for the demo image ...
MODS ?= tools resources brownies wallclock locales
DRVS ?= demo gpio mqtt brownies weather
MODS ?= tools showcase resources brownies wallclock locales
DRVS ?= demo gpio mqtt brownies weather mpd
ARCHS ?= $(shell dpkg --print-architecture)
export WITH_ANDROID ?= 0
export WITH_PHONE ?= 0
export WITH_GSTREAMER ?= 0
else
# Default: All modules, drivers and architectures ...
MODS ?= tools resources brownies wallclock locales doorman doc
MODS ?= tools showcase resources brownies wallclock locales doorman doc
DRVS ?= $(shell ls drivers)
ARCHS ?= amd64 armhf i386
endif
Expand Down Expand Up @@ -205,17 +205,32 @@ docker-master:


# Run the container (latest) ...
# NOTE [2024-05-24]: The option '--ipc=host' is required to avoid WallClock crashes
# but it reduces container isolation. See also:
# - https://github.com/jessfraz/dockerfiles/issues/359
# - https://github.com/libsdl-org/SDL/issues/4078
.PHONY: docker-run
docker-run:
@xhost +local: && \
docker run -ti --rm --tmpfs /tmp --name home2l-showcase --hostname home2l-showcase \
-e DISPLAY=$$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix --device /dev/snd \
-e DISPLAY=$$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix --ipc=host --device /dev/snd \
gkiefer/home2l





######################### Update Copyright Notices #############################


.PHONY: update-copyright
update-copyright: clean
tools/update-copyright.sh





############################## Main targets ####################################

# The following targets are equivalent to the targets of subprojects and
Expand Down
18 changes: 10 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,17 @@ The *Home2L `[houmtu:l]`* suite is a collection of tools and libraries for autom
What is New?
============

* Several improvements and cleanups in the **Resources** library:
- Support for MQTT-like and shell-like wildcards ('+', '#', '*', '?')
- Default URI prefix is now always */alias*, allowing for smaller scripts
- New event type *rceRequestChanged* and improved API for querying requests
- Shell improvements
* WallClock: Power meter for votovoltaic systems

* Updated **Tutorial**
* WallClock: User-configurable floorplan icons

* Several minor improvements and fixes
* WallClock: Improved and more self-contained Android app

* MQTT bridge: Support for JSON payloads

* New drivers: Fingerprint, Fronius

* Many small improvements and some bug fixes



Expand All @@ -61,7 +63,7 @@ The [*Home2L Book*](home2l-book.pdf) contains a **a step-by-step tutorial demons
$ docker run -ti --rm \
--name home2l-showcase --hostname home2l-showcase \
-e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix \
--device /dev/snd \
--ipc=host --device /dev/snd \
gkiefer/home2l


Expand Down
Binary file modified README.pdf
Binary file not shown.
19 changes: 6 additions & 13 deletions Setup.mk
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This file is part of the Home2L project.
#
# (C) 2015-2021 Gundolf Kiefer
# (C) 2015-2024 Gundolf Kiefer
#
# Home2L is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -72,7 +72,7 @@ SHELL := /bin/bash


# Python (used in 'resources') ...
PYTHON_INCLUDE := /usr/include/python3.9
PYTHON_INCLUDE := /usr/include/python3.11


# C/C++ Compiler & strip option for 'install'...
Expand All @@ -91,25 +91,18 @@ ifeq ($(ARCH),$(HOST_ARCH))
STRIP := -s
else
ifeq ($(ARCH),amd64)
# Note: Cross-building for 'amd64' on 'i386' under Debian Jessie (8.0) requires
# the package 'g++-multilib' (and dependencies). However, 'gcc-multilib'
# Note: Cross-building for 'i386' on 'amd64' under Debian Bookworm (12) requires
# the package 'gcc-multilib' (and dependencies). However, 'gcc-multilib'
# conflicts with the 'armhf' cross-building tools (see below).
# The workaround is to install 'g++-4.9-multilib' instead.
#
# Under Debian Stretch, things appear to be similar. Here, 'g++-6-multilib'
# has been installed manually.
#
# Under Debian Buster, things appear to be similar again. Here,
# 'g++-8-multilib' has been installed manually. The same holds for
# compiling 'i386' binaries on an 'amd64' machine.
# The workaround is to install 'g++-12-multilib' instead.
ifeq ($(HOST_ARCH),i386)
CC := g++ -m64 -no-pie
STRIP := -s
endif
endif
ifeq ($(ARCH),i386)
# Note: Cross-building for 'i386' on 'amd64' works after installing
# 'g++-10-multilib' (see comments above).
# 'g++-*-multilib' (see comments above).
ifeq ($(HOST_ARCH),amd64)
CC := g++ -m32 -no-pie
STRIP := -s
Expand Down
2 changes: 1 addition & 1 deletion brownies/avr/Family.mk
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This file is part of the Home2L project.
#
# (C) 2015-2021 Gundolf Kiefer
# (C) 2015-2024 Gundolf Kiefer
#
# Home2L is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion brownies/avr/configure.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* This file is part of the Home2L project.
*
* (C) 2015-2021 Gundolf Kiefer
* (C) 2015-2024 Gundolf Kiefer
*
* Home2L is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down
12 changes: 6 additions & 6 deletions brownies/avr/twi.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* This file is part of the Home2L project.
*
* (C) 2015-2021 Gundolf Kiefer
* (C) 2015-2024 Gundolf Kiefer
*
* Home2L is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -71,7 +71,7 @@
*
* For handling slave communication, two actors (logical threads/processes) have to be distinguished:
*
* a) ISR - The slave ISR in interaction with 'TwiSlIterate()', the functionality implemented in this module.
* a) ISR - The slave ISR in interaction with 'TwiSlIterate()', the functionality implemented in this module.
* b) APP - The (application) routines that generate replies on requests. These may be the
* application, the hub (below) or the error handler in 'TwiSlIterate()'.
*
Expand Down Expand Up @@ -659,7 +659,7 @@ EBrStatus TwiSlIterate () {

case slsSendingStall:
// Master is waiting for a reply, but none has been prepared yet.
// If the message received so far with error, we prepare the reply here.
// If the message received so far has an error, we prepare the reply here.
// If the message is OK or for a child (hub), the main program must prepare the reply.

// Handle completed requests, reply to faulty requests to the own host ...
Expand Down Expand Up @@ -1067,8 +1067,8 @@ void TwiHubIterate () {
hubState = hsIdle;
}
// Fall through to 'hsIdle' handling ...
// This is important to handle the master bus locking situations that in this
// we caused ourselves.
// This is important to handle the master bus locking situations that in
// this case we caused ourselves.
case hsIdle:

// Check for resurrection request ...
Expand Down Expand Up @@ -1153,7 +1153,7 @@ void TwiHubIterate () {
}
}
else {
if (slReqStatus != brIncomplete) { // request comlete and completely forwarded?
if (slReqStatus != brIncomplete) { // request complete and completely forwarded?
TwiMaSendStop ();
hubState = hsIdle;
}
Expand Down
Loading

0 comments on commit eebcfb7

Please sign in to comment.