I followed the above steps to install the image rendering plugin on a RPi4 (with custom installation of openhab and grafana). As others pointed out, you need to install chromium-browser via apt, since the version included in puppeteer does not work. After that just add this:
to plugin_start_linux_arm.
If you use SSL with a custom CA, then you also need to add this line:
I got Grafana rendering working on RPi 4 (4Gb) running openhabian using a mix of the steps above and some more. Rendering takes approximately 5 seconds, so the webview solution is faster. But here we go:
InfluxDB and Grafana should be fairly straightforward to install in openhabian using sudo openhabian-config.
However, nodejs needed to be version 12 for yarn run build, whereas the the default repositories will install v10 and the latest will install v13. To install nodejs v12 i followed the instruction titled “Major version upgrades” here but make sure to change 13 to 12 like so:
I cannot tell which of the following steps were necessary, but I did them as a part of trial and error:
(There was no grpc-plugin.ts to edit - no need)
Apparently yarn install was important too:
yarn install --pure-lockfile
yarn run build
cp plugin_start_linux_amd64 plugin_start_linux_arm
Now after restarting grafana, grafana renderer would complain in the log /var/log/grafana/grafana.log about executable not found, so we install chromium (1Gb):
sudo apt-get install chromium-browser
And make the renderer plugin use the chromium executable as pointed out above:
Finally:
I have likely missed something, but this is roughly how I got it working. I’m not an expert - I just put the pieces together. Hope it helps.
Hi all,
First of all a big thank you for @wezzix for completing the journey to a functioning setup on a RPi 4. I’ve tried to get this running last year and gave up. I used an Ubuntu VM since to do the rendering part.
I followed @wezzix guidenace and had it running on my RPi 4 in less then 30 minutes!!
Now as an addition to this post, if any of you (like I do) have enabled HTTPS with a real TLD Certificate on Grafana the rendering fails with “ERR_CERT_COMMON_NAME_INVALID”
This is easy to solve by modifying the plugin_start_linux_arm adding the following line:
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.