bitfocus / companion-pi

Bitfocus Companion enables the reasonably priced Elgato Streamdeck to be a professional shotbox surface for an increasing amount of different presentation switchers, video playback software and broadcast equipment.
http://bitfocus.io/companion
MIT License
29 stars 8 forks source link

Problem with instalation #21

Closed gavalierm closed 1 year ago

gavalierm commented 1 year ago

After instalation via install.sh i got:

pi@atemrpi:~ $ sudo companion-update 
Warning: Downgrading to an older version can cause issues with the database not being compatible
You are currently on "Unknown"
? What version do you want?  (Use arrow keys)
  latest stable 
❯ latest beta 
  specific stable 
  specific beta 
  custom-url 
  cancel 

But all options ends same.

Warning: Downgrading to an older version can cause issues with the database not being compatible
You are currently on "Unknown"
? What version do you want?  latest stable
No matching stable build was found!
Skipping update
Update is complete
pi@atemrpi:~ $ 

And companion not working.

What i m doing wrong?

Julusian commented 1 year ago

What does the command dpkg --print-architecture output?

My first suspicion is that the script doesn't recognise the cpu architecture, so is failing to find matching builds. We don't support arm here, only arm64 for SBCs, as well x64/amd64 (intel/amd cpu)

gavalierm commented 1 year ago

"armhf"

it is RPI4

I open https://api.bitfocus.io/v1/product/companion/packages

found the ARM64 gz file and use "custom url option"

Now i got You are currently on "3.1.1+6229-stable-4593dd7f"

gavalierm commented 1 year ago

support arm here, only arm64 for SBCs,

So you are telling me that companion v3 cannot run on RPI4?

Julusian commented 1 year ago

Hmm interesting.. This block of code should have realised you are on armhf and refused to run.. https://github.com/bitfocus/companion-pi/blob/main/install.sh#L4-L9

So you are telling me that companion v3 cannot run on RPI4?

No we do, but you need to use an arm64 image. This is because some of the native libraries we use dont (or didnt at the time) include support for armhf.
And when using armhf, a single process is not able to address more than 4gb of memory, so using an armhf image of a 8gb pi4 means that we may not be able to utilise all the available memory.

Every pi released since the 3B (including the 3B) supports arm64, but its not the default pi image (yet) because it doesnt support the older boards.

gavalierm commented 1 year ago

Sorry but i m lost a bit right now.

I have older instalation of RPI4 8G using oficialn raspbery image.

I was on 2.4.1 installed manually from git.

I try to update from 2.4.1 to 3+ but auto-update fails.

So i decide to run manual instalation like before. And get to the some point (i cant tell if i force something to run.. :P) but still i m not able run companion 3+ on my RPI4 now.

I can start over, but it is worthy?

Or you recommend to download Companion PI img file from website and start from scratch?

On my RPI runs few more services what i need for my church, like atem-node services and so on....

What you recommend to do?

gavalierm commented 1 year ago
  1. when i do install on "old unclear" instalation i got this:


root@atemrpi:~# curl https://raw.githubusercontent.com/bitfocus/companion-pi/main/install.sh | sh
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  2802  100  2802    0     0   8648      0 --:--:-- --:--:-- --:--:--  8621
sh: 5: [[: not found
This will attempt to install Companion as a system service on this device.
It is designed to be run on headless servers, but can be used on desktop machines if you are happy to not have the tray icon.
A user called 'companion' will be created to run the service, and various scripts will be installed to manage the service
adduser: The user `companion' already exists.

i did

root@atemrpi:~# userdel companion

after run instalation again

root@atemrpi:~# curl https://raw.githubusercontent.com/bitfocus/companion-pi/main/install.sh | sh
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  2802  100  2802    0     0  25944      0 --:--:-- --:--:-- --:--:-- 25944
sh: 5: [[: not found
This will attempt to install Companion as a system service on this device.
It is designed to be run on headless servers, but can be used on desktop machines if you are happy to not have the tray icon.
A user called 'companion' will be created to run the service, and various scripts will be installed to manage the service
Adding user `companion' ...
Adding new group `companion' (1001) ...
Adding new user `companion' (1001) with group `companion' ...
The home directory `/home/companion' already exists.  Not copying from `/etc/skel'.
Hit:1 http://raspbian.raspberrypi.org/raspbian bullseye InRelease
Get:2 http://pkg.sonobus.net/apt stable InRelease [5,866 B]
Hit:3 http://archive.raspberrypi.org/debian bullseye InRelease
Err:2 http://pkg.sonobus.net/apt stable InRelease
  The following signatures were invalid: EXPKEYSIG 9879B7CF31743BCF Matthew Evans <1388610+matthewevans@users.noreply.github.com>
Reading package lists... Done
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://pkg.sonobus.net/apt stable InRelease: The following signatures were invalid: EXPKEYSIG 9879B7CF31743BCF Matthew Evans <1388610+matthewevans@users.noreply.github.com>
W: Failed to fetch http://pkg.sonobus.net/apt/dists/stable/InRelease  The following signatures were invalid: EXPKEYSIG 9879B7CF31743BCF Matthew Evans <1388610+matthewevans@users.noreply.github.com>
W: Some index files failed to download. They have been ignored, or old ones used instead.
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
curl is already the newest version (7.74.0-1.3+deb11u9).
git is already the newest version (1:2.30.2-1+deb11u2).
libudev-dev is already the newest version (247.3-7+rpi1+deb11u2).
libusb-1.0-0-dev is already the newest version (2:1.0.24-3).
unzip is already the newest version (6.0-26+deb11u1).
zip is already the newest version (3.0-12).
The following packages were automatically installed and are no longer required:
  libfuse2 libpulsedsp pulseaudio-utils rtkit squashfs-tools
Use 'apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 202 not upgraded.
Checking dependencies for the installation script...
Checking availability of curl... OK!
Checking availability of unzip... OK!
Downloading https://github.com/Schniz/fnm/releases/latest/download/fnm-arm32.zip...
######################################################################## 100.0%
Installing for Bash. Appending the following to /root/.bashrc:

  # fnm
  export PATH="/opt/fnm:$PATH"
  eval "`fnm env`"

In order to apply the changes, open a new terminal or run the following command:

  source /root/.bashrc
Cloning into '/usr/local/src/companionpi'...
remote: Enumerating objects: 313, done.
remote: Counting objects: 100% (151/151), done.
remote: Compressing objects: 100% (90/90), done.
remote: Total 313 (delta 105), reused 72 (delta 58), pack-reused 162
Receiving objects: 100% (313/313), 100.69 KiB | 1.97 MiB/s, done.
Resolving deltas: 100% (166/166), done.
sh: 50: [: beta: unexpected operator
sh: 50: [: beta: unexpected operator
No matching stable build was found!
Skipping update
Adding user companion to group gpio
Adding user companion to group dialout
yarn install v1.22.19
[1/4] Resolving packages...

I have to qoted that i got succes because i manualy install the package into "/opt/companion"

success Already up-to-date.
Done in 0.44s.
Companion is installed!
You can start it with "sudo systemctl start companion" or "sudo companion-update"
Julusian commented 1 year ago

when i do install on "old unclear" instalation i got this:

oh, you ran the script with sh rather than bash. Reading through the full output, it is complaining at syntax errors at various points. That explains why it got further than I expected

gavalierm commented 1 year ago

According to this page:

https://github.com/bitfocus/companion/wiki/Manual-Install-on-Raspberry-Pi

i do curl https://raw.githubusercontent.com/bitfocus/companion-pi/main/install.sh | sh

with bash

root@atemrpi:~# curl https://raw.githubusercontent.com/bitfocus/companion-pi/main/install.sh | bash
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  2802  100  2802    0     0  26186      0 --:--:-- --:--:-- --:--:-- 26186
armhf is not a supported cpu architecture for running Companion.
If you are running on an arm device (such as a Raspberry Pi), make sure to use an arm64 image.
root@atemrpi:~# 
Julusian commented 1 year ago

According to this page:

Oops, fixed there now.

I try to update from 2.4.1 to 3+ but auto-update fails.

Yeah, the deployment process for 3 changed so that you dont it doesnt use git (except for the companion-pi updater), instead downloading builds from the website, which makes updating take seconds rather than minutes.
This is at the cost of not working for anyone who previously manually did the git clone flow


I would recommend either flashing a new official image from slightly further down the page https://www.raspberrypi.com/software/operating-systems/#raspberry-pi-os-64-bit or a companion pi image.
A bonus side effect of this would be getting a newer debian than you have. If you go with the offiical rather than companionpi image you will get even newer as they updated their images yesterday.

The companion pi images are literally just the official arm64 image, with that install script and a couple of other niceties (enablign ssh and changing the hostname)

Unfortunately that would mean redoing those other services.

The only other option I see is to go back to the clone from git flow and hope that the dependencies do exist, but I have no clue if that will work or if it will fail after spending 10+ minutes trying to install everything.

The simple problem is that we arent producing the builds that the updater is trying to find for armhf, and as a consequence I have no idea if it will run at all

gavalierm commented 1 year ago

So, i download the install.sh skip the architecture checking and run it


root@atemrpi:~# bash install.sh 
This will attempt to install Companion as a system service on this device.
It is designed to be run on headless servers, but can be used on desktop machines if you are happy to not have the tray icon.
A user called 'companion' will be created to run the service, and various scripts will be installed to manage the service
Adding user `companion' ...
Adding new group `companion' (1001) ...
Adding new user `companion' (1001) with group `companion' ...
The home directory `/home/companion' already exists.  Not copying from `/etc/skel'.
Hit:1 http://archive.raspberrypi.org/debian bullseye InRelease
Hit:2 http://raspbian.raspberrypi.org/raspbian bullseye InRelease
Get:3 http://pkg.sonobus.net/apt stable InRelease [5,866 B]
Err:3 http://pkg.sonobus.net/apt stable InRelease
  The following signatures were invalid: EXPKEYSIG 9879B7CF31743BCF Matthew Evans <1388610+matthewevans@users.noreply.github.com>
Fetched 5,866 B in 1s (5,404 B/s)
Reading package lists... Done
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://pkg.sonobus.net/apt stable InRelease: The following signatures were invalid: EXPKEYSIG 9879B7CF31743BCF Matthew Evans <1388610+matthewevans@users.noreply.github.com>
W: Failed to fetch http://pkg.sonobus.net/apt/dists/stable/InRelease  The following signatures were invalid: EXPKEYSIG 9879B7CF31743BCF Matthew Evans <1388610+matthewevans@users.noreply.github.com>
W: Some index files failed to download. They have been ignored, or old ones used instead.
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
curl is already the newest version (7.74.0-1.3+deb11u9).
git is already the newest version (1:2.30.2-1+deb11u2).
libudev-dev is already the newest version (247.3-7+rpi1+deb11u2).
libusb-1.0-0-dev is already the newest version (2:1.0.24-3).
unzip is already the newest version (6.0-26+deb11u1).
zip is already the newest version (3.0-12).
The following packages were automatically installed and are no longer required:
  libfuse2 libpulsedsp pulseaudio-utils rtkit squashfs-tools
Use 'apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 202 not upgraded.
Checking dependencies for the installation script...
Checking availability of curl... OK!
Checking availability of unzip... OK!
Downloading https://github.com/Schniz/fnm/releases/latest/download/fnm-arm32.zip...
######################################################################## 100.0%
Installing for Bash. Appending the following to /root/.bashrc:

  # fnm
  export PATH="/opt/fnm:$PATH"
  eval "`fnm env`"

In order to apply the changes, open a new terminal or run the following command:

  source /root/.bashrc
fatal: destination path '/usr/local/src/companionpi' already exists and is not an empty directory.
root@atemrpi:~# rm -rf /usr/local/src/companionpi
root@atemrpi:~# userdel companion
root@atemrpi:~# rm -rf /opt/companion
root@atemrpi:~# bash install.sh 
This will attempt to install Companion as a system service on this device.
It is designed to be run on headless servers, but can be used on desktop machines if you are happy to not have the tray icon.
A user called 'companion' will be created to run the service, and various scripts will be installed to manage the service
Adding user `companion' ...
Adding new group `companion' (1001) ...
Adding new user `companion' (1001) with group `companion' ...
The home directory `/home/companion' already exists.  Not copying from `/etc/skel'.
Hit:1 http://archive.raspberrypi.org/debian bullseye InRelease
Hit:2 http://raspbian.raspberrypi.org/raspbian bullseye InRelease
Get:3 http://pkg.sonobus.net/apt stable InRelease [5,866 B]
Err:3 http://pkg.sonobus.net/apt stable InRelease
  The following signatures were invalid: EXPKEYSIG 9879B7CF31743BCF Matthew Evans <1388610+matthewevans@users.noreply.github.com>
Fetched 5,866 B in 1s (5,553 B/s)
Reading package lists... Done
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://pkg.sonobus.net/apt stable InRelease: The following signatures were invalid: EXPKEYSIG 9879B7CF31743BCF Matthew Evans <1388610+matthewevans@users.noreply.github.com>
W: Failed to fetch http://pkg.sonobus.net/apt/dists/stable/InRelease  The following signatures were invalid: EXPKEYSIG 9879B7CF31743BCF Matthew Evans <1388610+matthewevans@users.noreply.github.com>
W: Some index files failed to download. They have been ignored, or old ones used instead.
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
curl is already the newest version (7.74.0-1.3+deb11u9).
git is already the newest version (1:2.30.2-1+deb11u2).
libudev-dev is already the newest version (247.3-7+rpi1+deb11u2).
libusb-1.0-0-dev is already the newest version (2:1.0.24-3).
unzip is already the newest version (6.0-26+deb11u1).
zip is already the newest version (3.0-12).
The following packages were automatically installed and are no longer required:
  libfuse2 libpulsedsp pulseaudio-utils rtkit squashfs-tools
Use 'apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 202 not upgraded.
Checking dependencies for the installation script...
Checking availability of curl... OK!
Checking availability of unzip... OK!
Downloading https://github.com/Schniz/fnm/releases/latest/download/fnm-arm32.zip...
######################################################################## 100.0%
Installing for Bash. Appending the following to /root/.bashrc:

  # fnm
  export PATH="/opt/fnm:$PATH"
  eval "`fnm env`"

In order to apply the changes, open a new terminal or run the following command:

  source /root/.bashrc
Cloning into '/usr/local/src/companionpi'...
remote: Enumerating objects: 313, done.
remote: Counting objects: 100% (151/151), done.
remote: Compressing objects: 100% (89/89), done.
remote: Total 313 (delta 105), reused 73 (delta 59), pack-reused 162
Receiving objects: 100% (313/313), 100.70 KiB | 1.80 MiB/s, done.
Resolving deltas: 100% (166/166), done.
No matching beta build was found!
Skipping update
Adding user companion to group gpio
Adding user companion to group dialout
yarn install v1.22.19
[1/4] Resolving packages...
success Already up-to-date.
Done in 0.42s.
No Companion build was installed!\nIt should be possible to recover from this with "sudo companion-update"

And like you can see. No companion was installed (again because the no architecture is corectly setted)

root@atemrpi:~# companion-update
Warning: Downgrading to an older version can cause issues with the database not being compatible
You are currently on "Unknown"
? What version do you want?  (Use arrow keys)
  latest stable 
❯ latest beta 
  specific stable 
  specific beta 
  custom-url 
  cancel 

so i choose custom url and use https://s3.bitfocus.io/builds/companion/companion-linux-arm64-3.1.0+6223-stable-1b6dfc49.tar.gz

And have to be good but is not.

pi@atemrpi:~ $ sudo systemctl start companion
pi@atemrpi:~ $ service status companion
status: unrecognized service
pi@atemrpi:~ $ systemctl status companion
● companion.service - Bitfocus Companion
     Loaded: loaded (/etc/systemd/system/companion.service; enabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Wed 2023-10-11 17:29:58 CEST; 16s ago
    Process: 1411 ExecStart=/usr/local/src/companionpi/launch.sh (code=exited, status=126)
   Main PID: 1411 (code=exited, status=126)
        CPU: 16ms

Oct 11 17:29:58 atemrpi systemd[1]: companion.service: Scheduled restart job, restart counter is at 5.
Oct 11 17:29:58 atemrpi systemd[1]: Stopped Bitfocus Companion.
Oct 11 17:29:58 atemrpi systemd[1]: companion.service: Start request repeated too quickly.
Oct 11 17:29:58 atemrpi systemd[1]: companion.service: Failed with result 'exit-code'.
Oct 11 17:29:58 atemrpi systemd[1]: Failed to start Bitfocus Companion.
pi@atemrpi:~ $ 
Julusian commented 1 year ago

And have to be good but is not.

Yeah that is expected. We will be depending on some arm64 system libraries, which as you are running an armhf image they wont be available. It could also be because the kernel is armhf, or a combination of the two.

An arm64 cpu can run an armhf os, but you cant run arm64 software on armhf userspace even if the cpu is arm64

gavalierm commented 1 year ago

Oh, i see. Make sense now. Thank you so much for your effort!

So start over with fresh arm64 image from RPI website.

I close the issue when i will be done.

gavalierm commented 1 year ago

On RaspberyOS arm64 all works like a charm! Thank you again.