Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ env:

jobs:
build:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
permissions:
packages: write
name: Builds the source distribution package
Expand All @@ -25,10 +25,13 @@ jobs:
- name: Setup python environment
uses: actions/setup-python@v4
with:
python-version: '3.11'
python-version: '3.13'

- name: Install packages
run: sudo apt install -y libsystemd-dev

- name: Install setuptools
run: pip3 install setuptools --upgrade

- name: Clean
run: python setup.py clean --all
Expand All @@ -50,7 +53,7 @@ jobs:
if-no-files-found: error

docker:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
name: Builds the docker image(s)
steps:
- name: Checkout
Expand Down
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# Changelog

## Server Version 4.7.1 (06.01.25):

### Maintenance:
- Update required packages to latest versions.
- Add optional resolution parameter to cli.py for chromium setup

### Fixes:
- Fix startup behavior with respect to mosquitto and influxdb.
- Fix to install libsystemd-dev under github docker workflow (use ubuntu-22.04 instead of ubuntu-latest)
- Adapt onewire setup -> change /boot/firmware/config.txt instead of /boot/config.txt


## Server Version 4.7.0 (23.11.25):
### Codename: Winter Bock

Expand Down
2 changes: 1 addition & 1 deletion cbpi/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
__version__ = "4.7.0"
__version__ = "4.7.1"
__codename__ = "Winter Bock"
30 changes: 21 additions & 9 deletions cbpi/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,22 +51,23 @@ def start(self):

def setup_one_wire(self):
print("Setting up 1Wire")
with open("/boot/config.txt", "r") as f:
with open("/boot/firmware/config.txt", "r") as f:
lines = f.readlines()
lines.append("dtoverlay=w1-gpio,gpiopin=4,pullup=on")
if "dtoverlay=w1-gpio,gpiopin=4,pullup=on\n" not in lines:
lines.append("dtoverlay=w1-gpio,gpiopin=4,pullup=on\n")

configtempfile = os.path.join(self.config.get_file_path(""), "config.txt")

with open(configtempfile, "w") as f:
for line in lines:
f.write(line)
destfile = "/boot/config.txt"
destfile = "/boot/firmware/config.txt"

# copy and remove afterwards as mv will work, but raise an error message due to different file owners
shutil.os.system('sudo cp "{}" "{}"'.format(configtempfile, destfile))
shutil.os.system('rm -rf "{}"'.format(configtempfile))

print("/boot/config.txt created")
print("/boot/firmware/config.txt created")

def list_one_wire(self):
print("List 1Wire")
Expand Down Expand Up @@ -291,7 +292,7 @@ def autostart(self, name):
return
return

def chromium(self, name):
def chromium(self, name, width=None, height=None):
try:
version = int(distro.version())
except:
Expand Down Expand Up @@ -389,11 +390,15 @@ def chromium(self, name):
pass
elif name == "on":
print("Add chromium to labwc autostart")
if width is not None and height is not None:
command='chromium = /usr/bin/chromium --start-maximized --start-fullscreen --window-size={},{} --password-store=basic --app=http://localhost:8000'.format(width, height)
else:
command='chromium = /usr/bin/chromium --start-maximized --start-fullscreen --password-store=basic --app=http://localhost:8000'
try:
if os.path.exists(file) is False:
pathlib.Path(file).mkdir(parents=True, exist_ok=True)
with open(file, "a") as f:
f.write('chromium = /usr/bin/chromium --start-fullscreen --start-maximized --password-store=basic --app=http://localhost:8000')
f.write(command)
print("Added chromium to labwc autostart")
print(
"CraftBeerPi Chromium Autostart is {}ON{}".format(
Expand All @@ -418,7 +423,7 @@ def chromium(self, name):
return
else:
with open(file, "a") as f:
f.write('chromium = /usr/bin/chromium --start-fullscreen --start-maximized --password-store=basic --app=http://localhost:8000')
f.write(command)
print("Added chromium to labwc autostart")
print(
"CraftBeerPi Chromium Autostart is {}ON{}".format(
Expand Down Expand Up @@ -604,10 +609,17 @@ def autostart(context, name):
@main.command()
@click.pass_context
@click.argument("name")
def chromium(context, name):
@click.option("--resolution", nargs=2, type=int, help="Optional for on:Set the chromium resolution for fullscreen mode (width height)")
def chromium(context, name, resolution):
"""(on|off|status) Enable or disable Kiosk mode"""
operationsystem = sys.platform
if not operationsystem.startswith("win"):
context.obj.chromium(name)
if resolution is not None and name == "on":
width = resolution[0]
height = resolution[1]
print("Set screen resolution to {}x{}".format(width, height))
context.obj.chromium(name, width, height)
else:
context.obj.chromium(name)
else:
print("Chromium option NOT available under Windows")
2 changes: 2 additions & 0 deletions cbpi/config/craftbeerpi.template
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
[Unit]
Description=Craftbeer Pi
After=mosquitto.service influxdb.service

[Service]
WorkingDirectory=/home/{{ user }}
ExecStartPre=/bin/sleep 5
ExecStart={{ path }} start
KillSignal=SIGKILL
TimeoutStopSec=15
Expand Down
2 changes: 1 addition & 1 deletion cbpi/controller/satellite_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def remove_key(self, d, key):
return r

async def init(self):

self.client = aiomqtt.Client(
self.host,
port=self.port,
Expand Down
6 changes: 3 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
typing-extensions>=4
aiohttp==3.13.2
aiohttp==3.13.3
aiohttp-auth==0.1.1
aiohttp-route-decorator==0.1.4
aiohttp-security==0.5.0
aiohttp-session==2.12.1
aiohttp-swagger==1.0.16
#async-timeout==4.0.3
aiojobs==1.4.0
aiosqlite==0.21.0
aiosqlite==0.22.1
cryptography==46.0.3
pyopenssl==25.3.0
requests==2.32.5
Expand All @@ -20,7 +20,7 @@ numpy==2.3.5
cbpi4gui
click==8.3.1
importlib_metadata
aiomqtt==2.4.0
aiomqtt==2.5.0
psutil==7.1.3
zipp>=0.5
distro>=1.8.0
Expand Down
6 changes: 3 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,14 @@
long_description_content_type='text/markdown',
install_requires=[
"typing-extensions>=4",
"aiohttp==3.13.2",
"aiohttp==3.13.3",
"aiohttp-auth==0.1.1",
"aiohttp-route-decorator==0.1.4",
"aiohttp-security==0.5.0",
"aiohttp-session==2.12.1",
"aiohttp-swagger==1.0.16",
"aiojobs==1.4.0 ",
"aiosqlite==0.21.0",
"aiosqlite==0.22.1",
"cryptography==46.0.3",
"pyopenssl==25.3.0",
"requests==2.32.5",
Expand All @@ -74,7 +74,7 @@
'click==8.3.1',
'shortuuid==1.0.13',
'tabulate==0.9.0',
'aiomqtt==2.4.0',
'aiomqtt==2.5.0',
'inquirer==3.4.1',
'colorama==0.4.6',
'psutil==7.1.3',
Expand Down