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

fail to start using this project #24

Closed sommo closed 3 years ago

sommo commented 3 years ago

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:

scenes:

giraffes: type: Giraffes extra_phrases:

modes: morning:

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

sommo commented 3 years ago

all installed via pyhton3 after getting issue with python2.. and mosquitto not already installed.

sommo commented 3 years ago

mosquitto need to be installed into the rpi that execute infopanel right? cause it could accept topic and update via pyhton the info on rgb matrix led, am i right?

partofthething commented 3 years ago

This line in your error

rgbmatrix/core.cpp:4:10: fatal error: Python.h: No such file or directory
#include "Python.h"

implies to me that you might try installing this lib first and then rerunning the install command

sudo apt install python3-dev

Let me know if it works and I'll update the docs.

partofthething commented 3 years ago

mosquitto need to be installed into the rpi that execute infopanel right? cause it could accept topic and update via pyhton the info on rgb matrix led, am i right?

To use Mosquitto you need a MQTT server somewhere that you can connect to. You do not need to manually install any mosquitto client libraries on the machine running infopanel because infopanel will install the python paho-mqtt client during its own installation.

sommo commented 3 years ago

I will try it all asap and let you know, thank you! Have a nice Sunday!

sommo commented 3 years ago

was that, "sudo apt install python3-dev" thank you. i started the infopanel, in yaml i had to remove some comment, cause it failed:

KeyError: 'led-pwm-lsb-nanoseconds', KeyError: 'led-chain' and others.. seems it needs to be declared.

sommo commented 3 years ago

for the mqtt part, i configured its yaml to connect to my mqtt (in lan), and i test some message to it and seems to works. is there a dictionary for all the type of message and setting that could be published to it? another question, the display has to show data, basicaly there's no need to having animation, what could be the setup to have a cleane dashboard to show data? anyway giraffes make me smile a lot :D

sommo commented 3 years ago

mmmm i'm wrong, i don't understand the logic to set infopanel via mqtt, i tried to send:

mosquitto_pub -d -h 192.168.0.127 -t house/screen/scenes -m welcomewelcome

it recieve: DEBUG:infopanel.mqtt:house/screen/scenes b'welcomewelcome'

partofthething commented 3 years ago

To just show numbers and no giraffes, just make a scene filled with sprites that are textual. The traffic scene shown on https://partofthething.com/infopanel/ is an example of this that just shows numbers (e.g. https://partofthething.com/infopanel/source/infopanel.html#infopanel.sprites.DynamicFancyText).

Then set the "mode" to the scene name directly, or set it to an actual mode name that you define that controls that scene. Should be like:

mosquitto_pub -d -h 192.168.0.127 -t house/screen/mode -m welcomewelcome

The display hierarchy is that Sprites make up Scenes, which make up Modes.

sommo commented 3 years ago

ok, so basically i have to: -configure into yaml file, all the "scene" i need -via mqtt i can change the mode by calling the scene name

via mqtt i could only change the mode, right? but how can adjust value into traffic scene?

sommo commented 3 years ago

is there a tree for the mqtt controlling topic to point to? or the purpouse of (e.g. https://partofthething.com/infopanel/source/infopanel.html#infopanel.sprites.DynamicFancyText) is that? cause i opened the link and i'm a bit confused..

sommo commented 3 years ago

traffic has 3 line for static text and a scrolling string bottom. how could i change I90, 520, VROOM! and the "OH YEAH!" ?

sommo commented 3 years ago

i closed the issue by mistake, sorry

sommo commented 3 years ago

hope you can re-open it cause i can't

partofthething commented 3 years ago

I don't think we currently have anything like a data map that you're looking for. Just the control table at the bottom of the main page.

sommo commented 3 years ago

Could you make me and example for changing for example VROOM text?

sommo commented 3 years ago

What I don't now is the topic I need to pub via mqtt, my mind let me think so:

mosquitto_pub -d -h 192.168.0.127 -t house/screen/vehicle/text -m test

but is not correct... i don't understand the logic between mqtt topic to the yaml file

sommo commented 3 years ago

thank you for your patience! and for my poor english too

sommo commented 3 years ago

and also what are the equivalente mqtt pub command for changing current temperature and I90 and so on... thank you thank you

sommo commented 3 years ago

of course if i can make a paypal donation, i'm really glad to do it for the project and the patience :)

partofthething commented 3 years ago

You're helping me identify weaknesses in the documentation so thank you!

If you just want a text item that will update when you publish to MQTT, you want to use a DynamicFancyText sprite and add a data_source config item, like this:

  vehicle:
      type: DynamicFancyText
      text: VROOM!
      data_source: vehicle_data
      pallete:
         text:
            - 255
            - 100
            - 255

Now when you publish to the vehicle_data topic, the text of that sprite should change.

sommo commented 3 years ago

If I add data_source field into yaml I get error while launching infopanel cause it doesnt expect this field:

pi@raspberrypi:~/infopanel $ sudo python3 -m infopanel --config test.yaml INFO:infopanel.driver:Starting InfoPanel. DEBUG:infopanel.sprites:Build <Duration at 0, 0. dx/dy: (0, 0), size: (64, 32)> DEBUG:infopanel.sprites:Build <Duration at 0, 0. dx/dy: (0, 0), size: (64, 32)> DEBUG:infopanel.sprites:Build <Temperature at 0, 0. dx/dy: (0, 0), size: (64, 32 )> DEBUG:infopanel.sprites:Build <Temperature at 0, 0. dx/dy: (0, 0), size: (64, 32 )> DEBUG:infopanel.sprites:Build <Temperature at 0, 0. dx/dy: (0, 0), size: (64, 32 )> 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 "/home/pi/infopanel/infopanel/main.py", line 5, in driver.run() File "/home/pi/infopanel/infopanel/driver.py", line 252, in run infopanel = driver_factory(disp, datasrc, conf) File "/home/pi/infopanel/infopanel/driver.py", line 222, in driver_factory driver.sprites = sprites.sprite_factory(conf["sprites"], data_src, disp) File "/home/pi/infopanel/infopanel/sprites.py", line 791, in sprite_factory sprite.apply_config(sprite_conf) File "/home/pi/infopanel/infopanel/sprites.py", line 353, in apply_config conf = Sprite.apply_config(self, conf) File "/home/pi/infopanel/infopanel/sprites.py", line 145, in apply_config conf = self.CONF(conf) File "/usr/local/lib/python3.7/dist-packages/voluptuous-0.12.1-py3.7.egg/volup tuous/schema_builder.py", line 272, in call return self._compiled([], data) File "/usr/local/lib/python3.7/dist-packages/voluptuous-0.12.1-py3.7.egg/volup tuous/schema_builder.py", line 594, in validate_dict return base_validate(path, iteritems(data), out) File "/usr/local/lib/python3.7/dist-packages/voluptuous-0.12.1-py3.7.egg/volup tuous/schema_builder.py", line 432, in validate_mapping raise er.MultipleInvalid(errors) voluptuous.error.MultipleInvalid: extra keys not allowed @ data['data_source']

sommo commented 3 years ago

till now i know whis topic:

changing sprites: house/screen/mode -m xxxxxx (where xxxxxx could be giraffes/traffic etc based on sprites)

changing brightness: house/screen/brightness -m x (where x is 0-100)

changing value: i90: house/screen/travel_time_i90 -m x (where x is a value) 520: house/screen/travel_time_520 -m x (where x is a value)

what can't do / dont know: -changing text value (ex "OH YEAH" or VROOM) -changing value for temperature (Current). High and Low works based on what the current is and storage it?

partofthething commented 3 years ago

Sorry for the trouble, I made a mistake above. I meant to say data_label rather than data_source. (Clearly even I need better docs!)

The config options for this kind of sprite do include a legal data_label, as seen here:

class DynamicFancyText(FancyText):  # pylint:disable=too-many-instance-attributes
    """
    FancyText that can have a changing/live data source.
    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("label_color", default="yellow"): str,
            vol.Optional("value_color", default="green"): str,
        }
    )
partofthething commented 3 years ago

assuming this works now so closing.

sommo commented 3 years ago

Hi Nick, I did not have time, I will try ASAP and let you know, Thank you

Inviato da iPhone

Il giorno 12 mag 2021, alle ore 05:35, Nick Touran @.***> ha scritto:

 Closed #24.

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub, or unsubscribe.