Skip to content

Commit

Permalink
Merge pull request #180 from AndreWohnsland/dev
Browse files Browse the repository at this point in the history
Fix non RPi system detection
  • Loading branch information
AndreWohnsland authored Aug 11, 2024
2 parents 80cba9a + cc459ce commit e0ddfa5
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 14 deletions.
3 changes: 0 additions & 3 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,10 @@ In addition, there is the possibility to use and set up a second device as a das
- Display different modes of data for a by team comparison
- _Optional_: Use the dashboard as WiFi hot-spot


# Quickstart

Here are some simple steps to get CocktailBerry running. You need to have **Python 3.9** or newer and **git** installed.


On the RPi, you can try the new [all in one installer script](https://github.com/AndreWohnsland/CocktailBerry/blob/master/scripts/all_in_one.sh). One command should install everything:

```bash
Expand All @@ -84,7 +82,6 @@ This will start the CocktailBerry program. You may want to run the provided inst
sh scripts/setup.sh
```


Now you can [Set Up](https://cocktailberry.readthedocs.io/setup/#setting-up-the-machine-modifying-other-values) your CocktailBerry and tweak the settings to your liking.

# Interface
Expand Down
8 changes: 0 additions & 8 deletions scripts/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,6 @@
# Options:
# dashboard: set up dashboard, otherwise will set up CocktailBerry

is_raspberry_pi() {
if grep -q "Raspberry Pi" /proc/device-tree/model 2>/dev/null; then
return 0
else
return 1
fi
}

echo "Installing updates, this may take a while..."
sudo apt update && sudo sudo apt -y full-upgrade

Expand Down
14 changes: 11 additions & 3 deletions scripts/setup_non_rpi.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
#!/bin/bash

is_raspberry_pi() {
if grep -q "Raspberry Pi" /proc/device-tree/model 2>/dev/null; then
return 0
else
return 1
fi
}

# Check if the script is running on a non-Raspberry Pi device
if ! is_raspberry_pi; then
echo "$(whoami) ALL=(ALL) NOPASSWD: ALL" | sudo tee "/etc/sudoers.d/99_$(whoami)_nopasswd" >/dev/null
Expand All @@ -12,8 +20,8 @@ if ! is_raspberry_pi; then
sudo usermod -aG gpio "$USER"

# Create the setup_gpio_permissions.sh script
sudo cp .scripts/setup_gpio_permissions.sh /usr/local/bin/setup_gpio_permissions.sh
sudo cp .scripts/setup_gpio_permissions.service /etc/systemd/system/setup_gpio_permissions.service
sudo cp ./scripts/setup_gpio_permissions.sh /usr/local/bin/setup_gpio_permissions.sh
sudo cp ./scripts/setup_gpio_permissions.service /etc/systemd/system/setup_gpio_permissions.service

# Make the script executable
sudo chmod +x /usr/local/bin/setup_gpio_permissions.sh
Expand All @@ -26,7 +34,7 @@ if ! is_raspberry_pi; then
# set the rules to enable gpio
# only both in combination seem to work
sudo apt install python3-pip libgpiod2
sudo cp .scripts/99-gpio.rules /etc/udev/rules.d/99-gpio.rules
sudo cp ./scripts/99-gpio.rules /etc/udev/rules.d/99-gpio.rules
sudo udevadm control --reload-rules
sudo udevadm trigger

Expand Down

0 comments on commit e0ddfa5

Please sign in to comment.