RGBMatrixEmulator 0.17.0__tar.gz → 0.18.0__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 (57) hide show
  1. rgbmatrixemulator-0.17.0/README.md → rgbmatrixemulator-0.18.0/PKG-INFO +30 -35
  2. rgbmatrixemulator-0.17.0/PKG-INFO → rgbmatrixemulator-0.18.0/README.md +1 -67
  3. {rgbmatrixemulator-0.17.0 → rgbmatrixemulator-0.18.0}/RGBMatrixEmulator/adapters/__init__.py +0 -5
  4. {rgbmatrixemulator-0.17.0 → rgbmatrixemulator-0.18.0}/RGBMatrixEmulator/emulation/options.py +0 -3
  5. {rgbmatrixemulator-0.17.0 → rgbmatrixemulator-0.18.0}/RGBMatrixEmulator/internal/emulator_config.py +0 -11
  6. {rgbmatrixemulator-0.17.0 → rgbmatrixemulator-0.18.0}/RGBMatrixEmulator/version.py +1 -1
  7. {rgbmatrixemulator-0.17.0 → rgbmatrixemulator-0.18.0}/pyproject.toml +0 -4
  8. rgbmatrixemulator-0.17.0/RGBMatrixEmulator/adapters/pi5_adapter/README.md +0 -62
  9. rgbmatrixemulator-0.17.0/RGBMatrixEmulator/adapters/pi5_adapter/__init__.py +0 -250
  10. {rgbmatrixemulator-0.17.0 → rgbmatrixemulator-0.18.0}/.gitignore +0 -0
  11. {rgbmatrixemulator-0.17.0 → rgbmatrixemulator-0.18.0}/LICENSE +0 -0
  12. {rgbmatrixemulator-0.17.0 → rgbmatrixemulator-0.18.0}/RGBMatrixEmulator/__init__.py +0 -0
  13. {rgbmatrixemulator-0.17.0 → rgbmatrixemulator-0.18.0}/RGBMatrixEmulator/adapters/base.py +0 -0
  14. {rgbmatrixemulator-0.17.0 → rgbmatrixemulator-0.18.0}/RGBMatrixEmulator/adapters/browser_adapter/README.md +0 -0
  15. {rgbmatrixemulator-0.17.0 → rgbmatrixemulator-0.18.0}/RGBMatrixEmulator/adapters/browser_adapter/__init__.py +0 -0
  16. {rgbmatrixemulator-0.17.0 → rgbmatrixemulator-0.18.0}/RGBMatrixEmulator/adapters/browser_adapter/adapter.py +0 -0
  17. {rgbmatrixemulator-0.17.0 → rgbmatrixemulator-0.18.0}/RGBMatrixEmulator/adapters/browser_adapter/fps.py +0 -0
  18. {rgbmatrixemulator-0.17.0 → rgbmatrixemulator-0.18.0}/RGBMatrixEmulator/adapters/browser_adapter/request_handlers/__init__.py +0 -0
  19. {rgbmatrixemulator-0.17.0 → rgbmatrixemulator-0.18.0}/RGBMatrixEmulator/adapters/browser_adapter/request_handlers/base.py +0 -0
  20. {rgbmatrixemulator-0.17.0 → rgbmatrixemulator-0.18.0}/RGBMatrixEmulator/adapters/browser_adapter/request_handlers/image.py +0 -0
  21. {rgbmatrixemulator-0.17.0 → rgbmatrixemulator-0.18.0}/RGBMatrixEmulator/adapters/browser_adapter/request_handlers/image_web_socket.py +0 -0
  22. {rgbmatrixemulator-0.17.0 → rgbmatrixemulator-0.18.0}/RGBMatrixEmulator/adapters/browser_adapter/request_handlers/main.py +0 -0
  23. {rgbmatrixemulator-0.17.0 → rgbmatrixemulator-0.18.0}/RGBMatrixEmulator/adapters/browser_adapter/request_handlers/single_file.py +0 -0
  24. {rgbmatrixemulator-0.17.0 → rgbmatrixemulator-0.18.0}/RGBMatrixEmulator/adapters/browser_adapter/server.py +0 -0
  25. {rgbmatrixemulator-0.17.0 → rgbmatrixemulator-0.18.0}/RGBMatrixEmulator/adapters/browser_adapter/static/assets/client.js +0 -0
  26. {rgbmatrixemulator-0.17.0 → rgbmatrixemulator-0.18.0}/RGBMatrixEmulator/adapters/browser_adapter/static/assets/icon.ico +0 -0
  27. {rgbmatrixemulator-0.17.0 → rgbmatrixemulator-0.18.0}/RGBMatrixEmulator/adapters/browser_adapter/static/assets/styles.css +0 -0
  28. {rgbmatrixemulator-0.17.0 → rgbmatrixemulator-0.18.0}/RGBMatrixEmulator/adapters/browser_adapter/static/index.html +0 -0
  29. {rgbmatrixemulator-0.17.0 → rgbmatrixemulator-0.18.0}/RGBMatrixEmulator/adapters/pygame_adapter.py +0 -0
  30. {rgbmatrixemulator-0.17.0 → rgbmatrixemulator-0.18.0}/RGBMatrixEmulator/adapters/raw_adapter/README.md +0 -0
  31. {rgbmatrixemulator-0.17.0 → rgbmatrixemulator-0.18.0}/RGBMatrixEmulator/adapters/raw_adapter/__init__.py +0 -0
  32. {rgbmatrixemulator-0.17.0 → rgbmatrixemulator-0.18.0}/RGBMatrixEmulator/adapters/sixel_adapter.py +0 -0
  33. {rgbmatrixemulator-0.17.0 → rgbmatrixemulator-0.18.0}/RGBMatrixEmulator/adapters/terminal_adapter.py +0 -0
  34. {rgbmatrixemulator-0.17.0 → rgbmatrixemulator-0.18.0}/RGBMatrixEmulator/adapters/tkinter_adapter.py +0 -0
  35. {rgbmatrixemulator-0.17.0 → rgbmatrixemulator-0.18.0}/RGBMatrixEmulator/adapters/turtle_adapter.py +0 -0
  36. {rgbmatrixemulator-0.17.0 → rgbmatrixemulator-0.18.0}/RGBMatrixEmulator/cli/__init__.py +0 -0
  37. {rgbmatrixemulator-0.17.0 → rgbmatrixemulator-0.18.0}/RGBMatrixEmulator/cli/command.py +0 -0
  38. {rgbmatrixemulator-0.17.0 → rgbmatrixemulator-0.18.0}/RGBMatrixEmulator/cli/config.py +0 -0
  39. {rgbmatrixemulator-0.17.0 → rgbmatrixemulator-0.18.0}/RGBMatrixEmulator/emulation/__init__.py +0 -0
  40. {rgbmatrixemulator-0.17.0 → rgbmatrixemulator-0.18.0}/RGBMatrixEmulator/emulation/canvas.py +0 -0
  41. {rgbmatrixemulator-0.17.0 → rgbmatrixemulator-0.18.0}/RGBMatrixEmulator/emulation/matrix.py +0 -0
  42. {rgbmatrixemulator-0.17.0 → rgbmatrixemulator-0.18.0}/RGBMatrixEmulator/graphics/__init__.py +0 -0
  43. {rgbmatrixemulator-0.17.0 → rgbmatrixemulator-0.18.0}/RGBMatrixEmulator/graphics/color.py +0 -0
  44. {rgbmatrixemulator-0.17.0 → rgbmatrixemulator-0.18.0}/RGBMatrixEmulator/graphics/font.py +0 -0
  45. {rgbmatrixemulator-0.17.0 → rgbmatrixemulator-0.18.0}/RGBMatrixEmulator/icon.png +0 -0
  46. {rgbmatrixemulator-0.17.0 → rgbmatrixemulator-0.18.0}/RGBMatrixEmulator/internal/adapter_loader.py +0 -0
  47. {rgbmatrixemulator-0.17.0 → rgbmatrixemulator-0.18.0}/RGBMatrixEmulator/internal/pixel_style.py +0 -0
  48. {rgbmatrixemulator-0.17.0 → rgbmatrixemulator-0.18.0}/RGBMatrixEmulator/internal/screen.py +0 -0
  49. {rgbmatrixemulator-0.17.0 → rgbmatrixemulator-0.18.0}/RGBMatrixEmulator/logger.py +0 -0
  50. {rgbmatrixemulator-0.17.0 → rgbmatrixemulator-0.18.0}/RGBMatrixEmulator/pixel_mappers/__init__.py +0 -0
  51. {rgbmatrixemulator-0.17.0 → rgbmatrixemulator-0.18.0}/RGBMatrixEmulator/pixel_mappers/identity.py +0 -0
  52. {rgbmatrixemulator-0.17.0 → rgbmatrixemulator-0.18.0}/RGBMatrixEmulator/pixel_mappers/mirror.py +0 -0
  53. {rgbmatrixemulator-0.17.0 → rgbmatrixemulator-0.18.0}/RGBMatrixEmulator/pixel_mappers/rotate.py +0 -0
  54. {rgbmatrixemulator-0.17.0 → rgbmatrixemulator-0.18.0}/RGBMatrixEmulator/pixel_mappers/stack_to_row.py +0 -0
  55. {rgbmatrixemulator-0.17.0 → rgbmatrixemulator-0.18.0}/RGBMatrixEmulator/pixel_mappers/umapper.py +0 -0
  56. {rgbmatrixemulator-0.17.0 → rgbmatrixemulator-0.18.0}/RGBMatrixEmulator/pixel_mappers/vmapper.py +0 -0
  57. {rgbmatrixemulator-0.17.0 → rgbmatrixemulator-0.18.0}/RGBMatrixEmulator/py.typed +0 -0
@@ -1,3 +1,32 @@
1
+ Metadata-Version: 2.4
2
+ Name: RGBMatrixEmulator
3
+ Version: 0.18.0
4
+ Summary: A PC emulator for Raspberry Pi LED matrices driven by rpi-rgb-led-matrix
5
+ Project-URL: Homepage, https://github.com/ty-porter/RGBMatrixEmulator
6
+ Author-email: Tyler Porter <tyler.b.porter@gmail.com>
7
+ License-Expression: MIT
8
+ License-File: LICENSE
9
+ Keywords: LED,LED matrix,RPI,matrix,raspberry,raspberry pi
10
+ Classifier: Development Status :: 4 - Beta
11
+ Classifier: Environment :: Console
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: Intended Audience :: Other Audience
14
+ Classifier: License :: OSI Approved :: MIT License
15
+ Classifier: Natural Language :: English
16
+ Classifier: Operating System :: OS Independent
17
+ Classifier: Programming Language :: Python :: 3
18
+ Classifier: Topic :: Other/Nonlisted Topic
19
+ Requires-Python: >=3.10
20
+ Requires-Dist: bdfparser<=2.2.0
21
+ Requires-Dist: numpy>=1.2.0
22
+ Requires-Dist: pillow>=10.0.1
23
+ Requires-Dist: tornado>=6.5.5
24
+ Provides-Extra: pygame
25
+ Requires-Dist: pygame<3,>=2.0.1; extra == 'pygame'
26
+ Provides-Extra: sixel
27
+ Requires-Dist: libsixel-python>=0.5.0; extra == 'sixel'
28
+ Description-Content-Type: text/markdown
29
+
1
30
  # `RGBMatrixEmulator`
2
31
 
3
32
  [![pypi Badge](https://img.shields.io/pypi/v/RGBMatrixEmulator)](https://pypi.org/project/RGBMatrixEmulator/)
@@ -34,17 +63,15 @@ The following adapters are supported but not installed by default.
34
63
 
35
64
  * `sixel`
36
65
  * `pygame`
37
- * `pi5` (experimental)
38
66
 
39
67
  You can install optional adapters via `pip`:
40
68
 
41
69
  ```sh
42
70
  pip install RGBMatrixEmulator[sixel]
43
71
  pip install RGBMatrixEmulator[pygame]
44
- pip install RGBMatrixEmulator[pi5]
45
72
 
46
73
  # All optional adapters at once
47
- pip install RGBMatrixEmulator[sixel,pygame,pi5]
74
+ pip install RGBMatrixEmulator[sixel,pygame]
48
75
  ```
49
76
 
50
77
  ## Usage
@@ -152,16 +179,6 @@ The config file enables configurations to be customized on a per-script basis. Y
152
179
  "image_format": "JPEG",
153
180
  "open_immediately": false
154
181
  },
155
- "pi5": {
156
- "_comment": "For use with the pi5 adapter only.",
157
- "pinout": "AdafruitMatrixBonnet",
158
- "n_addr_lines": 4,
159
- "rotation": "Normal",
160
- "n_planes": 10,
161
- "n_temporal_planes": 4,
162
- "n_lanes": 1,
163
- "led_rgb_sequence": "RGB"
164
- },
165
182
  "log_level": "info"
166
183
  }
167
184
  ```
@@ -206,18 +223,6 @@ Certain adapters may specify additional configurations. These specialized config
206
223
  | browser.image_format | String | Image format to use for rendering. Options are "JPEG" or "PNG".
207
224
  | browser.open_immediately | Bool | Open a new browser window immediately on startup (similar to other adapters).
208
225
 
209
- ##### `pi5` Options
210
-
211
- | Key | Type | Description |
212
- | --- | ---- | ----------- |
213
- | pi5.pinout | String | The hardware pinout definition. Matches attributes in `piomatter.Pinout` (e.g., "Active3", "AdafruitMatrixHat", "AdafruitMatrixBonnet").
214
- | pi5.n_addr_lines | Integer | Number of address lines for the display. Typically `4` for 32-pixel height panels, or `5` for 64-pixel height panels.
215
- | pi5.led_rgb_sequence | String | Color sequence of the LEDs (e.g., "RGB", "BGR", "RBG").
216
- | pi5.rotation | String | Display rotation. Matches attributes in `piomatter.Orientation` (e.g., "Normal", "R180", "CW", "CCW"). Does not work with "Active3" pinouts.
217
- | pi5.n_lanes | Integer | Number of parallel matrix chains (lanes). Only works with Active3 boards. Must be 2 or more.
218
- | pi5.n_planes | Integer | Colour Bit depth/number of planes. Maximum of 10, minimum of 1.
219
- | pi5.n_temporal_planes | Integer | Number of temporal planes for dithering/brightness control. Possible values are 0, 2 or 4 and can't be greater than the value of n_planes.
220
-
221
226
  ### Display Adapters
222
227
 
223
228
  By default, `RGBMatrixEmulator` uses `browser` as its display adapter for maximum compatibility with different operating systems as well as thread-safety. However, you can also use other display adapters as well if the default adapter does not suit your needs.
@@ -230,7 +235,6 @@ Currently supported display adapters are:
230
235
  * `tkinter`
231
236
  * `turtle`
232
237
  * `sixel`
233
- * `pi5` (experimental)
234
238
  * `raw`
235
239
 
236
240
  You can swap display adapters by changing the `display_adapter` value to one of the above in `emulator_config.json`.
@@ -241,15 +245,6 @@ You can swap display adapters by changing the `display_adapter` value to one of
241
245
 
242
246
  Please see the [README for the `browser` display adapter](RGBMatrixEmulator/adapters/browser_adapter/README.md) for further information regarding its configuration and usage.
243
247
 
244
- ### Raspberry Pi 5 Adapter
245
-
246
- > [!WARNING]
247
- > This adapter is deprecated. It will be removed no later than July 1, 2026. Please use native `rpi-rgb-led-matrix` Raspberry Pi 5 support.
248
-
249
- RGBME can be used to "bridge" scripts written for `rpi-rgb-led-matrix` to Raspberry Pi model 5 through [Adafruit Blinka](https://github.com/adafruit/Adafruit_Blinka) and the [Adafruit-Blinka-Raspberry-Pi5-Piomatter](https://github.com/adafruit/Adafruit_Blinka_Raspberry_Pi5_Piomatter) libraries.
250
-
251
- Please see the [README for the `pi5` display adapter](RGBMatrixEmulator/adapters/pi5_adapter/README.md) for further information regarding its configuration and usage.
252
-
253
248
  ### Raw Display Adapter
254
249
 
255
250
  If you prefer fine-grained control over the raw pixel data, such as to build integration testing or build your own UI on top of it, you can use the `raw` display adapter.
@@ -1,35 +1,3 @@
1
- Metadata-Version: 2.4
2
- Name: RGBMatrixEmulator
3
- Version: 0.17.0
4
- Summary: A PC emulator for Raspberry Pi LED matrices driven by rpi-rgb-led-matrix
5
- Project-URL: Homepage, https://github.com/ty-porter/RGBMatrixEmulator
6
- Author-email: Tyler Porter <tyler.b.porter@gmail.com>
7
- License-Expression: MIT
8
- License-File: LICENSE
9
- Keywords: LED,LED matrix,RPI,matrix,raspberry,raspberry pi
10
- Classifier: Development Status :: 4 - Beta
11
- Classifier: Environment :: Console
12
- Classifier: Intended Audience :: Developers
13
- Classifier: Intended Audience :: Other Audience
14
- Classifier: License :: OSI Approved :: MIT License
15
- Classifier: Natural Language :: English
16
- Classifier: Operating System :: OS Independent
17
- Classifier: Programming Language :: Python :: 3
18
- Classifier: Topic :: Other/Nonlisted Topic
19
- Requires-Python: >=3.10
20
- Requires-Dist: bdfparser<=2.2.0
21
- Requires-Dist: numpy>=1.2.0
22
- Requires-Dist: pillow>=10.0.1
23
- Requires-Dist: tornado>=6.5.5
24
- Provides-Extra: pi5
25
- Requires-Dist: adafruit-blinka-raspberry-pi5-piomatter>=1.0.0; (python_version >= '3.11') and extra == 'pi5'
26
- Requires-Dist: adafruit-blinka>=8.0.0; (python_version >= '3.11') and extra == 'pi5'
27
- Provides-Extra: pygame
28
- Requires-Dist: pygame<3,>=2.0.1; extra == 'pygame'
29
- Provides-Extra: sixel
30
- Requires-Dist: libsixel-python>=0.5.0; extra == 'sixel'
31
- Description-Content-Type: text/markdown
32
-
33
1
  # `RGBMatrixEmulator`
34
2
 
35
3
  [![pypi Badge](https://img.shields.io/pypi/v/RGBMatrixEmulator)](https://pypi.org/project/RGBMatrixEmulator/)
@@ -66,17 +34,15 @@ The following adapters are supported but not installed by default.
66
34
 
67
35
  * `sixel`
68
36
  * `pygame`
69
- * `pi5` (experimental)
70
37
 
71
38
  You can install optional adapters via `pip`:
72
39
 
73
40
  ```sh
74
41
  pip install RGBMatrixEmulator[sixel]
75
42
  pip install RGBMatrixEmulator[pygame]
76
- pip install RGBMatrixEmulator[pi5]
77
43
 
78
44
  # All optional adapters at once
79
- pip install RGBMatrixEmulator[sixel,pygame,pi5]
45
+ pip install RGBMatrixEmulator[sixel,pygame]
80
46
  ```
81
47
 
82
48
  ## Usage
@@ -184,16 +150,6 @@ The config file enables configurations to be customized on a per-script basis. Y
184
150
  "image_format": "JPEG",
185
151
  "open_immediately": false
186
152
  },
187
- "pi5": {
188
- "_comment": "For use with the pi5 adapter only.",
189
- "pinout": "AdafruitMatrixBonnet",
190
- "n_addr_lines": 4,
191
- "rotation": "Normal",
192
- "n_planes": 10,
193
- "n_temporal_planes": 4,
194
- "n_lanes": 1,
195
- "led_rgb_sequence": "RGB"
196
- },
197
153
  "log_level": "info"
198
154
  }
199
155
  ```
@@ -238,18 +194,6 @@ Certain adapters may specify additional configurations. These specialized config
238
194
  | browser.image_format | String | Image format to use for rendering. Options are "JPEG" or "PNG".
239
195
  | browser.open_immediately | Bool | Open a new browser window immediately on startup (similar to other adapters).
240
196
 
241
- ##### `pi5` Options
242
-
243
- | Key | Type | Description |
244
- | --- | ---- | ----------- |
245
- | pi5.pinout | String | The hardware pinout definition. Matches attributes in `piomatter.Pinout` (e.g., "Active3", "AdafruitMatrixHat", "AdafruitMatrixBonnet").
246
- | pi5.n_addr_lines | Integer | Number of address lines for the display. Typically `4` for 32-pixel height panels, or `5` for 64-pixel height panels.
247
- | pi5.led_rgb_sequence | String | Color sequence of the LEDs (e.g., "RGB", "BGR", "RBG").
248
- | pi5.rotation | String | Display rotation. Matches attributes in `piomatter.Orientation` (e.g., "Normal", "R180", "CW", "CCW"). Does not work with "Active3" pinouts.
249
- | pi5.n_lanes | Integer | Number of parallel matrix chains (lanes). Only works with Active3 boards. Must be 2 or more.
250
- | pi5.n_planes | Integer | Colour Bit depth/number of planes. Maximum of 10, minimum of 1.
251
- | pi5.n_temporal_planes | Integer | Number of temporal planes for dithering/brightness control. Possible values are 0, 2 or 4 and can't be greater than the value of n_planes.
252
-
253
197
  ### Display Adapters
254
198
 
255
199
  By default, `RGBMatrixEmulator` uses `browser` as its display adapter for maximum compatibility with different operating systems as well as thread-safety. However, you can also use other display adapters as well if the default adapter does not suit your needs.
@@ -262,7 +206,6 @@ Currently supported display adapters are:
262
206
  * `tkinter`
263
207
  * `turtle`
264
208
  * `sixel`
265
- * `pi5` (experimental)
266
209
  * `raw`
267
210
 
268
211
  You can swap display adapters by changing the `display_adapter` value to one of the above in `emulator_config.json`.
@@ -273,15 +216,6 @@ You can swap display adapters by changing the `display_adapter` value to one of
273
216
 
274
217
  Please see the [README for the `browser` display adapter](RGBMatrixEmulator/adapters/browser_adapter/README.md) for further information regarding its configuration and usage.
275
218
 
276
- ### Raspberry Pi 5 Adapter
277
-
278
- > [!WARNING]
279
- > This adapter is deprecated. It will be removed no later than July 1, 2026. Please use native `rpi-rgb-led-matrix` Raspberry Pi 5 support.
280
-
281
- RGBME can be used to "bridge" scripts written for `rpi-rgb-led-matrix` to Raspberry Pi model 5 through [Adafruit Blinka](https://github.com/adafruit/Adafruit_Blinka) and the [Adafruit-Blinka-Raspberry-Pi5-Piomatter](https://github.com/adafruit/Adafruit_Blinka_Raspberry_Pi5_Piomatter) libraries.
282
-
283
- Please see the [README for the `pi5` display adapter](RGBMatrixEmulator/adapters/pi5_adapter/README.md) for further information regarding its configuration and usage.
284
-
285
219
  ### Raw Display Adapter
286
220
 
287
221
  If you prefer fine-grained control over the raw pixel data, such as to build integration testing or build your own UI on top of it, you can use the `raw` display adapter.
@@ -34,9 +34,4 @@ ADAPTERS = {
34
34
  "class": "RawAdapter",
35
35
  "fallback": False,
36
36
  },
37
- "pi5": {
38
- "path": "RGBMatrixEmulator.adapters.pi5_adapter",
39
- "class": "Pi5Adapter",
40
- "fallback": False,
41
- },
42
37
  }
@@ -34,9 +34,6 @@ class RGBMatrixOptions:
34
34
  self.emulator_title = emulator_config.emulator_title
35
35
  self.icon_path = emulator_config.icon_path
36
36
 
37
- # Pi5 Adapter
38
- self.pi5 = emulator_config.pi5
39
-
40
37
  @property
41
38
  def screen(self) -> Screen:
42
39
  """The emulated screen model (mapper geometry + render).
@@ -31,16 +31,6 @@ class RGBMatrixEmulatorConfig:
31
31
  "image_format": "JPEG",
32
32
  "open_immediately": False,
33
33
  },
34
- "pi5": {
35
- "_comment": "For use with the pi5 adapter only.",
36
- "pinout": "AdafruitMatrixBonnet",
37
- "n_addr_lines": 4,
38
- "rotation": "Normal",
39
- "n_planes": 10,
40
- "n_temporal_planes": 4,
41
- "n_lanes": 1,
42
- "led_rgb_sequence": "RGB",
43
- },
44
34
  "log_level": "info",
45
35
  }
46
36
 
@@ -53,7 +43,6 @@ class RGBMatrixEmulatorConfig:
53
43
  emulator_title: Optional[str]
54
44
  suppress_font_warnings: bool
55
45
  log_level: str
56
- pi5: "ChildConfig"
57
46
  browser: "ChildConfig"
58
47
 
59
48
  def __init__(self):
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env python
2
2
 
3
3
  # package version
4
- __version__ = "0.17.0"
4
+ __version__ = "0.18.0"
5
5
  """Installed version of RGBMatrixEmulator."""
@@ -48,10 +48,6 @@ pygame = [
48
48
  sixel = [
49
49
  "libsixel-python>=0.5.0",
50
50
  ]
51
- pi5 = [
52
- "Adafruit-Blinka-Raspberry-Pi5-Piomatter>=1.0.0; python_version>='3.11'",
53
- "adafruit-blinka>=8.0.0; python_version>='3.11'",
54
- ]
55
51
 
56
52
  [project.urls]
57
53
  Homepage = "https://github.com/ty-porter/RGBMatrixEmulator"
@@ -1,62 +0,0 @@
1
- # Pi5 Adapter
2
-
3
- > [!NOTE]
4
- > This adapter is currently experimental. Please report issues to https://github.com/ty-porter/RGBMatrixEmulator/issues
5
-
6
- This adapter enables the RGBMatrixEmulator to drive RGB led matrices connected to a Raspberry Pi 5 using the `adafruit-circuitpython-piomatter` library. It bridges the emulator's frame generation with the PIO-based hardware driving capabilities of the Pi 5.
7
-
8
- ## Configuration
9
-
10
- The adapter is configured via the `pi5` section in your `emulator_config.json`.
11
-
12
- ### Options
13
-
14
- | Option | Type | Description |
15
- | :--- | :--- | :--- |
16
- | `pinout` | String | The hardware pinout definition. Matches attributes in `piomatter.Pinout` (e.g., `"Active3","AdafruitMatrixHat","AdafruitMatrixBonnet"`). |
17
- | `n_addr_lines` | Integer | Number of address lines for the display. Typically `4` for 32-pixel height panels, or `5` for 64-pixel height panels. |
18
- | `led_rgb_sequence` | String | Color sequence of the LEDs (e.g., `"RGB"`, `"BGR"`, `"RBG"`). |
19
- | `rotation` | String | Display rotation. Matches attributes in `piomatter.Orientation` (e.g., `"Normal"`, `"R180"`, `"CW"`, `"CCW"`). Does not work with `"Active3"` pinouts. |
20
- | `n_lanes` | Integer | Number of parallel matrix chains (lanes). Only works with Active3 boards. Must be 2 or more. |
21
- | `n_planes` | Integer | Colour Bit depth/number of planes. Maximum of 10, minimum of 1|
22
- | `n_temporal_planes` | Integer | Number of temporal planes for dithering/brightness control. Possible values are 0, 2 or 4 and can't be greater than the value of n_planes. |
23
-
24
- ### Example Configuration
25
-
26
- ```json
27
- "pi5": {
28
- "pinout": "AdafruitMatrixBonnet",
29
- "n_addr_lines": 4,
30
- "led_rgb_sequence": "RGB",
31
- "rotation": "Normal",
32
- "n_lanes": 2,
33
- "n_planes": 6,
34
- "n_temporal_planes": 0
35
- }
36
- ```
37
-
38
- ## Setup & Non-Root Access
39
-
40
- By default, accessing the PIO subsystem on the Raspberry Pi 5 requires root privileges (`sudo`). To run the adapter as a standard user, you must configure a `udev` rule.
41
-
42
- ### configuring `udev` Rules
43
-
44
- 1. Create or edit the file `/etc/udev/rules.d/99-com.rules`:
45
-
46
- ```bash
47
- sudo nano /etc/udev/rules.d/99-com.rules
48
- ```
49
-
50
- 2. Add the following line to the file:
51
-
52
- ```text
53
- SUBSYSTEM=="*-pio", GROUP="gpio", MODE="0660"
54
- ```
55
-
56
- 3. Save the file (Ctrl+S, then Ctrl+X) and reboot your Raspberry Pi:
57
-
58
- ```bash
59
- sudo reboot
60
- ```
61
-
62
- For more details, refer to the [Adafruit Raspberry Pi 5 Setup Guide](https://learn.adafruit.com/rgb-matrix-panels-with-raspberry-pi-5/raspberry-pi-5-setup#add-pio-subsystem-rule-configuration-3191958).
@@ -1,250 +0,0 @@
1
- from RGBMatrixEmulator.adapters.base import BaseAdapter
2
- from RGBMatrixEmulator.logger import Logger
3
-
4
- import sys
5
- from pathlib import Path
6
- import numpy as np
7
-
8
- try:
9
- import adafruit_blinka_raspberry_pi5_piomatter as piomatter
10
- except ImportError:
11
- piomatter = None
12
-
13
-
14
- class Pi5Adapter(BaseAdapter):
15
- def __init__(self, width, height, options):
16
- Logger.warning(
17
- "The Pi5 adapter is deprecated. rpi-rgb-led-matrix now provides Raspberry Pi 5 support natively. "
18
- "This adapter will be removed no later than July 1, 2026.",
19
- )
20
-
21
- super().__init__(width, height, options)
22
- self.matrix = None
23
- self.framebuffer = None
24
- self.pixel_swizzle = None
25
-
26
- self.__ensure_pi5_runtime()
27
-
28
- def load_emulator_window(self):
29
- config = self.options.pi5
30
-
31
- # Validate n_planes
32
- if config.n_planes > 10:
33
- config.n_planes = 10
34
- elif config.n_planes < 1:
35
- Logger.warning(
36
- f"n_planes must be at least 1. Got {config.n_planes}, setting to 1."
37
- )
38
- config.n_planes = 1
39
-
40
- # Validate n_temporal_planes
41
- valid_temporal = [0, 2, 4]
42
- if config.n_temporal_planes not in valid_temporal:
43
- closest = min(
44
- valid_temporal, key=lambda x: abs(x - config.n_temporal_planes)
45
- )
46
- Logger.warning(
47
- f"Invalid n_temporal_planes {config.n_temporal_planes}. "
48
- f"Snapping to closest valid value: {closest}."
49
- )
50
- config.n_temporal_planes = closest
51
-
52
- if config.n_temporal_planes > config.n_planes:
53
- # Find max valid value <= n_planes
54
- new_val = max(
55
- [v for v in valid_temporal if v <= config.n_planes], default=0
56
- )
57
- Logger.warning(
58
- f"n_temporal_planes ({config.n_temporal_planes}) cannot be greater than n_planes ({config.n_planes}). "
59
- f"Reducing to {new_val}."
60
- )
61
- config.n_temporal_planes = new_val
62
-
63
- if config.n_addr_lines == 5 and self.height < 64:
64
- Logger.critical(
65
- f"n_addr_lines=5 requires a display height of at least 64 pixels. Current height: {self.height}"
66
- )
67
- sys.exit(1)
68
-
69
- # Configure Geometry
70
- pinout_str = config.pinout
71
-
72
- # Handle LED Sequence (RGB vs BGR vs Other)
73
- # Check if BGR is requested and if there is a BGR pinout variant
74
- sequence = config.led_rgb_sequence.upper()
75
-
76
- if sequence == "BGR":
77
- # Attempt to find the BGR variant of the pinout
78
- # Typical naming convention: AdafruitMatrixBonnet -> AdafruitMatrixBonnetBGR
79
- bgr_pinout_str = f"{pinout_str}BGR"
80
- if hasattr(piomatter.Pinout, bgr_pinout_str):
81
- pinout_str = bgr_pinout_str
82
- # Handled by hardware/pinout, so we don't need to software swizzle
83
- sequence = "RGB" # Treat as normal for rest of pipeline
84
- else:
85
- Logger.warning(
86
- f"BGR Sequence requested but pinout '{bgr_pinout_str}' not found in piomatter.Pinout. Will attempt software pixel swap."
87
- )
88
-
89
- # Resolve Pinout Enum
90
- if hasattr(piomatter.Pinout, pinout_str):
91
- pinout = getattr(piomatter.Pinout, pinout_str)
92
- else:
93
- Logger.warning(
94
- f"Pinout '{pinout_str}' not found in piomatter.Pinout. Defaulting to AdafruitMatrixBonnet."
95
- )
96
- pinout = piomatter.Pinout.AdafruitMatrixBonnet
97
-
98
- # Setup Software Swizzle if needed
99
- # We need to map RGB (original) to Dest Sequence
100
- # Common cases: RGB (0,1,2), RBG (0,2,1), GRB (1,0,2), GBR (1,2,0), BRG (2,0,1), BGR (2,1,0)
101
- # Note: If we handled BGR via pinout, sequence is set to "RGB" above so we skip this.
102
- if sequence != "RGB":
103
- swizzle_map = {
104
- "RGB": [0, 1, 2],
105
- "RBG": [0, 2, 1],
106
- "GRB": [1, 0, 2],
107
- "GBR": [1, 2, 0],
108
- "BRG": [2, 0, 1],
109
- "BGR": [2, 1, 0],
110
- }
111
-
112
- if sequence in swizzle_map:
113
- self.pixel_swizzle = swizzle_map[sequence]
114
- Logger.info(
115
- f"Using software pixel swizzle for sequence '{sequence}': {self.pixel_swizzle}"
116
- )
117
- else:
118
- Logger.warning(
119
- f"Unknown LED sequence '{sequence}'. Display colors may be incorrect."
120
- )
121
-
122
- rotation_str = config.rotation
123
- if hasattr(piomatter.Orientation, rotation_str):
124
- rotation = getattr(piomatter.Orientation, rotation_str)
125
- else:
126
- Logger.warning(
127
- f"Rotation '{rotation_str}' not found in piomatter.Orientation. Defaulting to Normal."
128
- )
129
- rotation = piomatter.Orientation.Normal
130
-
131
- if "Active3" not in pinout_str and config.n_lanes > 2:
132
- Logger.warning(
133
- f"Pinout '{pinout_str}' does not support multiple lanes. "
134
- "Setting n_lanes to 2."
135
- )
136
- config.n_lanes = 2
137
-
138
- if config.n_lanes == 2 and "Active3" not in pinout_str:
139
- # Simple Geometry
140
- geometry = piomatter.Geometry(
141
- width=self.width,
142
- height=self.height,
143
- n_planes=config.n_planes,
144
- n_addr_lines=config.n_addr_lines,
145
- n_temporal_planes=config.n_temporal_planes,
146
- rotation=rotation,
147
- )
148
- else:
149
- if config.n_lanes < 2:
150
- Logger.warning(
151
- f"Active3 pinouts require n_lanes >= 2. Got {config.n_lanes}, setting to 2."
152
- )
153
- config.n_lanes = 2
154
-
155
- pixelmap = None
156
- if config.n_lanes > 1 or "Active3" in pinout_str:
157
- try:
158
- from adafruit_blinka_raspberry_pi5_piomatter.pixelmappers import (
159
- simple_multilane_mapper,
160
- )
161
-
162
- pixelmap = simple_multilane_mapper(
163
- self.width, self.height, config.n_addr_lines, config.n_lanes
164
- )
165
- except ImportError:
166
- Logger.warning(
167
- "Could not import simple_multilane_mapper. Active3/Multilane support may fail."
168
- )
169
-
170
- geometry = piomatter.Geometry(
171
- width=self.width,
172
- height=self.height,
173
- n_addr_lines=config.n_addr_lines,
174
- n_planes=config.n_planes,
175
- n_temporal_planes=config.n_temporal_planes,
176
- n_lanes=config.n_lanes,
177
- map=pixelmap,
178
- )
179
-
180
- self.framebuffer = np.zeros(
181
- shape=(geometry.height, geometry.width, 3), dtype=np.uint8
182
- )
183
-
184
- self.matrix = piomatter.PioMatter(
185
- colorspace=piomatter.Colorspace.RGB888Packed,
186
- pinout=pinout,
187
- framebuffer=self.framebuffer,
188
- geometry=geometry,
189
- )
190
-
191
- # Register cleanup to clear the screen on exit
192
- import atexit
193
-
194
- def cleanup():
195
- if self.framebuffer is not None and self.matrix is not None:
196
- self.framebuffer.fill(0)
197
- self.matrix.show()
198
- # Deinit if possible, though show() with 0s might be enough
199
- # self.matrix.deinit() # PioMatter object might not support deinit or it's automatic on GC
200
-
201
- atexit.register(cleanup)
202
-
203
- self.loaded = True
204
-
205
- def draw_to_screen(self, pixels):
206
- if not self.loaded:
207
- return
208
-
209
- # pixels is (height, width, 3)
210
- try:
211
- pixel_data = np.array(pixels, dtype=np.uint8)
212
-
213
- # Apply software swizzle if configured
214
- if self.pixel_swizzle:
215
- pixel_data = pixel_data[:, :, self.pixel_swizzle]
216
-
217
- np.copyto(self.framebuffer, pixel_data)
218
- self.matrix.show()
219
- except Exception as e:
220
- # Throttle logging?
221
- pass
222
-
223
- def __ensure_pi5_runtime(self):
224
- """
225
- Validates that the code is running on a Raspberry Pi 5
226
- and has the necessary dependencies installed.
227
- """
228
- is_pi5 = False
229
- try:
230
- model_path = Path("/proc/device-tree/model")
231
- if model_path.exists():
232
- model_name = model_path.read_text().strip()
233
- if "Raspberry Pi 5" in model_name:
234
- is_pi5 = True
235
- except Exception:
236
- pass
237
-
238
- if not is_pi5:
239
- Logger.critical(
240
- "This module is designed exclusively for the Raspberry Pi 5."
241
- )
242
- sys.exit(1)
243
-
244
- if piomatter is None:
245
- Logger.critical(
246
- "Pi5 adapter cannot load due to missing dependencies for Raspberry Pi 5.\n"
247
- "Please install dependencies using the [pi5] feature option:\n"
248
- " pip install RGBMatrixEmulator[pi5]"
249
- )
250
- sys.exit(1)