bwalink icon indicating copy to clipboard operation
bwalink copied to clipboard

Question re bwalink linux/arm64/u8?

Open jamienich opened this issue 3 years ago • 31 comments

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_ew11_ip'"

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.

jamienich avatar Dec 26 '21 23:12 jamienich

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.

jshank avatar Dec 28 '21 19:12 jshank

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.

jamienich avatar Dec 28 '21 19:12 jamienich

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 avatar Dec 28 '21 21:12 jshank

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.

jshank avatar Dec 28 '21 21:12 jshank

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 avatar Dec 28 '21 22:12 jamienich

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.

jamienich avatar Dec 28 '21 22:12 jamienich

@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

blundell avatar May 21 '23 19:05 blundell

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 avatar May 25 '23 02:05 jamienich

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: @.***>

jamienich avatar May 25 '23 02:05 jamienich

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.

mel9320107 avatar May 25 '23 03:05 mel9320107

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

blundell avatar Jun 01 '23 12:06 blundell

https://github.com/mel9320107/spa_pool

Here's the code blundell.

mel9320107 avatar Jun 03 '23 07:06 mel9320107

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.

ianthepez avatar Jun 07 '23 22:06 ianthepez

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

njhcarroll avatar Aug 21 '23 18:08 njhcarroll

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?

jshank avatar Aug 21 '23 22:08 jshank

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

jdvorecky avatar Jan 09 '24 18:01 jdvorecky

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.

njhcarroll avatar Jan 09 '24 23:01 njhcarroll

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

jdvorecky avatar Jan 10 '24 07:01 jdvorecky

@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.

mel9320107 avatar Jan 10 '24 11:01 mel9320107

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.

jdvorecky avatar Jan 10 '24 13:01 jdvorecky

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 ;)

njhcarroll avatar Feb 02 '24 18:02 njhcarroll

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.

jdvorecky avatar Feb 05 '24 07:02 jdvorecky

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.

DennisJohnsen avatar Mar 21 '24 12:03 DennisJohnsen

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.

jshank avatar Mar 21 '24 15:03 jshank

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.

mel9320107 avatar Mar 21 '24 20:03 mel9320107

@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.

jshank avatar Mar 22 '24 00:03 jshank

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?

DennisJohnsen avatar Mar 22 '24 01:03 DennisJohnsen

@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.

jshank avatar Mar 22 '24 14:03 jshank

@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 :)

DennisJohnsen avatar Apr 04 '24 00:04 DennisJohnsen

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 avatar Apr 04 '24 03:04 mel9320107