fl4p / batmon-ha

Add-on for Home Assistant to connect JK, JBD, Daly, ANT, SOK and Supervolt BMS via Bluetooth
MIT License
292 stars 55 forks source link

Error install addon from HomeAssistant (addon/2af0a32d_batmon) #175

Closed klugev303 closed 9 months ago

klugev303 commented 9 months ago

I have this error: The command '/bin/ash -o pipefail -c pip3 install -r requirements.txt' returned a non-zero code: 1

error

silviutu commented 9 months ago

@ batmon idem!

jim-bruna commented 9 months ago

I have the same error on my rasberry pi 3b

jmmitchell81 commented 9 months ago

I have the same error pi3b+

fl4p commented 9 months ago

can you please install Raspberry PI OS and follows this guide: https://github.com/fl4p/batmon-ha/blob/master/doc/Standalone.md does it work?

silviutu commented 9 months ago

can you please install Raspberry PI OS and follows this guide: https://github.com/fl4p/batmon-ha/blob/master/doc/Standalone.md does it work?

I have to buy another Raspberry. we need a more detailed guide, I'm not a software programmer. thank.

fl4p commented 9 months ago

you don’t need to write code, just use the linux console (many tutorials exist on the internet):

git clone https://github.com/fl4p/batmon-ha
cd batmon-ha
pip3 install -r requirements.txt
silviutu commented 9 months ago

you don’t need to write code, just use the linux console (many tutorials exist on the internet):

git clone https://github.com/fl4p/batmon-ha
cd batmon-ha
pip3 install -r requirements.txt

batmon install error three hours to get nothing.

jmmitchell81 commented 9 months ago

Any further update on this?

jmmitchell81 commented 9 months ago

I have now tried on a RPi4-4Gb and get the same error. Something isn’t right

k2dp2k commented 9 months ago

Same here.... The command '/bin/ash -o pipefail -c pip3 install -r requirements.txt' returned a non-zero code: 1 Rpi4 Hassio OS

Kodibuild commented 9 months ago

Something happened yesterday after working fine for months. It would not start so I tried the rebuild button. After that it would not start stating that it was missing an image. Then uninstall and reinstall would give me the missing requirements error. So I restored an old (same version) copy and hit start. Nothing happens (the start button stays and the integration icon stays greyed out). BUT... I am getting results fed to mqtt despite it showing as not started. As someone else said - "something isn't right".

I've been updating hassio with every update but this seemed to start right after I cleared the cache recently.

k2dp2k commented 9 months ago

Yeah but what ? is has to be a change on hassio side, because the code of this addon has not changed since two weeks...

Newspaperman57 commented 9 months ago

Hi, just to weigh in, i'm getting this error on a x86 haos installation too

webbbn commented 9 months ago

This is due to a change in the base image that prevents installation of pip packages in the system directories. The easiest fix is likely to use a virtual environment.

webbbn commented 9 months ago

This patch fixes it for me:

diff --git a/Dockerfile b/Dockerfile
index c6e9f14..b2676c4 100755
--- a/Dockerfile
+++ b/Dockerfile
@@ -24,7 +24,9 @@ RUN apk add git
 #COPY requirements.txt requirements.txt
 COPY . .

-RUN pip3 install -r requirements.txt
+RUN python3 -m venv venv && \
+    . ./venv/bin/activate && \
+    python -m pip install -r requirements.txt
 RUN chmod a+x addon_main.sh

 CMD [ "./addon_main.sh" ]
diff --git a/addon_main.sh b/addon_main.sh
index 5a3eb10..0a15320 100755
--- a/addon_main.sh
+++ b/addon_main.sh
@@ -1,6 +1,8 @@
 #!/usr/bin/with-contenv bashio

-python3 install_bleak.py
+. /app/venv/bin/activate
+
+python install_bleak.py

 MQTT_HOST=$(bashio::services mqtt "host")
jmmitchell81 commented 9 months ago

Thanks for the update. Would you be able to expand on how to implement this and install on home assistant running in a Pi3b+

k2dp2k commented 9 months ago

addons.zip unzip the folder which is inside the zip file into your addons folder, after that go to addons -> addons store klick update (top right corner, eventually you need to reload the page), there will be a local addon which you can install

or download the project of @webbbn https://github.com/webbbn/batmon-ha as a zip file and do the steps mentioned above....

jmmitchell81 commented 9 months ago

IMG_0073 I can seem to find the addons folder.

k2dp2k commented 9 months ago

IMG_0073 I can seem to find the addons folder.

you have to go one folder level back at the moment yoou are inside the homeassistant folder...

Bildschirmfoto 2023-12-14 um 08 57 23
Newspaperman57 commented 9 months ago

@webbbn This fixed it for me too. Consider opening a pull-request with the change, to get this into the official repository ASAP :)

jmmitchell81 commented 9 months ago

@k2dp2k I’m up and running. Thanks for all your help. Much appreciated.

k2dp2k commented 9 months ago

@k2dp2k I’m up and running. Thanks for all your help. Much appreciated.

no, we have to thank @webbbn for his fix ;-)

jmmitchell81 commented 9 months ago

Thanks @webbbn

webbbn commented 9 months ago

I'm glad you all got it working. I tried get all the repos setup to allow temporarily installing from my repo, but it was too late and my brain started shutting down. :-)

If @fl4p doesn't have already have it fixed this evening I'll submit a pull request.

webbbn commented 9 months ago

I got the repos sorted out, so for now you should be able to use this repository: https://github.com/webbbn/home-assistant-addons.git

Just don't forget to switch back to this repo.

fl4p commented 9 months ago

thanks everyone @silviutu @webbbn grateful for PR

webbbn commented 9 months ago

PR created: https://github.com/fl4p/batmon-ha/pull/177

bbeijl commented 9 months ago

image

Temperatures from my jk bms are unavailable, since version 1.75?