yarbo-local 0.1.0.dev0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (109) hide show
  1. yarbo_local-0.1.0.dev0/.gitignore +221 -0
  2. yarbo_local-0.1.0.dev0/LICENSE +21 -0
  3. yarbo_local-0.1.0.dev0/PKG-INFO +144 -0
  4. yarbo_local-0.1.0.dev0/README.md +111 -0
  5. yarbo_local-0.1.0.dev0/docs/multi-robot.md +73 -0
  6. yarbo_local-0.1.0.dev0/docs/phase0-findings.md +179 -0
  7. yarbo_local-0.1.0.dev0/docs/phase0.md +36 -0
  8. yarbo_local-0.1.0.dev0/docs/releasing.md +32 -0
  9. yarbo_local-0.1.0.dev0/docs/studio.md +31 -0
  10. yarbo_local-0.1.0.dev0/protocol/README.md +26 -0
  11. yarbo_local-0.1.0.dev0/protocol/codes.yaml +93 -0
  12. yarbo_local-0.1.0.dev0/protocol/commands.yaml +680 -0
  13. yarbo_local-0.1.0.dev0/protocol/fields.seed.yaml +844 -0
  14. yarbo_local-0.1.0.dev0/protocol/fields.yaml +4159 -0
  15. yarbo_local-0.1.0.dev0/protocol/fixtures/3.14.11/area-params.jsonl +9 -0
  16. yarbo_local-0.1.0.dev0/protocol/fixtures/3.14.11/devicemsg-awake-45s.jsonl +66 -0
  17. yarbo_local-0.1.0.dev0/protocol/fixtures/3.14.11/docked-awake-75s.jsonl +125 -0
  18. yarbo_local-0.1.0.dev0/protocol/fixtures/3.14.11/get_all_map_backup-asleep.jsonl +4 -0
  19. yarbo_local-0.1.0.dev0/protocol/fixtures/3.14.11/get_controller.jsonl +5 -0
  20. yarbo_local-0.1.0.dev0/protocol/fixtures/3.14.11/get_device_msg-asleep-via-basestation.jsonl +5 -0
  21. yarbo_local-0.1.0.dev0/protocol/fixtures/3.14.11/get_device_msg-asleep.jsonl +5 -0
  22. yarbo_local-0.1.0.dev0/protocol/fixtures/3.14.11/get_map-area-pathway.jsonl +13 -0
  23. yarbo_local-0.1.0.dev0/protocol/fixtures/3.14.11/get_map-asleep.jsonl +9 -0
  24. yarbo_local-0.1.0.dev0/protocol/fixtures/3.14.11/get_plan_feedback-idle.jsonl +3 -0
  25. yarbo_local-0.1.0.dev0/protocol/fixtures/3.14.11/get_state_msg-asleep.jsonl +4 -0
  26. yarbo_local-0.1.0.dev0/protocol/fixtures/3.14.11/heartbeat-asleep-20s.jsonl +4 -0
  27. yarbo_local-0.1.0.dev0/protocol/fixtures/3.14.11/heartbeat-wake-to-sleep-240s.jsonl +108 -0
  28. yarbo_local-0.1.0.dev0/protocol/fixtures/3.14.11/mapping-area-app.jsonl +494 -0
  29. yarbo_local-0.1.0.dev0/protocol/fixtures/3.14.11/mower-pro-fault-902-tilted.jsonl +10 -0
  30. yarbo_local-0.1.0.dev0/protocol/fixtures/3.14.11/mower-pro-plan-running.jsonl +17 -0
  31. yarbo_local-0.1.0.dev0/protocol/fixtures/3.14.11/mower-pro-run-faults-estop.jsonl +76 -0
  32. yarbo_local-0.1.0.dev0/protocol/fixtures/3.14.11/mower-pro-ultrasonic-avoidance.jsonl +167 -0
  33. yarbo_local-0.1.0.dev0/protocol/fixtures/3.14.11/plan-completes-and-docks.jsonl +118 -0
  34. yarbo_local-0.1.0.dev0/protocol/fixtures/3.14.11/plan-pause-resume-app.jsonl +19 -0
  35. yarbo_local-0.1.0.dev0/protocol/fixtures/3.14.11/plan-start-fails-route-wp005.jsonl +21 -0
  36. yarbo_local-0.1.0.dev0/protocol/fixtures/3.14.11/plan-start-from-dock.jsonl +39 -0
  37. yarbo_local-0.1.0.dev0/protocol/fixtures/3.14.11/plan-start-then-stop.jsonl +22 -0
  38. yarbo_local-0.1.0.dev0/protocol/fixtures/3.14.11/plan-stop-while-mowing.jsonl +18 -0
  39. yarbo_local-0.1.0.dev0/protocol/fixtures/3.14.11/plan-stopped-from-app-effects-only.jsonl +15 -0
  40. yarbo_local-0.1.0.dev0/protocol/fixtures/3.14.11/read_all_clean_area-asleep.jsonl +4 -0
  41. yarbo_local-0.1.0.dev0/protocol/fixtures/3.14.11/read_all_nogozone-asleep.jsonl +5 -0
  42. yarbo_local-0.1.0.dev0/protocol/fixtures/3.14.11/read_all_pathway-asleep.jsonl +4 -0
  43. yarbo_local-0.1.0.dev0/protocol/fixtures/3.14.11/read_all_plan-asleep.jsonl +5 -0
  44. yarbo_local-0.1.0.dev0/protocol/fixtures/3.14.11/read_all_sidewalk-asleep.jsonl +5 -0
  45. yarbo_local-0.1.0.dev0/protocol/fixtures/3.14.11/read_global_params-id1.jsonl +3 -0
  46. yarbo_local-0.1.0.dev0/protocol/fixtures/3.14.11/read_global_params-no-id-error.jsonl +5 -0
  47. yarbo_local-0.1.0.dev0/protocol/fixtures/3.14.11/read_gps_ref-asleep.jsonl +4 -0
  48. yarbo_local-0.1.0.dev0/protocol/fixtures/3.14.11/read_recharge_point-asleep.jsonl +5 -0
  49. yarbo_local-0.1.0.dev0/protocol/fixtures/3.14.11/read_schedules-asleep.jsonl +4 -0
  50. yarbo_local-0.1.0.dev0/protocol/fixtures/3.14.11/return-to-dock-from-fault.jsonl +76 -0
  51. yarbo_local-0.1.0.dev0/protocol/fixtures/3.14.11/set_working_state-wake.jsonl +46 -0
  52. yarbo_local-0.1.0.dev0/protocol/fixtures/README.md +32 -0
  53. yarbo_local-0.1.0.dev0/pyproject.toml +101 -0
  54. yarbo_local-0.1.0.dev0/src/yarbo_local/__init__.py +93 -0
  55. yarbo_local-0.1.0.dev0/src/yarbo_local/blackbox.py +110 -0
  56. yarbo_local-0.1.0.dev0/src/yarbo_local/capture.py +140 -0
  57. yarbo_local-0.1.0.dev0/src/yarbo_local/cli.py +264 -0
  58. yarbo_local-0.1.0.dev0/src/yarbo_local/client.py +231 -0
  59. yarbo_local-0.1.0.dev0/src/yarbo_local/codec.py +140 -0
  60. yarbo_local-0.1.0.dev0/src/yarbo_local/discover.py +244 -0
  61. yarbo_local-0.1.0.dev0/src/yarbo_local/dump.py +110 -0
  62. yarbo_local-0.1.0.dev0/src/yarbo_local/exceptions.py +65 -0
  63. yarbo_local-0.1.0.dev0/src/yarbo_local/feedback.py +177 -0
  64. yarbo_local-0.1.0.dev0/src/yarbo_local/fieldmap.py +207 -0
  65. yarbo_local-0.1.0.dev0/src/yarbo_local/lifecycle.py +325 -0
  66. yarbo_local-0.1.0.dev0/src/yarbo_local/models.py +904 -0
  67. yarbo_local-0.1.0.dev0/src/yarbo_local/observer.py +173 -0
  68. yarbo_local-0.1.0.dev0/src/yarbo_local/obstacles.py +205 -0
  69. yarbo_local-0.1.0.dev0/src/yarbo_local/preflight.py +100 -0
  70. yarbo_local-0.1.0.dev0/src/yarbo_local/probe.py +234 -0
  71. yarbo_local-0.1.0.dev0/src/yarbo_local/py.typed +0 -0
  72. yarbo_local-0.1.0.dev0/src/yarbo_local/redact.py +260 -0
  73. yarbo_local-0.1.0.dev0/src/yarbo_local/registry.py +184 -0
  74. yarbo_local-0.1.0.dev0/src/yarbo_local/resolve.py +105 -0
  75. yarbo_local-0.1.0.dev0/src/yarbo_local/session.py +434 -0
  76. yarbo_local-0.1.0.dev0/src/yarbo_local/simulator.py +408 -0
  77. yarbo_local-0.1.0.dev0/src/yarbo_local/sitecheck.py +841 -0
  78. yarbo_local-0.1.0.dev0/src/yarbo_local/status.py +90 -0
  79. yarbo_local-0.1.0.dev0/src/yarbo_local/studio/__init__.py +4 -0
  80. yarbo_local-0.1.0.dev0/src/yarbo_local/studio/server.py +440 -0
  81. yarbo_local-0.1.0.dev0/src/yarbo_local/studio/static/app.js +683 -0
  82. yarbo_local-0.1.0.dev0/src/yarbo_local/studio/static/index.html +13 -0
  83. yarbo_local-0.1.0.dev0/src/yarbo_local/studio/static/style.css +17 -0
  84. yarbo_local-0.1.0.dev0/src/yarbo_local/studio/static/vendor/README.md +12 -0
  85. yarbo_local-0.1.0.dev0/src/yarbo_local/studio/static/vendor/lit.js +44 -0
  86. yarbo_local-0.1.0.dev0/src/yarbo_local/topics.py +84 -0
  87. yarbo_local-0.1.0.dev0/src/yarbo_local/transport.py +264 -0
  88. yarbo_local-0.1.0.dev0/tests/conftest.py +15 -0
  89. yarbo_local-0.1.0.dev0/tests/live/test_site.py +43 -0
  90. yarbo_local-0.1.0.dev0/tests/test_blackbox.py +109 -0
  91. yarbo_local-0.1.0.dev0/tests/test_codec.py +73 -0
  92. yarbo_local-0.1.0.dev0/tests/test_codes_consistency.py +50 -0
  93. yarbo_local-0.1.0.dev0/tests/test_discover.py +58 -0
  94. yarbo_local-0.1.0.dev0/tests/test_dump.py +47 -0
  95. yarbo_local-0.1.0.dev0/tests/test_fieldmap.py +56 -0
  96. yarbo_local-0.1.0.dev0/tests/test_fields.py +72 -0
  97. yarbo_local-0.1.0.dev0/tests/test_lifecycle.py +392 -0
  98. yarbo_local-0.1.0.dev0/tests/test_models.py +275 -0
  99. yarbo_local-0.1.0.dev0/tests/test_multi_robot.py +346 -0
  100. yarbo_local-0.1.0.dev0/tests/test_observer.py +146 -0
  101. yarbo_local-0.1.0.dev0/tests/test_obstacles.py +91 -0
  102. yarbo_local-0.1.0.dev0/tests/test_preflight.py +231 -0
  103. yarbo_local-0.1.0.dev0/tests/test_protocol.py +73 -0
  104. yarbo_local-0.1.0.dev0/tests/test_redact.py +194 -0
  105. yarbo_local-0.1.0.dev0/tests/test_registry.py +46 -0
  106. yarbo_local-0.1.0.dev0/tests/test_session.py +321 -0
  107. yarbo_local-0.1.0.dev0/tests/test_sitecheck.py +334 -0
  108. yarbo_local-0.1.0.dev0/tests/test_studio.py +168 -0
  109. yarbo_local-0.1.0.dev0/tests/test_topics.py +30 -0
@@ -0,0 +1,221 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[codz]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ share/python-wheels/
24
+ *.egg-info/
25
+ .installed.cfg
26
+ *.egg
27
+ MANIFEST
28
+
29
+ # PyInstaller
30
+ # Usually these files are written by a python script from a template
31
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
32
+ *.manifest
33
+ *.spec
34
+
35
+ # Installer logs
36
+ pip-log.txt
37
+ pip-delete-this-directory.txt
38
+
39
+ # Unit test / coverage reports
40
+ htmlcov/
41
+ .tox/
42
+ .nox/
43
+ .coverage
44
+ .coverage.*
45
+ .cache
46
+ nosetests.xml
47
+ coverage.xml
48
+ *.cover
49
+ *.py.cover
50
+ .hypothesis/
51
+ .pytest_cache/
52
+ cover/
53
+
54
+ # Translations
55
+ *.mo
56
+ *.pot
57
+
58
+ # Django stuff:
59
+ *.log
60
+ local_settings.py
61
+ db.sqlite3
62
+ db.sqlite3-journal
63
+
64
+ # Flask stuff:
65
+ instance/
66
+ .webassets-cache
67
+
68
+ # Scrapy stuff:
69
+ .scrapy
70
+
71
+ # Sphinx documentation
72
+ docs/_build/
73
+
74
+ # PyBuilder
75
+ .pybuilder/
76
+ target/
77
+
78
+ # Jupyter Notebook
79
+ .ipynb_checkpoints
80
+
81
+ # IPython
82
+ profile_default/
83
+ ipython_config.py
84
+
85
+ # pyenv
86
+ # For a library or package, you might want to ignore these files since the code is
87
+ # intended to run in multiple environments; otherwise, check them in:
88
+ # .python-version
89
+
90
+ # pipenv
91
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
93
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
94
+ # install all needed dependencies.
95
+ # Pipfile.lock
96
+
97
+ # UV
98
+ # Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
99
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
100
+ # commonly ignored for libraries.
101
+ # uv.lock
102
+
103
+ # poetry
104
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
105
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
106
+ # commonly ignored for libraries.
107
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
108
+ # poetry.lock
109
+ # poetry.toml
110
+
111
+ # pdm
112
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
113
+ # pdm recommends including project-wide configuration in pdm.toml, but excluding .pdm-python.
114
+ # https://pdm-project.org/en/latest/usage/project/#working-with-version-control
115
+ # pdm.lock
116
+ # pdm.toml
117
+ .pdm-python
118
+ .pdm-build/
119
+
120
+ # pixi
121
+ # Similar to Pipfile.lock, it is generally recommended to include pixi.lock in version control.
122
+ # pixi.lock
123
+ # Pixi creates a virtual environment in the .pixi directory, just like venv module creates one
124
+ # in the .venv directory. It is recommended not to include this directory in version control.
125
+ .pixi
126
+
127
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
128
+ __pypackages__/
129
+
130
+ # Celery stuff
131
+ celerybeat-schedule
132
+ celerybeat.pid
133
+
134
+ # Redis
135
+ *.rdb
136
+ *.aof
137
+ *.pid
138
+
139
+ # RabbitMQ
140
+ mnesia/
141
+ rabbitmq/
142
+ rabbitmq-data/
143
+
144
+ # ActiveMQ
145
+ activemq-data/
146
+
147
+ # SageMath parsed files
148
+ *.sage.py
149
+
150
+ # Environments
151
+ .env
152
+ .envrc
153
+ .venv
154
+ env/
155
+ venv/
156
+ ENV/
157
+ env.bak/
158
+ venv.bak/
159
+
160
+ # Spyder project settings
161
+ .spyderproject
162
+ .spyproject
163
+
164
+ # Rope project settings
165
+ .ropeproject
166
+
167
+ # mkdocs documentation
168
+ /site
169
+
170
+ # mypy
171
+ .mypy_cache/
172
+ .dmypy.json
173
+ dmypy.json
174
+
175
+ # Pyre type checker
176
+ .pyre/
177
+
178
+ # pytype static type analyzer
179
+ .pytype/
180
+
181
+ # Cython debug symbols
182
+ cython_debug/
183
+
184
+ # PyCharm
185
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
186
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
187
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
188
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
189
+ # .idea/
190
+
191
+ # Abstra
192
+ # Abstra is an AI-powered process automation framework.
193
+ # Ignore directories containing user credentials, local state, and settings.
194
+ # Learn more at https://abstra.io/docs
195
+ .abstra/
196
+
197
+ # Visual Studio Code
198
+ # Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
199
+ # that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
200
+ # and can be added to the global gitignore or merged into this file. However, if you prefer,
201
+ # you could uncomment the following to ignore the entire vscode folder
202
+ # .vscode/
203
+ # Temporary file for partial code execution
204
+ tempCodeRunnerFile.py
205
+
206
+ # Ruff stuff:
207
+ .ruff_cache/
208
+
209
+ # PyPI configuration file
210
+ .pypirc
211
+
212
+ # Marimo
213
+ marimo/_static/
214
+ marimo/_lsp/
215
+ __marimo__/
216
+
217
+ # Streamlit
218
+ .streamlit/secrets.toml
219
+
220
+ # local captures contain serials and coordinates
221
+ captures/
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 yarbo-local
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,144 @@
1
+ Metadata-Version: 2.5
2
+ Name: yarbo-local
3
+ Version: 0.1.0.dev0
4
+ Summary: Local-first asyncio library and tooling for Yarbo robots over their LAN MQTT broker. No cloud.
5
+ Project-URL: Homepage, https://github.com/yarbo-local/yarbo-local
6
+ Project-URL: Issues, https://github.com/yarbo-local/yarbo-local/issues
7
+ Author: Yarbo Local contributors
8
+ License-Expression: MIT
9
+ License-File: LICENSE
10
+ Keywords: asyncio,home-assistant,mqtt,robot-mower,yarbo
11
+ Classifier: Development Status :: 2 - Pre-Alpha
12
+ Classifier: Framework :: AsyncIO
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: License :: OSI Approved :: MIT License
15
+ Classifier: Programming Language :: Python :: 3 :: Only
16
+ Classifier: Programming Language :: Python :: 3.13
17
+ Classifier: Programming Language :: Python :: 3.14
18
+ Classifier: Topic :: Home Automation
19
+ Classifier: Typing :: Typed
20
+ Requires-Python: >=3.13
21
+ Requires-Dist: aiomqtt<3,>=2.5
22
+ Requires-Dist: pyyaml>=6.0
23
+ Provides-Extra: dev
24
+ Requires-Dist: aiohttp<4,>=3.10; extra == 'dev'
25
+ Requires-Dist: mypy>=1.11; extra == 'dev'
26
+ Requires-Dist: pytest-asyncio>=0.24; extra == 'dev'
27
+ Requires-Dist: pytest>=8.3; extra == 'dev'
28
+ Requires-Dist: ruff>=0.6; extra == 'dev'
29
+ Requires-Dist: types-pyyaml>=6.0; extra == 'dev'
30
+ Provides-Extra: studio
31
+ Requires-Dist: aiohttp<4,>=3.10; extra == 'studio'
32
+ Description-Content-Type: text/markdown
33
+
34
+ # yarbo-local
35
+
36
+ Local-first tooling and, later, the asyncio library behind a Home Assistant integration for Yarbo robots. It talks to the anonymous MQTT broker the robot runs on your LAN and to nothing else. No Yarbo account, no vendor servers, no telemetry.
37
+
38
+ Status: **pre-alpha.** Phase 0 validated the protocol on real hardware (firmware 3.14.11) and produced the knowledge base in `protocol/`: 19 commands verified with captures, the rest marked as candidates that cannot be sent. The library core is in place: a registry-gated session, typed state, the map, a fixture-driven simulator and a small client. The Home Assistant integration ([yarbo-local-ha](https://github.com/yarbo-local/yarbo-local-ha)) shows the robot and its map but does not control it yet, and the dashboard card ([yarbo-local-card](https://github.com/yarbo-local/yarbo-local-card)) draws the map, the robot and plan progress. Next is plan control: pause, resume, stop and start, each verified against the robot first. Not on PyPI yet.
39
+
40
+ ## What is here
41
+
42
+ | Path | Purpose |
43
+ |---|---|
44
+ | `src/yarbo_local/client.py` | `YarboRobot`: connect, read typed state, and run the verified reads. |
45
+ | `src/yarbo_local/session.py` | The protocol layer: reconnect, reply correlation, encoding choice, wake and controller rules. |
46
+ | `src/yarbo_local/registry.py` | The command allowlist loaded from `protocol/commands.yaml`. Forbidden names cannot be sent. |
47
+ | `src/yarbo_local/models.py` | `RobotState` and the map, plan and GNSS parsers. No I/O. |
48
+ | `src/yarbo_local/transport.py` | aiomqtt transport plus an in-memory fake for tests. |
49
+ | `src/yarbo_local/simulator.py` | A robot built from fixtures, for tests and for developing without hardware. |
50
+ | `src/yarbo_local/resolve.py` | Address resolution: last address, DNS name, subnet scan. |
51
+ | `src/yarbo_local/fieldmap.py` | Builds `protocol/fields.yaml` from the curated seed and the fixtures. |
52
+ | `src/yarbo_local/studio/` | The Studio: aiohttp server and Lit UI (`docs/studio.md`). |
53
+ | `src/yarbo_local/codec.py` | zlib-or-plain JSON codec with the firmware rule and an observed-encoding fallback. |
54
+ | `src/yarbo_local/capture.py` | `sniff`: subscribe to `snowbot/+/#` and write every message to JSONL, optionally redacted. |
55
+ | `src/yarbo_local/probe.py` | `probe`: send one allowlisted command, show the correlated reply and the telemetry deltas. |
56
+ | `src/yarbo_local/discover.py` | `discover`: find brokers carrying `snowbot` traffic, identified by the serial in their topics. |
57
+ | `src/yarbo_local/dump.py` | `dump`: summarise a capture, including the full `DeviceMSG` key inventory. |
58
+ | `src/yarbo_local/sitecheck.py` | `sitecheck`: check a site with one or several robots, reads only, and write a report that is safe to share (`docs/multi-robot.md`). |
59
+ | `src/yarbo_local/redact.py` | Serial, MAC, IP, coordinate and Wi-Fi redaction for shareable fixtures. |
60
+ | `protocol/` | The knowledge base: `commands.yaml`, `fields.yaml`, `codes.yaml`, `fixtures/`. |
61
+ | `docs/phase0.md` | The twelve questions Phase 0 answers, with the exact commands. |
62
+
63
+ ## Quick start
64
+
65
+ ```bash
66
+ git clone https://github.com/yarbo-local/yarbo-local
67
+ cd yarbo-local
68
+ uv sync --extra dev
69
+ uv run yarbo-local discover 192.168.40.0/24
70
+ uv run yarbo-local sniff 192.168.40.23 --out captures/idle.jsonl
71
+ uv run yarbo-local dump captures/idle.jsonl --keys --app
72
+ uv run yarbo-local probe 192.168.40.23 get_device_msg
73
+ ```
74
+
75
+ `probe` only sends commands on a short allowlist of reads plus the wake-up command. It will not send anything that moves the robot, changes the map, or touches settings.
76
+
77
+ ## Using the library
78
+
79
+ ```python
80
+ import asyncio
81
+ from yarbo_local import YarboRobot
82
+
83
+
84
+ async def main() -> None:
85
+ async with YarboRobot.for_host("192.168.50.184") as robot:
86
+ state = await robot.snapshot()
87
+ print(state.activity, state.battery, state.head_name)
88
+ for plan in await robot.plans():
89
+ print(plan.id, plan.name)
90
+ robot.on_state(lambda s: print("changed:", s.activity))
91
+ await asyncio.sleep(30)
92
+
93
+
94
+ asyncio.run(main())
95
+ ```
96
+
97
+ Rules the session enforces, on purpose:
98
+
99
+ - Only commands in `protocol/commands.yaml` can be sent. Names in its `forbidden` section are not entries and can never be sent, with or without flags.
100
+ - A command whose status is `candidate` is refused unless the session was opened with `allow_candidates=True`. The Home Assistant integration never does that; the Studio does.
101
+ - A command with `risk: confirm` needs `confirmed=True` on the call.
102
+ - The wake command and the controller role are used only when the command's flags say they are needed, and the controller is itself still a candidate.
103
+ - Outbound encoding follows the robot's firmware, or what it has been seen sending, so a robot on 3.9 or later never silently drops a plaintext command.
104
+ - The connection loop never returns on a dropped broker; it backs off with jitter and reconnects.
105
+
106
+ The same CLI can show what the library sees, stand up a fake robot from a fixture for development without hardware, and open the Studio, a local web UI for watching the protocol, documenting fields and saving fixtures (see `docs/studio.md`):
107
+
108
+ ```bash
109
+ uv run yarbo-local status yarbo.localdomain --watch 30
110
+ uv run yarbo-local sim protocol/fixtures/3.14.11/get_device_msg-asleep.jsonl --broker 127.0.0.1
111
+ uv run yarbo-local studio yarbo.localdomain
112
+ ```
113
+
114
+ ## Can't see the base station in your router or controller?
115
+
116
+ You won't. The base station bridges the rover's HaLow link onto your LAN behind a locally administered MAC that never associates with an access point or asks your DHCP server for an address. It picks a static address for itself, inside your DHCP pool, and it has no management page. Network controllers such as UniFi list clients by association or wired port, so the base station simply does not exist to them, even while it answers on ports 1883, 8883 and 22.
117
+
118
+ Do not spend an afternoon on this. Scan the subnet instead:
119
+
120
+ ```bash
121
+ uv run yarbo-local discover 192.168.1.0/24 --wait 8
122
+ ```
123
+
124
+ Every host carrying Yarbo traffic is listed with the serial it carries and its DNS name, if it has one. A robot is identified by its own topics and nothing else; the tool reads no ARP table and runs no other program. The rover and the base station both answer, with the same data. Then protect yourself from the address collision Yarbo set up for you: either shrink your DHCP pool so it starts above the base station's address, or put the Yarbo Wi-Fi association on an isolated VLAN so the whole bridge moves out of your main network.
125
+
126
+ ## Safety and privacy
127
+
128
+ The robot's broker has no authentication. Anyone on its network segment can drive it. Put the robot on its own VLAN, allow only the machine running this tooling (and later Home Assistant) to reach port 1883, and think deliberately about whether the robot should have internet access at all. Captures contain your serial number, coordinates and network details; use `--redact` and review the file before sharing it.
129
+
130
+ ## Have more than one robot?
131
+
132
+ Nobody on the project does. One command tells us what we cannot find out ourselves, without sharing a serial, an address or a position: see [docs/multi-robot.md](docs/multi-robot.md).
133
+
134
+ ## Contributing protocol knowledge
135
+
136
+ Read `protocol/README.md`. A command becomes `verified` only with a fixture showing the request and the reply on real hardware, with the firmware version recorded. Pull requests that add knowledge without evidence are asked for a capture.
137
+
138
+ ## Releasing
139
+
140
+ Releases are published to PyPI by GitHub Actions through trusted publishing, with a manual approval and no token anywhere. See `docs/releasing.md`.
141
+
142
+ ## License and trademark
143
+
144
+ MIT. Protocol facts were assembled from the vendor's MIT-licensed SDK, from `python-yarbo`, `home-assistant-yarbo`, the `jtubb` and `briangann` forks of the vendor integration, and the `steves2j` map editor; see `protocol/commands.yaml` for per-entry sources. Yarbo is a trademark of its owner. This project is not affiliated with, endorsed by, or supported by Yarbo.
@@ -0,0 +1,111 @@
1
+ # yarbo-local
2
+
3
+ Local-first tooling and, later, the asyncio library behind a Home Assistant integration for Yarbo robots. It talks to the anonymous MQTT broker the robot runs on your LAN and to nothing else. No Yarbo account, no vendor servers, no telemetry.
4
+
5
+ Status: **pre-alpha.** Phase 0 validated the protocol on real hardware (firmware 3.14.11) and produced the knowledge base in `protocol/`: 19 commands verified with captures, the rest marked as candidates that cannot be sent. The library core is in place: a registry-gated session, typed state, the map, a fixture-driven simulator and a small client. The Home Assistant integration ([yarbo-local-ha](https://github.com/yarbo-local/yarbo-local-ha)) shows the robot and its map but does not control it yet, and the dashboard card ([yarbo-local-card](https://github.com/yarbo-local/yarbo-local-card)) draws the map, the robot and plan progress. Next is plan control: pause, resume, stop and start, each verified against the robot first. Not on PyPI yet.
6
+
7
+ ## What is here
8
+
9
+ | Path | Purpose |
10
+ |---|---|
11
+ | `src/yarbo_local/client.py` | `YarboRobot`: connect, read typed state, and run the verified reads. |
12
+ | `src/yarbo_local/session.py` | The protocol layer: reconnect, reply correlation, encoding choice, wake and controller rules. |
13
+ | `src/yarbo_local/registry.py` | The command allowlist loaded from `protocol/commands.yaml`. Forbidden names cannot be sent. |
14
+ | `src/yarbo_local/models.py` | `RobotState` and the map, plan and GNSS parsers. No I/O. |
15
+ | `src/yarbo_local/transport.py` | aiomqtt transport plus an in-memory fake for tests. |
16
+ | `src/yarbo_local/simulator.py` | A robot built from fixtures, for tests and for developing without hardware. |
17
+ | `src/yarbo_local/resolve.py` | Address resolution: last address, DNS name, subnet scan. |
18
+ | `src/yarbo_local/fieldmap.py` | Builds `protocol/fields.yaml` from the curated seed and the fixtures. |
19
+ | `src/yarbo_local/studio/` | The Studio: aiohttp server and Lit UI (`docs/studio.md`). |
20
+ | `src/yarbo_local/codec.py` | zlib-or-plain JSON codec with the firmware rule and an observed-encoding fallback. |
21
+ | `src/yarbo_local/capture.py` | `sniff`: subscribe to `snowbot/+/#` and write every message to JSONL, optionally redacted. |
22
+ | `src/yarbo_local/probe.py` | `probe`: send one allowlisted command, show the correlated reply and the telemetry deltas. |
23
+ | `src/yarbo_local/discover.py` | `discover`: find brokers carrying `snowbot` traffic, identified by the serial in their topics. |
24
+ | `src/yarbo_local/dump.py` | `dump`: summarise a capture, including the full `DeviceMSG` key inventory. |
25
+ | `src/yarbo_local/sitecheck.py` | `sitecheck`: check a site with one or several robots, reads only, and write a report that is safe to share (`docs/multi-robot.md`). |
26
+ | `src/yarbo_local/redact.py` | Serial, MAC, IP, coordinate and Wi-Fi redaction for shareable fixtures. |
27
+ | `protocol/` | The knowledge base: `commands.yaml`, `fields.yaml`, `codes.yaml`, `fixtures/`. |
28
+ | `docs/phase0.md` | The twelve questions Phase 0 answers, with the exact commands. |
29
+
30
+ ## Quick start
31
+
32
+ ```bash
33
+ git clone https://github.com/yarbo-local/yarbo-local
34
+ cd yarbo-local
35
+ uv sync --extra dev
36
+ uv run yarbo-local discover 192.168.40.0/24
37
+ uv run yarbo-local sniff 192.168.40.23 --out captures/idle.jsonl
38
+ uv run yarbo-local dump captures/idle.jsonl --keys --app
39
+ uv run yarbo-local probe 192.168.40.23 get_device_msg
40
+ ```
41
+
42
+ `probe` only sends commands on a short allowlist of reads plus the wake-up command. It will not send anything that moves the robot, changes the map, or touches settings.
43
+
44
+ ## Using the library
45
+
46
+ ```python
47
+ import asyncio
48
+ from yarbo_local import YarboRobot
49
+
50
+
51
+ async def main() -> None:
52
+ async with YarboRobot.for_host("192.168.50.184") as robot:
53
+ state = await robot.snapshot()
54
+ print(state.activity, state.battery, state.head_name)
55
+ for plan in await robot.plans():
56
+ print(plan.id, plan.name)
57
+ robot.on_state(lambda s: print("changed:", s.activity))
58
+ await asyncio.sleep(30)
59
+
60
+
61
+ asyncio.run(main())
62
+ ```
63
+
64
+ Rules the session enforces, on purpose:
65
+
66
+ - Only commands in `protocol/commands.yaml` can be sent. Names in its `forbidden` section are not entries and can never be sent, with or without flags.
67
+ - A command whose status is `candidate` is refused unless the session was opened with `allow_candidates=True`. The Home Assistant integration never does that; the Studio does.
68
+ - A command with `risk: confirm` needs `confirmed=True` on the call.
69
+ - The wake command and the controller role are used only when the command's flags say they are needed, and the controller is itself still a candidate.
70
+ - Outbound encoding follows the robot's firmware, or what it has been seen sending, so a robot on 3.9 or later never silently drops a plaintext command.
71
+ - The connection loop never returns on a dropped broker; it backs off with jitter and reconnects.
72
+
73
+ The same CLI can show what the library sees, stand up a fake robot from a fixture for development without hardware, and open the Studio, a local web UI for watching the protocol, documenting fields and saving fixtures (see `docs/studio.md`):
74
+
75
+ ```bash
76
+ uv run yarbo-local status yarbo.localdomain --watch 30
77
+ uv run yarbo-local sim protocol/fixtures/3.14.11/get_device_msg-asleep.jsonl --broker 127.0.0.1
78
+ uv run yarbo-local studio yarbo.localdomain
79
+ ```
80
+
81
+ ## Can't see the base station in your router or controller?
82
+
83
+ You won't. The base station bridges the rover's HaLow link onto your LAN behind a locally administered MAC that never associates with an access point or asks your DHCP server for an address. It picks a static address for itself, inside your DHCP pool, and it has no management page. Network controllers such as UniFi list clients by association or wired port, so the base station simply does not exist to them, even while it answers on ports 1883, 8883 and 22.
84
+
85
+ Do not spend an afternoon on this. Scan the subnet instead:
86
+
87
+ ```bash
88
+ uv run yarbo-local discover 192.168.1.0/24 --wait 8
89
+ ```
90
+
91
+ Every host carrying Yarbo traffic is listed with the serial it carries and its DNS name, if it has one. A robot is identified by its own topics and nothing else; the tool reads no ARP table and runs no other program. The rover and the base station both answer, with the same data. Then protect yourself from the address collision Yarbo set up for you: either shrink your DHCP pool so it starts above the base station's address, or put the Yarbo Wi-Fi association on an isolated VLAN so the whole bridge moves out of your main network.
92
+
93
+ ## Safety and privacy
94
+
95
+ The robot's broker has no authentication. Anyone on its network segment can drive it. Put the robot on its own VLAN, allow only the machine running this tooling (and later Home Assistant) to reach port 1883, and think deliberately about whether the robot should have internet access at all. Captures contain your serial number, coordinates and network details; use `--redact` and review the file before sharing it.
96
+
97
+ ## Have more than one robot?
98
+
99
+ Nobody on the project does. One command tells us what we cannot find out ourselves, without sharing a serial, an address or a position: see [docs/multi-robot.md](docs/multi-robot.md).
100
+
101
+ ## Contributing protocol knowledge
102
+
103
+ Read `protocol/README.md`. A command becomes `verified` only with a fixture showing the request and the reply on real hardware, with the firmware version recorded. Pull requests that add knowledge without evidence are asked for a capture.
104
+
105
+ ## Releasing
106
+
107
+ Releases are published to PyPI by GitHub Actions through trusted publishing, with a manual approval and no token anywhere. See `docs/releasing.md`.
108
+
109
+ ## License and trademark
110
+
111
+ MIT. Protocol facts were assembled from the vendor's MIT-licensed SDK, from `python-yarbo`, `home-assistant-yarbo`, the `jtubb` and `briangann` forks of the vendor integration, and the `steves2j` map editor; see `protocol/commands.yaml` for per-entry sources. Yarbo is a trademark of its owner. This project is not affiliated with, endorsed by, or supported by Yarbo.
@@ -0,0 +1,73 @@
1
+ # More than one robot
2
+
3
+ Nobody on this project owns two Yarbos. Everything below is either measured on one robot, reasoned from the protocol, or proven against the simulator, and each line says which. If you have two or more robots, five minutes of your time settles the open questions: see [Check your site](#check-your-site).
4
+
5
+ ## How it works
6
+
7
+ Every robot runs its own MQTT broker and puts its serial number in every topic (`snowbot/<serial>/...`). Two rovers on Wi-Fi are two brokers at two addresses. A robot sends a heartbeat every 2 s awake and every 5 s asleep (measured), so listening to a broker for six seconds hears every robot it carries.
8
+
9
+ The serial is the robot's identity everywhere: the Home Assistant entry, its entities, its device, its obstacle log and its aerial photo alignment are all keyed by it. A rover and its base station relay answer with the same data at two addresses (measured); because both carry one serial, they are one robot.
10
+
11
+ ## What is handled
12
+
13
+ | Situation | What happens | Basis |
14
+ |---|---|---|
15
+ | Two rovers, two addresses | One Home Assistant entry each. A subnet scan finds both. | simulated |
16
+ | One robot at two addresses (rover and relay) | One entry. The second address is refused as already configured. Two sessions at once work through both. | measured |
17
+ | One broker carrying several robots | Setup lists the robots and asks which one. A session for one robot subscribes to its serial alone. | simulated |
18
+ | A DHCP lease moves, and robot A's old address now answers as robot B | The old address is refused because A is not heard there, and the subnet is scanned for A. | simulated |
19
+ | Robots on different firmware | The encoding (zlib from 3.9, plain JSON before) is decided per robot. A sleeping robot says nothing about its firmware, so the first request may be a guess; a guess that gets no reply is retried the other way. | simulated |
20
+ | Finding one robot again on a site with several | The scan stops the moment that robot is heard. | simulated |
21
+
22
+ ## What is not known
23
+
24
+ 1. **Does a base station ever relay more than one rover?** If it does, one address carries several serials. The code handles that, but nobody has seen it.
25
+ 2. **Do brokers limit how many clients may connect?** Home Assistant holds one session per robot, the phone app another.
26
+ 3. **Does the heartbeat interval hold on other firmware?** Discovery waits six seconds.
27
+
28
+ ## Not supported, on purpose
29
+
30
+ Two robots on one map card. Each robot keeps its own map with its own reference point, so a card shows one robot. The Studio and the command line tools work with one robot per run.
31
+
32
+ ## Check your site
33
+
34
+ ```bash
35
+ git clone https://github.com/yarbo-local/yarbo-local
36
+ cd yarbo-local
37
+ uv sync
38
+ uv run yarbo-local sitecheck 192.168.50.0/24
39
+ ```
40
+
41
+ Use the subnet your robots are on; a single IP or a comma list works too. It takes about a minute.
42
+
43
+ **What it does to your robots: nothing.** It listens, and it sends three read requests (`get_device_msg`, `read_all_plan`, `get_map`). It does not wake a robot, does not take control away from the phone app, and cannot send anything that moves a robot.
44
+
45
+ **What it writes:** `sitecheck-report.md` and `sitecheck.log` in the current directory. Serial numbers become `robot-1`, `robot-2`; addresses become `host-1`, `host-2`; positions are never written, only whether two of them match. Both files are safe to attach to a [GitHub issue](https://github.com/yarbo-local/yarbo-local/issues), and that is the whole request: run it, attach both files, and say whether the Yarbo app was open.
46
+
47
+ Each finding has the same shape, so a failure tells us what to change:
48
+
49
+ ```
50
+ [FAIL] heartbeat-window: a robot heartbeats more slowly than discovery waits
51
+ expected: every robot heard at least every 6s (we measured 2 s awake, 5 s asleep)
52
+ seen: robot-2 on host-1: 2 heartbeats in 12s, longest gap 9.0s
53
+ meaning: Discovery and address recovery listen for one window and would miss this robot. ...
54
+ send us: the report file, sitecheck-report.md, and sitecheck.log; both are already scrubbed
55
+ ```
56
+
57
+ | Check | Question it answers |
58
+ |---|---|
59
+ | `found` | Can this machine reach any robot at all? |
60
+ | `shared-broker` | Does any address carry more than one robot? The main open question. |
61
+ | `heartbeat-window` | Is every robot heard within the six seconds discovery waits? |
62
+ | `isolation` | Does a subscription for one serial ever deliver another robot's messages? |
63
+ | `reads` | Does every robot answer reads through every address that carries it? |
64
+ | `coexistence` | Do several sessions stay connected together? |
65
+ | `identity` | Do replies come from the robot they were addressed to? Compared by position, never written. |
66
+ | `encoding` | Does each robot's encoding match the firmware rule? |
67
+ | `unscoped` | Does a session given no serial notice the robots it did not pick? |
68
+ | `resolve` | From a stale address, is each robot found again at an address that really carries it? |
69
+ | `maps` | Do robots share one map frame, or keep one each? |
70
+
71
+ The same checks run under pytest, if you prefer: `uv run pytest tests/live --hosts 192.168.50.0/24 -v`.
72
+
73
+ The tool is tested before it reaches you: `tests/test_sitecheck.py` runs it against simulated sites and hands it records of sites that misbehave, one per failure above, so a failure on your site is about your site.