partofthething / infopanel

Show live data, animations, pictures, or anything on simple displays like RGB matrices
https://partofthething.com/infopanel/
GNU General Public License v3.0
31 stars 12 forks source link

infopanel.yaml issue #22

Closed PablosGW closed 3 years ago

PablosGW commented 3 years ago

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
PablosGW commented 3 years ago

the error I get this :

INFO:infopanel.driver:Starting InfoPanel.
DEBUG:infopanel.sprites:Build <Duration 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 <AnimatedGif 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 <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)>
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 <AnimatedGif 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 <FancyText at 0, 0. dx/dy: (0, 0), size: (64, 64)>
DEBUG:infopanel.scenes:Initializing <class 'infopanel.scenes.Scene'>
DEBUG:infopanel.scenes:Initializing <class 'infopanel.scenes.Giraffes'>
DEBUG:infopanel.scenes:Initializing <class 'infopanel.scenes.Time'>
DEBUG:infopanel.scenes:Initializing <class 'infopanel.scenes.Scene'>
DEBUG:infopanel.scenes:Initializing <class 'infopanel.scenes.Welcome'>
INFO:infopanel.driver:Applying mode: morning
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 "/usr/local/lib/python3.7/dist-packages/infopanel-0.1-py3.7.egg/infopanel/__main__.py", line 5, in <module>
    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 226, in driver_factory
    driver.init_modes(conf)
  File "/usr/local/lib/python3.7/dist-packages/infopanel-0.1-py3.7.egg/infopanel/driver.py", line 214, in init_modes
    self.apply_mode(default_mode)
  File "/usr/local/lib/python3.7/dist-packages/infopanel-0.1-py3.7.egg/infopanel/driver.py", line 144, in apply_mode
    scene = self.scenes[scene_name]
KeyError: 'cat'
PablosGW commented 3 years ago

everything worked before adding the cat and hypnotoad line

partofthething commented 3 years ago

I think the issue here is that there's no scene called cat. In general, modes are made of scenes which are made of sprites. So if you were to just make a scene called cat and another called hypnotoad and add them to the scenes section then I think this would work.

scenes:
 ...[other scenes you already have defined]...
  cat: 
    sprites:
      - cat:
  hypnotoad:
    sprites:
      - hypnotoad:
PablosGW commented 3 years ago

thanx , it's work now 👍

partofthething commented 3 years ago

awesome, np!