Giter Site home page Giter Site logo

partofthething / infopanel Goto Github PK

View Code? Open in Web Editor NEW
31.0 8.0 12.0 242 KB

Show live data, animations, pictures, or anything on simple displays like RGB matrices

Home Page: https://partofthething.com/infopanel/

License: GNU General Public License v3.0

Python 100.00%
raspberry-pi home-automation led-matrix led-matrix-displays

infopanel's People

Contributors

partofthething avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

infopanel's Issues

fail to install

Hello i try to install but have severals error :
command : root@DietPi:~/infopanel# python setup.py install

response :

Running pytest-5.4.3/setup.py -q bdist_egg --dist-dir /tmp/easy_install-3CSZEj/pytest-5.4.3/egg-dist-tmp-3L0ln6
  File "build/bdist.linux-armv7l/egg/_pytest/mark/evaluate.py", line 17
    def cached_eval(config: Config, expr: str, d: Dict[str, object]) -> Any:
                          ^
SyntaxError: invalid syntax

  File "build/bdist.linux-armv7l/egg/_pytest/mark/legacy.py", line 42
    def from_item(cls, item: "Item") -> "KeywordMapping":
                           ^
SyntaxError: invalid syntax

  File "build/bdist.linux-armv7l/egg/_pytest/mark/structures.py", line 57
    def param(cls, *values, marks=(), id=None):
                                ^
SyntaxError: invalid syntax

  File "build/bdist.linux-armv7l/egg/_pytest/config/__init__.py", line 95
    def main(args=None, plugins=None) -> Union[int, ExitCode]:
                                      ^
SyntaxError: invalid syntax

  File "build/bdist.linux-armv7l/egg/_pytest/config/argparsing.py", line 39
    usage: Optional[str] = None,
         ^
SyntaxError: invalid syntax

  File "build/bdist.linux-armv7l/egg/_pytest/config/findpaths.py", line 66
    def get_common_ancestor(paths: Iterable[py.path.local]) -> py.path.local:
                                 ^
SyntaxError: invalid syntax

  File "build/bdist.linux-armv7l/egg/_pytest/assertion/__init__.py", line 45
    def register_assert_rewrite(*names) -> None:
                                        ^
SyntaxError: invalid syntax

  File "build/bdist.linux-armv7l/egg/_pytest/assertion/rewrite.py", line 216
    def _is_marked_for_rewrite(self, name: str, state):
                                         ^
SyntaxError: invalid syntax

  File "build/bdist.linux-armv7l/egg/_pytest/assertion/util.py", line 32
    def format_explanation(explanation: str) -> str:
                                      ^
SyntaxError: invalid syntax

  File "build/bdist.linux-armv7l/egg/_pytest/_io/__init__.py", line 8
    def _write_source(self, lines: List[str], indents: Sequence[str] = ()) -> None:
                                 ^
SyntaxError: invalid syntax

  File "build/bdist.linux-armv7l/egg/_pytest/_io/saferepr.py", line 15
    def _format_repr_exception(exc: BaseException, obj: Any) -> str:
                                  ^
SyntaxError: invalid syntax

  File "build/bdist.linux-armv7l/egg/_pytest/_code/code.py", line 52
    def __init__(self, rawcode) -> None:
                                ^
SyntaxError: invalid syntax

  File "build/bdist.linux-armv7l/egg/_pytest/_code/source.py", line 36
    def __init__(self, *parts, **kwargs) -> None:
                                         ^
SyntaxError: invalid syntax

  File "build/bdist.linux-armv7l/egg/_pytest/_argcomplete.py", line 68
    def __init__(self, directories: bool = True) -> None:
                                  ^
SyntaxError: invalid syntax

  File "build/bdist.linux-armv7l/egg/_pytest/cacheprovider.py", line 68
    def clear_cache(cls, cachedir: Path):
                                 ^
SyntaxError: invalid syntax

  File "build/bdist.linux-armv7l/egg/_pytest/capture.py", line 52
    def pytest_load_initial_conftests(early_config: Config):
                                                  ^
SyntaxError: invalid syntax

  File "build/bdist.linux-armv7l/egg/_pytest/compat.py", line 57
    def _format_args(func: Callable[..., Any]) -> str:
                         ^
SyntaxError: invalid syntax

  File "build/bdist.linux-armv7l/egg/_pytest/doctest.py", line 111
    def pytest_collect_file(path: py.path.local, parent):
                                ^
SyntaxError: invalid syntax

  File "build/bdist.linux-armv7l/egg/_pytest/fixtures.py", line 51
    def pytest_sessionstart(session: "Session"):
                                   ^
SyntaxError: invalid syntax

  File "build/bdist.linux-armv7l/egg/_pytest/hookspec.py", line 170
    def pytest_collection(session: "Session") -> Optional[Any]:
                                 ^
SyntaxError: invalid syntax

  File "build/bdist.linux-armv7l/egg/_pytest/logging.py", line 46
    def __init__(self, terminalwriter, *args, **kwargs) -> None:
                                                        ^
SyntaxError: invalid syntax

  File "build/bdist.linux-armv7l/egg/_pytest/main.py", line 179
    config: Config, doit: Callable[[Config, "Session"], Optional[Union[int, ExitCode]]]
          ^
SyntaxError: invalid syntax

  File "build/bdist.linux-armv7l/egg/_pytest/monkeypatch.py", line 112
    def context(self) -> Generator["MonkeyPatch", None, None]:
                      ^
SyntaxError: invalid syntax

  File "build/bdist.linux-armv7l/egg/_pytest/nodes.py", line 91
    class Node(metaclass=NodeMeta):
                        ^
SyntaxError: invalid syntax

  File "build/bdist.linux-armv7l/egg/_pytest/outcomes.py", line 34
    def __init__(self, msg: Optional[str] = None, pytrace: bool = True) -> None:
                          ^
SyntaxError: invalid syntax

  File "build/bdist.linux-armv7l/egg/_pytest/pathlib.py", line 37
    def get_lock_path(path: _AnyPurePath) -> _AnyPurePath:
                          ^
SyntaxError: invalid syntax

  File "build/bdist.linux-armv7l/egg/_pytest/pytester.py", line 165
    def _pytest(request: FixtureRequest) -> "PytestArg":
                       ^
SyntaxError: invalid syntax

  File "build/bdist.linux-armv7l/egg/_pytest/python.py", line 136
    def pytest_generate_tests(metafunc: "Metafunc") -> None:
                                      ^
SyntaxError: invalid syntax

  File "build/bdist.linux-armv7l/egg/_pytest/python_api.py", line 548
    expected_exception: Union["Type[_E]", Tuple["Type[_E]", ...]],
                      ^
SyntaxError: invalid syntax

  File "build/bdist.linux-armv7l/egg/_pytest/recwarn.py", line 60
    expected_warning: Optional[Union["Type[Warning]", Tuple["Type[Warning]", ...]]],
                    ^
SyntaxError: invalid syntax

  File "build/bdist.linux-armv7l/egg/_pytest/reports.py", line 48
    def __init__(self, **kw: Any) -> None:
                           ^
SyntaxError: invalid syntax

  File "build/bdist.linux-armv7l/egg/_pytest/resultlog.py", line 57
    print("{} {}".format(lettercode, testpath), file=self.logfile)
                                                    ^
SyntaxError: invalid syntax

  File "build/bdist.linux-armv7l/egg/_pytest/runner.py", line 184
    item, when: "Literal['setup', 'call', 'teardown']", log=True, **kwds
              ^
SyntaxError: invalid syntax

  File "build/bdist.linux-armv7l/egg/_pytest/setuponly.py", line 37
    def pytest_fixture_post_finalizer(fixturedef) -> None:
                                                  ^
SyntaxError: invalid syntax

  File "build/bdist.linux-armv7l/egg/_pytest/store.py", line 85
    def __init__(self) -> None:
                       ^
SyntaxError: invalid syntax

  File "build/bdist.linux-armv7l/egg/_pytest/terminal.py", line 173
    def pytest_configure(config: Config) -> None:
                               ^
SyntaxError: invalid syntax

  File "build/bdist.linux-armv7l/egg/_pytest/tmpdir.py", line 40
    def from_config(cls, config) -> "TempPathFactory":
                                 ^
SyntaxError: invalid syntax

  File "build/bdist.linux-armv7l/egg/_pytest/unittest.py", line 199
    def _expecting_failure(self, test_method) -> bool:
                                              ^
SyntaxError: invalid syntax

  File "build/bdist.linux-armv7l/egg/_pytest/warning_types.py", line 84
    def simple(cls, apiname: str) -> "PytestExperimentalApiWarning":
                           ^
SyntaxError: invalid syntax

  File "build/bdist.linux-armv7l/egg/_pytest/warnings.py", line 122
    def pytest_collection(session: Session) -> Generator[None, None, None]:
                                 ^
SyntaxError: invalid syntax

creating /usr/local/lib/python2.7/dist-packages/pytest-5.4.3-py2.7.egg
Extracting pytest-5.4.3-py2.7.egg to /usr/local/lib/python2.7/dist-packages
  File "/usr/local/lib/python2.7/dist-packages/pytest-5.4.3-py2.7.egg/_pytest/_argcomplete.py", line 68
    def __init__(self, directories: bool = True) -> None:
                                  ^
SyntaxError: invalid syntax

  File "/usr/local/lib/python2.7/dist-packages/pytest-5.4.3-py2.7.egg/_pytest/cacheprovider.py", line 68
    def clear_cache(cls, cachedir: Path):
                                 ^
SyntaxError: invalid syntax

  File "/usr/local/lib/python2.7/dist-packages/pytest-5.4.3-py2.7.egg/_pytest/capture.py", line 52
    def pytest_load_initial_conftests(early_config: Config):
                                                  ^
SyntaxError: invalid syntax

  File "/usr/local/lib/python2.7/dist-packages/pytest-5.4.3-py2.7.egg/_pytest/compat.py", line 57
    def _format_args(func: Callable[..., Any]) -> str:
                         ^
SyntaxError: invalid syntax

Defining any values for a scene sprite throws a KeyError

Partial config:

sprites:
  scroll:
      type: FancyText
      text: Test
      dx: -1
      ticks_per_movement: 1
  icon:
    type: Image
    path: /home/pi/icons/message.ppm

scenes:
  notification:
    sprites:
      - icon:
      - scroll:
        x: 0
        y: 0

Any values assigned to a sprite in a scene causes a KeyError to be generated.

INFO:infopanel.driver:Starting InfoPanel.
DEBUG:infopanel.sprites:Build <FancyText at 0, 0. dx/dy: (-1, 0), size: (32, 32)>
DEBUG:PIL.Image:Error closing: 'NoneType' object has no attribute 'close'
DEBUG:infopanel.sprites:Build <Image at 0, 0. dx/dy: (0, 0), size: (32, 32)>
DEBUG:infopanel.scenes:Initializing <class 'infopanel.scenes.Scene'>
Traceback (most recent call last):
  File "/usr/lib/python2.7/runpy.py", line 174, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/usr/local/lib/python2.7/dist-packages/infopanel-0.1-py2.7.egg/infopanel/__main__.py", line 4, in <module>
    driver.run()
  File "/usr/local/lib/python2.7/dist-packages/infopanel-0.1-py2.7.egg/infopanel/driver.py", line 206, in run
    infopanel = driver_factory(disp, datasrc, conf)
  File "/usr/local/lib/python2.7/dist-packages/infopanel-0.1-py2.7.egg/infopanel/driver.py", line 184, in driver_factory
    conf['scenes'], driver.sprites)
  File "/usr/local/lib/python2.7/dist-packages/infopanel-0.1-py2.7.egg/infopanel/scenes.py", line 100, in scene_factory
    sprite = copy.copy(existing_sprites[spritename][0])
KeyError: 'y'

Using 2 64x64 panels

I have your code working with two 64x64 panels with the config below...

Setting led-chain=2, I would expect, per RGB-Matrix documentation a frame size of 128x64, but as you can see, its 64x64 and everything that on panel 1, is duplicated on panel 2...

Setting it to 4, give me the correct frame size of 128x64... it appears that you may have led-cols= defaulted to 32 in your code...

I did notice that led-cols= is missing from your config, adding it give an error... <-- would be nice to have it available to properly allow for configuration of large displays

INFO:infopanel.sprites:Built custom frames for <Sprite at 0, 0. dx/dy: (1, 0), size: (64, 64)>.
DEBUG:infopanel.sprites:Build <Sprite at 0, 0. dx/dy: (1, 0), size: (64, 64)>
DEBUG:infopanel.sprites:Build <Temperature at 0, 0. dx/dy: (0, 0), size: (64, 64)>
DEBUG:infopanel.sprites:Build <Temperature at 0, 0. dx/dy: (0, 0), size: (64, 64)>
DEBUG:infopanel.sprites:Build <Duration at 0, 0. dx/dy: (0, 0), size: (64, 64)>
DEBUG:infopanel.sprites:Build <FancyText at 0, 0. dx/dy: (0, 0), size: (64, 64)>
DEBUG:infopanel.sprites:Build <Temperature at 0, 0. dx/dy: (0, 0), size: (64, 64)>
DEBUG:infopanel.sprites:Build <FancyText at 0, 0. dx/dy: (-1, 0), size: (64, 64)>
DEBUG:infopanel.sprites:Build <Duration at 0, 0. dx/dy: (0, 0), size: (64, 64)>
DEBUG:infopanel.scenes:Initializing <class 'infopanel.scenes.Welcome'>
DEBUG:infopanel.scenes:Initializing <class 'infopanel.scenes.Scene'>
DEBUG:infopanel.scenes:Initializing <class 'infopanel.scenes.Time'>
DEBUG:infopanel.scenes:Initializing <class 'infopanel.scenes.Scene'>
DEBUG:infopanel.scenes:Initializing <class 'infopanel.scenes.Giraffes'>
INFO:infopanel.driver:Applying mode: all
DEBUG:infopanel.driver:Switching to new scene: <infopanel.scenes.Scene object at 0x7577b5b0>
INFO:infopanel.mqtt:Connecting to MQTT server at 127.0.0.1
INFO:infopanel.mqtt:Connected with result code 0
DEBUG:infopanel.driver:Switching to new scene: <infopanel.sce
RGBMatrix:
  led-rows: 64
  led-chain: 2
  led-parallel: 1
  led-pwm-bits: 11
  led-brightness: 75
  led-gpio-mapping: adafruit-hat-pwm
  led-scan-mode: 0
  led-pwm-lsb-nanoseconds: 130
  led-show-refresh: false
  led-slowdown-gpio: 2
  led-no-hardware-pulse: false

Adding brightness to Modes

It would be nice to be able to add brightness to a mode...

modes:
    
   morning: 
    - RSF:
        duration: 10
        brightness: 10          # <--- not working here, but accepts it, need to look at code
    - RSF-Time:
        duration: 10
        brightness: 30

Color is not pickup from config file. New class DynamicText

I did a new version of your DynamicFancyText sprite that allows the color to be in the config file...
it also builds this format: label-data-units --> CO2: 234.2 ppm, all in one sprite

What happens is the color is set to the defaults from class Sprite, and it stays that way until I send an MQTT data value then it changes to the colors from the config file... what am I doing wrong???

If I remove in update_value, the if val != self.last_val:, from the program, it works correctly, as it forces a refresh...

I've also notice that fancytext may have the same issue, it only uses the default color
is there a way to force the color change on setup??
thanks.....

you need to add pallete for 'units' in sprite CONF as below...

    CONF = vol.Schema({vol.Optional('dx', default=0): int,
                       vol.Optional('dy', default=0): int,
                       vol.Optional('ticks_per_frame', default=1): int,
                       vol.Optional('ticks_per_movement', default=1): int,
                       vol.Optional('ticks_per_phrase', default=200): int,
                       vol.Optional('min_ticks_per_phrase', default=100): int,
                       vol.Optional('max_ticks_per_phrase', default=400): int,
                       vol.Optional('x', default=0): int,
                       vol.Optional('y', default=0): int,
                       vol.Optional('font_name', default='5x8.bdf'): str,
                       vol.Optional('phrases', default=['']): list,
                       vol.Optional('pallete', default={1: [255, 255, 255],
                                                        'text':[0, 255, 0],
                                                        'label':[255, 255, 0],
                                                        'units':[255,0,255]}): PALLETE_SCHEMA,
                       vol.Optional('frames', default=None): FRAMES_SCHEMA,
                       vol.Optional('text', default=''): str,
                       vol.Optional('can_flip', default=True): bool,
                       vol.Optional('reverse_frame_loop', default=True): bool})
# ************************************************************** #
# ************************************************************** # 
# ver: 1.0 [email protected] 15Dec2018  
    
class DynamicText(FancyText):  # pylint:disable=too-many-instance-attributes
    """
    FancyText that can have a changing/live data source. With Data_label, then data, then units

    This has a ``label`` configuration to render something like:
    ``Label: [value]``
    """

    CONF = FancyText.CONF.extend({'label': vol.Coerce(str),
                                  vol.Optional('data_label'): vol.Coerce(str),
                                  vol.Optional('label_fmt', default='{}'): str,
                                  vol.Optional('val_fmt', default='{}'): str,
                                  vol.Optional('units', default=''): str })

    def __init__(self, max_x, max_y, data_source):
        """Construct a sprite."""
        FancyText.__init__(self, max_x, max_y, data_source=data_source)
        self.last_val = None
        self.label = None
        self.value = None
        self.label_fmt = None
        self.val_fmt = None
        self.data_label = None
        self.pallete = None # {'label':[0, 255, 255], 'units':[255, 0, 0], 'text': [255, 255, 255]}
        self.units = None
       
    def apply_config(self, conf):
        """Validate and apply configuration to this sprite."""
        conf = FancyText.apply_config(self, conf)
        if conf['data_label']:
            # make this a callable function to enable live/updating data
            self.value = lambda: self._convert_data(self.data_source[conf['data_label']])
        self._make_text()
        return conf

    def _convert_data(self, val):  # pylint: disable=no-self-use
        return val

    def _make_text(self):
        """Render the label and live value."""
        if self.label:
            DynamicText.add(self, self.label_fmt.format(self.label), self.pallete['text'])        # <--------------
           
        val = self.value() if callable(self.value) else self.value  # pylint: disable=not-callable
        text = self.val_fmt.format(val)
        self.last_val = val
        DynamicText.add(self, text, self.pallete['label'])
       
        if self.units:
            DynamicText.add(self, self.units, self.pallete['units'])

    def update_value(self):
        """Update, but only if the value has changed."""
        val = self.value() if callable(self.value) else self.value  # pylint: disable=not-callable
        if val != self.last_val:
            # only do lookup when things change for speed.
            self.clear()
            self._make_text()

    def render(self, display):
        """Render a frame and advance."""
        self.update_value()
        return FancyText.render(self, display)

# ************************************************************** #

infopanel.yaml issue

sorry for my English :)
I have a problem with a gif image that I am trying to put into the configuration file
I have a bug all the time
I also tried to validate the yaml file but it didn't help

The code looks like this:

mqtt:
  broker: test.mosquitto.org
  #port: 8883
  port: 1883
  client_id: screen
  keepalive: 60
  username: user
  password: pass
  #certificate: /etc/ssl/certs/DST_Root_CA_X3.pem
  topic: house/screen/#

RGBMatrix:
  led-rows: 64
  led-cols: 64
  led-chain: 1
  led-parallel: 1
  led-pwm-bits: 11
  led-brightness: 100
  led-gpio-mapping: regular
  led-scan-mode: 1
  led-pwm-lsb-nanoseconds: 130
  led-show-refresh: false
  led-slowdown-gpio: 0
  led-no-hardware-pulse: false

DummyMatrix:

sprites: 
  I90:
      type: Duration
      label: I90
      low_val: 13.0
      high_val: 23.0
      data_label: travel_time_i90
  WA520:
      type: Duration
      label: 520
      low_val: 13.0
      high_val: 23.0
      data_label: travel_time_520
  daily_high: 
      type: Temperature
      label: H
      low_val: -15
      high_val: 28
      data_label: daily_high
  daily_low: 
      type: Temperature
      label: L
      low_val: -15
      high_val: 28
      data_label: daily_low
  current: 
      type: Temperature
      label: C
      low_val: -15
      high_val: 28
      data_label: current_temp
  vehicle:
      type: FancyText
      text: VROOM!
      pallete:
         text:
            - 255
            - 100
            - 255
  scroll:
      type: FancyText
      text: OH YEAH!
      dx: -1
      ticks_per_movement: 1
  giraffe2:
      type: Sprite
      ticks_per_frame: 3
      dx: 1
      pallete: 
         1: 
            - 255
            - 0
            - 0
         2: 
            - 0
            - 0
            - 255
      frames:
        - 00010
          00011
          00020
          00010
          00020
          00010
          00020
          00110
          01210
          12120
          10010
          10001
          10001

        - 00100
          00110
          00020
          00010
          00020
          00010
          00020
          00110
          01210
          12120
          10010
          10010
          01100
          #  flag:
          #      type: Image
          #      path: flag.ppm
  cat:
      type: AnimatedGif
      path: /home/pi/led-infopanel/rainbow_cat.gif
  hypnotoad:
      type: AnimatedGif
      path: /home/pi/led-infopanel/hypnotoad.gif

scenes:

  giraffes:
      type: Giraffes
      extra_phrases: 
        - I90
        - WA520
        - daily_high
        - daily_low
        - current
      extra_phrase_frequency: 4

  welcome:
      type: Welcome
  time: 
      type: Time
  traffic:
      sprites: 
        - I90: 
            x: 0
            y: 8
        - WA520:
            x: 0
            y: 16
        - daily_high:
            x: 33
            y: 8
        - daily_low: 
            x: 33
            y: 16
        - current:
            x: 33 
            y: 24
        - vehicle: 
            x: 0 
            y: 24
        - scroll: 
            x: 0 
            y: 32
  giraffe2:
     sprites: 
       - giraffe2:
           y: 10

modes: 
  morning: 
    - giraffes:
        duration: 15
        brightness: 70
    - traffic:
        duration: 10 
    - cat:
        duration: 10
    - traffic:
        duration: 10 

global:
    #font_dir: $RPI_RGB_LED_MATRIX/fonts
    font_dir: /home/pi/rpi-rgb-led-matrix/fonts
    default_mode: morning

No RGB Matrix library found...

@partofthething

Forgive me but I have the RPI-RGB-LED-MATRIX api working with demos and such. However, I saw your code and am trying to get it to work. I am getting: No RGB Matrix library found. Cannot use that display

Am I missing something? It looks like it calls for rgbmatrix but can't find it?

image_path fails with frequent updates

Hey there - I know I'm using this beyond the intended use - but I have a subway-arrival-time display going, and I'm updating logos for 4 routes via 4 sprites on the display.

I've found that unless I rate limit the updates to 1-every-3-seconds the updates aren't applied. The rate limit is a serviceable workaround, but if there's a way to address this in the underlying code - that would be awesome.

config.py - change parameters to support faster raspberries

The line in config.py should be amended to support faster Pis
old:
'led-slowdown-gpio': vol.All(int, vol.Range(min=0, max=2))

new:
'led-slowdown-gpio': vol.All(int, vol.Range(min=0, max=4))

sorry I don't know how to do a pull request!

test

I receive an error during installation.
this is my log:

pi@Info_bord:~/infopanel $ sudo python setup.py install
running install
running bdist_egg
running egg_info
writing requirements to infopanel.egg-info/requires.txt
writing infopanel.egg-info/PKG-INFO
writing top-level names to infopanel.egg-info/top_level.txt
writing dependency_links to infopanel.egg-info/dependency_links.txt
reading manifest file 'infopanel.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'infopanel.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-armv7l/egg
running install_lib
running build_py
creating build/bdist.linux-armv7l/egg
creating build/bdist.linux-armv7l/egg/infopanel
copying build/lib.linux-armv7l-2.7/infopanel/config.py -> build/bdist.linux-armv7l/egg/infopanel
copying build/lib.linux-armv7l-2.7/infopanel/data.py -> build/bdist.linux-armv7l/egg/infopanel
copying build/lib.linux-armv7l-2.7/infopanel/init.py -> build/bdist.linux-armv7l/egg/infopanel
copying build/lib.linux-armv7l-2.7/infopanel/driver.py -> build/bdist.linux-armv7l/egg/infopanel
creating build/bdist.linux-armv7l/egg/infopanel/tests
copying build/lib.linux-armv7l-2.7/infopanel/tests/init.py -> build/bdist.linux-armv7l/egg/infopanel/tests
copying build/lib.linux-armv7l-2.7/infopanel/tests/test_mqtt.py -> build/bdist.linux-armv7l/egg/infopanel/tests
copying build/lib.linux-armv7l-2.7/infopanel/tests/test_config.yaml -> build/bdist.linux-armv7l/egg/infopanel/tests
copying build/lib.linux-armv7l-2.7/infopanel/tests/test_scenes.py -> build/bdist.linux-armv7l/egg/infopanel/tests
copying build/lib.linux-armv7l-2.7/infopanel/tests/test_sprites.py -> build/bdist.linux-armv7l/egg/infopanel/tests
copying build/lib.linux-armv7l-2.7/infopanel/tests/dummy_screen.py -> build/bdist.linux-armv7l/egg/infopanel/tests
copying build/lib.linux-armv7l-2.7/infopanel/tests/test_driver.py -> build/bdist.linux-armv7l/egg/infopanel/tests
copying build/lib.linux-armv7l-2.7/infopanel/main.py -> build/bdist.linux-armv7l/egg/infopanel
copying build/lib.linux-armv7l-2.7/infopanel/display.py -> build/bdist.linux-armv7l/egg/infopanel
copying build/lib.linux-armv7l-2.7/infopanel/colors.py -> build/bdist.linux-armv7l/egg/infopanel
copying build/lib.linux-armv7l-2.7/infopanel/scenes.py -> build/bdist.linux-armv7l/egg/infopanel
copying build/lib.linux-armv7l-2.7/infopanel/mqtt.py -> build/bdist.linux-armv7l/egg/infopanel
copying build/lib.linux-armv7l-2.7/infopanel/sprites.py -> build/bdist.linux-armv7l/egg/infopanel
copying build/lib.linux-armv7l-2.7/infopanel/helpers.py -> build/bdist.linux-armv7l/egg/infopanel
byte-compiling build/bdist.linux-armv7l/egg/infopanel/config.py to config.pyc
byte-compiling build/bdist.linux-armv7l/egg/infopanel/data.py to data.pyc
byte-compiling build/bdist.linux-armv7l/egg/infopanel/init.py to init.pyc
byte-compiling build/bdist.linux-armv7l/egg/infopanel/driver.py to driver.pyc
byte-compiling build/bdist.linux-armv7l/egg/infopanel/tests/init.py to init.pyc
byte-compiling build/bdist.linux-armv7l/egg/infopanel/tests/test_mqtt.py to test_mqtt.pyc
byte-compiling build/bdist.linux-armv7l/egg/infopanel/tests/test_scenes.py to test_scenes.pyc
byte-compiling build/bdist.linux-armv7l/egg/infopanel/tests/test_sprites.py to test_sprites.pyc
byte-compiling build/bdist.linux-armv7l/egg/infopanel/tests/dummy_screen.py to dummy_screen.pyc
byte-compiling build/bdist.linux-armv7l/egg/infopanel/tests/test_driver.py to test_driver.pyc
byte-compiling build/bdist.linux-armv7l/egg/infopanel/main.py to main.pyc
byte-compiling build/bdist.linux-armv7l/egg/infopanel/display.py to display.pyc
byte-compiling build/bdist.linux-armv7l/egg/infopanel/colors.py to colors.pyc
byte-compiling build/bdist.linux-armv7l/egg/infopanel/scenes.py to scenes.pyc
byte-compiling build/bdist.linux-armv7l/egg/infopanel/mqtt.py to mqtt.pyc
byte-compiling build/bdist.linux-armv7l/egg/infopanel/sprites.py to sprites.pyc
byte-compiling build/bdist.linux-armv7l/egg/infopanel/helpers.py to helpers.pyc
creating build/bdist.linux-armv7l/egg/EGG-INFO
copying infopanel.egg-info/PKG-INFO -> build/bdist.linux-armv7l/egg/EGG-INFO
copying infopanel.egg-info/SOURCES.txt -> build/bdist.linux-armv7l/egg/EGG-INFO
copying infopanel.egg-info/dependency_links.txt -> build/bdist.linux-armv7l/egg/EGG-INFO
copying infopanel.egg-info/requires.txt -> build/bdist.linux-armv7l/egg/EGG-INFO
copying infopanel.egg-info/top_level.txt -> build/bdist.linux-armv7l/egg/EGG-INFO
zip_safe flag not set; analyzing archive contents...
infopanel.tests.init: module references file
creating 'dist/infopanel-0.1-py2.7.egg' and adding 'build/bdist.linux-armv7l/egg' to it
removing 'build/bdist.linux-armv7l/egg' (and everything under it)
Processing infopanel-0.1-py2.7.egg
removing '/usr/local/lib/python2.7/dist-packages/infopanel-0.1-py2.7.egg' (and everything under it)
creating /usr/local/lib/python2.7/dist-packages/infopanel-0.1-py2.7.egg
Extracting infopanel-0.1-py2.7.egg to /usr/local/lib/python2.7/dist-packages
infopanel 0.1 is already the active version in easy-install.pth

Installed /usr/local/lib/python2.7/dist-packages/infopanel-0.1-py2.7.egg
Processing dependencies for infopanel==0.1
Searching for more-itertools>=4.0.0
Reading https://pypi.python.org/simple/more-itertools/
Downloading https://files.pythonhosted.org/packages/a0/47/6ff6d07d84c67e3462c50fa33bf649cda859a8773b53dc73842e84455c05/more-itertools-8.2.0.tar.gz#sha256=b1ddb932186d8a6ac451e1d95844b382f55e12686d51ca0c68b6f61f2ab7a507
Best match: more-itertools 8.2.0
Processing more-itertools-8.2.0.tar.gz
Writing /tmp/easy_install-VNGeaj/more-itertools-8.2.0/setup.cfg
Running more-itertools-8.2.0/setup.py -q bdist_egg --dist-dir /tmp/easy_install-VNGeaj/more-itertools-8.2.0/egg-dist-tmp-7gcyUg
Traceback (most recent call last):
File "setup.py", line 37, in
include_package_data=True
File "/usr/lib/python2.7/distutils/core.py", line 151, in setup
dist.run_commands()
File "/usr/lib/python2.7/distutils/dist.py", line 953, in run_commands
self.run_command(cmd)
File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
cmd_obj.run()
File "/usr/lib/python2.7/dist-packages/setuptools/command/install.py", line 67, in run
self.do_egg_install()
File "/usr/lib/python2.7/dist-packages/setuptools/command/install.py", line 117, in do_egg_install
cmd.run()
File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 436, in run
self.easy_install(spec, not self.no_deps)
File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 680, in easy_install
return self.install_item(None, spec, tmpdir, deps, True)
File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 727, in install_item
self.process_distribution(spec, dist, deps)
File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 772, in process_distribution
[requirement], self.local_index, self.easy_install
File "/usr/lib/python2.7/dist-packages/pkg_resources/init.py", line 846, in resolve
dist = best[req.key] = env.best_match(req, ws, installer)
File "/usr/lib/python2.7/dist-packages/pkg_resources/init.py", line 1118, in best_match
return self.obtain(req, installer)
File "/usr/lib/python2.7/dist-packages/pkg_resources/init.py", line 1130, in obtain
return installer(requirement)
File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 699, in easy_install
return self.install_item(spec, dist.location, tmpdir, deps)
File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 725, in install_item
dists = self.install_eggs(spec, download, tmpdir)
File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 906, in install_eggs
return self.build_and_install(setup_script, setup_base)
File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 1145, in build_and_install
self.run_setup(setup_script, setup_base, args)
File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 1131, in run_setup
run_setup(setup_script, args)
File "/usr/lib/python2.7/dist-packages/setuptools/sandbox.py", line 258, in run_setup
raise
File "/usr/lib/python2.7/contextlib.py", line 35, in exit
self.gen.throw(type, value, traceback)
File "/usr/lib/python2.7/dist-packages/setuptools/sandbox.py", line 198, in setup_context
yield
File "/usr/lib/python2.7/contextlib.py", line 35, in exit
self.gen.throw(type, value, traceback)
File "/usr/lib/python2.7/dist-packages/setuptools/sandbox.py", line 169, in save_modules
saved_exc.resume()
File "/usr/lib/python2.7/dist-packages/setuptools/sandbox.py", line 144, in resume
six.reraise(type, exc, self._tb)
File "/usr/lib/python2.7/dist-packages/setuptools/sandbox.py", line 157, in save_modules
yield saved
File "/usr/lib/python2.7/dist-packages/setuptools/sandbox.py", line 198, in setup_context
yield
File "/usr/lib/python2.7/dist-packages/setuptools/sandbox.py", line 255, in run_setup
DirectorySandbox(setup_dir).run(runner)
File "/usr/lib/python2.7/dist-packages/setuptools/sandbox.py", line 285, in run
return func()
File "/usr/lib/python2.7/dist-packages/setuptools/sandbox.py", line 253, in runner
_execfile(setup_script, ns)
File "/usr/lib/python2.7/dist-packages/setuptools/sandbox.py", line 47, in _execfile
exec(code, globals, locals)
File "/tmp/easy_install-VNGeaj/more-itertools-8.2.0/setup.py", line 5, in

File "/tmp/easy_install-VNGeaj/more-itertools-8.2.0/more_itertools/init.py", line 1, in
File "/tmp/easy_install-VNGeaj/more-itertools-8.2.0/more_itertools/more.py", line 480
yield from iterable
^
SyntaxError: invalid syntax

gr Tim

News enhancements

There are other free news sources like the NYT and NewsAPI listed below that you may want to consider as a future enhancement...

https://newsapi.org/docs/get-started
https://archive.nytimes.com/www.nytimes.com/services/xml/rss/index.html
-->  http://www.nytimes.com/services/xml/rss/nyt/HomePage.xml

also, there s a free weather API that looks interesting...

https://openweathermap.org

Advanced scrolling text

Hello,

first of all thanks for having created such an awesome project! I have actually forked the project locally and heavily modified it to have additional features (animated transitions between scenes, ability to specify whether a sprite should loop or not, whether it should autostart playing or not, and much more "under the hood" stuff). I hope to publish it at some point, or even add pull requests to this project. Again, thanks for the amazing base!

Now to my actual question: I was wondering how to properly implement advanced scrolling text sprites. What I mean is that one could define a textbox area, for simplicity let's say we want our text be 20px wide. Then, if the actual text we want to display is shorter than 20px, it will display statically, without no animation. If it is longer, it will scroll, but WITHIN the designated 20px.
This is thus opposed to a normal FancyText which is not bound to any specifc box but takes the whole screen.

Is that something that you might include in future releases? Or do you have any ideas on how to implement it 'cleanly'? I was thinking of creating individual PIL canvases that match the desired textbox size and animate the text on those canvases. Finally, the canvas will be pasted onto the "main" image/canvas. Any thoughts?

Cheers!

allow mqtt string-based data_source of generic fancytext object

More of a request than an issue, I would love if the standard fancytext object accepted a data_source. Also for that subway-arrival-time clock. I've finagled the code on my own to show the minutes for the arrival time - but the next step is actually showing the route destination rather than just the direction.

I'm not great with python - I know the data_source is looking for an integer, and I haven't been able to figure out how to make it just pass a plain string. If you have any time to implement this, I think that would be awesome. If not, I'll share my results if I'm able to eventually get it working. Seems simple enough - I'm just a novice at this.

Exception: Couldn't load font

I keep getting the follow error:

INFO:infopanel.driver:Starting InfoPanel. Traceback (most recent call last): File "/usr/lib/python3.9/runpy.py", line 197, in _run_module_as_main return _run_code(code, main_globals, None, File "/usr/lib/python3.9/runpy.py", line 87, in _run_code exec(code, run_globals) File "/root/infopanel/infopanel/__main__.py", line 5, in <module> File "/root/infopanel/infopanel/driver.py", line 252, in run File "/root/infopanel/infopanel/driver.py", line 222, in driver_factory File "/root/infopanel/infopanel/sprites.py", line 791, in sprite_factory File "/root/infopanel/infopanel/sprites.py", line 435, in apply_config File "/root/infopanel/infopanel/sprites.py", line 353, in apply_config File "/root/infopanel/infopanel/sprites.py", line 153, in apply_config File "/root/infopanel/infopanel/helpers.py", line 41, in load_font File "graphics.pyx", line 32, in rgbmatrix.graphics.Font.LoadFont Exception: Couldn't load font ~/infopanel/5x8.bdf

As you can see, I moved the font to the infopanel as well to see if that would help, it doesn't. It definitely exists in that folder. The fonts work from the RPI-RGB-LED-MATRIX samples. Any ideas?

A Time-Date Sprite

This is a sprite that will display time or date formatted by Linux style "strftime"

     sprites:
       - DayTime: 
           x: 25 
           y: 10
           ticks_per_movement: 2
           dx: -1
           can_flip: false
           strftime: '%I:%M:%S %p'
           pallete: 
             text: 
               - 255
               - 0
               - 255 
# ************************************************************** #
# ************************************************************** #
# ver: 1.0 [email protected] 15Dec2018  

class DayTime(FancyText):
	

    CONF = FancyText.CONF.extend ({vol.Optional('strftime', default= '%I:%M:%S %P'): str})

    def __init__(self, max_x, max_y, data_source):
        """Construct a sprite."""
        FancyText.__init__(self, max_x, max_y, data_source=data_source)
        self.last_val = None
        self.value = None
        self.now = None
        self.text = None
        self.pallete = {'text':[0, 255, 255]}
        self.strftime = None
        
    def apply_config(self, conf):
        """Validate and apply configuration to this sprite."""
        conf = FancyText.apply_config(self, conf)
        self._make_text()
        return conf 
        
    def _make_text(self):

        """Draw the current time."""
        self.now = datetime.datetime.now()
        self.text = self.now.strftime(self.strftime)
        self.last_val = self.text
        DayTime.add(self, self.text, self.pallete['text'])    
                                                   
    def update_value(self):
        """Update, but only if the value has changed."""
        val = self.value() if callable(self.value) else self.value  # pylint: disable=not-callable
        if val != self.last_val:
            # only do lookup when things change for speed.
            self.clear()
            self._make_text()

    def render(self, display):
        """Render a frame and advance."""
        self.update_value()
        return FancyText.render(self, display)

# ************************************************************** #

Can't get my head around dx

So dx seems to be simple:

  • 0 (default) Sprites scroll from left to right
  • 1 Sprites scroll from right to left

So why is my text scrolling from left to right and back from right to left no matter what i set the parameter to?

  eventdescription:
      type: DynamicFancyText
      #label: 'Description '
      data_label: event_description
      label_color: red
      value_color: white
      font_name: 5x7.bdf
      dx: 1
      ticks_per_movement: 5

Errors?

Trying to have fun with this awesome Project, but getting following errors:

:228: RuntimeWarning: Your system is neon capable but pygame was not built with support for it. The performance of some of your blits could be adversely affected
pygame 2.3.0 (SDL 2.0.14, Python 3.9.2)
Hello from the pygame community. https://www.pygame.org/contribute.html
error: XDG_RUNTIME_DIR not set in the environment.
error: XDG_RUNTIME_DIR not set in the environment.
Traceback (most recent call last):
File "/usr/lib/python3.9/runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/usr/lib/python3.9/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/home/pi/infopanel/infopanel/main.py", line 5, in
driver.run()
File "/home/pi/infopanel/infopanel/driver.py", line 250, in run
disp = display.display_factory(conf)
File "/home/pi/infopanel/infopanel/display.py", line 164, in display_factory
display = dummy_screen.DummyScreen()
File "/home/pi/infopanel/infopanel/tests/dummy_screen.py", line 26, in init
self._display = pygame.display.set_mode(
pygame.error: displayIndex must be in the range 0 - -1

Some help is needed :-) At least, I´m interested in using the MQTT - thing by its own... I don´t need other things except the MQTT :-)

test_config.yaml fails to run

I am unable to run infopanel, even using the test_config.yaml file provided. Below is the error:

root@raspberrypi:~/infopanel/infopanel/tests# python -m infopanel --config ./test_config.yaml
INFO:infopanel.driver:Starting InfoPanel.
Traceback (most recent call last):
File "/usr/lib/python3.5/runpy.py", line 193, in _run_module_as_main
"main", mod_spec)
File "/usr/lib/python3.5/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/usr/local/lib/python3.5/dist-packages/infopanel-0.1-py3.5.egg/infopanel/main.py", line 4, in
driver.run()
File "/usr/local/lib/python3.5/dist-packages/infopanel-0.1-py3.5.egg/infopanel/driver.py", line 218, in run
infopanel = driver_factory(disp, datasrc, conf)
File "/usr/local/lib/python3.5/dist-packages/infopanel-0.1-py3.5.egg/infopanel/driver.py", line 192, in driver_factory
driver.sprites = sprites.sprite_factory(conf['sprites'], data_src, disp)
File "/usr/local/lib/python3.5/dist-packages/infopanel-0.1-py3.5.egg/infopanel/sprites.py", line 687, in sprite_factory
sprite.apply_config(sprite_conf)
File "/usr/local/lib/python3.5/dist-packages/infopanel-0.1-py3.5.egg/infopanel/sprites.py", line 372, in apply_config
conf = FancyText.apply_config(self, conf)
File "/usr/local/lib/python3.5/dist-packages/infopanel-0.1-py3.5.egg/infopanel/sprites.py", line 295, in apply_config
conf = Sprite.apply_config(self, conf)
File "/usr/local/lib/python3.5/dist-packages/infopanel-0.1-py3.5.egg/infopanel/sprites.py", line 90, in apply_config
conf = self.CONF(conf)
File "/usr/local/lib/python3.5/dist-packages/voluptuous-0.11.5-py3.5.egg/voluptuous/schema_builder.py", line 267, in call
File "/usr/local/lib/python3.5/dist-packages/voluptuous-0.11.5-py3.5.egg/voluptuous/schema_builder.py", line 589, in validate_dict
File "/usr/local/lib/python3.5/dist-packages/voluptuous-0.11.5-py3.5.egg/voluptuous/schema_builder.py", line 427, in validate_mapping
voluptuous.error.MultipleInvalid: expected a list for dictionary value @ data['frames']

Invalid mode change

In testing I was using MQTTfx to send a command to infopanel, unfortunately, it added two "LF", 0x0A, at the end of each message. If you send an invalid message, the code in display.py would flag it as invalid, but when the data was first received from MQTT it populated the invalid data in self.data_source... so, next time through the code it would use the invalid data and somewhat hang the system.

This fix was to re populate the MQTT structure with the current mode...

 self.data_source['mode'] = self._mode  # if mode is invalid, reset this in the mqtt populated 
    def apply_mode(self, mode):
        """
        Apply a different sequence of scenes with different durations.

        If the mode is the name of a scene, set that scene instead.
        """
        LOG.info('Applying mode: %s', mode)
        if mode not in self.modes:
            if mode in self.scenes:
                # allow mode names to be any scene name to get just that mode.
                scene = self.scenes[mode]
                self.scene_sequence = [scene]
                self.durations_in_s[scene] = MODE_ALL_DURATION
            else:
                LOG.error('Invalid mode: %s', mode)
                self.data_source['mode'] = self._mode  # if mode is invalid, reset this in the mqtt populated collection
                return
        else:
            self.scene_sequence = []
            for scene_name, duration in self.modes[mode]:
                scene = self.scenes[scene_name]
                self.scene_sequence.append(scene)
                self.durations_in_s[scene] = duration
        self._scene_iterator = itertools.cycle(self.scene_sequence)
        self._previous_mode = self._mode  # for suspend/resume
        self._mode = mode

Mode Setting

mosquitto_pub -h 192.168.101.102 -m "blank" -t house/screen/mode
or
mosquitto_pub -h 192.168.101.102 -m "all" -t house/screen/mode

result in:
INFO:infopanel.driver:Applying mode: b'blank'
ERROR:infopanel.driver:Invalid mode: b'blank'
INFO:infopanel.driver:Applying mode: b'all'
ERROR:infopanel.driver:Invalid mode: b'all'

Incompatible with most recent version of Voluptuous

After installing and configuring and trying to fire up the thing, I was encountering this error:

voluptuous.error.MultipleInvalid: expected a list for dictionary value @ data['frames']

Having just installed this yesterday, the setup script installed voluptuous-0.11.1

I took a look at requirements.txt and saw it specifies GREATER than 0.9.3, so I figured i'd give a shot to rolling that back to the specified version. That cleared the error, and once I troubleshot more basic issues with my YAML, I was at least getting a "hello world" displayed on the panel triggered by mqtt. Haven't waded much past that just yet.

if anyone else is reading this with that problem, before the code is patched, here's what you do
sudo pip uninstall voluptuous
sudo pip install voluptuous==0.9.3

Anyway - easily fixed on the user end - seems to otherwise work great, thank you for sharing.
Mostly raising the issue in case anyone else has it, to share the fix.

fail to start using this project

Hi,
and thank you for your project.
i'm using an rpi zero with an adafruit bonnet rgb hat matrix, all works ok, but i want to use it with mqtt and i saw your project.
I'm a noob with python... and i get this:

while installing (?) the dependencies:

pi@raspberrypi:~/rpi-rgb-led-matrix/bindings/python $ sudo python3 setup.py install
running install
running build
running build_py
creating build/lib.linux-armv6l-3.7
creating build/lib.linux-armv6l-3.7/rgbmatrix
copying rgbmatrix/init.py -> build/lib.linux-armv6l-3.7/rgbmatrix
running build_ext
building 'core' extension
creating build/temp.linux-armv6l-3.7
creating build/temp.linux-armv6l-3.7/rgbmatrix
arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I../../include -I/usr/include/python3.7m -c rgbmatrix/core.cpp -o build/temp.linux-armv6l-3.7/rgbmatrix/core.o -O3 -Wall
rgbmatrix/core.cpp:4:10: fatal error: Python.h: No such file or directory
#include "Python.h"
^~~~~~~~~~
compilation terminated.
error: command 'arm-linux-gnueabihf-gcc' failed with exit status 1

and if i try to start infopanel:

pi@raspberrypi:~/infopanel $ python3 infopanel --config ledmatrix.yaml
No RGB Matrix library found. Cannot use that display.
INFO:infopanel.driver:Starting InfoPanel.
Traceback (most recent call last):
File "/usr/lib/python3.7/runpy.py", line 193, in _run_module_as_main
"main", mod_spec)
File "/usr/lib/python3.7/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "infopanel/main.py", line 5, in
driver.run()
File "/usr/local/lib/python3.7/dist-packages/infopanel-0.1-py3.7.egg/infopanel/driver.py", line 252, in run
infopanel = driver_factory(disp, datasrc, conf)
File "/usr/local/lib/python3.7/dist-packages/infopanel-0.1-py3.7.egg/infopanel/driver.py", line 222, in driver_factory
driver.sprites = sprites.sprite_factory(conf["sprites"], data_src, disp)
File "/usr/local/lib/python3.7/dist-packages/infopanel-0.1-py3.7.egg/infopanel/sprites.py", line 790, in sprite_factory
sprite = cls(disp.width, disp.height, data_source=data_source)
File "/usr/local/lib/python3.7/dist-packages/infopanel-0.1-py3.7.egg/infopanel/display.py", line 29, in width
raise NotImplementedError
NotImplementedError

this is my yaml file:

[mqtt:
broker: 192.168.0.187
#port: 8883
port: 1883
client_id: screen
keepalive: 60
#username: user
#password: pass
#certificate: /etc/ssl/certs/DST_Root_CA_X3.pem
topic: house/screen/#

RGBMatrix:
led-rows: 32
led-cols: 64

led-chain: 2

led-parallel: 1

led-pwm-bits: 11

led-brightness: 100

led-gpio-mapping: adafruit-hat

led-scan-mode: 1

led-pwm-lsb-nanoseconds: 130

led-show-refresh: false

led-slowdown-gpio: 0

led-no-hardware-pulse: false

#DummyMatrix:

sprites:
I90:
type: Duration
label: I90
low_val: 13.0
high_val: 23.0
data_label: travel_time_i90
WA520:
type: Duration
label: 520
low_val: 13.0
high_val: 23.0
data_label: travel_time_520
daily_high:
type: Temperature
label: H
low_val: -15
high_val: 28
data_label: daily_high
daily_low:
type: Temperature
label: L
low_val: -15
high_val: 28
data_label: daily_low
current:
type: Temperature
label: C
low_val: -15
high_val: 28
data_label: current_temp
vehicle:
type: FancyText
text: VROOM!
pallete:
text:
- 255
- 100
- 255
scroll:
type: FancyText
text: OH YEAH!
dx: -1
ticks_per_movement: 1
giraffe2:
type: Sprite
ticks_per_frame: 3
dx: 1
pallete:
1:
- 255
- 0
- 0
2:
- 0
- 0
- 255
frames:
- 00010
00011
00020
00010
00020
00010
00020
00110
01210
12120
10010
10001
10001

    - 00100
      00110
      00020
      00010
      00020
      00010
      00020
      00110
      01210
      12120
      10010
      10010
      01100
      #  flag:
      #      type: Image
      #      path: flag.ppm
  #  cat:
  #      type: AnimatedGif
  #      path: $HOME/.infopanel/rainbow_cat.gif
  #  hypnotoad:
  #      type: AnimatedGif
  #      path: $HOME/.infopanel/hypnotoad.gif

scenes:

giraffes:
type: Giraffes
extra_phrases:
- I90
- WA520
- daily_high
- daily_low
- current
extra_phrase_frequency: 4

welcome:
type: Welcome
time:
type: Time
traffic:
sprites:
- I90:
x: 0
y: 8
- WA520:
x: 0
y: 16
- daily_high:
x: 33
y: 8
- daily_low:
x: 33
y: 16
- current:
x: 33
y: 24
- vehicle:
x: 0
y: 24
- scroll:
x: 0
y: 32
giraffe2:
sprites:
- giraffe2:
y: 10

modes:
morning:
- giraffes:
duration: 15
brightness: 70
- traffic:
duration: 10

global:
font_dir: /home/pi/rpi-rgb-led-matrix/fonts
default_mode: morning](url)

Animated gifs

Hello,

Is it possible to get a random animated gif from an directory?
for example:
random_gif:
type: AnimatedGif
path: /home/pi/gifs/*.gif

Regards,
Joey

If MQTT mode set to all, Brightness goes to 100

If I change modes, it will pick up the brightness associated with the mode. However, if I use 'all' the brightness defaults to 100% and I cant change it.

Maybe pick up the brightness for each of the modes or the default when using 'all'?

Programmatically build DynamicText sprites within a custom scene

I am trying to programmatically create dynamic text sprites within a custom scene. I am building the sprite like this:

text_1 = sprites.DynamicFancyText(width, height, data_source=None)
text_1.x = 30
text_1.y = 9
text_1.apply_config({'data_label': 'text_one'})
self.sprites.append(text_1)

for some reason, the text is not updating via MQTT when the topic is updated. Dynamic text built within the config file updates fine, it's just the dynamic text I programmatically build within the custom scene.

I think maybe it has something to do with no data_source being sent to the sprite?

Any ideas? :)

led-pixel-mapper implementation

Hi there,

Really nice work, thanks for sharing.

I think to allow mapper working, in config.py, the line in should be uncommented

vol.Optional('led-pixel-mapper', default='') : str,

and the trick is in display.py were the option name is pixel_mapper_config as the example here

# options.led_pixel_mapper = config['led-pixel-mapper']
options.pixel_mapper_config = config['led-pixel-mapper']

Image - dynamic path

Cheers for setting up the project, was looking for something just like this!

I have a use case where I would like to set the path of an image sprite equal to an MQTT value, so that I can dynamically change what image gets shown. Would be awesome if you could consider adding that feature, I will try to dig through the code and see if I can't submit a PR myself otherwise.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.