Update - Nov 2019 - This has been significantly edited to support the update made to the plugin and also RPI 4 with buster.
History.
Was trying to implement parts of the “Matrix” look in Habpanel. Leaving aside CSS, the challenge was the graphs coming out of Grafana.
The current version arm (raspberry pi) of Grafana no longer contains the phantomJS engine for rendering images and you will receive an error. It is also not possible to install phantomJS from the repository. After doing some investigation I found there is a new rendering engine plugin available
However, there are a few hoops you have jump thru to get this working.
Base assumption:
- Raspberry Pi V4 with OpenHabian (Buster) installed - Custom install should be fine
- You have already installed and have a working version of influxDB and Grafana.
- Node is installed on your Raspberry PI. I use Node-Red from the openHabian install which installs Node
Steps:
We will switch to root as the plugin directory is secure
sudo su
Install git and clone copy of the plugin.
apt-get update
apt-get install git
cd /var/lib/grafana/plugins
git clone https://github.com/grafana/grafana-image-renderer
cd grafana-image-renderer
npm -g install yarn
sudo npm i grpc
sudo npm i install
Next we need to do a smidge of file editing as Typescript on the RPI does not like the code.
cd src
nano grpc-plugin.ts
add the ignore line above the export to tell Typescript to ignore it.
// @ts-ignore: the nested grpc objects are not recognized by ts
export const GRPC_HEALTH_PROTO = grpc.load(GRPC_HEALTH_PROTO_PATH).grpc.health.v1;
and again here
// @ts-ignore: the nested grpc objects are not recognized by ts
server.addService(RENDERER_PROTO.Renderer.service, {
save the file and now run yarn build
cd ..
yarn run build
I have no idea why this needs to be run with sudo given you are root but it will fail otherwise. Maybe somebody can provide some insight into that!! Also the grpc step is probably a duplicate and the install would cover it, but these steps have worked twice now.
Now copy the start file to arm version
cp plugin_start_linux_amd64 plugin_start_linux_arm
(Note - All the steps for correcting puppeteer seem redundant now)
Now restart grafana
sudo systemctl restart grafana-server.service
give it about 20 seconds to start
sudo systemctl status grafana-server.service
If all has gone well the log will show the plugin is recognised and loaded.
Log file can be found at
cd /var/log/graphana
credit references: