Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions .config/conky/conky-esp-config/battery_watchdog.sh
Original file line number Diff line number Diff line change
@@ -1,19 +1,25 @@
#!/bin/bash

DIR="/home/ditrobotics/DIT-Scripts/.config/conky/conky-esp-config"
pactl set-sink-volume @DEFAULT_SINK@ 60%
pactl set-sink-volume @DEFAULT_SINK@ 95%
cd $DIR
sleep 1

# Boot-up sound effect
ffplay -nodisp -autoexit welcome.mp3

while true; do
voltage=$(./conky_esp32.sh)

if (( $(echo "$voltage < 17.5" | bc -l) )); then
if ! pgrep -x "ffplay" > /dev/null; then
# ffplay -nodisp -autoexit mario_death.mp3 > /dev/null 2>&1 && ffplay -nodisp -autoexit warning_low_battery.mp3 > /dev/null 2>&1 &

# Broadcast shutdown message
wall < shutdown_message.txt
# Brocast low battery warning
ffplay -nodisp -autoexit warning_low_battery.mp3 > /dev/null 2>&1 &
# ffplay -nodisp -autoexit mario_death.mp3 > /dev/null 2>&1 && ffplay -nodisp -autoexit warning_low_battery.mp3 > /dev/null 2>&1 &

fi
fi

Expand Down
Binary file modified .config/conky/conky-esp-config/welcome.mp3
Binary file not shown.
Binary file added .config/conky/conky-esp-config/welcome_2024.mp3
Binary file not shown.
Binary file added .config/conky/conky-esp-config/welcome_Paimon.mp3
Binary file not shown.
17 changes: 9 additions & 8 deletions .config/conky/conky_entry.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ conky -c $DIR/conky-esp-config/.conky_esp32 &
$DIR/lean-conky-config/start-lcc.sh
$DIR/conky-esp-config/battery_watchdog.sh &

# Web
/home/ditrobotics/DIT-Scripts/web-ui/scripts/aio.sh &

while ! nc -z localhost 5000; do
sleep 0.1
done

firefox http://localhost:5000 http://${HOSTNAME}-esp.local &
# # Run the Web Pannel essential scripts
# /home/ditrobotics/DIT-Scripts/web-ui/scripts/aio.sh &
# # Wait for the web server to start
# while ! nc -z localhost 5000; do
# sleep 0.1
# done
#
# # Open Robot UI in Firefox
# firefox http://localhost:5000 http://${HOSTNAME}-esp.local &
222 changes: 101 additions & 121 deletions .mozilla/firefox/dit_config.default/prefs.js

Large diffs are not rendered by default.

26 changes: 23 additions & 3 deletions 00-pre-installation.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,25 @@ install_dependencies() {
ffmpeg \
jq

# net-tools --- for network configuration
# iw --- for wireless network configuration
# lm-sensors --- for device temperature monitoring
# conky --- for system monitoring panel
# iperf3 --- for network performance testing
# timeshift --- for system snapshot and restore
# cheese --- for camera testing
# ffmpeg --- for audio and video processing (ex. boot-on sound)
# jq --- for JSON parsing

sleep 1
progress_bar $step $total_steps
((step++))
}

remove_brltty() {
# Fix for USB device detection issue
# | Reference:
# | https://askubuntu.com/questions/1403705/dev-ttyusb0-not-present-in-ubuntu-22-04
remove_brltty() {
echo -e "\033[32mRemoving brltty...\033[0m"

apt remove -y brltty
Expand All @@ -72,6 +85,7 @@ remove_brltty() {
((step++))
}

# Install Docker Engine
install_docker() {
echo -e "\033[32mInstalling Docker...\033[0m"

Expand All @@ -88,6 +102,7 @@ install_docker() {
((step++))
}

# Setup Conky system monitoring panel
setup_conky() {
echo -e "\033[32mSetting up conky...\033[0m"

Expand All @@ -98,6 +113,7 @@ setup_conky() {
((step++))
}

# Setup Message of the MOTD banner
setup_motd_banner() {
echo -e "\033[32mSetting up motd banner...\033[0m"

Expand All @@ -108,6 +124,7 @@ setup_motd_banner() {
((step++))
}

# Setup DIT user group
create_user() {
echo -e "\033[32mCreate each group user and set their permission...\033[0m"

Expand All @@ -118,6 +135,7 @@ create_user() {
((step++))
}

# Setup DIT logger (System change information for each group)
setup_dit_logger() {
echo -e "\033[32mSetting up DIT logger...\033[0m"

Expand All @@ -128,14 +146,15 @@ setup_dit_logger() {
((step++))
}

# Setup touch screen orientation
flip_screen() {
echo -e "\033[32mSetting up touch screen HID layout...\033[0m"

read -p "Would you like to rotate touch screen? (y/n): " answer
read -p "Would you like to rotate touch screen? (y/N): " answer

case $answer in
[Yy]* )
echo 'ATTRS{name}=="wch.cn USB2IIC_CTP_CONTROL", ENV{LIBINPUT_CALIBRATION_MATRIX}="-1.000 0.000 1.000 0.000 -1.000 1.000"' >> /etc/udev/rules.d/99-calibration.rules
echo 'ATTRS{name}=="wch.cn USB2IIC_CTP_CONTROL", ENV{LIBINPUT_CALIBRATION_MATRIX}="-1.000 0.000 1.000 0.000 -1.000 1.000"' >> /etc/udev/rules.d/80-calibration.rules
udevadm control --reload-rules
udevadm trigger
service udev restart
Expand All @@ -150,6 +169,7 @@ flip_screen() {
((step++))
}

# Restore firefox user preference
restore_firefox() {
echo -e "\033[32mRestoring firefox user preference...\033[0m"

Expand Down
6 changes: 6 additions & 0 deletions 10-conky_setup.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
#!/bin/bash

# Setup conky layout (including relative scripts)
echo "Copying conky config files to ~/.config/conky/"
cp -r .config/conky /home/ditrobotics/.config/

# Setup autostart script for conky_entry.sh
echo "Copying autostart config files to ~/.config/autostart/"
cp -r .config/autostart /home/ditrobotics/.config/

# Setup udev rules for USB devices (e.g. esp32|stm32|imu|lidar|vive|touchscreen|...)
echo "Copying udev rules files to /etc/udev/rules.d/"
cp -r udev/. /etc/udev/rules.d/.

# Reload udev rules
udevadm control --reload-rules && udevadm trigger
1 change: 1 addition & 0 deletions 10-motd_setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ if [ "$(id -u)" != "0" ]; then
exit 1
fi

# Copy the motd message file
echo "Copying motd config to $FilePATH"
cp "$FileNAME" "$FilePATH"

1 change: 1 addition & 0 deletions 10-user_setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ if [ "$(id -u)" != "0" ]; then
exit 1
fi

# DIT software group list
usernames=("main" "vision" "navigation" "localization")

for username in "${usernames[@]}"
Expand Down
2 changes: 1 addition & 1 deletion 99-dit-news
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ MOTD=" ____ __________ ____ __ __ _
/ /_/ // / / / / _, _/ /_/ / /_/ / /_/ / /_/ / /__(__ )
/_____/___/ /_/ /_/ |_|\____/_.___/\____/\__/_/\___/____/

$HOSTNAME Intel® Core™ i3-N300 MediaTek MT7922
$HOSTNAME AMD Ryzen™ 7 8840U Intel® AX210 160MHz
"

echo "$MOTD"
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2024 SeanChangX
Copyright (c) 2025 SeanChangX

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
33 changes: 32 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,42 @@

This repository contains the environment deployment scripts for the DIT upper-level system, designed primarily for `Ubuntu Desktop 22.04 LTS`. It includes the installation of dependencies, deployment of the Docker environment, setup of the system status dashboard, configuration of the User Group permission framework for DIT's internal teams, and installation of `DIT-Logger`.

## Prerequisites for Running This Script

Before running this script, ensure your Ubuntu system is properly configured and the necessary programs are installed.

### A. Update System & Install Essential Programs (On Local Machine)

>Run the following commands:
>```bash
>sudo apt update
>sudo apt dist-upgrade -y
>sudo apt install openssh-server git
>sudo apt autoremove
>sudo apt autoclean
>sudo apt clean
>```

### B. Modify Wi-Fi Configuration to Resolve Connection Issues (Learn from 2024)

>1. Open the Wi-Fi configuration file
>```bash
>sudo vim /etc/NetworkManager/conf.d/default-wifi-powersave-on.conf
>```
>2. Update the content as follows:
>```bash
>[connection]
>wifi.powersave = 2
>```
>~~wifi.powersave = 3~~
>
>Refer to the [Framework Knowledge Base](https://knowledgebase.frame.work/zh_tw/ubuntu-wi-fi-Skmizxznj) for more information.

## Usage

To install the DIT-Scripts, clone the repository to your local machine and run the `./00-pre-installation` script.

> **Attention**: Run the script on **<ins>desktop terminal</ins>** is recommended. After the script is executed, the system will reboot and the installation will be completed.
> **⚠️ Attention**: Run the script on **<ins>desktop terminal</ins>** is recommended. After the script is executed, the system will reboot and the installation will be completed.

## Issues

Expand Down
Binary file added dit/DIT_Circuit.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added dit/DIT_Tech.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 0 additions & 1 deletion udev/80-calibration.rules

This file was deleted.