Skip to content

Commit 84d8f7d

Browse files
Merge pull request #27 from ClemensElflein/fix/fix-container-shell-prefix
Fix Minor Stuff
2 parents 1a93df5 + 88e31d8 commit 84d8f7d

File tree

17 files changed

+100
-49
lines changed

17 files changed

+100
-49
lines changed

.github/img/dockge_01.jpg

-49.5 KB
Binary file not shown.

README.md

Lines changed: 31 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[![OpenMower header](.github/img/open_mower_header.jpg)](https://github.com/ClemensElflein/OpenMower)
44

5-
This repository contains the official OpenMowerOS (OMOSv2) image for running the [OpenMower](https://github.com/ClemensElflein/OpenMower) project on your OM's Pi4/CM4.
5+
This repository contains the official OpenMowerOS (OMOSv2) image for running the [OpenMower](https://github.com/ClemensElflein/OpenMower) project on your OM's Pi/CM.
66

77
➡️ What’s new in the latest release? See [WHATSNEW.md](./WHATSNEW.md).
88

@@ -25,14 +25,14 @@ This repository contains the official OpenMowerOS (OMOSv2) image for running the
2525
Tip: Click a section title to expand/collapse.
2626

2727
<details>
28-
<summary><b>Install OpenMowerOS on your Pi4/CM4</b></summary>
28+
<summary><b>Install OpenMowerOS on your Pi/CM</b></summary>
2929

3030

31-
1. Flash the latest image (link TODO) to an SD card, preferably using [**Raspberry Pi** Imager](https://www.raspberrypi.com/software/).
31+
1. Flash the latest OpenMowerOS v2.x [OpenMowerOS_YYYYMMDD.zip](https://github.com/ClemensElflein/OpenMowerOS/releases) to an SD card or your CM, preferably using [**Raspberry Pi** Imager](https://www.raspberrypi.com/software/).
3232

3333
2. ***Optional: Raspberry Pi Imager configuration***<br>
3434
When prompted by Raspberry Pi Imager, you can change some custom settings:
35-
1. As shown here, but never use a username other than `openmower`!<br>
35+
1. As shown here, but the username must be `openmower`.
3636
![General Settings](.github/img/rpimager_general.png)
3737
2. You may also add your SSH public key for quicker SSH login;
3838
password login remains active (even if it's an either/or selection).<br>
@@ -43,10 +43,10 @@ Tip: Click a section title to expand/collapse.
4343
<details>
4444
<summary><b>First boot and network setup</b></summary>
4545

46-
3. After writing the image, eject the card, insert it into your mowers Pi4 or xCore, and turn it on.
46+
3. After writing the image, eject the card, insert it into your mower’s Pi or xCore, and turn it on.
4747

4848
4. Your Pi will boot multiple times.<br>
49-
***Sometimes, after the first boot, it may fail to reboot*** (red LED near the HDMI plug remains on, whereas the green one doesn't flicker anymore). If that happens, a power cycle will get it back on track.
49+
***Sometimes, after the first boot, it may fail to reboot*** (the Pi/xCore’s green LED doesnt flicker anymore and remains off for >10 seconds). If that happens, a power cycle will get it back on track.
5050

5151
5. ***Optional: Comitup hotspot (if you skipped step 2 "Raspberry Pi Imager configuration")***<br>
5252
If you didn't enter your Wifi settings when asked for the custom settings during Pi Imager (see step 2), or if you accidentally entered the wrong Wifi settings:
@@ -57,61 +57,68 @@ If you didn't enter your Wifi settings when asked for the custom settings during
5757

5858
<p align="center"><img src=".github/img/comitup_hotspot.png" style="width:50%"></p>
5959

60-
3. Click on your home WiFi and fill in your password.
60+
3. Click on your home WiFi, fill in your password and click "SUBMIT".
6161

6262
4. The hotspot will disappear and the mower should connect to your WiFi.
6363

64-
6. Try pinging your mower via `ping openmower` (or the hostname you entered during Pi Imager). If the host can't be found, check your router for the mower's IP address.
64+
6. Two minutes after the second reboot, try pinging your mower via `ping openmower` (or the hostname you entered during Pi Imager). If the host can't be found, check your router for the mower's IP address.
6565

66-
7. SSH into your mower via `ssh openmower@openmower` or `ssh openmower@<your hostname or mower's IP address>` (password 'openmower' or the one you entered during Raspberry Pi Imager).
67-
68-
8. ***Optional:***<br>
69-
1. If you didn't configure a custom password during step 2 (Raspberry Pi Imager configuration), change your password now via `passwd`.
66+
7. ***Optional:***<br>
67+
1. If you didn't configure a custom password during step 2 (Raspberry Pi Imager configuration), login via SSH and change your password now via `passwd`.
7068
2. Use `raspi-config` to change keyboard, timezone, WLAN country and the like (if not configured in Raspberry Pi Imager's custom settings).
7169

7270
</details>
7371

72+
73+
7474
<details>
7575
<summary><b>Manage OpenMower stack (GUI + CLI)</b></summary>
7676

77-
Dockge (a container manager GUI), as well as a ttyd (a WebTerminal) are automatically pulled and started after 2-5 minutes (after final boot).
77+
[Dockge](https://dockge.kuma.pet/) (a container manager GUI) and [ttyd](https://tsl0922.github.io/ttyd/) (a web terminal)
78+
are bundled with the OpenMowerOS image and are unpacked and installed during the final second‑boot step.
79+
This may take about 2 minutes.
80+
81+
Please wait while the Pi/xCore’s green LED is flickering or steadily on.
7882

7983
The WebTerminal is available as a lightweight alternative to SSH for running the same commands.
8084
It can be reached via `http://openmower:7681` (adjust if you changed the hostname).
81-
Default login credentials: openmower/openmower.
8285

8386
For each relevant GUI action, a CLI alternative is available via a powerful `openmower` command; both are listed below.
8487

8588
1. Connect to the container manager:
86-
- GUI: Open <http://openmower:5001> (or your individual hostname if changed), and login by entering the default Dockge admin user `openmower/openmower`:
87-
![Create Admin Account](.github/img/dockge_01.jpg)
8889
- CLI:
8990
- SSH into your Pi: `ssh openmower@openmower` (or your configured hostname).
9091
- WebTerminal via URL `http://openmower:7681` (or your configured hostname).
92+
- GUI: Open <http://openmower:5001> (or your individual hostname if changed)
9193

9294
2. Configure the stack (.env)
95+
- CLI: `openmower configure env`
9396
- GUI:
9497
![Select and Edit Stack](.github/img/dockge_02_select_and_edit.jpg)
9598
![Edit .env](.github/img/dockge_03_edit.jpg)
9699
![Save .env](.github/img/dockge_04_save.jpg)
97-
- CLI: `openmower configure env`
98100

99-
3. Start the stack (inclusive initial pull)
100-
- GUI:
101-
![Start Stack](.github/img/dockge_05_start.jpg)
102-
- CLI:
101+
3. Start the stack (including the initial pull)
102+
- CLI: If you configured your .env file via `openmower configure env` then the stack is pulled and started automatically.<br>
103+
If not:
103104

104105
```bash
105106
openmower pull
106107
openmower start
107108
```
109+
- GUI:
110+
![Start Stack](.github/img/dockge_05_start.jpg)
108111

109-
4. Check status and open the OpenMower webApp
112+
4. Check status and open the OpenMower web app
113+
- CLI: `openmower status` should list three service names (open_mower_ros, Mosquitto and OpenMowerApp), all with status 'up'. If so, open a browser and visit `http://openmower:8080` (or your configured hostname).
110114
- GUI:
111115
![Stack Active](.github/img/dockge_06_active.jpg)
112-
- CLI: `openmower status` should list three service names (open_mower_ros, Mosquitto, OpenMowerApp), all with status 'up'. If so, open a browser and visit `http://openmower:8080` (or your configured hostname).
113116

114-
5. Configure the ROS parameters (CLI only for now): `openmower configure ros`
117+
5. Configure the ROS parameters (CLI only for now): `openmower configure ros` and:
118+
119+
1. Adapt section `gps` to your needs, but set at least `datum_lat` and `datum_lon` to the corresponding lat/lon values near your docking station. Use right‑click in [Google Maps](https://maps.google.com) to get them.
120+
2. `ntrip_client` settings with the ones from your local RTK base or from your public NTRIP service.
121+
3. Once (and not before 🩸) you have validated your emergency sensors, set `enable_mower` to true.
115122

116123
</details>
117124

WHATSNEW.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ This document highlights the most relevant changes compared to previous OpenMowe
66
## 🆕 New
77

88
- 🖥️ [Dockge](https://dockge.kuma.pet/) GUI for container management.
9-
- 🖥️ WebTerminal [ttyd](https://github.com/tsl0922/ttyd) provides a browser-based shell as a lightweight SSH alternative.
9+
- 🖥️ WebTerminal [ttyd](https://tsl0922.github.io/ttyd/) provides a browser-based shell as a lightweight SSH alternative.
1010
- 🧰 Unified `openmower` CLI for configure, pull, start, stop, status, shell, logs, …
1111
- 🗂️ Consolidated storage layout: configs, maps, logs now in `/home/openmower`.
1212
- 🧾 Version metadata at `/usr/share/openmoweros/version.{json,yaml,sh,txt}` (git hash, branch, describe, build timestamp).
@@ -16,15 +16,15 @@ This document highlights the most relevant changes compared to previous OpenMowe
1616

1717
- ⚙️ Key settings (e.g. WLAN SSID & password) configurable directly in Raspberry Pi Imager.
1818
- ✍️ No need to pre-edit files like `/boot/openmower/openmower_version.txt` before first boot.
19-
- 🚀 Eliminated initial large image pull (only a short 2–5 minute Dockge pull remains).
19+
- 🚀 Eliminated initial large image pull.
2020
- 👤 Containers run with `openmower` user permissions (no sudo needed for most operations).
2121

2222

2323
## 🛠️ Under the hood (for the curious)
2424

2525
- 🐧 Debian Trixie (arm64) images built with [pi‑gen](https://github.com/RPi-Distro/pi-gen).
2626
- 📁 `openmower` CLI command is in `/usr/local/bin`.
27-
- 🐳 OpenMower stack: Mosquitto and OpenMowerApp (together with a small Nginx) now run as separate containers and are no longer built into the openmower image.
27+
- 🐳 OpenMower stack: Mosquitto and OpenMowerApp (together with a small Nginx) now run as separate containers and are no longer built into the open_mower_ros image.
2828
- 📶 WLAN is managed by NetworkManager.
2929
- 🔌 LAN is managed by ifupdown.
3030
- 📡 DHCP for the internal (xCore) LAN is handled by dnsmasq.

stage-openmower/30-docker/00-run-chroot.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,10 @@ cat > /etc/docker/daemon.json <<'EOF'
3636
}
3737
EOF
3838
fi
39+
40+
# Bundled docker images
41+
mkdir -p /opt/docker-images
42+
chmod -R u=rwX,g=rX,o=rX /opt/docker-images
43+
44+
# Ensure the preloader runs on boot (after docker)
45+
systemctl enable docker-preload-images.service
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#!/bin/bash -e
2+
3+
STAGE_DIR="$(dirname "$0")"
4+
5+
install -m 0644 -D "$STAGE_DIR/files/etc/systemd/system/docker-preload-images.service" "$ROOTFS_DIR/etc/systemd/system/docker-preload-images.service"
6+
7+
# Install bundled docker images
8+
install -d -m 0755 "$ROOTFS_DIR/opt/docker-images"
9+
cp -a "$STAGE_DIR/files/opt/docker-images/." "$ROOTFS_DIR/opt/docker-images/"
10+
11+
# Reassemble split files into their base
12+
DEST="$ROOTFS_DIR/opt/docker-images"
13+
if compgen -G "$DEST"/*.tar.gz.part* > /dev/null; then
14+
# Build unique list of basenames without the .partNN suffix
15+
for base in $(for f in "$DEST"/*.tar.gz.part*; do echo "${f%.part*}"; done | sort -u); do
16+
rm -f "${base}"
17+
for p in $(ls -1 "${base}".part* 2>/dev/null | sort -V); do
18+
cat "$p" >> "${base}"
19+
done
20+
rm -f "${base}".part*
21+
done
22+
fi
23+
24+
# Uncompress all .tar.gz files to .tar. OS image gets ZIPped anyway but preload service only needs docker load them
25+
for gz in "$DEST"/*.tar.gz; do
26+
[ -e "$gz" ] || break
27+
gunzip -f "$gz"
28+
done
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
[Unit]
2+
Description=Preload bundled Docker images (*.tar) into local Docker
3+
After=docker.service
4+
Requires=docker.service
5+
Before=dockge.service webterminal.service
6+
ConditionDirectoryNotEmpty=/opt/docker-images
7+
8+
[Service]
9+
Type=oneshot
10+
TimeoutStartSec=4min
11+
ExecStart=/bin/sh -e -c '\
12+
dir=/opt/docker-images; \
13+
# Load all .tar and delete on success \
14+
for tar in "$dir"/*.tar; do \
15+
[ -e "$tar" ] || break; \
16+
if docker load -i "$tar"; then rm -f "$tar"; fi; \
17+
done \
18+
'
19+
20+
[Install]
21+
WantedBy=multi-user.target
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)