laberning / openrowingmonitor

A free and open source performance monitor for rowing machines
https://laberning.github.io/openrowingmonitor
GNU General Public License v3.0
98 stars 19 forks source link

Installation fails on Raspbian OS 64bit lite #88

Closed Gordon-Shumway2 closed 1 year ago

Gordon-Shumway2 commented 1 year ago

Installation of main branch fails with "This script currently only works on Raspberry Pi OS, you will have to do a manual installation."

Steps to reproduce:

Cause: Installation script checks OS version by reading /etc/os-release and looking for 'ID'. Raspberry PI OS lite (64bit) identifies itself as 'debian', not as 'raspbian' anymore.

Quick fix: Edit /etc/os-release and change "ID=debian" to "ID=raspbian".

Or change installation script to look for the correct match.

JaapvanEkris commented 1 year ago

This is correct, in the updated version of the install scipt, it is already fixed: https://github.com/JaapvanEkris/openrowingmonitor/blob/Backend_Redesign/install/install.sh

Please note that this install script will also install the pigpio library, which might interfer with the onoff library used by the current branch.

laberning commented 1 year ago

Hi Gordon,

thanks for reporting this. Yes, for now this is a good way to mitigate this.

We'll fix it in the upcoming versions.

@JaapvanEkris Whitelisting all 'Debian' style Linux versions is probably not the safest choice. The idea of that check in the beginning of the installer is to make sure that we are running on a raspberry device, since we are doing some very raspberry specific stuff later (like changing gpio settings etc). There are a lot of Linux Distributions out there that are based on Debian and would report with 'debian'. Still didn't find the time to investigate this further, but maybe we can use some other piece of information in /etc/os-release that would work as criteria for this (in 32bit and 64bit).

JaapvanEkris commented 1 year ago

Hahaha, that is true. I'll look what the Lite version reports :)

JaapvanEkris commented 1 year ago

@laberning : it reports general Debian info.

What I found is using cat /proc/device-tree/model, I do get a decent detection of Raspberry on a Pi4B on 64 bit, as it answers: Raspberry Pi 4 Model B Rev 1.4

Does that result in decent info on a 3 or Zero?

Gordon-Shumway2 commented 1 year ago

Hi,

I ran cat /proc/device-tree/model on a Pi 3 model B v1.2 and a Pi Zero 2 W (both running 64bit lite OS) . Here are the results:

 Raspberry Pi Zero 2 W Rev 1.0

and

 Raspberry Pi 3 Model B Rev 1.2

Hope this helps, Michael (aka Gordon)

laberning commented 1 year ago

Thank you @JaapvanEkris and @Gordon-Shumway2. I've pushed a fix that should address this by checking /proc/device-tree/model. Can you confirm that this also works on your devices?

Gordon-Shumway2 commented 1 year ago

I can confirm that running the installation script https://raw.githubusercontent.com/laberning/openrowingmonitor/HEAD/install/install.sh now succeeds on both Pi 3 and Pi Zero 2 W.

Mind you that the installation on the Zero 2 W would have failed due to insufficient RAM/swap on an out-of-the-box installation of 64bit lite. With only 512 MB of RAM the Zero 2 W falls back on swap and the installation script uses up to 460 MB of it - which if remember correctly is more than the default swap size.
(edit: the default swap size is 100MB.)

Maybe a note could be added in the documentation to make Zero 2 W owners aware of this potential pitfall.

Kind regards, Michael (aka Gordon)