This guide targets contributors (humans or agents) working in SonarSimulator.
- Documentation policy: English only across repository docs.
- Track all notable changes in
version.md, grouped by date. - Keep contributor docs aligned with real behavior (
agents.md,README.md,version.md). - Make minimal and safe changes, then validate with executable checks.
- Runtime: Python 3
- Serial I/O:
pyserial - Deployment:
systemdservice (nmea.service) - Target platform: Ubuntu Server on Raspberry Pi (and compatible Linux hosts)
- Simulator code:
Script/sonar_simulator.py - Service launcher:
Script/autolaunch.sh - Unit tests:
Script/sonar_simulator_unittest.py - Test runner:
Script/unittest.sh - Install script:
Install/install.sh - Hardware BOM:
BOM.txt
- Keep Python code PEP 8 compatible and easy to test.
- Avoid hard-coded assumptions when possible; use env vars for runtime config.
- Keep shell scripts POSIX/Bash-safe (
set -euo pipefailfor bash scripts). - Use ASCII-only text in source/docs unless file already requires Unicode.
- Run unit tests before finalizing:
bash Script/unittest.sh
- Validate Python syntax when touching scripts:
python3 -m py_compile Script/sonar_simulator.py Script/sonar_simulator_unittest.py
Install/install.shwrites/etc/systemd/system/nmea.service.- Default runtime values are configured by service env vars:
SONAR_SERIAL_PORT=/dev/ttyUSB0SONAR_BAUD_RATE=9600SONAR_SENTENCE_TYPE=dpt(dptordbt)
- After service changes always run:
sudo systemctl daemon-reloadsudo systemctl restart nmea
VERSIONstores the current semantic version.version.mdstores dated change history.- New notes must be added under the current date section.
- Unit tests pass (
bash Script/unittest.sh) - README commands match current scripts/paths
- Service install flow tested or reason documented
-
version.mdupdated for notable behavior changes -
agents.mdupdated if contributor workflow changed