Skip to content

ondras12345/mower

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

My Mowgli build

This repository contains various notes about my Mowgli OpenMower build.

Hardware

Mowers

I bought two broken mowers:

  • Yardforce 500

    • This one was driving around, but the blade motor wasn't spinning.
    • The fault was caused by bad contact in one of the connectors on the ribbon cable between the mainboard and the display board.
    • The motor debug script and discord question were for this mower.
    • I continued the build with this one.
  • Yardforce 500 B

    • Drives along the cable, turns around and goes back to the dock.
    • I haven't investigated this one further yet.

Hardware modifications

USB connector

Connections

  • STM32 pins are 5V tolerant, that's why people are able to get away with connecting 5V IMUs
  • J18 pin 6 has continuity to J14 (USB) 5V, and no other 5V supplies

System install instructions

  • ~/Downloads/NAS/completed/2025-05-13-raspios-bookworm-arm64-lite.img.xz
  • use raspi imager:
    • hostname openmower.local
    • username + pw
    • SSID: pISS ; WLAN country CZ
    • timezone: Europe/Prague
    • enable SSH; add key
    • it already did this: sudoedit /etc/ssh/sshd_config: PasswordAuthentication no
  • sudo apt update && sudo apt upgrade
  • sudo apt install tmux vim zsh git minicom etckeeper
  • sudo reboot

Docker

# https://docs.docker.com/engine/install/debian/#install-using-the-repository
# Add Docker's official GPG key:
sudo apt-get update
sudo apt-get install ca-certificates curl
#sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/debian/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc

# Add the repository to Apt sources:
echo \
  "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/debian \
  $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
  sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update

sudo apt install -y docker-ce docker-compose-plugin

Set docker to also log through standard systemd facilities:

sudo tee /etc/docker/daemon.json >/dev/null << "EOF"
{
  "log-driver": "journald"
}
EOF

sudo systemctl restart docker.service

Firewall

sudo apt install ufw
sudo ufw allow ssh
sudo ufw enable
# ... but docker containers still make it through (unless they use host networking)

TODO disabled, I think it was blocking me from moving the mower via the web interface.

Mowgli

sudo tee /etc/udev/rules.d/50-mowgli.rules >/dev/null <<"EOF"
SUBSYSTEM=="tty" ATTRS{product}=="Mowgli", SYMLINK+="mowgli"
# simpleRTK USB
SUBSYSTEM=="tty" ATTRS{idVendor}=="1546" ATTRS{idProduct}=="01a9", SYMLINK+="gps"
# ESP USB CDC - RTK1010Board
SUBSYSTEM=="tty" ATTRS{idVendor}=="303a" ATTRS{idProduct}=="4001", SYMLINK+="gps"

# ondra
# Mowgli debug
SUBSYSTEM=="tty" KERNEL=="ttyAMA5", SYMLINK+="mowgli_debug"

# WTRTK-960 GPS - uses generic CH340 :-(
SUBSYSTEM=="tty" ATTRS{idVendor}=="1a86" ATTRS{idProduct}=="7523", SYMLINK+="gps"
# same GPS, but via GPIO UART
SUBSYSTEM=="tty" KERNEL=="ttyAMA2", SYMLINK+="gps"
EOF

cd
git clone https://github.com/cedbossneo/mowgli-docker  # 0ab26b9
cd mowgli-docker
sudo docker compose pull
vi .env  # set both IPs to 127.0.0.1
sudo docker compose up -d

# see mowgli gui @ port 4006
# openmower web @ port 4005

Back up mainboard firmware via stlink:

sudo apt install openocd
lsusb | grep ST-LINK  # note the Bus xxx Device yyy
sudo chmod 666 /dev/bus/usb/001/003  # xxx/yyy

mkdir ~/firmware_backup
cd ~/firmware_backup
tee yardforce500.cfg >/dev/null <<"EOF"
source [find interface/stlink.cfg]
source [find target/stm32f1x.cfg]

transport select hla_swd
#reset_config srst_only srst_nogate


#program "firmware.bin" 0x08000000 verify reset; shutdown;
EOF

openocd -f yardforce500.cfg -c "init" -c "reset halt"   -c " dump_image firmware_backup.bin 0x08000000 0x40000" -c "reset" -c shutdown

# connect ST-LINK to display panel
# Disconnect ribbon cable from main unit, power the target from ST-LINK.
# is seems to have a fake stm32, -c set CPUTAPID 0x2ba01477 is needed
# Not sure what ram backup is for. It is different each time.
openocd -c "set CPUTAPID 0x2ba01477" -f yardforce500.cfg -c "init" -c "reset halt"   -c " dump_image panel_controller_ram.bin 0x20000000 0x10000" -c "reset" -c shutdown
openocd -c "set CPUTAPID 0x2ba01477" -f yardforce500.cfg -c "init" -c "reset halt" -c " dump_image panel_controller_backup.bin 0x08000000 0x10000" -c "reset" -c shutdown

Firmware version:

$ sha256sum firmware_backup.bin panel_controller_backup.bin
875bedb32ccb62ee23453581c8af13e61a523bfe758120564d6bdb27cf641998  firmware_backup.bin
b3b1142bf84e09fd506bf4b399632b60d2a6ae3a520c685d3fdbca08e2c1fb88  panel_controller_backup.bin

The upload tool does not work, build firmware manually:

cd
curl -fsSL -o get-platformio.py https://raw.githubusercontent.com/platformio/platformio-core-installer/master/get-platformio.py
python3 get-platformio.py
mkdir ~/bin
cd ~/bin
ln -s ~/.platformio/penv/bin/pio .
# start a new shell

cd
git clone https://github.com/cedbossneo/mowgli
cd ~/mowgli/stm32/ros_usbnode
pio run -e Yardforce500

lsusb | grep ST-LINK  # note the Bus xxx Device yyy
sudo chmod 666 /dev/bus/usb/001/003  # xxx/yyy

pio run -e Yardforce500 -t upload

Debug UART setup

sudoedit /boot/firmware/config.txt
# # Mowgli debug UART
# dtoverlay=uart5
# # GPS UART
# dtoverlay=uart2
minicom -D /dev/ttyAMA5
# see udev rules above
minicom -D /dev/mowgli_debug

Configure gps

  • WT-RTK960
  • I measured 3.3V DC on the coax => it does send phantom power the antenna
python -m serial.tools.miniterm /dev/gps 115200 -e

COM1 is USB COM2 and COM3 set to 115200 just to be safe, we can try higher baud rates later.

FRESET
CONFIG COM1 460800
CONFIG COM2 115200
CONFIG COM3 115200
MODE ROVER UAV
GPGGA 0.1
GPGSV 1
GPRMC 1
GPGSA 1
GPVTG 1
GPGST 1
SAVECONFIG

GPS antenna offset

Discord c.ez:

set export OM_ANTENNA_OFFSET_X=1.234 export OM_ANTENNA_OFFSET_Y=1.234 in your mower config file. (0/0) is the point between the wheels of your mower, X is to the front and Y is to the left, unit is m. So if your antenna is 10cm to the front relative to the origin, and centered left/right, then you would put 0.1 and 0.0

Setting

export OM_ANTENNA_OFFSET_X=0.290
export OM_ANTENNA_OFFSET_Y=-0.030

GPS base station

About

Some notes + hardware designs for my OpenMower Mowgli build

Topics

Resources

License

Stars

Watchers

Forks

Contributors