Tutorial - Grafana rendering on Raspberry Pi

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:

13 Likes

All contribution’s to the OH community are both welcome and encouraged.:wink:

That’s relative to the individual reader, as the knowledge base can vary from little to lots.:smile: It would be great to have the tutorial, plus support for questions and answers, but it’s up to you. Regardless of free time for questions, I would post the tutorial, if you’re not available then hopefully another forum member will be.

Thanks

I’d certainly appreciate your tutorial. I’ve got the same issue.

C

Thanks for feedback. I’ve gone over the steps I took and updated the original post with the tutorial. Hope it helps.

1 Like

Maybe you should consider changing this to the tutorial category as that will help other’s find your work. You could also edit the title and add Tutorial at the beginning.:wink:

1 Like

Hey David,

thanks for writing this down!
I noticed a small typo in the the terminal commands when installing Yarn:

npm -g yarn

should be

npm -g install yarn

Best regards,
Lieven.

1 Like

Many thanks. Original post has been updated

Hi @David_deMarco,

I used your tutorial and installed all packages. but when i run status of grafana i get a error.

openHABianPi grafana-server[475]: t=2019-07-04T17:34:08+0200 lvl=eror msg="Plugins: Failed to load plugin json file: /var/lib/grafana/plugins/grafana-image-renderer/plugin.json, err: Unknown

Hi @kugelsicha
A couple of thoughts here. Can you check the contents of the JSON file? I have included mine below. Also, check all the permissions as I had to switch via sudo su to just be able to view the file. It was a long time since i set this up but do recall permissions being tricky.

{
  "type": "renderer",
  "name": "Backend Renderer",
  "id": "grafana-image-renderer",

  "info": {
    "description": "Grafana Backend Image Renderer that uses headless chrome to       capture images.",
    "author": {
      "name": "Grafana Labs",
      "url": "https://grafana.com"
    },
    "keywords": ["test"],
    "logos": {
    },
    "links": [
    ],
    "version": "1.0.0",
    "updated": "2018-02-10"
  }
}

Cheers.
dd

i have the exact same content in my plugin.json file.
I also had to open this via sudo su with root…
so i guess it could be a permission issue with the openhabian user maybe?

● grafana-server.service - Grafana instance
   Loaded: loaded (/usr/lib/systemd/system/grafana-server.service; enabled; vendor preset: enabled)
   Active: active (running) since Thu 2019-07-04 20:33:38 CEST; 11h ago
     Docs: http://docs.grafana.org
 Main PID: 472 (grafana-server)
   CGroup: /system.slice/grafana-server.service
           └─472 /usr/sbin/grafana-server --config=/etc/grafana/grafana.ini --pidfile=/var/run/grafana/grafana-server.pid cfg:default.paths.logs=/var/log/grafana cfg:default.paths.data=/var/lib/grafana cfg:de

Jul 04 20:33:43 openHABianPi grafana-server[472]: t=2019-07-04T20:33:43+0200 lvl=info msg="Skipping migration condition not fulfilled" logger=migrator id="copy data account to org"
Jul 04 20:33:43 openHABianPi grafana-server[472]: t=2019-07-04T20:33:43+0200 lvl=info msg="Executing migration" logger=migrator id="copy data account_user to org_user"
Jul 04 20:33:43 openHABianPi grafana-server[472]: t=2019-07-04T20:33:43+0200 lvl=info msg="Skipping migration condition not fulfilled" logger=migrator id="copy data account_user to org_user"
Jul 04 20:33:43 openHABianPi grafana-server[472]: t=2019-07-04T20:33:43+0200 lvl=info msg="Starting plugin search" logger=plugins
Jul 04 20:33:44 openHABianPi grafana-server[472]: t=2019-07-04T20:33:44+0200 lvl=eror msg="Plugins: Failed to load plugin json file: /var/lib/grafana/plugins/grafana-image-renderer/plugin.json,  err: Unknown
Jul 04 20:33:44 openHABianPi grafana-server[472]: t=2019-07-04T20:33:44+0200 lvl=info msg="Registering plugin" logger=plugins name=Discrete
Jul 04 20:33:44 openHABianPi grafana-server[472]: t=2019-07-04T20:33:44+0200 lvl=info msg="Initializing Alerting" logger=alerting.engine
Jul 04 20:33:44 openHABianPi grafana-server[472]: t=2019-07-04T20:33:44+0200 lvl=info msg="Initializing CleanUpService" logger=cleanup
Jul 04 20:33:45 openHABianPi grafana-server[472]: t=2019-07-04T20:33:45+0200 lvl=info msg="Initializing Stream Manager"
Jul 04 20:33:45 openHABianPi grafana-server[472]: t=2019-07-04T20:33:45+0200 lvl=info msg="Initializing HTTP Server" logger=http.server address=0.0.0.0:3000 protocol=http subUrl= socket=

I suspect you are correct that there is a permission issue going on here. My setup is using the OpenHabian install and I don’t recall making any permission updates. The directories are secured by root and for me it seems to work. If you have any other diagnostic information I can compare to my setup. Cheers d

Hi @David_deMarco,

i finally got the plugin loaded… after i manually updated my openhabian to the latest grafana stable (6.2.5)
I see in the Log that the plugin is loaded. yay! :slight_smile:

so i cant get it to work to display the graph…
i added this to my grafana.ini

[rendering]
server_url=http://renderer:8081/render

and used this in my HABPanel

http://renderer:8081/render/d-solo/XXXXXX/mini-graphs?refresh=5m&orgId=1&panelId=9&from=now/d&to=now

and i get the error “couldnt find the server-ip of renderer”

Die Server-IP-Adresse von renderer wurde nicht gefunden.

so what i’m missing here?

Thanks

http://renderer … either your hosts file or your router have to translate it to IP somehow, so you have to configure it :wink:

on local network, convention should be
http://hostname.local -> routers are mostly able to give IP to that name if your device hostname is configured properly

otherwise it’s kind of better to just use pure IP where possible

Hello,

im running Grafana v6.3.4 on my Raspberry Pi 4 and need help to render an image.
I installed phantomJS with your tutorial on my Raspberry but im still getting the error “Rendering failed” if i click on “Direct link rendered image”.

Here is the log:

t=2019-09-01T13:06:03+0200 lvl=info msg=“Registering plugin” logger=plugins name=“Backend Renderer”
t=2019-09-01T13:06:03+0200 lvl=info msg=“Initializing RenderingService” logger=server
t=2019-09-01T13:06:03+0200 lvl=info msg=“Initializing AlertEngine” logger=server
t=2019-09-01T13:06:03+0200 lvl=info msg=“Initializing DatasourceCacheService” logger=server
t=2019-09-01T13:06:03+0200 lvl=info msg=“Initializing HooksService” logger=server
t=2019-09-01T13:06:03+0200 lvl=info msg=“Initializing LoginService” logger=server
t=2019-09-01T13:06:03+0200 lvl=info msg=“Initializing SearchService” logger=server
t=2019-09-01T13:06:03+0200 lvl=info msg=“Initializing ServerLockService” logger=server
t=2019-09-01T13:06:03+0200 lvl=info msg=“Initializing TracingService” logger=server
t=2019-09-01T13:06:03+0200 lvl=info msg=“Initializing UsageStatsService” logger=server
t=2019-09-01T13:06:03+0200 lvl=info msg=“Initializing UserAuthTokenService” logger=server
t=2019-09-01T13:06:03+0200 lvl=info msg=“Initializing CleanUpService” logger=server
t=2019-09-01T13:06:03+0200 lvl=info msg=“Initializing NotificationService” logger=server
t=2019-09-01T13:06:03+0200 lvl=info msg=“Initializing provisioningServiceImpl” logger=server
t=2019-09-01T13:06:03+0200 lvl=info msg=“Renderer plugin found, starting” logger=rendering cmd=plugin_start_linux_arm
t=2019-09-01T13:06:03+0200 lvl=info msg=“Initializing Stream Manager”
t=2019-09-01T13:06:03+0200 lvl=info msg=“HTTP Server Listen” logger=http.server address=0.0.0.0:3000 protocol=http subUrl= socket=
t=2019-09-01T13:06:03+0200 lvl=eror msg=“Rendering failed.” logger=context userId=1 orgId=1 uname=admin error=“No renderer found”
t=2019-09-01T13:06:03+0200 lvl=eror msg=“Request Completed” logger=context userId=1 orgId=1 uname=admin method=GET path=/render/d-solo/nISKbEZRk/raumklima status=500 remote_addr=192.168.178.63 time_ms=7 size=1722 referer=“http://192.168.178.85:3000/d/nISKbEZRk/raumklima?orgId=1&refresh=1m”
t=2019-09-01T13:06:05+0200 lvl=eror msg=“Stopped RenderingService” logger=server reason=“Unrecognized remote plugin message: \n\nThis usually means that the plugin is either invalid or simply\nneeds to be recompiled to support the latest protocol.”
t=2019-09-01T13:06:05+0200 lvl=info msg=“Stopped NotificationService” logger=server reason=“context canceled”
t=2019-09-01T13:06:05+0200 lvl=info msg=“Stopped provisioningServiceImpl” logger=server reason=“context canceled”
t=2019-09-01T13:06:05+0200 lvl=info msg=“Stopped UsageStatsService” logger=server reason=“context canceled”
t=2019-09-01T13:06:05+0200 lvl=info msg=“Stopped Stream Manager”
t=2019-09-01T13:06:05+0200 lvl=info msg=“Stopped TracingService” logger=server reason=nil
t=2019-09-01T13:06:05+0200 lvl=info msg=“Stopped AlertEngine” logger=server reason=“context canceled”
t=2019-09-01T13:06:05+0200 lvl=info msg=“Stopped UserAuthTokenService” logger=server reason=“context canceled”
t=2019-09-01T13:06:05+0200 lvl=info msg=“Stopped InternalMetricsService” logger=server reason=“context canceled”
t=2019-09-01T13:06:05+0200 lvl=info msg=“Stopped RemoteCache” logger=server reason=“context canceled”
t=2019-09-01T13:06:05+0200 lvl=info msg=“Stopped PluginManager” logger=server reason=“context canceled”
t=2019-09-01T13:06:05+0200 lvl=info msg=“Stopped CleanUpService” logger=server reason=“context canceled”
t=2019-09-01T13:06:05+0200 lvl=info msg=“Stopped HTTPServer” logger=server reason=nil
t=2019-09-01T13:06:05+0200 lvl=eror msg=“Server shutdown” logger=server reason=“Unrecognized remote plugin message: \n\nThis usually means that the plugin is either invalid or simply\nneeds to be recompiled to support the latest protocol.”
t=2019-09-01T13:06:06+0200 lvl=info msg=“Starting Grafana” logger=server version=6.3.4 commit=a557646 branch=HEAD compiled=2019-08-19T16:28:51+0200
t=2019-09-01T13:06:06+0200 lvl=info msg=“Config loaded from” logger=settings file=/usr/share/grafana/conf/defaults.ini
t=2019-09-01T13:06:06+0200 lvl=info msg=“Config loaded from” logger=settings file=/etc/grafana/grafana.ini
t=2019-09-01T13:06:06+0200 lvl=info msg=“Config overridden from command line” logger=settings arg=“default.paths.data=/var/lib/grafana”
t=2019-09-01T13:06:06+0200 lvl=info msg=“Config overridden from command line” logger=settings arg=“default.paths.logs=/var/log/grafana”
t=2019-09-01T13:06:06+0200 lvl=info msg=“Config overridden from command line” logger=settings arg=“default.paths.plugins=/var/lib/grafana/plugins”
t=2019-09-01T13:06:06+0200 lvl=info msg=“Config overridden from command line” logger=settings arg=“default.paths.provisioning=/etc/grafana/provisioning”
t=2019-09-01T13:06:06+0200 lvl=info msg=“Path Home” logger=settings path=/usr/share/grafana
t=2019-09-01T13:06:06+0200 lvl=info msg=“Path Data” logger=settings path=/var/lib/grafana
t=2019-09-01T13:06:06+0200 lvl=info msg=“Path Logs” logger=settings path=/var/log/grafana
t=2019-09-01T13:06:06+0200 lvl=info msg=“Path Plugins” logger=settings path=/var/lib/grafana/plugins
t=2019-09-01T13:06:06+0200 lvl=info msg=“Path Provisioning” logger=settings path=/etc/grafana/provisioning
t=2019-09-01T13:06:06+0200 lvl=info msg=“App mode production” logger=settings
t=2019-09-01T13:06:06+0200 lvl=info msg=“Writing PID file” logger=server path=/var/run/grafana/grafana-server.pid pid=4776
t=2019-09-01T13:06:06+0200 lvl=info msg=“Initializing SqlStore” logger=server
t=2019-09-01T13:06:06+0200 lvl=info msg=“Connecting to DB” logger=sqlstore dbtype=sqlite3
t=2019-09-01T13:06:06+0200 lvl=info msg=“Starting DB migration” logger=migrator
t=2019-09-01T13:06:06+0200 lvl=info msg=“Initializing HTTPServer” logger=server
t=2019-09-01T13:06:06+0200 lvl=info msg=“Initializing InternalMetricsService” logger=server
t=2019-09-01T13:06:06+0200 lvl=info msg=“Initializing RemoteCache” logger=server
t=2019-09-01T13:06:06+0200 lvl=info msg=“Initializing QuotaService” logger=server
t=2019-09-01T13:06:06+0200 lvl=info msg=“Initializing PluginManager” logger=server
t=2019-09-01T13:06:06+0200 lvl=info msg=“Starting plugin search” logger=plugins
t=2019-09-01T13:06:06+0200 lvl=info msg=“Registering plugin” logger=plugins name=“Backend Renderer”
t=2019-09-01T13:06:06+0200 lvl=info msg=“Initializing RenderingService” logger=server
t=2019-09-01T13:06:06+0200 lvl=info msg=“Initializing AlertEngine” logger=server
t=2019-09-01T13:06:06+0200 lvl=info msg=“Initializing DatasourceCacheService” logger=server
t=2019-09-01T13:06:06+0200 lvl=info msg=“Initializing HooksService” logger=server
t=2019-09-01T13:06:06+0200 lvl=info msg=“Initializing LoginService” logger=server
t=2019-09-01T13:06:06+0200 lvl=info msg=“Initializing SearchService” logger=server
t=2019-09-01T13:06:06+0200 lvl=info msg=“Initializing ServerLockService” logger=server
t=2019-09-01T13:06:06+0200 lvl=info msg=“Initializing TracingService” logger=server
t=2019-09-01T13:06:06+0200 lvl=info msg=“Initializing UsageStatsService” logger=server
t=2019-09-01T13:06:06+0200 lvl=info msg=“Initializing UserAuthTokenService” logger=server
t=2019-09-01T13:06:06+0200 lvl=info msg=“Initializing CleanUpService” logger=server
t=2019-09-01T13:06:06+0200 lvl=info msg=“Initializing NotificationService” logger=server
t=2019-09-01T13:06:06+0200 lvl=info msg=“Initializing provisioningServiceImpl” logger=server
t=2019-09-01T13:06:06+0200 lvl=info msg=“Renderer plugin found, starting” logger=rendering cmd=plugin_start_linux_arm
t=2019-09-01T13:06:06+0200 lvl=info msg=“Initializing Stream Manager”
t=2019-09-01T13:06:06+0200 lvl=info msg=“HTTP Server Listen” logger=http.server address=0.0.0.0:3000 protocol=http subUrl= socket=
t=2019-09-01T13:06:08+0200 lvl=eror msg=“Stopped RenderingService” logger=server reason=“Unrecognized remote plugin message: \n\nThis usually means that the plugin is either invalid or simply\nneeds to be recompiled to support the latest protocol.”
t=2019-09-01T13:06:08+0200 lvl=info msg=“Stopped UserAuthTokenService” logger=server reason=“context canceled”
t=2019-09-01T13:06:08+0200 lvl=info msg=“Stopped NotificationService” logger=server reason=“context canceled”
t=2019-09-01T13:06:08+0200 lvl=info msg=“Stopped provisioningServiceImpl” logger=server reason=“context canceled”
t=2019-09-01T13:06:08+0200 lvl=info msg=“Stopped PluginManager” logger=server reason=“context canceled”
t=2019-09-01T13:06:08+0200 lvl=info msg=“Stopped Stream Manager”
t=2019-09-01T13:06:08+0200 lvl=info msg=“Stopped RemoteCache” logger=server reason=“context canceled”
t=2019-09-01T13:06:08+0200 lvl=info msg=“Stopped CleanUpService” logger=server reason=“context canceled”
t=2019-09-01T13:06:08+0200 lvl=info msg=“Stopped UsageStatsService” logger=server reason=“context canceled”
t=2019-09-01T13:06:08+0200 lvl=info msg=“Stopped InternalMetricsService” logger=server reason=“context canceled”
t=2019-09-01T13:06:08+0200 lvl=info msg=“Stopped TracingService” logger=server reason=nil
t=2019-09-01T13:06:08+0200 lvl=info msg=“Stopped AlertEngine” logger=server reason=“context canceled”
t=2019-09-01T13:06:08+0200 lvl=info msg=“Stopped HTTPServer” logger=server reason=nil
t=2019-09-01T13:06:08+0200 lvl=eror msg=“Server shutdown” logger=server reason=“Unrecognized remote plugin message: \n\nThis usually means that the plugin is either invalid or simply\nneeds to be recompiled to support the latest protocol.”
t=2019-09-01T13:06:09+0200 lvl=info msg=“Starting Grafana” logger=server version=6.3.4 commit=a557646 branch=HEAD compiled=2019-08-19T16:28:51+0200
t=2019-09-01T13:06:09+0200 lvl=info msg=“Config loaded from” logger=settings file=/usr/share/grafana/conf/defaults.ini
t=2019-09-01T13:06:09+0200 lvl=info msg=“Config loaded from” logger=settings file=/etc/grafana/grafana.ini
t=2019-09-01T13:06:09+0200 lvl=info msg=“Config overridden from command line” logger=settings arg=“default.paths.data=/var/lib/grafana”
t=2019-09-01T13:06:09+0200 lvl=info msg=“Config overridden from command line” logger=settings arg=“default.paths.logs=/var/log/grafana”
t=2019-09-01T13:06:09+0200 lvl=info msg=“Config overridden from command line” logger=settings arg=“default.paths.plugins=/var/lib/grafana/plugins”
t=2019-09-01T13:06:09+0200 lvl=info msg=“Config overridden from command line” logger=settings arg=“default.paths.provisioning=/etc/grafana/provisioning”
t=2019-09-01T13:06:09+0200 lvl=info msg=“Path Home” logger=settings path=/usr/share/grafana
t=2019-09-01T13:06:09+0200 lvl=info msg=“Path Data” logger=settings path=/var/lib/grafana
t=2019-09-01T13:06:09+0200 lvl=info msg=“Path Logs” logger=settings path=/var/log/grafana
t=2019-09-01T13:06:09+0200 lvl=info msg=“Path Plugins” logger=settings path=/var/lib/grafana/plugins
t=2019-09-01T13:06:09+0200 lvl=info msg=“Path Provisioning” logger=settings path=/etc/grafana/provisioning
t=2019-09-01T13:06:09+0200 lvl=info msg=“App mode production” logger=settings
t=2019-09-01T13:06:09+0200 lvl=info msg=“Writing PID file” logger=server path=/var/run/grafana/grafana-server.pid pid=4824
t=2019-09-01T13:06:09+0200 lvl=info msg=“Initializing SqlStore” logger=server
t=2019-09-01T13:06:09+0200 lvl=info msg=“Connecting to DB” logger=sqlstore dbtype=sqlite3
t=2019-09-01T13:06:09+0200 lvl=info msg=“Starting DB migration” logger=migrator
t=2019-09-01T13:06:09+0200 lvl=info msg=“Initializing HTTPServer” logger=server
t=2019-09-01T13:06:09+0200 lvl=info msg=“Initializing InternalMetricsService” logger=server
t=2019-09-01T13:06:09+0200 lvl=info msg=“Initializing RemoteCache” logger=server
t=2019-09-01T13:06:09+0200 lvl=info msg=“Initializing QuotaService” logger=server
t=2019-09-01T13:06:09+0200 lvl=info msg=“Initializing PluginManager” logger=server
t=2019-09-01T13:06:09+0200 lvl=info msg=“Starting plugin search” logger=plugins
t=2019-09-01T13:06:09+0200 lvl=info msg=“Registering plugin” logger=plugins name=“Backend Renderer”
t=2019-09-01T13:06:09+0200 lvl=info msg=“Initializing RenderingService” logger=server
t=2019-09-01T13:06:09+0200 lvl=info msg=“Initializing AlertEngine” logger=server
t=2019-09-01T13:06:09+0200 lvl=info msg=“Initializing DatasourceCacheService” logger=server
t=2019-09-01T13:06:09+0200 lvl=info msg=“Initializing HooksService” logger=server
t=2019-09-01T13:06:09+0200 lvl=info msg=“Initializing LoginService” logger=server
t=2019-09-01T13:06:09+0200 lvl=info msg=“Initializing SearchService” logger=server
t=2019-09-01T13:06:09+0200 lvl=info msg=“Initializing ServerLockService” logger=server
t=2019-09-01T13:06:09+0200 lvl=info msg=“Initializing TracingService” logger=server
t=2019-09-01T13:06:09+0200 lvl=info msg=“Initializing UsageStatsService” logger=server
t=2019-09-01T13:06:09+0200 lvl=info msg=“Initializing UserAuthTokenService” logger=server
t=2019-09-01T13:06:09+0200 lvl=info msg=“Initializing CleanUpService” logger=server
t=2019-09-01T13:06:09+0200 lvl=info msg=“Initializing NotificationService” logger=server
t=2019-09-01T13:06:09+0200 lvl=info msg=“Initializing provisioningServiceImpl” logger=server
t=2019-09-01T13:06:09+0200 lvl=info msg=“Renderer plugin found, starting” logger=rendering cmd=plugin_start_linux_arm
t=2019-09-01T13:06:09+0200 lvl=info msg=“Initializing Stream Manager”
t=2019-09-01T13:06:09+0200 lvl=info msg=“HTTP Server Listen” logger=http.server address=0.0.0.0:3000 protocol=http subUrl= socket=
t=2019-09-01T13:06:11+0200 lvl=eror msg=“Stopped RenderingService” logger=server reason=“Unrecognized remote plugin message: \n\nThis usually means that the plugin is either invalid or simply\nneeds to be recompiled to support the latest protocol.”
t=2019-09-01T13:06:11+0200 lvl=info msg=“Stopped PluginManager” logger=server reason=“context canceled”
t=2019-09-01T13:06:11+0200 lvl=info msg=“Stopped Stream Manager”
t=2019-09-01T13:06:11+0200 lvl=info msg=“Stopped UsageStatsService” logger=server reason=“context canceled”
t=2019-09-01T13:06:11+0200 lvl=info msg=“Stopped UserAuthTokenService” logger=server reason=“context canceled”
t=2019-09-01T13:06:11+0200 lvl=info msg=“Stopped NotificationService” logger=server reason=“context canceled”
t=2019-09-01T13:06:11+0200 lvl=info msg=“Stopped CleanUpService” logger=server reason=“context canceled”
t=2019-09-01T13:06:11+0200 lvl=info msg=“Stopped TracingService” logger=server reason=nil
t=2019-09-01T13:06:11+0200 lvl=info msg=“Stopped provisioningServiceImpl” logger=server reason=“context canceled”
t=2019-09-01T13:06:11+0200 lvl=info msg=“Stopped RemoteCache” logger=server reason=“context canceled”
t=2019-09-01T13:06:11+0200 lvl=info msg=“Stopped InternalMetricsService” logger=server reason=“context canceled”
t=2019-09-01T13:06:11+0200 lvl=info msg=“Stopped AlertEngine” logger=server reason=“context canceled”
t=2019-09-01T13:06:11+0200 lvl=info msg=“Stopped HTTPServer” logger=server reason=nil
t=2019-09-01T13:06:11+0200 lvl=eror msg=“Server shutdown” logger=server reason=“Unrecognized remote plugin message: \n\nThis usually means that the plugin is either invalid or simply\nneeds to be recompiled to support the latest protocol.”
t=2019-09-01T13:06:12+0200 lvl=info msg=“Starting Grafana” logger=server version=6.3.4 commit=a557646 branch=HEAD compiled=2019-08-19T16:28:51+0200
t=2019-09-01T13:06:12+0200 lvl=info msg=“Config loaded from” logger=settings file=/usr/share/grafana/conf/defaults.ini
t=2019-09-01T13:06:12+0200 lvl=info msg=“Config loaded from” logger=settings file=/etc/grafana/grafana.ini
t=2019-09-01T13:06:12+0200 lvl=info msg=“Config overridden from command line” logger=settings arg=“default.paths.data=/var/lib/grafana”
t=2019-09-01T13:06:12+0200 lvl=info msg=“Config overridden from command line” logger=settings arg=“default.paths.logs=/var/log/grafana”
t=2019-09-01T13:06:12+0200 lvl=info msg=“Config overridden from command line” logger=settings arg=“default.paths.plugins=/var/lib/grafana/plugins”
t=2019-09-01T13:06:12+0200 lvl=info msg=“Config overridden from command line” logger=settings arg=“default.paths.provisioning=/etc/grafana/provisioning”
t=2019-09-01T13:06:12+0200 lvl=info msg=“Path Home” logger=settings path=/usr/share/grafana
t=2019-09-01T13:06:12+0200 lvl=info msg=“Path Data” logger=settings path=/var/lib/grafana
t=2019-09-01T13:06:12+0200 lvl=info msg=“Path Logs” logger=settings path=/var/log/grafana
t=2019-09-01T13:06:12+0200 lvl=info msg=“Path Plugins” logger=settings path=/var/lib/grafana/plugins
t=2019-09-01T13:06:12+0200 lvl=info msg=“Path Provisioning” logger=settings path=/etc/grafana/provisioning
t=2019-09-01T13:06:12+0200 lvl=info msg=“App mode production” logger=settings
t=2019-09-01T13:06:12+0200 lvl=info msg=“Writing PID file” logger=server path=/var/run/grafana/grafana-server.pid pid=4947
t=2019-09-01T13:06:12+0200 lvl=info msg=“Initializing SqlStore” logger=server
t=2019-09-01T13:06:12+0200 lvl=info msg=“Connecting to DB” logger=sqlstore dbtype=sqlite3
t=2019-09-01T13:06:12+0200 lvl=info msg=“Starting DB migration” logger=migrator
t=2019-09-01T13:06:12+0200 lvl=info msg=“Initializing HTTPServer” logger=server
t=2019-09-01T13:06:12+0200 lvl=info msg=“Initializing InternalMetricsService” logger=server
t=2019-09-01T13:06:12+0200 lvl=info msg=“Initializing RemoteCache” logger=server
t=2019-09-01T13:06:12+0200 lvl=info msg=“Initializing QuotaService” logger=server
t=2019-09-01T13:06:12+0200 lvl=info msg=“Initializing PluginManager” logger=server
t=2019-09-01T13:06:12+0200 lvl=info msg=“Starting plugin search” logger=plugins
t=2019-09-01T13:06:12+0200 lvl=info msg=“Registering plugin” logger=plugins name=“Backend Renderer”
t=2019-09-01T13:06:12+0200 lvl=info msg=“Initializing RenderingService” logger=server
t=2019-09-01T13:06:12+0200 lvl=info msg=“Initializing AlertEngine” logger=server
t=2019-09-01T13:06:12+0200 lvl=info msg=“Initializing DatasourceCacheService” logger=server
t=2019-09-01T13:06:12+0200 lvl=info msg=“Initializing HooksService” logger=server
t=2019-09-01T13:06:12+0200 lvl=info msg=“Initializing LoginService” logger=server
t=2019-09-01T13:06:12+0200 lvl=info msg=“Initializing SearchService” logger=server
t=2019-09-01T13:06:12+0200 lvl=info msg=“Initializing ServerLockService” logger=server
t=2019-09-01T13:06:12+0200 lvl=info msg=“Initializing TracingService” logger=server
t=2019-09-01T13:06:12+0200 lvl=info msg=“Initializing UsageStatsService” logger=server
t=2019-09-01T13:06:12+0200 lvl=info msg=“Initializing UserAuthTokenService” logger=server
t=2019-09-01T13:06:12+0200 lvl=info msg=“Initializing CleanUpService” logger=server
t=2019-09-01T13:06:12+0200 lvl=info msg=“Initializing NotificationService” logger=server
t=2019-09-01T13:06:12+0200 lvl=info msg=“Initializing provisioningServiceImpl” logger=server
t=2019-09-01T13:06:12+0200 lvl=info msg=“Renderer plugin found, starting” logger=rendering cmd=plugin_start_linux_arm
t=2019-09-01T13:06:12+0200 lvl=info msg=“Initializing Stream Manager”
t=2019-09-01T13:06:12+0200 lvl=info msg=“HTTP Server Listen” logger=http.server address=0.0.0.0:3000 protocol=http subUrl= socket=
t=2019-09-01T13:06:14+0200 lvl=eror msg=“Stopped RenderingService” logger=server reason=“Unrecognized remote plugin message: \n\nThis usually means that the plugin is either invalid or simply\nneeds to be recompiled to support the latest protocol.”
t=2019-09-01T13:06:14+0200 lvl=info msg=“Stopped CleanUpService” logger=server reason=“context canceled”
t=2019-09-01T13:06:14+0200 lvl=info msg=“Stopped UserAuthTokenService” logger=server reason=“context canceled”
t=2019-09-01T13:06:14+0200 lvl=info msg=“Stopped UsageStatsService” logger=server reason=“context canceled”
t=2019-09-01T13:06:14+0200 lvl=info msg=“Stopped provisioningServiceImpl” logger=server reason=“context canceled”
t=2019-09-01T13:06:14+0200 lvl=info msg=“Stopped NotificationService” logger=server reason=“context canceled”
t=2019-09-01T13:06:14+0200 lvl=info msg=“Stopped RemoteCache” logger=server reason=“context canceled”
t=2019-09-01T13:06:14+0200 lvl=info msg=“Stopped TracingService” logger=server reason=nil
t=2019-09-01T13:06:14+0200 lvl=info msg=“Stopped InternalMetricsService” logger=server reason=“context canceled”
t=2019-09-01T13:06:14+0200 lvl=info msg=“Stopped Stream Manager”
t=2019-09-01T13:06:14+0200 lvl=info msg=“Stopped AlertEngine” logger=server reason=“context canceled”
t=2019-09-01T13:06:14+0200 lvl=info msg=“Stopped PluginManager” logger=server reason=“context canceled”
t=2019-09-01T13:06:14+0200 lvl=info msg=“Stopped HTTPServer” logger=server reason=nil
t=2019-09-01T13:06:14+0200 lvl=eror msg=“Server shutdown” logger=server reason=“Unrecognized remote plugin message: \n\nThis usually means that the plugin is either invalid or simply\nneeds to be recompiled to support the latest protocol.”
t=2019-09-01T13:06:15+0200 lvl=info msg=“Starting Grafana” logger=server version=6.3.4 commit=a557646 branch=HEAD compiled=2019-08-19T16:28:51+0200
t=2019-09-01T13:06:15+0200 lvl=info msg=“Config loaded from” logger=settings file=/usr/share/grafana/conf/defaults.ini
t=2019-09-01T13:06:15+0200 lvl=info msg=“Config loaded from” logger=settings file=/etc/grafana/grafana.ini
t=2019-09-01T13:06:15+0200 lvl=info msg=“Config overridden from command line” logger=settings arg=“default.paths.data=/var/lib/grafana”
t=2019-09-01T13:06:15+0200 lvl=info msg=“Config overridden from command line” logger=settings arg=“default.paths.logs=/var/log/grafana”
t=2019-09-01T13:06:15+0200 lvl=info msg=“Config overridden from command line” logger=settings arg=“default.paths.plugins=/var/lib/grafana/plugins”
t=2019-09-01T13:06:15+0200 lvl=info msg=“Config overridden from command line” logger=settings arg=“default.paths.provisioning=/etc/grafana/provisioning”
t=2019-09-01T13:06:15+0200 lvl=info msg=“Path Home” logger=settings path=/usr/share/grafana
t=2019-09-01T13:06:15+0200 lvl=info msg=“Path Data” logger=settings path=/var/lib/grafana
t=2019-09-01T13:06:15+0200 lvl=info msg=“Path Logs” logger=settings path=/var/log/grafana
t=2019-09-01T13:06:15+0200 lvl=info msg=“Path Plugins” logger=settings path=/var/lib/grafana/plugins
t=2019-09-01T13:06:15+0200 lvl=info msg=“Path Provisioning” logger=settings path=/etc/grafana/provisioning
t=2019-09-01T13:06:15+0200 lvl=info msg=“App mode production” logger=settings
t=2019-09-01T13:06:15+0200 lvl=info msg=“Writing PID file” logger=server path=/var/run/grafana/grafana-server.pid pid=4993
t=2019-09-01T13:06:15+0200 lvl=info msg=“Initializing SqlStore” logger=server
t=2019-09-01T13:06:15+0200 lvl=info msg=“Connecting to DB” logger=sqlstore dbtype=sqlite3
t=2019-09-01T13:06:15+0200 lvl=info msg=“Starting DB migration” logger=migrator
t=2019-09-01T13:06:15+0200 lvl=info msg=“Initializing HTTPServer” logger=server
t=2019-09-01T13:06:15+0200 lvl=info msg=“Initializing InternalMetricsService” logger=server
t=2019-09-01T13:06:15+0200 lvl=info msg=“Initializing RemoteCache” logger=server
t=2019-09-01T13:06:15+0200 lvl=info msg=“Initializing QuotaService” logger=server
t=2019-09-01T13:06:15+0200 lvl=info msg=“Initializing PluginManager” logger=server
t=2019-09-01T13:06:15+0200 lvl=info msg=“Starting plugin search” logger=plugins
t=2019-09-01T13:06:15+0200 lvl=info msg=“Registering plugin” logger=plugins name=“Backend Renderer”
t=2019-09-01T13:06:15+0200 lvl=info msg=“Initializing RenderingService” logger=server
t=2019-09-01T13:06:15+0200 lvl=info msg=“Initializing AlertEngine” logger=server
t=2019-09-01T13:06:15+0200 lvl=info msg=“Initializing DatasourceCacheService” logger=server
t=2019-09-01T13:06:15+0200 lvl=info msg=“Initializing HooksService” logger=server
t=2019-09-01T13:06:15+0200 lvl=info msg=“Initializing LoginService” logger=server
t=2019-09-01T13:06:15+0200 lvl=info msg=“Initializing SearchService” logger=server
t=2019-09-01T13:06:15+0200 lvl=info msg=“Initializing ServerLockService” logger=server
t=2019-09-01T13:06:15+0200 lvl=info msg=“Initializing TracingService” logger=server
t=2019-09-01T13:06:15+0200 lvl=info msg=“Initializing UsageStatsService” logger=server
t=2019-09-01T13:06:15+0200 lvl=info msg=“Initializing UserAuthTokenService” logger=server
t=2019-09-01T13:06:15+0200 lvl=info msg=“Initializing CleanUpService” logger=server
t=2019-09-01T13:06:15+0200 lvl=info msg=“Initializing NotificationService” logger=server
t=2019-09-01T13:06:15+0200 lvl=info msg=“Initializing provisioningServiceImpl” logger=server
t=2019-09-01T13:06:15+0200 lvl=info msg=“Renderer plugin found, starting” logger=rendering cmd=plugin_start_linux_arm
t=2019-09-01T13:06:15+0200 lvl=info msg=“Initializing Stream Manager”
t=2019-09-01T13:06:15+0200 lvl=info msg=“HTTP Server Listen” logger=http.server address=0.0.0.0:3000 protocol=http subUrl= socket=

Can somebody help me?

Hi.
Just to confirm. The tutorial was not about installing phantomJS as that no longer is supplied. Rather the alternative rendering engine is installed.

Also I note that the plugin has been updated recently so the instructions may not be accurate.

Hi David,

I tried to use the phantomjs bin file but as I read your comments I understand that will not work anymore.
So I tried the grafana-image-renderer as instructed, but the yarn install --pure-lockfile gives me the following errors on Raspbian GNU/Linux 10 (buster) :

Any suggestions or tips? (Is it even possible on arm ?)

David,

I followed your tutorial on how to build the Grafana-renderer… but no luck. I get the following errors:

      CXX(target) Release/obj.target/grpc/deps/grpc/src/core/ext/transport/chttp2/transport/flow_control.o
      ../deps/grpc/src/core/ext/transport/chttp2/transport/flow_control.cc: In member function ‘virtual       uint32_t grpc_core::chttp2::TransportFlowControl::MaybeSendUpdate(bool)’:
../deps/grpc/src/core/ext/transport/chttp2/transport/flow_control.cc:188:50: error: type qualifiers ignored on cast result type [-Werror=ignored-qualifiers]
       static_cast<const uint32_t>(target_window());
                                                  ^
cc1plus: all warnings being treated as errors
make: *** [grpc.target.mk:396: Release/obj.target/grpc/deps/grpc/src/core/ext/transport/chttp2/transport/flow_control.o] Fehler 1
make: Verzeichnis „/var/lib/grafana/plugins/grafana-image-renderer/node_modules/grpc/build“ wird verlassen
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:196:23)
gyp ERR! stack     at ChildProcess.emit (events.js:198:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:248:12)
gyp ERR! System Linux 4.19.66-v7+
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--library=static_library" "--module=/var/lib/grafana/plugins/grafana-image-renderer/node_modules/grpc/src/node/extension_binary/node-v64-linux-arm-glibc/grpc_node.node" "--module_name=grpc_node" "--module_path=/var/lib/grafana/plugins/grafana-image-renderer/node_modules/grpc/src/node/extension_binary/node-v64-linux-arm-glibc" "--napi_version=4" "--node_abi_napi=napi"
gyp ERR! cwd /var/lib/grafana/plugins/grafana-image-renderer/node_modules/grpc
gyp ERR! node -v v10.16.3
gyp ERR! node-gyp -v v5.0.3
gyp ERR! not ok 
node-pre-gyp ERR! build error 
node-pre-gyp ERR! stack Error: Failed to execute '/usr/bin/node /usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --library=static_library --module=/var/lib/grafana/plugins/grafana-image-renderer/node_modules/grpc/src/node/extension_binary/node-v64-linux-arm-glibc/grpc_node.node --module_name=grpc_node --module_path=/var/lib/grafana/plugins/grafana-image-renderer/node_modules/grpc/src/node/extension_binary/node-v64-linux-arm-glibc --napi_version=4 --node_abi_napi=napi' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/var/lib/grafana/plugins/grafana-image-renderer/node_modules/grpc/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:198:13)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:982:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
node-pre-gyp ERR! System Linux 4.19.66-v7+
node-pre-gyp ERR! command "/usr/bin/node" "/var/lib/grafana/plugins/grafana-image-renderer/node_modules/grpc/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build" "--library=static_library"
node-pre-gyp ERR! cwd /var/lib/grafana/plugins/grafana-image-renderer/node_modules/grpc
node-pre-gyp ERR! node -v v10.16.3
node-pre-gyp ERR! node-pre-gyp -v v0.10.0
node-pre-gyp ERR! not ok 

Any ideas what’s going wrong?
I am using Grafana 6.4, and openhab milestone build 2.5.0~M3…

Thanks in advance!

From the research, I have done is that this is broken. Have been learning NodeJS so might have some time to look deeper into this.

Thanks for your interesting tutorial, but unfortunately I had the same problem as deichgraf Hauke. I am using Grafana 6.4 and openhab 2.4.0. Any ideas? Thanks!

Have done some research on this and think it is a problem with typescript compiling on the RPI 4. Now this update is provisional as I need to rebuild my RPI4 testing box.

So using the instructions above download the file from git and run upto

yarn install --pure-lockfile

now we have to do abit of editing of a source file

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

yarn run build

it should now complete without errors. Please let me know if plugin now loads.