Skip to content
Open
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
2 changes: 1 addition & 1 deletion configFiles/board_fw_version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
31.1.3
32.0.0
15 changes: 5 additions & 10 deletions configFiles/checkWiredConnection.service
Original file line number Diff line number Diff line change
@@ -1,18 +1,13 @@
[Unit]
Description=Check Wired Wombat Connection Service

After=network.target
# This ensures the network is up before the script runs (optional)
Description=Check Wired Wombat Connection
After=NetworkManager.service
Wants=NetworkManager.service

[Service]
ExecStart=/home/kipr/wombat-os/configFiles/checkWombatWiredConnect.sh
ExecStart=/home/kipr/wombat-os/configFiles/checkWombatWiredConnect_temp.sh
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This filename is incorrect. Did you mean /home/kipr/wombat-os/configFiles/checkWombatWiredConnection_temp.sh?

Restart=always
# Optional: to automatically restart the service if it fails
User=root
# Optional: run the service as the 'pi' user (or your user)
Group=kipr
WorkingDirectory=/usr/local/bin
# Optional: set the working directory for the script

[Install]
WantedBy=multi-user.target
WantedBy=multi-user.target
44 changes: 44 additions & 0 deletions configFiles/checkWombatWiredConnection_temp.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#!/bin/bash

WIRED_CONN="wired_wombat"
ETH_IF="eth0"
STATIC_IP="192.168.124.1/24"
DHCP_SERVICE="udhcpd"

# Ensure wired connection profile exists
if ! nmcli connection show | grep -q "$WIRED_CONN"; then
echo "$(date) - Creating wired connection profile..."
nmcli connection add type ethernet con-name "$WIRED_CONN" ifname "$ETH_IF" ipv4.method manual ipv4.addresses "$STATIC_IP" ipv4.gateway "$STATIC_IP"
nmcli connection modify "$WIRED_CONN" connection.autoconnect no
fi

while true; do
# Check if Ethernet cable is plugged in
if ethtool "$ETH_IF" 2>/dev/null | grep -q "Link detected: yes"; then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line can be replaced by a simple cat command

if [ "$(cat /sys/class/net/eth0/link_mode)" -eq "1" ]; then

echo "$(date) - Ethernet detected, bringing up $WIRED_CONN"

# Bring up wired connection
nmcli connection up "$WIRED_CONN"
Copy link
Contributor

@twells46 twells46 Sep 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this nmcli command really need to be re-run every 5 seconds? nmcli and systemctl commands are relatively heavy, so re-running them constantly is very inefficient.

I would suggest adding a stamp file somewhere to indicate which state it's in and checking that first to determine if you need to run the rest of this then block.


# Wait until the interface has the correct IP
while ! ip -4 addr show "$ETH_IF" | grep -q "${STATIC_IP%/*}"; do
echo "$(date) - Waiting for $ETH_IF to get IP $STATIC_IP..."
sleep 1
done

echo "$(date) - $ETH_IF is up with IP $STATIC_IP, starting DHCP..."
sudo systemctl restart "$DHCP_SERVICE"

else
echo "$(date) - Ethernet not detected, bringing down $WIRED_CONN"

# Bring down wired connection
nmcli connection down "$WIRED_CONN"
Copy link
Contributor

@twells46 twells46 Sep 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as other issue, this block doesn't seem like it needs to be re-run constantly.


# Stop DHCP server
sudo systemctl stop "$DHCP_SERVICE"
fi

# Check every 5 seconds
sleep 5
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since you are already managing this script with systemd and have Restart set to Always, this while loop isn't strictly necessary. You can remove the while loop here and add RestartSec=5 to the systemd unit file above and achieve roughly the same effect while also allowing systemd to handle keepalive logic.

done
13 changes: 7 additions & 6 deletions configFiles/udhcpd.conf
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

# The start and end of the IP lease block

start 192.168.124.2 #default: 192.168.0.20
end 192.168.124.2 #default: 192.168.0.254
start 192.168.124.20 #default: 192.168.0.20
end 192.168.124.50 #default: 192.168.0.254


# The interface that udhcpd will use
Expand All @@ -14,7 +14,7 @@ interface eth0 #default: eth0
# The maximim number of leases (includes addressesd reserved
# by OFFER's, DECLINE's, and ARP conficts

#max_leases 254 #default: 254
max_leases 30


# If remaining is true (default), udhcpd will store the time
Expand Down Expand Up @@ -83,13 +83,14 @@ interface eth0 #default: eth0
#Examles
#opt dns 192.168.10.2 192.168.10.10
option subnet 255.255.255.0
opt router 192.168.124.1
option router 192.168.124.1
option dns 8.8.8.8
#opt wins 192.168.10.10
#option dns 129.219.13.81 # appened to above DNS servers for a total of 3
#option domain local
option lease 12 # 10 days of seconds

option lease 86400 # 10 days of seconds

`
# Currently supported options, for more info, see options.c
#opt subnet
#opt timezone
Expand Down
12 changes: 6 additions & 6 deletions configFiles/wombat_launcher.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash
#Bash script to launch harrogate web IDE and botui GUI
#Bash script to launch voldigate web IDE and botui GUI
#created 23 May 2023
#edited 9 October 2024
#edited 11 September 2025

LOGFILE="/var/log/wombat_launcher.log"

Expand Down Expand Up @@ -54,12 +54,12 @@ fi
# Run dynamicChannelSwitch.sh in the background
sudo /home/kipr/wombat-os/configFiles/dynamicChannelSwitch.sh &

echo "[WOMBAT] Launching harrogate server.js and other scripts"
echo "[WOMBAT] Launching voldigate express.js and other scripts"
export LD_LIBRARY_PATH=/usr/local/qt6/lib:/usr/local/lib

# Run harrogate server.js in the background
cd harrogate || exit 1
sudo node server.js &
# Run voldigate express.js in the background
cd /opt/voldigate-slim-wombat
sudo node express.js &

# Launch firstTimeScreen.sh in the background
/home/kipr/wombat-os/configFiles/firstTimeScreen.sh &
Expand Down
Binary file added updateFiles/files/.yarn/install-state.gz
Binary file not shown.
948 changes: 948 additions & 0 deletions updateFiles/files/.yarn/releases/yarn-4.9.1.cjs

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions updateFiles/files/.yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
nodeLinker: node-modules

yarnPath: .yarn/releases/yarn-4.9.1.cjs
1 change: 1 addition & 0 deletions updateFiles/files/classrooms.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
180 changes: 180 additions & 0 deletions updateFiles/files/reorganizeUsersJson.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,180 @@
#!/bin/bash
shopt -s nullglob
LOGFILE="/home/kipr/voldigate_update.log"

sudo touch "$LOGFILE"
sudo chmod 666 "$LOGFILE"

>"$LOGFILE"

exec &> >(tee -a "$LOGFILE")

OLD_USER_JSON="/home/kipr/Documents/KISS/users.json"
NEW_USER_JSON="/home/kipr/Documents/KISS/newUsers.json"
HOME_DIR="/home/kipr/Documents/KISS"
SCRIPT_DIR="$(dirname "$0")"
#JQ="../pkgs/jq-linux64" #jq-linux64 testing on computer, pkgs/jq-linux-arm64 for pi once ready
sudo cp ../pkgs/jq-linux-arm64 /usr/local/bin/jq
sudo chmod +x /usr/local/bin/jq
JQ=/usr/local/bin/jq
# Get all directories stored in /home/kipr/Documents/KISS - Users
for dir in "$HOME_DIR"/*; do
if [ -d "$dir" ]; then
userName=$(basename "$dir")

# Skip the 'classrooms' folder
if [ "$userName" = "classrooms" ]; then
continue
fi

userPath_array+=("$dir")
user_array+=("$userName")
fi
done


#New voldigate structure for users.json
voldigateJson=$(printf '%s\n' "${user_array[@]}" | "$JQ" -Rn '
[inputs] | reduce .[] as $item ({}; .[$item] = {})
')

#Make sure current users.json doesn't have trailing , (v31.1.2)
perl -pe 's/,\s*}/}/g' /home/kipr/Documents/KISS/users.json \
| "$JQ" . > /home/kipr/Documents/KISS/users.json.fixed

sudo mv /home/kipr/Documents/KISS/users.json.fixed /home/kipr/Documents/KISS/users.json

echo "Fixed users.json: $(< /home/kipr/Documents/KISS/users.json)"

#Read old users.json to get user interface
oldUsersJson=$(cat "$OLD_USER_JSON")

# Iterate users and collect projects safely
for userPath in "${userPath_array[@]}"; do
userName=$(basename "$userPath")
projects_json_list=()
userMode=$(echo "$oldUsersJson" | jq -r --arg uname "$userName" '.[$uname].mode')

echo "oldUsers[$userName].mode: $userMode"
for projDir in "$userPath"/*; do
[ -d "$projDir" ] || continue
projectName=$(basename "$projDir")

# Collect files in subdirectories
includeFiles=()
srcFiles=()
dataFiles=()
projectLanguage=""
for subDir in "$projDir"/*; do
[ -d "$subDir" ] || continue
subDirName=$(basename "$subDir")
case "$subDirName" in
"include")
for f in "$subDir"/*; do
[ -f "$f" ] || continue
includeFiles+=("$(basename "$f")")
done
;;
"src")
for f in "$subDir"/*; do
[ -f "$f" ] || continue
filename=$(basename "$f")
[ "$filename" = "xmlToC.c" ] && continue # skip this file
# Detect main.* and extract the extension as projectLanguage
if [[ "$filename" == main.* ]]; then
ext="${filename##*.}"
projectLanguage="$ext"
fi
srcFiles+=("$filename")
done
;;
"data")
for f in "$subDir"/*; do
[ -f "$f" ] || continue
dataFiles+=("$(basename "$f")")
done
;;
esac
done

if [ ${#includeFiles[@]} -gt 0 ]; then
includeJSON=$(printf '%s\n' "${includeFiles[@]}" | "$JQ" -R . | "$JQ" -s .)
else
includeJSON='[]'
fi

if [ ${#srcFiles[@]} -gt 0 ]; then
srcJSON=$(printf '%s\n' "${srcFiles[@]}" | "$JQ" -R . | "$JQ" -s .)
else
srcJSON='[]'
fi

if [ ${#dataFiles[@]} -gt 0 ]; then
dataJSON=$(printf '%s\n' "${dataFiles[@]}" | "$JQ" -R . | "$JQ" -s .)
else
dataJSON='[]'
fi

# Build project JSON
project_json=$("$JQ" -n \
--arg projectName "$projectName" \
--arg projectLanguage "$projectLanguage" \
--argjson include "$includeJSON" \
--argjson src "$srcJSON" \
--argjson data "$dataJSON" \
'{
projectName: $projectName,
projectLanguage: $projectLanguage,
includeFolderFiles: $include,
srcFolderFiles: $src,
dataFolderFiles: $data
}')

echo "$project_json" >"$projDir/.project.config.json"
projects_json_list+=("$project_json")
done

# Combine all projects into a JSON array
all_projects_json=$(printf '%s\n' "${projects_json_list[@]}" | "$JQ" -s .)

#Create .user.config.json that belongs in the User's root folder
userConfigJson=$("$JQ" -n \
--arg user "$userName" \
--argjson projects "$all_projects_json" \
--argjson oldUsers "$oldUsersJson" \
'{
userName: $user,
interfaceMode: ($oldUsers[$user].mode // "Simple"),
projects: $projects,
classroomName: null
}')

echo "$userConfigJson" >"$userPath/.user.config.json"

# Inject into the Voldigate JSON
voldigateJson=$(
echo "$voldigateJson" | "$JQ" \
--arg user "$userName" \
--argjson oldUsers "$oldUsersJson" \
--argjson projs "$all_projects_json" \
'.[$user] += {
userName: $user,
interfaceMode: ($oldUsers[$user].mode // "Simple"),
projects: $projs,
classroomName: null
}'
)

done

# Output final JSON
echo "$voldigateJson" >"$NEW_USER_JSON"

if [ -f "$NEW_USER_JSON" ]; then
echo "Successfully created $NEW_USER_JSON"
cat "$NEW_USER_JSON" > "$OLD_USER_JSON"
rm "$NEW_USER_JSON"
else
echo "Failed to create $NEW_USER_JSON"
exit 1
fi
Loading