ovos-control-panel-mark1 0.1.0a1__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 (25) hide show
  1. ovos_control_panel_mark1-0.1.0a1/LICENSE +202 -0
  2. ovos_control_panel_mark1-0.1.0a1/PKG-INFO +212 -0
  3. ovos_control_panel_mark1-0.1.0a1/README.md +190 -0
  4. ovos_control_panel_mark1-0.1.0a1/ovos_control_panel_mark1/__init__.py +32 -0
  5. ovos_control_panel_mark1-0.1.0a1/ovos_control_panel_mark1/api.py +193 -0
  6. ovos_control_panel_mark1-0.1.0a1/ovos_control_panel_mark1/device.py +434 -0
  7. ovos_control_panel_mark1-0.1.0a1/ovos_control_panel_mark1/i18n/ar.json +95 -0
  8. ovos_control_panel_mark1-0.1.0a1/ovos_control_panel_mark1/i18n/da.json +95 -0
  9. ovos_control_panel_mark1-0.1.0a1/ovos_control_panel_mark1/i18n/en.json +95 -0
  10. ovos_control_panel_mark1-0.1.0a1/ovos_control_panel_mark1/i18n/es.json +95 -0
  11. ovos_control_panel_mark1-0.1.0a1/ovos_control_panel_mark1/i18n/pt.json +95 -0
  12. ovos_control_panel_mark1-0.1.0a1/ovos_control_panel_mark1/icon.svg +1 -0
  13. ovos_control_panel_mark1-0.1.0a1/ovos_control_panel_mark1/page.html +1112 -0
  14. ovos_control_panel_mark1-0.1.0a1/ovos_control_panel_mark1.egg-info/PKG-INFO +212 -0
  15. ovos_control_panel_mark1-0.1.0a1/ovos_control_panel_mark1.egg-info/SOURCES.txt +23 -0
  16. ovos_control_panel_mark1-0.1.0a1/ovos_control_panel_mark1.egg-info/dependency_links.txt +1 -0
  17. ovos_control_panel_mark1-0.1.0a1/ovos_control_panel_mark1.egg-info/entry_points.txt +2 -0
  18. ovos_control_panel_mark1-0.1.0a1/ovos_control_panel_mark1.egg-info/requires.txt +6 -0
  19. ovos_control_panel_mark1-0.1.0a1/ovos_control_panel_mark1.egg-info/top_level.txt +1 -0
  20. ovos_control_panel_mark1-0.1.0a1/pyproject.toml +40 -0
  21. ovos_control_panel_mark1-0.1.0a1/setup.cfg +4 -0
  22. ovos_control_panel_mark1-0.1.0a1/tests/test_mark1.py +329 -0
  23. ovos_control_panel_mark1-0.1.0a1/tests/test_mark1_face.py +298 -0
  24. ovos_control_panel_mark1-0.1.0a1/tests/test_messages_match_the_plugin.py +59 -0
  25. ovos_control_panel_mark1-0.1.0a1/tests/test_page.py +14 -0
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
@@ -0,0 +1,212 @@
1
+ Metadata-Version: 2.4
2
+ Name: ovos-control-panel-mark1
3
+ Version: 0.1.0a1
4
+ Summary: ovos-control-panel extension: draw the Mark-1's mouth and eyes, animate them, and update the faceplate firmware
5
+ Author: Andreas Lorensen
6
+ License: Apache-2.0
7
+ Project-URL: Homepage, https://github.com/andlo/ovos-control-panel-mark1
8
+ Project-URL: Issues, https://github.com/andlo/ovos-control-panel-mark1/issues
9
+ Keywords: ovos,openvoiceos,mycroft,mark1,control-panel
10
+ Classifier: Development Status :: 3 - Alpha
11
+ Classifier: License :: OSI Approved :: Apache Software License
12
+ Classifier: Programming Language :: Python :: 3
13
+ Requires-Python: >=3.10
14
+ Description-Content-Type: text/markdown
15
+ License-File: LICENSE
16
+ Requires-Dist: ovos-control-panel>=0.0.1a81
17
+ Requires-Dist: ovos-mark1-utils
18
+ Provides-Extra: test
19
+ Requires-Dist: pytest>=7.4; extra == "test"
20
+ Requires-Dist: httpx<1.0,>=0.27; extra == "test"
21
+ Dynamic: license-file
22
+
23
+ # ovos-control-panel-mark1
24
+
25
+ The Mark-1 faceplate editors for
26
+ [ovos-control-panel](https://github.com/OpenVoiceOS/ovos-control-panel): draw
27
+ the mouth and the eye rings, preview them in the browser, play animations on
28
+ the device, and update the faceplate firmware.
29
+
30
+ It is a **panel extension**: a page for the panel, nothing more. Where
31
+ `ovos-PHAL-plugin-mk1` is installed, the panel already shows a plain Mark-1
32
+ page (eyes, colours, brightness, text on the mouth). Install this beside the
33
+ panel and its page takes that one's place:
34
+
35
+ ```
36
+ pip install --pre ovos-control-panel-mark1
37
+ ```
38
+
39
+ (`--pre`, as for the panel itself, which still needs alpha releases of
40
+ OVOS.) Then restart the panel. It needs ovos-control-panel 0.0.1a81 or newer.
41
+
42
+ ## The page
43
+
44
+ The Mark-1 faceplate page controls the eyes and the mouth of a Mark-1
45
+ device. You draw an image for the mouth. You set the eyes, either a whole ring at a
46
+ time or one LED at a time. You can preview the result in the browser before
47
+ you send it, and mirror what the device is showing.
48
+
49
+ ![The Mark-1 faceplate page](docs/img/mark1-wide.png)
50
+
51
+ ![The same page on a phone](docs/img/mark1-mobile.png)
52
+
53
+ ## What it needs
54
+
55
+ Sending anything to real hardware needs the `ovos-PHAL-plugin-mk1` plugin.
56
+ Install it on the device first. Without the plugin the page still works: the
57
+ simulator and the mouth editor run in the browser, and the controls still put
58
+ their messages on the bus, where nothing picks them up.
59
+
60
+ The page tries to confirm a Mark-1 by asking the faceplate two things: what
61
+ colour the eyes are showing, and what firmware it runs. Either answer is proof
62
+ enough. A plugin that answers neither leaves the page unable to tell a working
63
+ device from an absent one, so it says it could not confirm a Mark-1 and
64
+ disables nothing on that basis. Mirroring the live face and the firmware card
65
+ do need a confirmed device, because both read from it.
66
+
67
+ ## The face
68
+
69
+ The canvas at the top of the page is laid out the way the hardware is: the
70
+ left eye, the mouth, and the right eye in a row, behind one panel.
71
+
72
+ Each eye is a ring of twelve individually addressable colour LEDs, and the
73
+ mouth is a grid of 32 by 8 white ones. The page draws every one of them
74
+ separately, so what you see is the arrangement the device actually has rather
75
+ than a sketch of a face.
76
+
77
+ Click a single LED in either ring to light it in the colour you have picked.
78
+ Click it again, with the same colour still chosen, to turn it off. With a
79
+ device connected the change goes straight to that one LED. The colour control
80
+ above changes the whole ring at once.
81
+
82
+ Where the device answers the eye-colour question, the page reads it and
83
+ follows it. The eyes show what the device is showing, including changes
84
+ something else made — a skill lighting them up, or the volume knob. Press
85
+ **Stop following** to keep the face as your own design instead; press **Follow
86
+ the device** to go back.
87
+
88
+ Otherwise the canvas is a simulator. It runs entirely in the browser,
89
+ so you can design a faceplate before you own a Mark-1, or before you set up
90
+ the plugin.
91
+
92
+ ## Build an animation
93
+
94
+ Set the face the way you want it, then press **Add this face as a frame**. Do
95
+ it again for the next pose. Each frame holds the mouth drawing and all
96
+ twenty-four eye LEDs, so a frame that changes only the eyes is a real frame.
97
+
98
+ The strip below shows every frame as a thumbnail. The number loads that frame
99
+ back onto the face; the × removes it.
100
+
101
+ **Play here** runs the sequence in the browser. **Play on the device** sends
102
+ each frame to a real Mark-1 in turn.
103
+
104
+ Frames are held for the time in **Hold each frame**, and that will not go
105
+ below 0.4 seconds. That is the floor `ovos-mark1-utils` clamps an animation
106
+ to, because the faceplate misbehaves when it is written to faster. The board takes
107
+ its commands over a slow serial link, so a frame that changes many LEDs is held
108
+ longer than the floor, for about as long as its own writes take to reach the
109
+ board. Only the LEDs that changed are sent, so a frame that moves the mouth and
110
+ leaves the eyes alone runs at the floor.
111
+
112
+ ### Export
113
+
114
+ **Export animation** writes a JSON file, which **Import animation** reads back.
115
+ That is the format to share with another Mark-1 owner.
116
+
117
+ **Export as Python** writes a `FacePlateAnimation` subclass instead — the same
118
+ shape `ovos-mark1-utils` uses — so an animation designed here can be dropped
119
+ into a skill and run from code. The exported file carries the frame delay you
120
+ chose.
121
+
122
+ ## Faceplate firmware
123
+
124
+ The eyes and the mouth are driven by a small board with its own firmware,
125
+ separate from the OVOS software on the device. It rarely needs changing.
126
+
127
+ The page shows which version the board reports and whether a newer one is
128
+ available. When the board has not reported a version yet the page says so,
129
+ rather than treating silence as an old version.
130
+
131
+ Updating rewrites that board. It is built on the device first, because there
132
+ is no prebuilt firmware to download any more, so the whole operation takes a
133
+ few minutes. **Do not power the device off while it runs.** If the write is
134
+ interrupted the eyes and the mouth stop working until the update is run again.
135
+ The page asks you to type `UPDATE` before it starts, and reports success only
136
+ once the board reports its new version — not merely once the request was
137
+ accepted.
138
+
139
+ Managing firmware needs a version of `ovos-PHAL-plugin-mk1` that supports it.
140
+ Where the plugin is older, the page says so instead of offering an update.
141
+
142
+ ## Draw the mouth
143
+
144
+ The mouth display is 8 rows by 32 columns of pixels. Click or drag on the
145
+ grid to turn pixels on and off.
146
+
147
+ Use **Clear** to start over, or **Invert** to swap every pixel. Three
148
+ presets load a ready-made image: **Heart**, **Music note**, and
149
+ **Smile**. Press **Send drawing to device** to show your drawing on a
150
+ connected Mark-1.
151
+
152
+ ## Mouth text and animations
153
+
154
+ Type text in the **Scrolling text** field and press **Scroll text** to
155
+ show it, letter by letter, on the mouth. **Reset mouth** clears the
156
+ display. The viseme buttons (0 to 6) and the animation buttons (**Talk**,
157
+ **Think**, **Listen**, **Smile**) play the mouth's built-in shapes.
158
+
159
+ ## The eyes
160
+
161
+ Pick a color with the color picker. It also updates the simulator at
162
+ once. **On** and **Off** turn the eyes on or off. **Blink** closes one
163
+ eye or both for a moment. **Look** points the eyes in a direction.
164
+ **Narrow** and **Spin** play the eyes' built-in animations.
165
+
166
+ The **Brightness** slider sets how bright the eyes glow, from 1 to 30.
167
+ The **Fill** slider sets how much of each eye is lit, from 0 to 100%.
168
+
169
+ ## System
170
+
171
+ **Reset** puts the whole faceplate back to its startup state. **Mute**
172
+ and **Unmute** silence or restore the enclosure's own sounds. **Blink**
173
+ makes the enclosure blink a few times, as a visible "I heard that"
174
+ signal.
175
+
176
+ ## How it talks to the device
177
+
178
+ Every eye, mouth and system control sends one of the Mark-1's own
179
+ `enclosure.*` bus messages, the same ones `ovos-PHAL-plugin-mk1` already
180
+ listens for. For those the page is a browser front end for controls the plugin
181
+ has always had. The firmware card is the exception: it uses
182
+ `enclosure.firmware.version.get` and `enclosure.firmware.update`, which the
183
+ plugin answers only where firmware support is present.
184
+
185
+ ## If it doesn't work
186
+
187
+ If the page says it could not confirm a Mark-1, the controls still send. The
188
+ page asks the faceplate two questions, and only a version of
189
+ `ovos-PHAL-plugin-mk1` that answers one of them will reply, so a working device
190
+ can stay silent. Where the plugin is missing altogether, install it from the
191
+ [Plugins](https://github.com/OpenVoiceOS/ovos-control-panel/blob/dev/docs/plugins.md) page and reload.
192
+
193
+ A control reports only that the message reached the bus. Nothing on the bus
194
+ says whether the faceplate acted on it, so a control that reports success on a
195
+ device with no plugin running is telling the truth about what it can see. Where
196
+ the eyes or the mouth do not change, check that the plugin is running and read
197
+ its log. For anything else, see [troubleshooting.md](https://github.com/OpenVoiceOS/ovos-control-panel/blob/dev/docs/troubleshooting.md).
198
+
199
+ ## Development
200
+
201
+ ```
202
+ pip install --pre -e ".[test]"
203
+ pytest -q tests
204
+ ```
205
+
206
+ The page was the panel's own until 0.0.1a80; see the panel's
207
+ [docs/pages.md](https://github.com/OpenVoiceOS/ovos-control-panel/blob/dev/docs/pages.md#panel-extensions)
208
+ for how an extension is found.
209
+
210
+ ## License
211
+
212
+ Apache-2.0
@@ -0,0 +1,190 @@
1
+ # ovos-control-panel-mark1
2
+
3
+ The Mark-1 faceplate editors for
4
+ [ovos-control-panel](https://github.com/OpenVoiceOS/ovos-control-panel): draw
5
+ the mouth and the eye rings, preview them in the browser, play animations on
6
+ the device, and update the faceplate firmware.
7
+
8
+ It is a **panel extension**: a page for the panel, nothing more. Where
9
+ `ovos-PHAL-plugin-mk1` is installed, the panel already shows a plain Mark-1
10
+ page (eyes, colours, brightness, text on the mouth). Install this beside the
11
+ panel and its page takes that one's place:
12
+
13
+ ```
14
+ pip install --pre ovos-control-panel-mark1
15
+ ```
16
+
17
+ (`--pre`, as for the panel itself, which still needs alpha releases of
18
+ OVOS.) Then restart the panel. It needs ovos-control-panel 0.0.1a81 or newer.
19
+
20
+ ## The page
21
+
22
+ The Mark-1 faceplate page controls the eyes and the mouth of a Mark-1
23
+ device. You draw an image for the mouth. You set the eyes, either a whole ring at a
24
+ time or one LED at a time. You can preview the result in the browser before
25
+ you send it, and mirror what the device is showing.
26
+
27
+ ![The Mark-1 faceplate page](docs/img/mark1-wide.png)
28
+
29
+ ![The same page on a phone](docs/img/mark1-mobile.png)
30
+
31
+ ## What it needs
32
+
33
+ Sending anything to real hardware needs the `ovos-PHAL-plugin-mk1` plugin.
34
+ Install it on the device first. Without the plugin the page still works: the
35
+ simulator and the mouth editor run in the browser, and the controls still put
36
+ their messages on the bus, where nothing picks them up.
37
+
38
+ The page tries to confirm a Mark-1 by asking the faceplate two things: what
39
+ colour the eyes are showing, and what firmware it runs. Either answer is proof
40
+ enough. A plugin that answers neither leaves the page unable to tell a working
41
+ device from an absent one, so it says it could not confirm a Mark-1 and
42
+ disables nothing on that basis. Mirroring the live face and the firmware card
43
+ do need a confirmed device, because both read from it.
44
+
45
+ ## The face
46
+
47
+ The canvas at the top of the page is laid out the way the hardware is: the
48
+ left eye, the mouth, and the right eye in a row, behind one panel.
49
+
50
+ Each eye is a ring of twelve individually addressable colour LEDs, and the
51
+ mouth is a grid of 32 by 8 white ones. The page draws every one of them
52
+ separately, so what you see is the arrangement the device actually has rather
53
+ than a sketch of a face.
54
+
55
+ Click a single LED in either ring to light it in the colour you have picked.
56
+ Click it again, with the same colour still chosen, to turn it off. With a
57
+ device connected the change goes straight to that one LED. The colour control
58
+ above changes the whole ring at once.
59
+
60
+ Where the device answers the eye-colour question, the page reads it and
61
+ follows it. The eyes show what the device is showing, including changes
62
+ something else made — a skill lighting them up, or the volume knob. Press
63
+ **Stop following** to keep the face as your own design instead; press **Follow
64
+ the device** to go back.
65
+
66
+ Otherwise the canvas is a simulator. It runs entirely in the browser,
67
+ so you can design a faceplate before you own a Mark-1, or before you set up
68
+ the plugin.
69
+
70
+ ## Build an animation
71
+
72
+ Set the face the way you want it, then press **Add this face as a frame**. Do
73
+ it again for the next pose. Each frame holds the mouth drawing and all
74
+ twenty-four eye LEDs, so a frame that changes only the eyes is a real frame.
75
+
76
+ The strip below shows every frame as a thumbnail. The number loads that frame
77
+ back onto the face; the × removes it.
78
+
79
+ **Play here** runs the sequence in the browser. **Play on the device** sends
80
+ each frame to a real Mark-1 in turn.
81
+
82
+ Frames are held for the time in **Hold each frame**, and that will not go
83
+ below 0.4 seconds. That is the floor `ovos-mark1-utils` clamps an animation
84
+ to, because the faceplate misbehaves when it is written to faster. The board takes
85
+ its commands over a slow serial link, so a frame that changes many LEDs is held
86
+ longer than the floor, for about as long as its own writes take to reach the
87
+ board. Only the LEDs that changed are sent, so a frame that moves the mouth and
88
+ leaves the eyes alone runs at the floor.
89
+
90
+ ### Export
91
+
92
+ **Export animation** writes a JSON file, which **Import animation** reads back.
93
+ That is the format to share with another Mark-1 owner.
94
+
95
+ **Export as Python** writes a `FacePlateAnimation` subclass instead — the same
96
+ shape `ovos-mark1-utils` uses — so an animation designed here can be dropped
97
+ into a skill and run from code. The exported file carries the frame delay you
98
+ chose.
99
+
100
+ ## Faceplate firmware
101
+
102
+ The eyes and the mouth are driven by a small board with its own firmware,
103
+ separate from the OVOS software on the device. It rarely needs changing.
104
+
105
+ The page shows which version the board reports and whether a newer one is
106
+ available. When the board has not reported a version yet the page says so,
107
+ rather than treating silence as an old version.
108
+
109
+ Updating rewrites that board. It is built on the device first, because there
110
+ is no prebuilt firmware to download any more, so the whole operation takes a
111
+ few minutes. **Do not power the device off while it runs.** If the write is
112
+ interrupted the eyes and the mouth stop working until the update is run again.
113
+ The page asks you to type `UPDATE` before it starts, and reports success only
114
+ once the board reports its new version — not merely once the request was
115
+ accepted.
116
+
117
+ Managing firmware needs a version of `ovos-PHAL-plugin-mk1` that supports it.
118
+ Where the plugin is older, the page says so instead of offering an update.
119
+
120
+ ## Draw the mouth
121
+
122
+ The mouth display is 8 rows by 32 columns of pixels. Click or drag on the
123
+ grid to turn pixels on and off.
124
+
125
+ Use **Clear** to start over, or **Invert** to swap every pixel. Three
126
+ presets load a ready-made image: **Heart**, **Music note**, and
127
+ **Smile**. Press **Send drawing to device** to show your drawing on a
128
+ connected Mark-1.
129
+
130
+ ## Mouth text and animations
131
+
132
+ Type text in the **Scrolling text** field and press **Scroll text** to
133
+ show it, letter by letter, on the mouth. **Reset mouth** clears the
134
+ display. The viseme buttons (0 to 6) and the animation buttons (**Talk**,
135
+ **Think**, **Listen**, **Smile**) play the mouth's built-in shapes.
136
+
137
+ ## The eyes
138
+
139
+ Pick a color with the color picker. It also updates the simulator at
140
+ once. **On** and **Off** turn the eyes on or off. **Blink** closes one
141
+ eye or both for a moment. **Look** points the eyes in a direction.
142
+ **Narrow** and **Spin** play the eyes' built-in animations.
143
+
144
+ The **Brightness** slider sets how bright the eyes glow, from 1 to 30.
145
+ The **Fill** slider sets how much of each eye is lit, from 0 to 100%.
146
+
147
+ ## System
148
+
149
+ **Reset** puts the whole faceplate back to its startup state. **Mute**
150
+ and **Unmute** silence or restore the enclosure's own sounds. **Blink**
151
+ makes the enclosure blink a few times, as a visible "I heard that"
152
+ signal.
153
+
154
+ ## How it talks to the device
155
+
156
+ Every eye, mouth and system control sends one of the Mark-1's own
157
+ `enclosure.*` bus messages, the same ones `ovos-PHAL-plugin-mk1` already
158
+ listens for. For those the page is a browser front end for controls the plugin
159
+ has always had. The firmware card is the exception: it uses
160
+ `enclosure.firmware.version.get` and `enclosure.firmware.update`, which the
161
+ plugin answers only where firmware support is present.
162
+
163
+ ## If it doesn't work
164
+
165
+ If the page says it could not confirm a Mark-1, the controls still send. The
166
+ page asks the faceplate two questions, and only a version of
167
+ `ovos-PHAL-plugin-mk1` that answers one of them will reply, so a working device
168
+ can stay silent. Where the plugin is missing altogether, install it from the
169
+ [Plugins](https://github.com/OpenVoiceOS/ovos-control-panel/blob/dev/docs/plugins.md) page and reload.
170
+
171
+ A control reports only that the message reached the bus. Nothing on the bus
172
+ says whether the faceplate acted on it, so a control that reports success on a
173
+ device with no plugin running is telling the truth about what it can see. Where
174
+ the eyes or the mouth do not change, check that the plugin is running and read
175
+ its log. For anything else, see [troubleshooting.md](https://github.com/OpenVoiceOS/ovos-control-panel/blob/dev/docs/troubleshooting.md).
176
+
177
+ ## Development
178
+
179
+ ```
180
+ pip install --pre -e ".[test]"
181
+ pytest -q tests
182
+ ```
183
+
184
+ The page was the panel's own until 0.0.1a80; see the panel's
185
+ [docs/pages.md](https://github.com/OpenVoiceOS/ovos-control-panel/blob/dev/docs/pages.md#panel-extensions)
186
+ for how an extension is found.
187
+
188
+ ## License
189
+
190
+ Apache-2.0
@@ -0,0 +1,32 @@
1
+ """The Mark-1 faceplate editors: a page for ovos-control-panel.
2
+
3
+ A panel extension: the panel finds this page through the
4
+ ``opm.control_panel.page`` entry point (see pyproject.toml and the panel's
5
+ docs/pages.md, "Panel extensions"). It takes the place of the plain Mark-1
6
+ page the panel brings for ovos-PHAL-plugin-mk1, and adds what a
7
+ controlpanel.json cannot say: drawing the mouth and the eye rings, a live
8
+ preview, animations and firmware updates. Nothing here runs outside the
9
+ panel.
10
+ """
11
+
12
+
13
+ def routes(r):
14
+ # imported here, so reading PAGE needs no web framework
15
+ from ovos_control_panel_mark1.api import routes as add
16
+ add(r)
17
+
18
+
19
+ PAGE = {
20
+ "api_version": 1,
21
+ "id": "mark1",
22
+ "path": "/mark1",
23
+ "title": {"key": "nav.mark1", "label": "Mark-1 faceplate"},
24
+ "group": "screen",
25
+ "order": 30,
26
+ "needs": ["ovos-PHAL-plugin-mk1"],
27
+ "html": "page.html",
28
+ "icon": "icon.svg",
29
+ "heading": {"key": "hdr.mark1", "label": "Mark-1 faceplate"},
30
+ "i18n": "i18n",
31
+ "routes": routes,
32
+ }