jshank / bwalink

Automate your Balboa Spa! A docker container with socat and ccutrer/balboa_worldwide_app that supports a remote serial to IP device or host running ser2net, socat or ESPEasy serial server
30 stars 6 forks source link

Question re bwalink linux/arm64/u8? #3

Closed jamienich closed 2 weeks ago

jamienich commented 2 years ago

Hi @jshank thank you for putting together bwalink. It appears the bwalink supports linux/amd64, I expected it would operate on the Raspberry Pi?

Context: BWALink Docker Setup

Notes: On a Raspberry Pi with Home Assistant Operating System, I am currently trying to execute the following command (my variables are specific to my implementation): _"docker run --rm ghcr.io/jshank/bwalink:latest -e MQTT_URI='your_mqtt_uri' -e BRIDGE_IP='your_ew11ip'"

The command fails with the following: "image's platform (linux/amd64) does not match the detected host platform (linux/arm64/u8) and no specific platform was requested."

So I tried specifying the platform using the command line switch "--platform linux/arm64/u8" and the command fails with the following: "image's platform (linux/amd64) does not match the detected host platform (linux/arm64/u8) and no specific platform was requested."

Is it possible to recompile the docker or do I need to operate it on a linux server/desktop architecture? I'm not sure where the docker sauce is, or how to recompile it, but I'll take a look around.

jshank commented 2 years ago

Thanks for opening the issue @jamienich. Can you run uname -m and dpkg --print-architecture and report back here? The Dockerfile is based on ruby:2.6-alpine which shows arm64v8 as a supported architecture. I notice yours is arm64/u8, maybe a language difference?

You could try to add --platform linux/arm/v8 but I'm not sure if that will help.

jamienich commented 2 years ago

Hi @jshank

Re the architecture (arm64v8 vs arm64/u8), I expect they are they same. See requested output below:

#uname -m
aarrch64
#dpkg --print-architecture
/bin/ash : dkpg : not found

The error does not mention the package ruby:s2.6-apline, it mentions the platform. I understand Ruby is a dependency but I assume, it would first need to ensure it can operate on the operating system "Home Assistant Operating System".

My Home Assistant Operating System uses Linux 5.4 and is operating on a Raspberry Pi 4, I don't have it hosted within Ubuntu; but I'm starting to think I should have. Note the error says "image's platform" and in docker-publish.yml it has a job to build and run on ubuntu-latest

jobs:
  build:
    runs-on: ubuntu-latest

Home Assistant isn't ubuntu-latest, if I was Docker I wouldn't like that too much. I think maybe updating the docker-publish to be similar to what the hassio-addons support may just fix it. But I'm not sure, I'll take a look at the hassio-addons and see how different they are.

https://github.com/hassio-addons

I haven't worked with Docker before so I'm a bit green on what to put where, but I may try this later on.

jshank commented 2 years ago

Don't worry about the docker-publish.yml file, that's the internal github system for creating a new docker image when the code gets updated and has nothing to do with your operating system.

The root cause of the issue is that the base image I am using for the docker container doesn't support the Home Assistant OS architecture of aarch64. See https://hub.docker.com/_/ruby

Supported architectures: amd64, arm32v5, arm32v6, arm32v7, arm64v8, i386, mips64le, ppc64le, s390x

Docker should run the full environment you need without you needing to install any of the dependencies (OS and Ruby) but the base image I choose does appear to have some architecture limitations. I'm happy to take suggestions on a better base image for the container that would expand support for Home Assistant OS.

jshank commented 2 years ago

I just updated the base image to ruby3 which may include some architecture improvements. Give it a try and see if it works any better. I don't have an RPi 4 or Home Assistant OS environment to test it against.

jamienich commented 2 years ago

I just updated the base image to ruby3 which may include some architecture improvements. Give it a try and see if it works any better. I don't have an RPi 4 or Home Assistant OS environment to test it against.

Awesome will do.

jamienich commented 2 years ago

I just updated the base image to ruby3 which may include some architecture improvements. Give it a try and see if it works any better. I don't have an RPi 4 or Home Assistant OS environment to test it against.

Same error unfortunately.

blundell commented 1 year ago

@jamienich did you find a work around in the end?

I was contemplating installing this also on my RPi running Home Assistant OS, but looks like now I should run a separate machine

jamienich commented 1 year ago

I believe my sister used GPT 4 to get everything working, she will respond if she has time.

On Mon, May 22, 2023 at 5:19 AM Paul Blundell @.***> wrote:

@jamienich https://github.com/jamienich did you find a work around in the end?

I was contemplating installing this also on my RPi running Home Assistant OS, but looks like now I should run a separate machine

— Reply to this email directly, view it on GitHub https://github.com/jshank/bwalink/issues/3#issuecomment-1556266478, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAY365ZMCPU3HSPULAHYU3LXHJTC3ANCNFSM5KZNKHUA . You are receiving this because you were mentioned.Message ID: @.***>

jamienich commented 1 year ago

She rewrote everything and made everything work on the Pi.

On Thu, May 25, 2023 at 12:45 PM Jamie Nicholson @.***> wrote:

I believe my sister used GPT 4 to get everything working, she will respond if she has time.

On Mon, May 22, 2023 at 5:19 AM Paul Blundell @.***> wrote:

@jamienich https://github.com/jamienich did you find a work around in the end?

I was contemplating installing this also on my RPi running Home Assistant OS, but looks like now I should run a separate machine

— Reply to this email directly, view it on GitHub https://github.com/jshank/bwalink/issues/3#issuecomment-1556266478, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAY365ZMCPU3HSPULAHYU3LXHJTC3ANCNFSM5KZNKHUA . You are receiving this because you were mentioned.Message ID: @.***>

mel9320107 commented 1 year ago

Jamienich's sister here - I just wrote a python integration that sends a few serial commands directly and decodes the status message. It's barebones and was a bit of an experiment to see if I could start coding in python with ChatGPT. It took a few days, but managed to get something that works. It sometimes falls off the network and doesn't restart itself, so next job will be to figure out the code for that. I haven't uploaded it to GitHub.

blundell commented 1 year ago

Nice! :-) you should totally put it on GitHub

mel9320107 commented 1 year ago

https://github.com/mel9320107/spa_pool

Here's the code blundell.

ianthepez commented 1 year ago

Same issue here, but wanted to clarify that this impacts Raspian, not just installs with Home Assistant OS. I have Home Assistant on one raspberry pi and everything else on a separate raspberry pi that I was hoping to run this on. I don't have any suggestions, but here is the info requested above in case it helps.

uname -m aarch64 dpkg --print-architecture armhf

Edit: I updated the machine to 64 bit, so at least the architecture is arm64 now. That would need arm64/v8, which appears to be supported by ruby 3, but still does not install.

njhcarroll commented 12 months ago

Hi @jshank Your solution looks exactly what I was looking for.
I have one hiccup in trying to install it on a RPI Zero 2. I get a message saying image with reference ghcr.io/jshank/bwalink:latest was found but does not match the specified platform: wanted linux/arm/v7, actual: linux/amd64. Clearly it is the same problem as the others have above. Can you tell me what machine you are running your setup on? It might be simpler to match that rather than trying to get my PI to work. Thanks

jshank commented 12 months ago

Hey @njhcarroll - I'm running this on Ubuntu 22.04.03, x86_64 amd64 (Intel Xeon CPU). I think it's the alpine base that may have the limitation. Did you look at the rpi fork at https://github.com/mel9320107/spa_pool?

jdvorecky commented 7 months ago

Hi Jshank is there no further update to this project to be compatible with the aarch64 architecture? i would really like to use this addon through HA, but when i try to install it i just get an error : unknown error see supervisor :(

any ideas how else i could make your addon work??? please help me if you can. thanks

Version | core-2023.12.1

Installation Type | Home Assistant OS Development | false Supervisor | true Docker | true User | root Virtual Environment | false Python Version | 3.11.6 Operating System Family | Linux Operating System Version | 6.1.21-v8 CPU Architecture | aarch64

njhcarroll commented 7 months ago

hi @jdvorecky I solved my problem by setting up a VM using VirtualBox with the HASS operating system (running on a mac that is always on). BWAlink installed perfectly in this environment. My only other challenge was to get a very strong wifi signal as I found that the EW11 kept dropping its connection for a period which upset BWAlink. With a signal upped from rssi 48 to now running at rssi of 80, all works pretty reliably.

jdvorecky commented 7 months ago

hi njhcarroll, thanks for the suggestion, but i would like to keep the HA on my RPI as it is now, so im not sure if addon is workable or not. im also trying the addon from https://github.com/supersebbo/bwa-mqtt-bridge-addon and got to the installation point where it fails. so im not sure if i'll ever get a working solution for my balboa BP spa :( if anyone is able to help me i would be even willing to pay :) . im not really code savy person so i need a bit of handholding during the initial set up. thanks to anyone who can help. jd

mel9320107 commented 7 months ago

@jdvorecky

https://github.com/mel9320107/spa_pool

The code above works on my raspberry pi as a stand alone control for a balboa spa with the Elfin wifi adapter. I wrote some detailed instructions on how to install so hopefully it's clear, but happy to help if it's not. I'm a beginner too so it's not the most elegant implementation and just controls temperature, time and I think Ready to Rest. It also creates a sensor with all the attributes so you can use those to automate tasks.

jdvorecky commented 7 months ago

Hi mel, thanks for that, i have looked at it, but had some difficulties getting it going. im giving a try the bwalink with the help of a friend so we'll see if we get that going. if not, i'll give you a ring :) thanks for the offer to help.

njhcarroll commented 6 months ago

Hi @jdvorecky - In case you are still having a problem with RPI. I may have a work around - certainly has worked for me. I created a virtual machine using virtual box with a linux based 64 bit system and loaded HASS onto that. Installing BWA link worked perfectly in that environment. Today, I bought a RPI 5 and migrated a backup of my entire system from the VM to the RPI. Worked flawlessly (just had to restart it a couple of times and BWALINK appeared and works! You may be able to install bwalink onto a RPI 5 directly but if you are having problems - this route worked for me. Of course you need to upgrade the PI to version 5 ;)

jdvorecky commented 6 months ago

Hi NJ, thanks for the info. actually i had my friend look at the code, he rewrote something and it started working. :) so all functional and working with homeassistant. Finally can manage the temperature based on Solar power production. Thanks for your suggestions though.

DennisJohnsen commented 4 months ago

Hello

I feel so bummed out. I just installed the module, and hooked it up and everything is great so far.

But then i went to install the docker image on my Raspberry Pi which already has docker with various other stuff running, and i'm running into this: WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm/v8) and no specific platform was requested

I am planning to update my Pi to run 64bit version of Raspberry Pi OS but i doubt this would be enough for this software, as its not an amd64 cpu.

Im not sure what to do from this point on. I just need MQTT as i don't want to run HA, and do things manually in NodeRed instead.

I did try and add --platform linux/arm/v8 to my docker command, but no dice: docker: image with reference ghcr.io/jshank/bwalink:latest was found but does not match the specified platform: wanted linux/arm/v8, actual: linux/amd64.

jshank commented 4 months ago

Hey all. My understanding is that https://github.com/mel9320107/spa_pool solves this issue (running the image on RPi). The base image is ruby:3-alpine. I found another project similarly impacted and their fix was to change the image to use FROM ruby:2-alpine. Unfortunately I don't have an RPi to test this on.

mel9320107 commented 4 months ago

My little spa_pool plugin is nowhere near as sophisticated. It just allows me to monitor the status message every 30 seconds and change temperature. I wrote it when ChatGPT came out because I don't have a lot of coding experience.

jshank commented 4 months ago

@mel9320107 don't sell yourself short, every contribution helps! I can't claim any credit other than putting together a docker container around Cody's amazing work and doing a quick write-up of my installation.

DennisJohnsen commented 4 months ago

Hey all. My understanding is that https://github.com/mel9320107/spa_pool solves this issue (running the image on RPi). The base image is ruby:3-alpine. I found another project similarly impacted and their fix was to change the image to use FROM ruby:2-alpine. Unfortunately I don't have an RPi to test this on.

My little spa_pool plugin is nowhere near as sophisticated. It just allows me to monitor the status message every 30 seconds and change temperature. I wrote it when ChatGPT came out because I don't have a lot of coding experience.

Sounds great, i will give that a look. But from what i see it's a HA only thing? The thing i liked about your repo here @jshank, is that it comes with pure MQTT, which is what i need since i dont use HA. Maybe @mel9320107 can answer that?

jshank commented 4 months ago

@DennisJohnsen those changes were for my repo. If you clone the repo and change the Dockerfile FROM line to use ruby:2 instead of ruby:3, the rebuild the docker container, it could allow you to run this on RPi architecture. I don't remember if BWA specifically needed ruby 3 and don't have a Pi to test on.

DennisJohnsen commented 4 months ago

@jshank I think i see the points of the above discussions now form this comment. Sorry for not responding earlier, but life had gotten in the way :)

I am not very familiar with Docker outside of consuming images, but this makes sense and should be able to try it. Will report back here later. I suppose i will be able to host the docker image on github too. Time will tell, or i can get Co pilot to help me :)

mel9320107 commented 4 months ago

Hey all. My understanding is that https://github.com/mel9320107/spa_pool solves this issue (running the image on RPi). The base image is ruby:3-alpine. I found another project similarly impacted and their fix was to change the image to use FROM ruby:2-alpine. Unfortunately I don't have an RPi to test this on.

My little spa_pool plugin is nowhere near as sophisticated. It just allows me to monitor the status message every 30 seconds and change temperature. I wrote it when ChatGPT came out because I don't have a lot of coding experience.

Sounds great, i will give that a look. But from what i see it's a HA only thing? The thing i liked about your repo here @jshank, is that it comes with pure MQTT, which is what i need since i dont use HA. Maybe @mel9320107 can answer that?

Yes, mine is only for HA and has no MQTT functionality.

mel9320107 commented 4 months ago

@mel9320107 don't sell yourself short, every contribution helps! I can't claim any credit other than putting together a docker container around Cody's amazing work and doing a quick write-up of my installation.

Thanks! There's a couple of things I'm not happy about (mainly that it just creates one sensor with lots of attributes instead of multiple entities and takes 30s to refresh), but I did write it from scratch so feel like I accomplished something for my first coding project. It does the job though, providing a handle for me to write automations in HA to heat the spa when the sun is shining ;-)

DennisJohnsen commented 2 weeks ago

With some help from ChatGPT, i got docker to build me a 32bit arm image i could run on my Raspberry PI.

https://github.com/DennisJohnsen/spa-link

I bascially just forked and changed the dockerfile, only difference. Everything works now, and i can happily add the MQTT to anything i want, and in this case i added it to Homekit via Homebridge MQTTthing.

Thanks for the great work, and thanks for guiding me to how to make this work for my setup.

jshank commented 2 weeks ago

Great to head @DennisJohnsen and nice work! @jamienich take a look and see if this helps.