If you use the provided docker-compose.yml there, you can get this working on a Raspberry Pi within minutes and no need to mess around with its dependencies. Seems to be working with the new 7.0 as well!
Since the version upgrade to Grafana 7 my renderer stopped working (was using the arm7 phantomjs till now). After trying to compile the grafana renderer for arm and going to all kinds of nodejs /yarn version mismatches I had most luck with the Docker version of the renderer. I decided to keep using my installed Grafana version and only run the renderer from Docker.
You need to make the following changes only to the /etc/grafana.ini (replace “openhab” with the ip of your server running Grafana and the Docker container with the renderer):
After that restart Grafana (sudo systemctl restart grafana-server.service if on linux / opehabian) and start the docker container (in the location of your docker-compose.yml file):
docker-compose up -d
If Docker is installed and started by systemd at boot the renderer will automatically start next time.
@wezzix
Thanks for taking the time to document your solution. It worked perfectly for me. I would have never figured this out on my own. Just too bad that Grafana doesn’t have a plugin for RPi as it is such a common platform.
If you are running grafana as a docker as well, add these as env vars:
GF_RENDERING_SERVER_URL=http://openhab:8081/render
GF_RENDERING_CALLBACK_URL=http://openhab:3000
You should update the volumes path for your installation but anything else then this is not required. Honestly I don’t really know where these urls are resolved and how, but in this case it works. If you are using Grafana as a standard installation, I think you might need to update these values.
For me this was the easiest way to get it working, other installation methods all failed for me somewhere.
I think this is because openHAB did not have a cached authenticated session for Grafana. Try enabling anonymous access so that you don’t have to authenticate yourself to view the graphs.
I can confirm that above steps for running the plugin in grafana without docker is working on my raspberry PI 3B+ with the latest version of grafana (v 7.0.6)
In my case, editing the grpc-plugin.ts file was not needed (the file did not exist)
However, I did have to add another step. After restarting grafana and checking the the log with systemctl status grafana-server.service, I received following error:
"Failed to load plugin" logger=plugins error="plugin \"grafana-image-renderer\" is unsigned" pluginPath=/var/lib/grafana/plugins/grafana-image-renderer
Apparently, the compiled plugin is not signed. I used following workaround to get unsigned plugins working:
This allows grafana to run the unsigned image renderer plugin. Another option could be to get a signed version of the plugin, but I have no idea on how to do that.
I also had to install the chromium browser as already pointed out in this thread.
The image rendering is working fine now, but it does take ~5 secs for the image to appear
Raspberry Pi 3b+ SBU and grafana-image-renderer and Openhab does not look a good combination.
I started using Garafan Separately rather than integrating with openhab .
Do not know the performance on Pi 4 .
I’m seeing some other users here are getting the Failure to launch chrome! error, as am I but with a different message. It seems it’s a permission issue. I know Grafana runs with a group ID of 472, so I’ve run sudo chown -R 472:472 ... on the suspect directories but no luck. Has anyone ran across this?
t=2021-04-26T05:03:16+0000 lvl=eror msg="Render request failed" logger=plugins.backend pluginId=grafana-image-renderer url="http://localhost:3000/dashboard-solo/db/graph-styles?panelId=2&fullscreen&from=1617645176357&to=1617855730979&width=1000&height=500&render=1" error="Error: Failed to launch chrome!\n/usr/bin/chromium-browser: 12: xdg-settings: not found\ncmd_run.go:994: WARNING: cannot create user data directory: cannot create \"/usr/share/grafana/snap/chromium/1565\": mkdir /usr/share/grafana/snap: permission denied\ncannot create user data directory: /usr/share/grafana/snap/chromium/1565: Permission denied\n\n\nTROUBLESHOOTING: https://github.com/GoogleChrome/puppeteer/blob/master/docs/troubleshooting.md\n"
t=2021-04-26T05:03:16+0000 lvl=eror msg="Rendering failed." logger=context userId=0 orgId=1 uname= error="rendering failed: Error: Failed to launch chrome!\n/usr/bin/chromium-browser: 12: xdg-settings: not found\ncmd_run.go:994: WARNING: cannot create user data directory: cannot create \"/usr/share/grafana/snap/chromium/1565\": mkdir /usr/share/grafana/snap: permission denied\ncannot create user data directory: /usr/share/grafana/snap/chromium/1565: Permission denied\n\n\nTROUBLESHOOTING: https://github.com/GoogleChrome/puppeteer/blob/master/docs/troubleshooting.md\n"
t=2021-04-26T05:03:16+0000 lvl=eror msg="Request Completed" logger=context userId=0 orgId=1 uname= method=GET path=/render/dashboard-solo/db/graph-styles status=500 remote_addr=192.168.1.228 time_ms=347 size=1723 referer=
Hello, I wonder if still someone is using the compiled plugin. I used it for about one year, but since update to Grafana 8.3.x it stopped working. When I downgrade to 8.2.1 it still works. Anyone else with this problem? The Log shows:
t=2021-12-12T15:35:23+0100 lvl=info msg="Initialising plugins" logger=plugin.manager
t=2021-12-12T15:35:24+0100 lvl=info msg="Plugin registered" logger=plugin.manager pluginId=input
t=2021-12-12T15:35:24+0100 lvl=warn msg="Permitting unsigned plugin. This is not recommended" logger=plugin.signature.validator pluginID=grafana-image-renderer pluginDir=/var/lib/grafana/plugins/grafana-image-renderer
t=2021-12-12T15:35:24+0100 lvl=info msg="Plugin registered" logger=plugin.manager pluginId=grafana-image-renderer
t=2021-12-12T15:35:24+0100 lvl=info msg="Live Push Gateway initialization" logger=live.push_http
t=2021-12-12T15:35:24+0100 lvl=info msg="Writing PID file" logger=server path=/run/grafana/grafana-server.pid pid=25452
t=2021-12-12T15:35:24+0100 lvl=eror msg="Stopped background service *rendering.RenderingService" logger=server reason="could not start plugin grafana-image-renderer as no plugin client exists"
t=2021-12-12T15:35:24+0100 lvl=eror msg="failed to lock and execute cleanup of expired auth token" logger=auth error="context canceled"
t=2021-12-12T15:35:24+0100 lvl=info msg="HTTP Server Listen" logger=http.server address=[::]:3000 protocol=http subUrl= socket=
t=2021-12-12T15:35:24+0100 lvl=eror msg="Server shutdown" logger=server error="*rendering.RenderingService run error: could not start plugin grafana-image-renderer as no plugin client exists"