As g++ didn’t do the trick I tried build-essential, but it’s producing an error in the logs:
ERROR: unable to select packages:
build-essential (no such package):
required by: world[build-essential]
[07:52:49] FATAL: Failed installing system package build-essential
All was working until I launched a massive update of the system after almost a year (core, supervisor, HA, node-red …).
Smartmeter is not available any more, it looks like I have similar issues. Did you solve yours?
Add-on version: 14.0.1
You are running the latest version of this add-on.
System: Home Assistant OS 9.4 (amd64 / qemux86-64)
Home Assistant Core: 2022.12.8
Home Assistant Supervisor: 2022.12.1
.
.
.
3 Jan 12:55:48 - [info] Node-RED version: v3.0.2
3 Jan 12:55:48 - [info] Node.js version: v18.12.1
3 Jan 12:55:48 - [info] Linux 5.15.80 x64 LE
3 Jan 12:55:50 - [info] Loading palette nodes
3 Jan 12:55:59 - [info] Dashboard version 3.3.0 started at /endpoint/ui
3 Jan 12:56:01 - [warn] ------------------------------------------------------
3 Jan 12:56:01 - [warn] [node-red-contrib-smartmeter/smartmeter] Error: Error relocating /config/node-red/node_modules/@serialport/bindings/build/Release/bindings.node: _ZN2v82V818GlobalizeReferenceEPNS_8internal7IsolateEPm: symbol not found
3 Jan 12:56:01 - [warn] [node-red-contrib-smartmeter/smartmeter-connection] Error: Error relocating /config/node-red/node_modules/@serialport/bindings/build/Release/bindings.node: _ZN2v82V818GlobalizeReferenceEPNS_8internal7IsolateEPm: symbol not found
node-RED itself is telling me:
Flows stopped due to missing node types.
smartmeter-connection
smartmeter
This node is a type unknown to your installation of Node-RED.
In “Manage palette” I could even update the smart-meter contribution to 0.6.3 (before it was 0.6.0),
I had already the same system_packages installed. Under npm_packages, I tried node-red-contrib-smartmeter too (which should have added the node type to the pallete by default), so I think the key to the solution was serialport.
Too much try and error in my eyes, but hey, now it works .
I also need help installing the smartmeter package in NodeRed. The installation keeps crashing with an error and I don’t know how to solve it.
Here is the log for it:
-----------------------------------------------------------
2023-01-04T15:17:07.022Z Installieren : node-red-contrib-smartmeter 0.6.3
2023-01-04T15:16:57.428Z npm install --no-audit --no-update-notifier --no-fund --save --save-prefix=~ --production --engine-strict [email protected]
2023-01-04T15:16:59.554Z [err] npm
2023-01-04T15:16:59.555Z [err] WARN
2023-01-04T15:16:59.556Z [err] config production Use `--omit=dev` instead.
2023-01-04T15:17:15.228Z [err] npm
2023-01-04T15:17:15.229Z [err] WARN deprecated [email protected]: this library is no longer supported
2023-01-04T15:17:15.649Z [err] npm WARN
2023-01-04T15:17:15.650Z [err] deprecated [email protected]: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
2023-01-04T15:17:15.842Z [err] npm WARN deprecated [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142
2023-01-04T15:17:18.746Z [err] npm ERR! code 1
2023-01-04T15:17:18.746Z [err] npm ERR! path /config/node-red/node_modules/@serialport/bindings
2023-01-04T15:17:18.746Z [err] npm ERR! command failed
2023-01-04T15:17:18.746Z [err] npm ERR! command sh -c prebuild-install --tag-prefix @serialport/bindings@ || node-gyp rebuild
2023-01-04T15:17:18.746Z [err] npm ERR! prebuild-install warn install No prebuilt binaries found (target=18.12.1 runtime=node arch=arm64 libc=musl platform=linux)
2023-01-04T15:17:18.746Z [err] npm ERR! gyp info it worked if it ends with ok
2023-01-04T15:17:18.746Z [err] npm ERR! gyp info using [email protected]
2023-01-04T15:17:18.746Z [err] npm ERR! gyp info using [email protected] | linux | arm64
2023-01-04T15:17:18.746Z [err] npm ERR! gyp ERR! find Python
2023-01-04T15:17:18.746Z [err] npm ERR! gyp ERR! find Python checking Python explicitly set from command line or npm configuration
2023-01-04T15:17:18.746Z [err] npm ERR! gyp ERR! find Python - "--python=" or "npm config get python" is "/usr/bin/python3"
2023-01-04T15:17:18.746Z [err] npm ERR! gyp ERR! find Python - "/usr/bin/python3" is not in PATH or produced an error
2023-01-04T15:17:18.746Z [err] npm ERR! gyp ERR! find Python Python is not set from environment variable PYTHON
2023-01-04T15:17:18.746Z [err] npm ERR! gyp ERR! find Python checking if "python3" can be used
2023-01-04T15:17:18.746Z [err] npm ERR! gyp ERR! find Python - "python3" is not in PATH or produced an error
2023-01-04T15:17:18.746Z [err] npm ERR! gyp ERR! find Python checking if "python" can be used
2023-01-04T15:17:18.746Z [err] npm ERR! gyp ERR! find Python - "python" is not in PATH or produced an error
2023-01-04T15:17:18.746Z [err] npm ERR! gyp ERR! find Python
2023-01-04T15:17:18.746Z [err] npm ERR! gyp ERR! find Python **********************************************************
2023-01-04T15:17:18.746Z [err] npm ERR! gyp ERR! find Python You need to install the latest version of Python.
2023-01-04T15:17:18.746Z [err] npm ERR! gyp ERR! find Python Node-gyp should be able to find and use Python. If not,
2023-01-04T15:17:18.746Z [err] npm ERR! gyp ERR! find Python you can try one of the following options:
2023-01-04T15:17:18.746Z [err] npm ERR! gyp ERR! find Python - Use the switch --python="/path/to/pythonexecutable"
2023-01-04T15:17:18.746Z [err] npm ERR! gyp ERR! find Python (accepted by both node-gyp and npm)
2023-01-04T15:17:18.746Z [err] npm ERR! gyp ERR! find Python - Set the environment variable PYTHON
2023-01-04T15:17:18.746Z [err] npm ERR! gyp ERR! find Python - Set the npm configuration variable python:
2023-01-04T15:17:18.746Z [err] npm ERR! gyp ERR! find Python npm config set python "/path/to/pythonexecutable"
2023-01-04T15:17:18.746Z [err] npm ERR! gyp ERR! find Python For more information consult the documentation at:
2023-01-04T15:17:18.746Z [err] npm ERR! gyp ERR! find Python https://github.com/nodejs/node-gyp#installation
2023-01-04T15:17:18.746Z [err] npm ERR! gyp ERR! find Python **********************************************************
2023-01-04T15:17:18.746Z [err] npm ERR! gyp ERR! find Python
2023-01-04T15:17:18.746Z [err] npm ERR! gyp ERR! configure error
2023-01-04T15:17:18.746Z [err] npm ERR! gyp ERR! stack Error: Could not find any Python installation to use
2023-01-04T15:17:18.746Z [err] npm ERR! gyp ERR! stack at PythonFinder.fail (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/find-python.js:330:47)
2023-01-04T15:17:18.746Z [err] npm ERR! gyp ERR! stack at PythonFinder.runChecks (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/find-python.js:159:21)
2023-01-04T15:17:18.746Z [err] npm ERR! gyp ERR! stack at PythonFinder.<anonymous> (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/find-python.js:202:16)
2023-01-04T15:17:18.746Z [err] npm ERR! gyp ERR! stack at PythonFinder.execFileCallback (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/find-python.js:294:16)
2023-01-04T15:17:18.746Z [err] npm ERR! gyp ERR! stack at exithandler (node:child_process:420:5)
2023-01-04T15:17:18.746Z [err] npm ERR! gyp ERR! stack at ChildProcess.errorhandler (node:child_process:432:5)
2023-01-04T15:17:18.746Z [err] npm ERR! gyp ERR! stack at ChildProcess.emit (node:events:513:28)
2023-01-04T15:17:18.746Z [err] npm ERR! gyp ERR! stack at ChildProcess._handle.onexit (node:internal/child_process:289:12)
2023-01-04T15:17:18.746Z [err] npm ERR! gyp ERR! stack at onErrorNT (node:internal/child_process:476:16)
2023-01-04T15:17:18.746Z [err] npm ERR! gyp ERR! stack at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
2023-01-04T15:17:18.746Z [err] npm ERR! gyp ERR! System Linux 5.15.76-v8
2023-01-04T15:17:18.746Z [err] npm ERR! gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
2023-01-04T15:17:18.746Z [err] npm ERR! gyp ERR! cwd /config/node-red/node_modules/@serialport/bindings
2023-01-04T15:17:18.746Z [err] npm ERR! gyp ERR! node -v v18.12.1
2023-01-04T15:17:18.746Z [err] npm ERR! gyp ERR! node-gyp -v v9.3.0
2023-01-04T15:17:18.746Z [err] npm ERR! gyp ERR! not ok
2023-01-04T15:17:18.746Z [err]
2023-01-04T15:17:18.746Z [err] npm ERR! A complete log of this run can be found in:
2023-01-04T15:17:18.746Z [err] npm ERR! /root/.npm/_logs/2023-01-04T15_16_59_398Z-debug-0.log
2023-01-04T15:17:18.785Z rc=1
-----------------------------------------------------------
2023-01-04T15:19:15.713Z Installieren : node-red-contrib-smartmeter 0.6.3
2023-01-04T15:19:06.417Z npm install --no-audit --no-update-notifier --no-fund --save --save-prefix=~ --production --engine-strict [email protected]
2023-01-04T15:19:08.547Z [err] npm
2023-01-04T15:19:08.549Z [err] WARN
2023-01-04T15:19:08.549Z [err] config production Use `--omit=dev` instead.
2023-01-04T15:19:15.414Z [err] npm
2023-01-04T15:19:15.415Z [err] WARN deprecated [email protected]: this library is no longer supported
2023-01-04T15:19:15.640Z [err] npm
2023-01-04T15:19:15.640Z [err] WARN deprecated [email protected]: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
2023-01-04T15:19:15.716Z [err] npm
2023-01-04T15:19:15.717Z [err] WARN
2023-01-04T15:19:15.717Z [err]
2023-01-04T15:19:15.718Z [err] deprecated [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142
2023-01-04T15:19:17.984Z [err] npm ERR!
2023-01-04T15:19:17.985Z [err] code 1
2023-01-04T15:19:17.985Z [err] npm ERR! path /config/node-red/node_modules/@serialport/bindings
2023-01-04T15:19:17.990Z [err] npm ERR!
2023-01-04T15:19:17.991Z [err] command failed
2023-01-04T15:19:17.991Z [err] npm ERR! command sh -c prebuild-install --tag-prefix @serialport/bindings@ || node-gyp rebuild
2023-01-04T15:19:17.991Z [err] npm ERR!
2023-01-04T15:19:17.992Z [err] prebuild-install warn install No prebuilt binaries found (target=18.12.1 runtime=node arch=arm64 libc=musl platform=linux)
2023-01-04T15:19:17.993Z [err] npm ERR! gyp info it worked if it ends with ok
2023-01-04T15:19:17.993Z [err] npm ERR! gyp info using [email protected]
2023-01-04T15:19:17.993Z [err] npm ERR! gyp info using [email protected] | linux | arm64
2023-01-04T15:19:17.993Z [err] npm ERR!
2023-01-04T15:19:17.993Z [err] gyp ERR! find Python
2023-01-04T15:19:17.993Z [err] npm ERR! gyp ERR! find Python checking Python explicitly set from command line or npm configuration
2023-01-04T15:19:17.993Z [err] npm ERR! gyp ERR! find Python - "--python=" or "npm config get python" is "/usr/bin/python3"
2023-01-04T15:19:17.993Z [err] npm ERR! gyp ERR! find Python - "/usr/bin/python3" is not in PATH or produced an error
2023-01-04T15:19:17.993Z [err] npm ERR! gyp ERR! find Python Python is not set from environment variable PYTHON
2023-01-04T15:19:17.993Z [err] npm
2023-01-04T15:19:17.994Z [err] ERR! gyp ERR! find Python checking if "python3" can be used
2023-01-04T15:19:17.994Z [err] npm ERR! gyp ERR! find Python - "python3" is not in PATH or produced an error
2023-01-04T15:19:17.994Z [err] npm ERR! gyp ERR! find Python checking if "python" can be used
2023-01-04T15:19:17.994Z [err] npm
2023-01-04T15:19:17.994Z [err] ERR! gyp ERR! find Python - "python" is not in PATH or produced an error
2023-01-04T15:19:17.994Z [err] npm ERR! gyp ERR! find Python
2023-01-04T15:19:17.994Z [err] npm ERR!
2023-01-04T15:19:17.994Z [err] gyp ERR! find Python **********************************************************
2023-01-04T15:19:17.994Z [err] npm ERR! gyp ERR! find Python You need to install the latest version of Python.
2023-01-04T15:19:17.994Z [err] npm ERR! gyp ERR! find Python Node-gyp should be able to find and use Python. If not,
2023-01-04T15:19:17.994Z [err] npm ERR! gyp ERR! find Python you can try one of the following options:
2023-01-04T15:19:17.994Z [err] npm
2023-01-04T15:19:18.005Z [err] ERR! gyp ERR! find Python - Use the switch --python="/path/to/pythonexecutable"
2023-01-04T15:19:18.005Z [err] npm
2023-01-04T15:19:18.005Z [err] ERR! gyp ERR! find Python (accepted by both node-gyp and npm)
2023-01-04T15:19:18.005Z [err] npm ERR! gyp ERR! find Python - Set the environment variable PYTHON
2023-01-04T15:19:18.005Z [err] npm ERR! gyp ERR! find Python - Set the npm configuration variable python:
2023-01-04T15:19:18.005Z [err] npm ERR! gyp ERR! find Python npm config set python "/path/to/pythonexecutable"
2023-01-04T15:19:18.005Z [err] npm
2023-01-04T15:19:18.005Z [err] ERR! gyp ERR! find Python For more information consult the documentation at:
2023-01-04T15:19:18.005Z [err] npm ERR! gyp ERR! find Python https://github.com/nodejs/node-gyp#installation
2023-01-04T15:19:18.005Z [err] npm ERR! gyp ERR! find Python **********************************************************
2023-01-04T15:19:18.006Z [err] npm ERR! gyp ERR! find Python
2023-01-04T15:19:18.006Z [err] npm ERR! gyp ERR! configure error
2023-01-04T15:19:18.006Z [err] npm
2023-01-04T15:19:18.006Z [err] ERR! gyp ERR! stack Error: Could not find any Python installation to use
2023-01-04T15:19:18.006Z [err] npm ERR! gyp ERR! stack at PythonFinder.fail (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/find-python.js:330:47)
2023-01-04T15:19:18.006Z [err] npm
2023-01-04T15:19:18.006Z [err] ERR! gyp ERR! stack at PythonFinder.runChecks (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/find-python.js:159:21)
2023-01-04T15:19:18.006Z [err] npm ERR! gyp ERR! stack at PythonFinder.<anonymous> (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/find-python.js:202:16)
2023-01-04T15:19:18.006Z [err] npm
2023-01-04T15:19:18.006Z [err] ERR! gyp ERR! stack at PythonFinder.execFileCallback (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/find-python.js:294:16)
2023-01-04T15:19:18.006Z [err] npm ERR! gyp ERR! stack at exithandler (node:child_process:420:5)
2023-01-04T15:19:18.006Z [err] npm
2023-01-04T15:19:18.006Z [err] ERR! gyp ERR! stack at ChildProcess.errorhandler (node:child_process:432:5)
2023-01-04T15:19:18.006Z [err] npm ERR! gyp ERR! stack at ChildProcess.emit (node:events:513:28)
2023-01-04T15:19:18.006Z [err] npm
2023-01-04T15:19:18.007Z [err] ERR! gyp ERR! stack at ChildProcess._handle.onexit (node:internal/child_process:289:12)
2023-01-04T15:19:18.007Z [err] npm ERR! gyp ERR! stack at onErrorNT (node:internal/child_process:476:16)
2023-01-04T15:19:18.007Z [err] npm ERR! gyp ERR! stack at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
2023-01-04T15:19:18.007Z [err] npm ERR!
2023-01-04T15:19:18.007Z [err] gyp ERR! System Linux 5.15.76-v8
2023-01-04T15:19:18.007Z [err] npm ERR! gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
2023-01-04T15:19:18.007Z [err] npm ERR!
2023-01-04T15:19:18.007Z [err] gyp ERR! cwd /config/node-red/node_modules/@serialport/bindings
2023-01-04T15:19:18.007Z [err] npm ERR! gyp ERR! node -v v18.12.1
2023-01-04T15:19:18.007Z [err] npm ERR!
2023-01-04T15:19:18.007Z [err] gyp ERR! node-gyp -v v9.3.0
2023-01-04T15:19:18.007Z [err] npm ERR! gyp ERR! not ok
2023-01-04T15:19:18.016Z [err]
2023-01-04T15:19:18.017Z [err] npm ERR! A complete log of this run can be found in:
2023-01-04T15:19:18.018Z [err] npm ERR! /root/.npm/_logs/2023-01-04T15_19_08_401Z-debug-0.log
2023-01-04T15:19:18.063Z rc=1
I was asking for a friend and he confirmed that it works now. Thanks @smarthome356!
@parkkralle you need to install the dependencies mentioned above via your Node-RED add-on configuration. In my opinion the easiest way is to switch to yaml-view (the three dots in the upper right corner) and insert these lines:
npm_packages:
- nan
- serialport
- node-red-contrib-smartmeter
system_packages:
- python3
- make
- gcc
- g++
- linux-headers
The configuration of the sensor looks correct, but I am not sure what Transport setting should be. Can you confirm that the USB sensor is connected to USB0 under HA Settings->System->Hardware->All Hardware (3 dots top right)? Did you check using SSH that the sensor sends data?
Also make sure the sensor is oriented correctly. There is a send/recieve “bulb” on the IR sensor as well as your energy meter. Check that they are lined up (I had this issue )
as an absolute beginner I might ask stupid questions, but were exactly do I have to include the mentioned lines?
In the configuration.yaml of home assistant?
you will have to add those lines to the add-on configuration. Navigate to your Node-RED add-on, select configuration in the top menu, hit the three dots in the upper right corner and switch to yaml.
Excelsior!!!
After implementing all the NPM and System packages, i was able to install node-red-contrib-smartmeter.
1000 Thanks to you Zahnweh.
Although I now get another error ( smartmeter-obis error: Error: No or too long answer from Serial Device after last request) and have absolutely no clue how to solve, it still feels like victory after 4 months and lots of long nights searching for a way to get my IR Sensor talking to HA.
Fired up by this incredible good “excelsior” feeling Zahnweh’s help has given me, I am no longer to proud and stubborn to ask for help in an earlier phase…
Has anyone an idear what I have to do next and how? After 5 hours google research and “try and error” I am open for suggestions since I would like to get this thing running prior to X-Mas