Closed sommo closed 3 years ago
all installed via pyhton3 after getting issue with python2.. and mosquitto not already installed.
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?
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.
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.
I will try it all asap and let you know, thank you! Have a nice Sunday!
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.
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
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'
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.
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?
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..
traffic has 3 line for static text and a scrolling string bottom. how could i change I90, 520, VROOM! and the "OH YEAH!" ?
i closed the issue by mistake, sorry
hope you can re-open it cause i can't
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.
Could you make me and example for changing for example VROOM text?
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
thank you for your patience! and for my poor english too
and also what are the equivalente mqtt pub command for changing current temperature and I90 and so on... thank you thank you
of course if i can make a paypal donation, i'm really glad to do it for the project and the patience :)
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.
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
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?
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,
}
)
assuming this works now so closing.
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.
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 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:
current extra_phrase_frequency: 4
welcome: type: Welcome time: type: Time traffic: sprites:
modes: morning:
global: font_dir: /home/pi/rpi-rgb-led-matrix/fonts default_mode: morning](url)