Skip to content

Commit

Permalink
Ubuntu deploy updates
Browse files Browse the repository at this point in the history
  • Loading branch information
stephendade committed Jan 7, 2025
1 parent ca64a8e commit 3fdf9e8
Show file tree
Hide file tree
Showing 5 changed files with 81 additions and 9 deletions.
12 changes: 10 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ to configure and install Rpanion-server with all required dependencies. Note thi
an initial Wifi hotspot.

```
cd ./deploy && ./RasPi2-3-4-5-deploy.sh
cd ~/Rpanion-server/deploy/ && ./RasPi2-3-4-5-deploy.sh
```

If running Ubuntu 20.04 OS on the Pi, use:
Expand All @@ -74,7 +74,15 @@ If running Ubuntu 22.04 OS on the Pi, use:
cd ~/Rpanion-server/deploy/ && ./RasPi-ubuntu22-deploy.sh
```

Note the CSI camera does not currently work on Ubuntu 22.04, due to incompatibilities with the Raspberry Pi.
If running Ubuntu 24.04 OS on the Pi, use:

```
cd ~/Rpanion-server/deploy/ && ./RasPi-ubuntu24-deploy.sh
```

Note the CSI camera does not currently work on Ubuntu 22.04 and 24.04, due to incompatibilities with the Raspberry Pi.

Note the GPIO UARTs are not currently working with Ubuntu 24.04.

If not already configured for an initial Wifi hotspot, run the ``./deploy/wifi_access_point.sh`` script.
The hotspot has the SSID "rpanion" and password "rpanion123". The Pi's IP address will be 10.0.2.100,
Expand Down
3 changes: 0 additions & 3 deletions deploy/RasPi-ubuntu20-deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ set -x

git submodule update --init --recursive

## Change hostname
sudo hostnamectl set-hostname rpanion --static

## Enable serial port
sudo perl -pe 's/console=serial0,115200//' -i /boot/firmware/cmdline.txt

Expand Down
3 changes: 0 additions & 3 deletions deploy/RasPi-ubuntu22-deploy.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ set -x

git submodule update --init --recursive

## Change hostname
sudo hostnamectl set-hostname rpanion --static

## Enable serial port
sudo perl -pe 's/console=serial0,115200//' -i /boot/firmware/cmdline.txt

Expand Down
68 changes: 68 additions & 0 deletions deploy/RasPi-ubuntu24-deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
#!/bin/bash

set -e
set -x

git submodule update --init --recursive

## Enable serial port
sudo perl -pe 's/console=serial0,115200//' -i /boot/firmware/cmdline.txt

echo "export PATH=$PATH:$HOME/.local/bin" >> ~/.bashrc

## CSI Camera - not working for now (Ubuntu issue ... not fixable at my end)
#echo "" | sudo tee -a /boot/firmware/config.txt >/dev/null
#echo "# Enable Camera" | sudo tee -a /boot/firmware/config.txt >/dev/null
#echo "start_x=1" | sudo tee -a /boot/firmware/config.txt >/dev/null
#echo "gpu_mem=128" | sudo tee -a /boot/firmware/config.txt >/dev/null

## Need to temp disable this
sudo systemctl stop unattended-upgrades.service

## Remove this to disable the "Pending Kernel Upgrade" message
sudo apt -y remove needrestart

## Packages
./install_common_libraries.sh
sudo apt install -y wireless-tools

sudo systemctl disable dnsmasq

sudo apt-get install -y ca-certificates curl gnupg
sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_20.x nodistro main" | sudo tee /etc/apt/sources.list.d/nodesource.list

sudo apt update
sudo apt install -y nodejs

## Configure nmcli to not need sudo
sudo sed -i.bak -e '/^\[main\]/aauth-polkit=false' /etc/NetworkManager/NetworkManager.conf

## Ensure nmcli can manage all network devices
sudo touch /etc/NetworkManager/conf.d/10-globally-managed-devices.conf
echo "[keyfile]" | sudo tee -a /etc/NetworkManager/conf.d/10-globally-managed-devices.conf >/dev/null
echo "unmanaged-devices=*,except:type:wifi,except:type:gsm,except:type:cdma,except:type:wwan,except:type:ethernet,type:vlan" | sudo tee -a /etc/NetworkManager/conf.d/10-globally-managed-devices.conf >/dev/null

## Need this to get eth0 working too
## From https://askubuntu.com/questions/1290471/ubuntu-ethernet-became-unmanaged-after-update
sudo touch /etc/netplan/networkmanager.yaml
echo "network:" | sudo tee -a /etc/netplan/networkmanager.yaml >/dev/null
echo " version: 2" | sudo tee -a /etc/netplan/networkmanager.yaml >/dev/null
echo " renderer: NetworkManager" | sudo tee -a /etc/netplan/networkmanager.yaml >/dev/null
sudo netplan generate
sudo netplan apply

## mavlink-router
./build_mavlinkrouter.sh

## and build & run Rpanion
./build_rpanion.sh

## For wireguard. Must be installed last as it messes the DNS resolutions
sudo apt install -y resolvconf

## And re-enable
sudo systemctl start unattended-upgrades.service

sudo reboot
4 changes: 3 additions & 1 deletion deploy/install_common_libraries.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ sudo apt install -y gstreamer1.0-plugins-good libgstrtspserver-1.0-dev gstreamer
sudo apt install -y network-manager python3 python3-dev python3-gst-1.0 python3-pip dnsmasq git ninja-build

## Pymavlink
sudo apt install -y libxml2-dev libxslt1-dev python3-lxml python3-numpy
sudo apt install -y libxml2-dev libxslt1-dev python3-lxml python3-numpy python3-future

sudo apt purge -y modemmanager
sudo apt remove -y nodejs nodejs-doc
Expand All @@ -25,6 +25,8 @@ source ~/.profile
source /etc/os-release
if [[ "$ID" == "debian" || "$ID" == "raspbian" ]] && [ "$VERSION_CODENAME" == "bookworm" ]; then
sudo apt install -y meson python3-netifaces gstreamer1.0-libcamera
elif [ "$ID" == "ubuntu" ] && [ "$VERSION_CODENAME" == "noble" ]; then
sudo apt install -y meson python3-netifaces
else
sudo python3 -m pip install --upgrade pip
sudo pip3 install meson
Expand Down

0 comments on commit 3fdf9e8

Please sign in to comment.