The Manafish firmware is designed to run on Raspberry Pi devices, specifically the Raspberry Pi 3 and 4. It provides the firmware for controlling and using the Manafish ROV.
To build the SD image you need to have nix installed on an aarch64-linux
platform or proper emulation support for the aarch64-linux platform. Also add
the caches for the nixos-raspberrypi flake to the build system so the build
finishes in a reasonable time. Run the command for the specific Pi and camera
module you want to use:
nix build .#pi3-ov5647
nix build .#pi3-imx219
nix build .#pi3-imx477
nix build .#pi4-ov5647
nix build .#pi4-imx219
nix build .#pi4-imx477When you have built the image you can list it out with the following command:
ls -lh result/sd-imageThis will include the size of the image in the output. The image is compressed with zstd.
We need to plug in the SD card and find out what the device path is for the SD card.
On linux:
lsblkOn darwin:
diskutil listOn linux it is usually /dev/sdX where X is a letter, for example /dev/sdb.
On darwin it is usually /dev/diskX where X is a number for example
/dev/disk6.
To flash the image to the SD card you can use the following command, make sure
to replace /dev/XXX with the correct device path for your SD card:
zstd -dc result/sd-image/*.zst | sudo dd of=/dev/XXX bs=4M status=progress oflag=syncFlashing the SD card on windows is a little more complicated. It is not possible
to build the image on Windows and the commands will not work. Instead start by
downloading the image you want to use form the release page on GitHub. The
image will be in a .zst file format.
Make sure you have 7-Zip installed, and right-click the sd-image zst file and
select "Extract Here" to extract the image file.
Next make sure you have Rufus installed, and open it. Select the SD card from the "Device" dropdown. Click "Select" and choose the extracted .img file. Click "Start" to begin flashing the SD card.
After plugging the SD card in the Raspberry Pi and powering it on, you need to tell your computer how to connect to the Pi without disrupting your regular internet connection. This is done by assigning a static IP address to your computer in the same address space as the IP of the firmware (by default this is 10.10.10.10). We recommend setting it to 10.10.10.100 for simplicity.
- Open System Settings > Network
- Select your Ethernet connection
- Click "Details..."
- Under "Configure IPv4", select "Manually"
- Set the following:
- IP Address: 10.10.10.100
- Subnet Mask: 255.255.255.0
- Click "OK" and "Apply"
- Open "View Network Connections"
- You can find this by searching for "View Network Connections" in the Start menu
- Right-click your Ethernet connection and select "Properties"
- Select "Internet Protocol Version 4 (TCP/IPv4)" and click "Properties"
- Select "Use the following IP address" and enter:
- IP Address: 10.10.10.100
- Subnet Mask: 255.255.255.0
- Click "OK" to save
-
For Ubuntu/Debian GUI:
- Open Settings > Network
- Click the gear icon next to your Ethernet connection
- Go to IPv4 tab
- Select "Manual"
- Add Address: 10.10.10.100
- Netmask: 255.255.255.0
- Click "Apply"
-
For command line:
sudo ip addr add 10.10.10.100/24 dev eth0
Replace
eth0with your Ethernet interface name if different.
To modify the firmware on the Raspberry Pi, you need to connect to it via SSH.
The default username is pi and the password is manafish. The Pi will be
available on port 10.10.10.10 when connected via Ethernet after you have
configured your computer's Ethernet connection as described above.
Command to connect via SSH:
ssh pi@10.10.10.10If you have reflashed the SD card, you may need to delete the known hosts entry for the Pi before connecting:
ssh-keygen -R 10.10.10.10To connect to a WiFi network on the Pi, use the following commands:
-
List available WiFi networks:
nmcli device wifi list
-
Connect to a WiFi network:
nmcli device wifi connect "NETWORK_NAME" password "PASSWORD"
-
Check connection status:
nmcli connection show
The Manafish firmware runs as a systemd service. It is set to run automatically on startup, but during development it can be useful to stop/start/restart it. Here are the common commands to manage it:
-
Start the firmware service:
sudo systemctl start manafish-firmware
-
Stop the firmware service:
sudo systemctl stop manafish-firmware
-
Restart the firmware service:
sudo systemctl restart manafish-firmware
-
Check the service status:
sudo systemctl status manafish-firmware
-
Disable the service from starting on boot:
sudo systemctl disable manafish-firmware
-
View service logs:
journalctl -u manafish-firmware -fThis project is licensed under the GNU Affero General Public License v3.0 or later - see the LICENSE file for details.