Closed WarrenFoxley closed 11 months ago
I think the offending line is /hass-addon-sunsynk-multi/Dockerfile#L22C1-L22C1.
But I am no Docker compose guru. so not sure why or how. 😞
I've changed the build, but have not really taken the standalone docker builds into account yet.
In the official build, I do the following:
mkdir -p hass-addon-sunsynk-multi/sunsynk
cp -r src hass-addon-sunsynk-multi/sunsynk/
cp setup.* README.md hass-addon-sunsynk-multi/sunsynk/
So your options are:
# COPY sunsynk sunsynk
pip install sunsynk[umodbus,pymodbus,solarman]==0.5.9
Thanks @kellerza !
Tried out your option 1 (use already built image). But the container is failing to start. It seems it cannot find the linked .local.yaml
file when starting up. I have linked this file to the options.yaml
on the host pi as per the docker-compose file. 🤔
I pulled the pre-built image down and started a container from it with the volume settings lifted from the docker-compose file. This was all done in Portainer.
Full log:
s6-rc: info: service s6rc-oneshot-runner: starting
s6-rc: info: service s6rc-oneshot-runner successfully started
s6-rc: info: service fix-attrs: starting
s6-rc: info: service fix-attrs successfully started
s6-rc: info: service legacy-cont-init: starting
s6-rc: info: service legacy-cont-init successfully started
s6-rc: info: service legacy-services: starting
services-up: info: copying legacy longrun sunsynk (no readiness notification)
s6-rc: info: service legacy-services successfully started
19:36:26 INFO Local test mode
Traceback (most recent call last):
File "<frozen runpy>", line 198, in _run_module_as_main
File "<frozen runpy>", line 88, in _run_code
File "/usr/local/lib/python3.11/site-packages/ha_addon_sunsynk_multi/__main__.py", line 72, in <module>
main()
File "/usr/local/lib/python3.11/site-packages/ha_addon_sunsynk_multi/__main__.py", line 59, in main
init_options()
File "/usr/local/lib/python3.11/site-packages/ha_addon_sunsynk_multi/options.py", line 87, in init_options
localf = Path(".local.yaml").resolve(True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/pathlib.py", line 993, in resolve
s = os.path.realpath(self, strict=strict)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<frozen posixpath>", line 416, in realpath
File "<frozen posixpath>", line 451, in _joinrealpath
FileNotFoundError: [Errno 2] No such file or directory: '.local.yaml'
[19:36:26] WARNING: Halt add-on with exit code 1
s6-rc: info: service legacy-services: stopping
s6-rc: info: service legacy-services successfully stopped
s6-rc: info: service legacy-cont-init: stopping
s6-rc: info: service legacy-cont-init successfully stopped
s6-rc: info: service fix-attrs: stopping
s6-rc: info: service fix-attrs successfully stopped
s6-rc: info: service s6rc-oneshot-runner: stopping
s6-rc: info: service s6rc-oneshot-runner successfully stopped
Any pointers on where I am going wrong? 😅
The working dir must be different in the new build, since it does not use /src/app.
Can you try the edge
tag on the container and then bind it to /data/options.yaml
?
https://github.com/kellerza/sunsynk/commit/4978907fa1ee0bfd68ec1dcbe3e1fcf905fbbbc6
Good morning!
I gave that a bash this morning and still got the same errors as in my previous post... looking at your changes, maybe the image was built with the wrong code version? Because I see no more references to ".local.yaml" in the code but yet it still complained about that file. and I saw no new log printout that read "No configuration file found" when starting the container.
Ok, so the latest edge
or d49b09e
contains these changes.
Hey! That did it! Yay!
Thank you so much for your efforts! I appreciate it a ton!
Great, you found a bug in the build as well 😉
If you can update the compose docs page I'd appreciate it!
Each page has a link to where you can fork/edit/create the PR... you should be able to modify a single page directly from the browser. Tbh, It might even make sense to inclue the entire dcoker-compose.yaml example on the docs page rather than in the repo as it is today. It's a fairly short file.
Ye - sure. I'll take a look tonight and I'll get a PR up.
The current standalone deployment is still broken.
I just reinstalled my setup on a Raspberry Pi 3, with the original standalone deployment docs are written for a Raspberry Pi 1.
The steps I had to follow are:
https://docs.docker.com/engine/install/debian/ https://docs.docker.com/engine/install/linux-postinstall/ https://docs.docker.com/config/containers/logging/json-file/
sudo apt install git
git clone https://github.com/kellerza/sunsynk.git
cd sunsynk/
uname -m
- aarch64
on pi3
In docker-compose.yaml replace build with image, according to your architecture (aarch64
for pi3):
image: ghcr.io/kellerza/hass-addon-sunsynk-multi/aarch64:stable
# build:
# context: hass-addon-sunsynk-multi
# dockerfile: Dockerfile
# args:
# BUILD_FROM: ${BUILD_FROM}
Update options path:
volumes:
- ${PWD}/options.yaml:/data/options.yaml
Prefix with correct HA base image for architecture (aarch64
for pi3)
BUILD_FROM=homeassistant/aarch64-base-python:3.11-alpine3.18 docker compose build
nano options.yaml
# or copy template and modify
sudo nano /etc/udev/rules.d/10-usb-serial.rules
and add
SUBSYSTEM=="tty", ATTRS{idProduct}=="6015", ATTRS{idVendor}=="0403", SYMLINK+="ttyRS232"
SUBSYSTEM=="tty", ATTRS{idProduct}=="6001", ATTRS{idVendor}=="0403", SYMLINK+="ttyRS485"
docker compose up mbusd
# ctrl-c to stop
docker compose up sunsynk-multi
# ctrl-c to stop
docker compose up -d
@kellerza can you assist with this last point? I'm not sure what changes you made recently that broke the Dockerfile.
Issue related to
Docker Standalone Sunsynk / mbusd Home Assistant Add-On
Describe the issue/bug
When following the instructions here to get the Sunsynk Addon running in a stand-alone docker I get the following:
When running
BUILD_FROM=ghcr.io/home-assistant/armv7-base docker compose build sunsynk-multi
I get the following error:
Expected behavior I was expecting the docker image to be built successfully.
Your environment
2bab67a09
)You configuration
options.yaml
:Logs