Tutorial - Grafana rendering on Raspberry Pi

Hi David,

Thank you so much for helping! unfortunately for me it still does not work. I am still stuck at

[20:57:36] root@openhab:/var/lib/grafana/plugins/grafana-image-renderer# yarn install --pure-lockfile
yarn install v1.19.1
[1/4] Resolving packages...
warning Resolution field "set-value@2.0.1" is incompatible with requested version "set-value@^0.4.3"
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
[1/4] ⠄ grpc
[2/4] ⠄ puppeteer
[3/4] ⠄ husky
error /var/lib/grafana/plugins/grafana-image-renderer/node_modules/grpc: Command failed.
Exit code: 1
Command: ./node_modules/.bin/node-pre-gyp install --fallback-to-build --library=static_library
Arguments:
Directory: /var/lib/grafana/plugins/grafana-image-renderer/node_modules/grpc
Output:
node-pre-gyp info it worked if it ends with ok
node-pre-gyp info using node-pre-gyp@0.10.0
node-pre-gyp info using node@10.15.2 | linux | arm
node-pre-gyp info check checked for "/var/lib/grafana/plugins/grafana-image-renderer/node_modules/grpc/src/node/extension_binary/node-v64-linux-arm-glibc/grpc_node.node" (not found)
node-pre-gyp http GET https://storage.googleapis.com/grpc-precompiled-binaries/node/grpc/v1.11.3/node-v64-linux-arm-glibc.tar.gz
node-pre-gyp http 403 https://storage.googleapis.com/grpc-precompiled-binaries/node/grpc/v1.11.3/node-v64-linux-arm-glibc.tar.gz
node-pre-gyp WARN Tried to download(403): https://storage.googleapis.com/grpc-precompiled-binaries/node/grpc/v1.11.3/node-v64-linux-arm-glibc.tar.gz
node-pre-gyp WARN Pre-built binaries not found for grpc@1.11.3 and node@10.15.2 (node-v64 ABI, glibc) (falling back to source compile with node-gyp)
node-pre-gyp http 403 status code downloading tarball https://storage.googleapis.com/grpc-precompiled-binaries/node/grpc/v1.11.3/node-v64-linux-arm-glibc.tar.gz
gyp info it worked if it ends with ok
gyp info using node-gyp@5.0.3
gyp info using node@10.15.2 | linux | arm
gyp info ok
gyp info it worked if it ends with ok
gyp info using node-gyp@5.0.3
gyp info using node@10.15.2 | linux | arm
gyp info find Python using Python version 2.7.16 found at "/usr/bin/python"
gyp info spawn /usr/bin/python
gyp info spawn args [ '/usr/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'make',
gyp info spawn args   '-I',
gyp info spawn args   '/var/lib/grafana/plugins/grafana-image-renderer/node_modules/grpc/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/usr/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/root/.cache/node-gyp/10.15.2/include/node/common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=/root/.cache/node-gyp/10.15.2',
gyp info spawn args   '-Dnode_gyp_dir=/usr/lib/node_modules/npm/node_modules/node-gyp',
gyp info spawn args   '-Dnode_lib_file=/root/.cache/node-gyp/10.15.2/<(target_arch)/node.lib',
gyp info spawn args   '-Dmodule_root_dir=/var/lib/grafana/plugins/grafana-image-renderer/node_modules/grpc',
gyp info spawn args   '-Dnode_engine=v8',
gyp info spawn args   '--depth=.',
gyp info spawn args   '--no-parallel',
gyp info spawn args   '--generator-output',
gyp info spawn args   'build',
gyp info spawn args   '-Goutput_dir=.' ]
gyp info ok
gyp info it worked if it ends with ok
gyp info using node-gyp@5.0.3
gyp info using node@10.15.2 | linux | arm
gyp info spawn make
gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
make: Entering directory '/var/lib/grafana/plugins/grafana-image-renderer/node_modules/grpc/build'
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/surface/init.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/avl/avl.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/backoff/backoff.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/channel/channel_args.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/channel/channel_stack.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/channel/channel_stack_builder.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/channel/connected_channel.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/channel/handshaker.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/channel/handshaker_factory.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/channel/handshaker_registry.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/compression/compression.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/compression/compression_internal.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/compression/message_compress.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/compression/stream_compression.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/compression/stream_compression_gzip.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/compression/stream_compression_identity.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/debug/stats.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/debug/stats_data.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/http/format_request.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/http/httpcli.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/http/parser.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/call_combiner.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/combiner.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/endpoint.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/endpoint_pair_posix.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/endpoint_pair_uv.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/endpoint_pair_windows.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/error.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/ev_epoll1_linux.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/ev_epollex_linux.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/ev_epollsig_linux.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/ev_poll_posix.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/ev_posix.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/ev_windows.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/exec_ctx.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/executor.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/fork_posix.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/fork_windows.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/gethostname_fallback.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/gethostname_host_name_max.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/gethostname_sysconf.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/iocp_windows.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/iomgr.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/iomgr_posix.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/iomgr_uv.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/iomgr_windows.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/is_epollexclusive_available.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/load_file.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/lockfree_event.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/network_status_tracker.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/polling_entity.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/pollset_set_uv.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/pollset_set_windows.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/pollset_uv.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/pollset_windows.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/resolve_address_posix.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/resolve_address_uv.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/resolve_address_windows.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/resource_quota.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/sockaddr_utils.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/socket_factory_posix.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/socket_mutator.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/socket_utils_common_posix.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/socket_utils_linux.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/socket_utils_posix.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/socket_utils_uv.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/socket_utils_windows.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/socket_windows.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/tcp_client_posix.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/tcp_client_uv.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/tcp_client_windows.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/tcp_posix.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/tcp_server_posix.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/tcp_server_utils_posix_common.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/tcp_server_utils_posix_ifaddrs.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/tcp_server_utils_posix_noifaddrs.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/tcp_server_uv.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/tcp_server_windows.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/tcp_uv.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/tcp_windows.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/time_averaged_stats.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/timer_generic.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/timer_heap.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/timer_manager.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/timer_uv.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/udp_server.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/unix_sockets_posix.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/unix_sockets_posix_noop.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/wakeup_fd_cv.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/wakeup_fd_eventfd.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/wakeup_fd_nospecial.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/wakeup_fd_pipe.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/wakeup_fd_posix.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/json/json.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/json/json_reader.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/json/json_string.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/json/json_writer.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/slice/b64.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/slice/percent_encoding.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/slice/slice.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/slice/slice_buffer.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/slice/slice_hash_table.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/slice/slice_intern.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/slice/slice_string_helpers.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/surface/api_trace.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/surface/byte_buffer.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/surface/byte_buffer_reader.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/surface/call.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/surface/call_details.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/surface/call_log_batch.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/surface/channel.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/surface/channel_init.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/surface/channel_ping.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/surface/channel_stack_type.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/surface/completion_queue.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/surface/completion_queue_factory.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/surface/event_string.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/surface/lame_client.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/surface/metadata_array.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/surface/server.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/surface/validate_metadata.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/surface/version.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/transport/bdp_estimator.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/transport/byte_stream.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/transport/connectivity_state.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/transport/error_utils.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/transport/metadata.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/transport/metadata_batch.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/transport/pid_controller.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/transport/service_config.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/transport/static_metadata.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/transport/status_conversion.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/transport/timeout_encoding.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/transport/transport.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/transport/transport_op_string.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/debug/trace.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/ext/transport/chttp2/server/secure/server_secure_chttp2.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/ext/transport/chttp2/transport/bin_decoder.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/ext/transport/chttp2/transport/bin_encoder.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/ext/transport/chttp2/transport/chttp2_plugin.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/ext/transport/chttp2/transport/chttp2_transport.o
  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:398: Release/obj.target/grpc/deps/grpc/src/core/ext/transport/chttp2/transport/flow_control.o] Error 1
make: Leaving directory '/var/lib/grafana/plugins/grafana-image-renderer/node_modules/grpc/build'
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:189:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:248:12)
gyp ERR! System Linux 4.19.75-v7l+
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=3" "--node_abi_napi=napi"
gyp ERR! cwd /var/lib/grafana/plugins/grafana-image-renderer/node_modules/grpc
gyp ERR! node -v v10.15.2
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=3 --node_abi_napi=napi' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/var/lib/grafana/plugins/grafana-image-renderer/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:189:13)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:970: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.75-v7l+
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.15.2
node-pre-gyp ERR! node-pre-gyp -v v0.10.0
node-pre-gyp ERR! not ok
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/exten

yarn run build then does something but grafana does not start after that.

yarn run v1.19.1
$ yarn run tsc
$ /var/lib/grafana/plugins/grafana-image-renderer/node_modules/.bin/tsc
Done in 13.09s.

I just can’t get node-pre-gyp to work :frowning:

Hi Christian
There is definitively something odd with permission. However I think I have a working version now.
Git download
Change into directory

sudo npm i grpc
sudo npm i install
yarn run build

(The install of grpc would occur with the overall install, but satisfying to see install after so many failures.)

Now copy the start file to arm version

cp plugin_start_linux_amd64 plugin_start_linux_arm

Now stop following tutorial which I will give a huge edit to and restart the graphana service. Mine is now showing service has started.

Hi @David_deMarco,

Thank you so much! I finally was able to install the plugin with the following:

apt-get update
apt-get install git
sudo su (could not access the folder with my regular user)
cd /var/lib/grafana/plugins
git clone https://github.com/grafana/grafana-image-renderer
cd grafana-image-renderer
npm config set unsafe-perm=true (had to do this in order to make the gprc install work)
npm i grpc
npm i install
npm install (otherwise it would complain about "tsc not found")
cd src
nano grpc-plugin.ts
// @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;

// @ts-ignore: the nested grpc objects are not recognized by ts
    server.addService(RENDERER_PROTO.Renderer.service, {
cd ..
yarn run build
cp plugin_start_linux_amd64 plugin_start_linux_arm

systemctl restart grafana-server.service
sudo apt install gconf-service libasound2 libatk1.0-0 libatk-bridge2.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 libnspr4 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 ca-certificates fonts-liberation libappindicator1 libnss3 lsb-release xdg-utils wget
sudo apt install chromium

Now I have the problem that the image is not being generated…
It seems that there is an issue with puppeteer.

t=2019-11-05T09:56:55+0100 lvl=eror msg="Rendering failed." logger=context userId=0 orgId=1 uname= error="Rendering failed: Error: Failed to launch chrome!\n/var/lib/grafana/plugins/grafana-image-renderer/node_modules/puppeteer/.local-chromium/linux-686378/chrome-linux/chrome: 1: /var/lib/grafana/plugins/grafana-image-renderer/node_modules/puppeteer/.local-chromium/linux-686378/chrome-linux/chrome: Syntax error: Unterminated quoted string\n\n\nTROUBLESHOOTING: https://github.com/GoogleChrome/puppeteer/blob/master/docs/troubleshooting.md\n"
t=2019-11-05T09:56:55+0100 lvl=eror msg="Request Completed" logger=context userId=0 orgId=1 uname= method=GET path=/render/d-solo/7BO9uURRk/temperature status=500 remote_addr=192.168.0.111 time_ms=74 size=723 referer="http://127.0.0.1:3000/d/7BO9uURRk/temperature?orgId=1"

I found this, but it doe snot really solve the problem (same error message).

Does anyone have an idea how to solve this?

1 Like

Hi @Chrishab, @David_deMarco,
I’m facing the same “Rendering failed: Error: Failed to launch chrome!” issue.
The deployment of the rendering module was really smooth, no errors at all. During the install I also noticed Chrome getting installed. After restart of Grafana the module is loaded and listed.
This is happening on a Raspberry Pi 4, latest Openhabian test release.
I have the exact same deployment running on an Ubuntu VM. Followed the same deployment steps listed here and the result is a perfectly operating rendering module.
So it seems Buster / Raspberry related?

Thnx,
E

Hi all
Okay. I getting abit confused on this all with regards to the Chrome install.

My last test was on a blank install of OpenHabian then followed the instructions I thought I had edited.

Seen some other versions of the install so not sure how to update this yet. I removed all the additional info on adding chrome as my install worked without it

Appreciate a few users are following this so will try and recreate it this again. Please be aware I am offline travelling until 10 Dec from next week.

Don’t do the instructions of installing Chrome. I know they were in the first set and I thought I had removed them.

The Current instruction will include pupeteer and you don’t need to install chrome and all that. This worked for me on a fresh test install.

Understand that I now seem to be the lead on how this works and happy to follow up on that. Please be aware I’m not around for the next month so all follow up details welcome.

Hey @David_deMarco, thanks for the hard work on this, really appreciated.
Just wanted to let you know I gave up on rendering on the Pi4. I’ve done a couple of fresh installs on the Pi using Openhabian as a base OS (I’m quite the expert on this these days) and I must say everything (time over time) evrything worked perfectly except the last mile . . the rendering.
I already had an Ubuntu VM that I used for testing and found that running Grafana on that VM rendered like a charm.
So now I removed Grafana from my ‘production’ Pi4 (kept Influx on the Pi4) and use the Ubuntu based Grafana as a centralized instance for Graphing and Rendering using various databases running on different Pi’s.
:slight_smile:

For what it’s worth, this will NOT work on a Raspberry Pi 3B+ on Buster.

Some node.js packages can’t be installed (puppeteer, husky) and the compilation aborts in a matter of seconds.

1 Like

I have the same problem… Everything works on the Pi4, and it finally can handle all my things in one device, but the rendering doesn’t seem to work… I tried it multiple times, always stuck somewhere…

Hello,

sorry, but i did not understood this lines. It must looks so Screenshot by Lightshot ?

after this i get error

[23:13:11] root@openhab:/var/lib/grafana/plugins/grafana-image-renderer# yarn run build
yarn run v1.19.1
$ yarn run tsc
error Command "tsc" not found.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

How it can be fixed?

I am on OH 2.5M4 on Pi4

Hi.
I am travelling in Myanmar at the moment so can’t investigate this further. Back mid Dec

Have a good trip! We will be waiting)

Just to chime in, I end up with the same chrome error error once everything is installed

t=2019-11-17T21:30:52+0100 lvl=eror msg="Rendering failed." logger=context userId=1 orgId=1 uname=admin error="Rendering failed: Error: Failed to launch chrome!\n/var/lib/grafana/plugins/grafana-image-renderer/node_modules/puppeteer/.local-chromium/linux-686378/chrome-linux/chrome: 1: /var/lib/grafana/plugins/grafana-image-renderer/node_modules/puppeteer/.local-chromium/linux-686378/chrome-linux/chrome: Syntax error: Unterminated quoted string\n\n\nTROUBLESHOOTING: https://github.com/GoogleChrome/puppeteer/blob/master/docs/troubleshooting.md\n"
t=2019-11-17T21:30:52+0100 lvl=eror msg="Request Completed" logger=context userId=1 orgId=1 uname=admin method=GET path=/render/d-solo/vL8w4giRk/basement-office-thermostat status=500 remote_addr=10.13.2.11 time_ms=61 size=1722 referer="http://10.13.0.41:3000/d/vL8w4giRk/basement-office-thermostat?orgId=1"

In order to get everything installed I had to do the following:

After apt-get install git it did:
apt-get install nodejs

before the npm install I had to do the following also:

npm install typescript -g
sudo npm i husky
sudo npm i puppeteer
sudo npm i postinstall
1 Like

Here are instructions for compiling it on the RPi3B+:

sudo su
cd /var/lib/grafana/plugins
git clone https://github.com/grafana/grafana-image-renderer
cd grafana-image-renderer

Now we’ll update npm, just in case:

npm -g install npm

Now we’ll install yarn and typescript:

npm -g install yarn
npm -g install typescript

The following line is essential for compiling the plugin’s dependencies on a RPi3B+ on openhabian buster:

npm config set unsafe-perm=true

We can now at last add the Node.JS dependencies to compile the plugin:

npm i grpc

npm i husky
npm i puppeteer
npm i postinstall
npm i install
npm install

Time to edit add // @ts-ignore above 2 TypeScript lines (see above):

cd src
nano grpc-plugin.ts

And now we can build the plugin:

cd ..
yarn run build

Copy plugin_start_linux_amd64 as plugin_start_linux_arm and restart the Grafana server:

cp plugin_start_linux_amd64 plugin_start_linux_arm
systemctl restart grafana-server.service

After 10 seconds, verify that the plugin has been loaded successfully:

systemctl status grafana-server.service

Look for the following log lines:

Nov 24 12:11:58 openhab grafana-server[18874]: t=2019-11-24T12:11:58+0100 lvl=info msg="Renderer plugin found, starting" logger=rendering cmd=plugin_start_linux_arm
. . .
Nov 24 12:12:00 openhab grafana-server[18874]: t=2019-11-24T12:12:00+0100 lvl=info msg="Renderer plugin started" logger=rendering timestamp=0001-01-01T00:00:00.000Z

Have fun!

AWESOME step by step @shutterfreak
Thank you for all your help :muscle:

Thanks @shutterfreak for updating the tutorial for RPi3B+
Unfortunately I still end up with an error in the log like before.

t=2019-11-24T15:41:54+0100 lvl=eror msg="Rendering failed." logger=context userId=1 orgId=1 uname=admin error="Rendering failed: Error: Failed to launch chrome!\n/var/lib/grafana/plugins/grafana-image-renderer/node_modules/puppeteer/.local-chromium/linux-686378/chrome-linux/chrome: 1: /var/lib/grafana/plugins/grafana-image-renderer/node_modules/puppeteer/.local-chromium/linux-686378/chrome-linux/chrome: Syntax error: Unterminated quoted string\n\n\nTROUBLESHOOTING: https://github.com/GoogleChrome/puppeteer/blob/master/docs/troubleshooting.md\n"

I’ve deleted the folder grafana-image-renderer, followed every step and besides very few warnings everything looked fine in the console.

npm WARN renderer@1.0.0 No repository field.

When I try to export a graph to an image, I also run into the same error messages in /var/log/grafana/grafana.log:

t=2019-11-24T20:53:30+0100 lvl=eror msg="Render request failed" logger=rendering url="http://localhost:3000/d-solo/Bj1viEiRk/weather?orgId=1&from=1572029597812&to=1574625197812&panelId=9&width=1000&height=500&tz=Europe%2FBrussels&render=1" error=map[] timestamp=0001-01-01T00:00:00.000Z
t=2019-11-24T20:53:30+0100 lvl=eror msg="Rendering failed." logger=context userId=1 orgId=1 uname=admin error="Rendering failed: Error: Failed to launch chrome!\n/var/lib/grafana/plugins/grafana-image-renderer/node_modules/puppeteer/.local-chromium/linux-686378/chrome-linux/chrome: 1: /var/lib/grafana/plugins/grafana-image-renderer/node_modules/puppeteer/.local-chromium/linux-686378/chrome-linux/chrome: Syntax error: Unterminated quoted string\n\n\nTROUBLESHOOTING: https://github.com/GoogleChrome/puppeteer/blob/master/docs/troubleshooting.md\n"
t=2019-11-24T20:53:30+0100 lvl=eror msg="Request Completed" logger=context userId=1 orgId=1 uname=admin method=GET path=/render/d-solo/Bj1viEiRk/weather status=500 remote_addr=[::1] time_ms=429 size=1730 referer="https://shutterfreak.routemehome.com/grafana/d/Bj1viEiRk/weather?orgId=1&from=now-30d&to=now"

So it appears that the renderer plugin complains about an unterminated string somewhere. Problem is that /var/lib/grafana/plugins/grafana-image-renderer/node_modules/puppeteer/.local-chromium/linux-686378/chrome-linux/chrome is an ELF binary and not a script, so it must be a problem within one of the JavaScript (TypeScript) files.

Maybe puppeteer expects a launch script instead of the chrome binary?

It appears that puppeteer installs the wrong binary for the chrome browser:

$ sudo su
# /var/lib/grafana/plugins/grafana-image-renderer/node_modules/puppeteer/.local-chromium/linux-686378/chrome-linux/chrome --version
bash: /var/lib/grafana/plugins/grafana-image-renderer/node_modules/puppeteer/.local-chromium/linux-686378/chrome-linux/chrome: cannot execute binary file: Exec format error

No wonder that the Grafana renderer plugin bails out.

My bet is that the chrome binary shipped with puppeteer is for the wrong processor architecture.

UPDATE: This is apparently a know problem of puppeteer: https://github.com/puppeteer/puppeteer/issues/550

I installed a recent snapshot of the chromium-browser package, and that one reports:

# apt list --installed | grep -i chrom

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

chromium-browser-l10n/testing,now 74.0.3729.157-rpt5 all [installed,automatic]
chromium-browser/testing,now 74.0.3729.157-rpt5 armhf [installed]
chromium-codecs-ffmpeg/testing,now 74.0.3729.157-rpt5 armhf [installed]

# which chromium-browser 
/usr/bin/chromium-browser

# /usr/bin/chromium-browser --version
Chromium 74.0.3729.157 Built on Raspbian , running on Raspbian 10

Now I need to figure out either how to replace the incorrect chrome image deployed by puppeteer or by configuring the grafana renderer plugin to use /usr/bin/chromium-browser (or a compatible version for puppeteer).

Actually getting the render plugin to use your custom chromium is very simple :wink: once you figure out how.
Add this line

export GF_RENDERER_PLUGIN_CHROME_BIN="/usr/bin/chromium-browser"

just above the

node ${DIR}/build/app.js

in plugin_start_linux_arm

I actually managed to install the chromium browser just by going sudo apt-get install chromium-browser

However I am still not there as I now get the following errors in the grafana logs

t=2019-11-26T09:36:56+0100 lvl=info msg="Renderer plugin started" logger=rendering chromeBin=/usr/bin/chromium-browser ignoreHttpsErrors=false timestamp=0001-01-01T00:00:00.000Z
t=2019-11-26T09:37:35+0100 lvl=eror msg="Render request failed" logger=rendering url="http://localhost:3000/d-solo/45sF64igk/air-quality?orgId=1&from=1574735848638&to=1574757448638&panelId=2&width=1000&height=500&tz=Europe%2FParis&render=1" error=map[] timestamp=0001-01-01T00:00:00.000Z
t=2019-11-26T09:37:35+0100 lvl=eror msg="Rendering failed." logger=context userId=1 orgId=1 uname=admin error="Rendering failed: Error: Protocol error: Connection closed. Most likely the page has been closed."
t=2019-11-26T09:37:35+0100 lvl=eror msg="Request Completed" logger=context userId=1 orgId=1 uname=admin method=GET path=/render/d-solo/45sF64igk/air-quality status=500 remote_addr=10.13.2.11 time_ms=4095 size=1722 referer="http://10.13.0.41:3000/d/45sF64igk/air-quality?orgId=1"

UPDATE:
Maybe I should just have tried running chromium headless first which gives this error:
Failed to put Xlib into threaded mode.

Thanks for this update!

I have the impression that puppeteer requires a specific version of the chromium browser, and that it is impossible to find as it’s not pre-built for the ARM processor architecture. In the thread I mentioned in my earlier post (https://github.com/puppeteer/puppeteer/issues/550) it seems that some people tried to cross-compile chromium-browser so it could run on a Raspberry Pi 3B+ / 4.

However, given the RPi3 is very tight on memory (1GB), I fear that running the chromium browser from puppeteer will be very slow and will wear out the SD card in no time due to the need of swap space for running. Hence I decided to abandon this track.

You may want to try the following instructions: https://code-flow-hjbello.blogspot.com/2018/11/make-puppeteer-work-with-raspbian-vers.html

That did the trick! I followed the instructions in you last link and used the added line of code from @petero
Works like a charm now in grafana. Thanks!

1 Like