yes already working on, but Python is running well:
root@MC100:~# python3
Python 3.7.8 (default, Sep 06 2020, 16:19:39)
[GCC 7.5.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> print("HW")
Python 3.7.8 (default, Sep 06 2020, 16:19:39)
[GCC 7.5.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> print("HW")
root@MC100:~#
same situation
you mean change/add environment variables for PYTHON / PYTHONPATH ?
or setup a virtual environment ?
Sorry asking that stupid questions, but Linux/OpenWrt is not my first business, I'm busy enough with all the programming of PLCs, robots, VBA a.s.o.
Last project I have forwarded data from Modbus to MQTT. Now I just want to read from the Can interface and forward to MQTT. My target wasn't to programm Linux OS.
But anyway I will follow this way now
The answer of the service of the gateway was: "this nodes only able to run on older version of node red" !?!?!? That I do not believe, there for I'm here
I hadn't come across that previously, but on Ubuntu
apt show python-is-python3
suggests that it should do what is required:
"This is a convenience package which ships a symlink to point the /usr/bin/python interpreter at the current default python3"
So I suggest giving that a go. After installing then which python
which show /usr/bin/python
.
stucking on the OpenWrt side:
root@MC100:~# apt show python-is-python3
-ash: apt: not found
try to find why....
Package: python3
Version: 3.7.8-4
Depends: libc, python3-light, python3-unittest, python3-ncurses, python3-ctypes, python3-pydoc, python3-logging, python3-multiprocessing, python3-urllib, python3-xml, python3-sqlite3, python3-gdbm, python3-distutils, python3-codecs, python3-email, python3-openssl, python3-cgi, python3-cgitb, python3-dbm, python3-asyncio, python3-lzma, python3-decimal
Status: install user installed
Architecture: arm_cortex-a9_neon
Installed-Time: 1599409179
root@MC100:~# opkg status python-is-python3
root@MC100:~#
root@MC100:~# opkg install python-is-python3
Unknown package 'python-is-python3'.
Collected errors:
* opkg_install_cmd: Cannot install package python-is-python3.
root@MC100:~#
Usage: ln [OPTIONS] TARGET... LINK|DIR
Create a link LINK or DIR/TARGET to the specified TARGET(s)
-s Make symlinks instead of hardlinks
-f Remove existing destinations
-n Don't dereference symlinks - treat like normal file
-b Make a backup of the target (if exists) before link operation
-S suf Use suffix instead of ~ when making backup files
-T 2nd arg must be a DIR
-v Verbose
root@MC100:~# ln -s python /usr/bin/python3
ln: /usr/bin/python3: File exists
root@MC100:~#
You are not the only one that finds that confusing, but if you read carefully it says:
Create a LINK to the TARGET.
The first parameter is the TARGET, which is python3, the second parm is the LINK, which is python.
root@MC100:~# ln -s /usr/bin/python3 python
root@MC100:~# which python
root@MC100:~# which python3
/usr/bin/python3
Colin,
sorry for giving no feedback, but I have been on customer site the whole week.
Python problem seems to be solved, now the bcrypt installation still failed:
-----------------------------------------------------------
2021-03-27T10:26:20.065Z installieren : node-red-contrib-socketcan 1.0.11
2021-03-27T10:26:20.757Z npm install --no-audit --no-update-notifier --no-fund --save --save-prefix="~" --production [email protected]
2021-03-27T10:27:42.170Z [out]
2021-03-27T10:27:42.170Z [out] > [email protected] install /.node-red/node_modules/bcrypt
2021-03-27T10:27:42.170Z [out] > node-pre-gyp install --fallback-to-build
2021-03-27T10:27:42.170Z [out]
2021-03-27T10:27:57.530Z [err] node-pre-gyp
2021-03-27T10:27:57.533Z [err]
2021-03-27T10:27:57.541Z [err] ERR! install response status 404 Not Found on https://github.com/kelektiv/node.bcrypt.js/releases/download/v5.0.1/bcrypt_lib-v5.0.1-napi-v3-linux-arm-musl.tar.gz
2021-03-27T10:27:57.543Z [err] node-pre-gyp
2021-03-27T10:27:57.545Z [err]
2021-03-27T10:27:57.547Z [err] WARN
2021-03-27T10:27:57.549Z [err]
2021-03-27T10:27:57.563Z [err] Pre-built binaries not installable for [email protected] and [email protected] (node-v57 ABI, musl) (falling back to source compile with node-gyp)
2021-03-27T10:27:57.563Z [err] node-pre-gyp WARN Hit error response status 404 Not Found on https://github.com/kelektiv/node.bcrypt.js/releases/download/v5.0.1/bcrypt_lib-v5.0.1-napi-v3-linux-arm-musl.tar.gz
2021-03-27T10:28:23.191Z [err] gyp
2021-03-27T10:28:23.199Z [err]
2021-03-27T10:28:23.201Z [err] ERR!
2021-03-27T10:28:23.203Z [err]
2021-03-27T10:28:23.205Z [err] configure error
2021-03-27T10:28:23.207Z [err]
2021-03-27T10:28:23.246Z [err] gyp
2021-03-27T10:28:23.253Z [err] ERR! stack Error: Command failed: /usr/bin/python -c import sys; print "%s.%s.%s" % sys.version_info[:3];
2021-03-27T10:28:23.253Z [err] gyp ERR! stack
2021-03-27T10:28:23.255Z [err] File "<string>", line 1
2021-03-27T10:28:23.256Z [err] gyp
2021-03-27T10:28:23.258Z [err]
2021-03-27T10:28:23.263Z [err] ERR! stack import sys; print "%s.%s.%s" % sys.version_info[:3];
2021-03-27T10:28:23.263Z [err] gyp ERR! stack ^
2021-03-27T10:28:23.269Z [err] gyp
2021-03-27T10:28:23.271Z [err]
2021-03-27T10:28:23.273Z [err] ERR!
2021-03-27T10:28:23.283Z [err] stack SyntaxError: invalid syntax
2021-03-27T10:28:23.283Z [err] gyp ERR! stack
2021-03-27T10:28:23.283Z [err] gyp ERR! stack at ChildProcess.exithandler (child_process.js:281:12)
2021-03-27T10:28:23.283Z [err] gyp ERR! stack at emitTwo (events.js:126:13)
2021-03-27T10:28:23.283Z [err] gyp ERR! stack at ChildProcess.emit (events.js:214:7)
2021-03-27T10:28:23.283Z [err] gyp ERR!
2021-03-27T10:28:23.293Z [err]
2021-03-27T10:28:23.295Z [err] stack
2021-03-27T10:28:23.296Z [err] at maybeClose (internal/child_process.js:915:16)
2021-03-27T10:28:23.323Z [err] gyp ERR! stack at Socket.stream.socket.on (internal/child_process.js:336:11)
2021-03-27T10:28:23.323Z [err] gyp ERR! stack at emitOne (events.js:116:13)
2021-03-27T10:28:23.323Z [err] gyp ERR! stack at Socket.emit (events.js:211:7)
2021-03-27T10:28:23.323Z [err] gyp ERR! stack at Pipe._handle.close [as _onclose] (net.js:561:12)
2021-03-27T10:28:23.323Z [err] gyp ERR!
2021-03-27T10:28:23.346Z [err] System
2021-03-27T10:28:23.348Z [err] Linux 4.14.195
2021-03-27T10:28:23.350Z [err] gyp
2021-03-27T10:28:23.352Z [err]
2021-03-27T10:28:23.363Z [err] ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "--fallback-to-build" "--module=/.node-red/node_modules/bcrypt/lib/binding/napi-v3/bcrypt_lib.node" "--module_name=bcrypt_lib" "--module_path=/.node-red/node_modules/bcrypt/lib/binding/napi-v3" "--napi_version=4" "--node_abi_napi=napi" "--napi_build_version=3" "--node_napi_label=napi-v3"
2021-03-27T10:28:23.363Z [err] gyp ERR! cwd /.node-red/node_modules/bcrypt
2021-03-27T10:28:23.363Z [err] gyp ERR! node -v v8.16.1
2021-03-27T10:28:23.363Z [err] gyp ERR! node-gyp -v v3.8.0
2021-03-27T10:28:23.363Z [err] gyp ERR!
2021-03-27T10:28:23.385Z [err]
2021-03-27T10:28:23.387Z [err] not ok
2021-03-27T10:28:23.390Z [err]
2021-03-27T10:28:23.414Z [err] node-pre-gyp
2021-03-27T10:28:23.419Z [err]
2021-03-27T10:28:23.421Z [err] ERR!
2021-03-27T10:28:23.423Z [err]
2021-03-27T10:28:23.443Z [err] build error
2021-03-27T10:28:23.443Z [err] 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 configure --fallback-to-build --module=/.node-red/node_modules/bcrypt/lib/binding/napi-v3/bcrypt_lib.node --module_name=bcrypt_lib --module_path=/.node-red/node_modules/bcrypt/lib/binding/napi-v3 --napi_version=4 --node_abi_napi=napi --napi_build_version=3 --node_napi_label=napi-v3' (1)
2021-03-27T10:28:23.443Z [err] node-pre-gyp ERR! stack at ChildProcess.cmd.on (/.node-red/node_modules/@mapbox/node-pre-gyp/lib/util/compile.js:89:23)
2021-03-27T10:28:23.453Z [err] node-pre-gyp
2021-03-27T10:28:23.455Z [err]
2021-03-27T10:28:23.457Z [err] ERR!
2021-03-27T10:28:23.463Z [err] stack at emitTwo (events.js:126:13)
2021-03-27T10:28:23.463Z [err] node-pre-gyp ERR! stack at ChildProcess.emit (events.js:214:7)
2021-03-27T10:28:23.463Z [err] node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:915:16)
2021-03-27T10:28:23.465Z [err] node-pre-gyp
2021-03-27T10:28:23.466Z [err]
2021-03-27T10:28:23.468Z [err] ERR!
2021-03-27T10:28:23.470Z [err]
2021-03-27T10:28:23.472Z [err] stack at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
2021-03-27T10:28:23.481Z [err] node-pre-gyp
2021-03-27T10:28:23.483Z [err]
2021-03-27T10:28:23.485Z [err] ERR!
2021-03-27T10:28:23.493Z [err] System Linux 4.14.195
2021-03-27T10:28:23.493Z [err] node-pre-gyp ERR! command "/usr/bin/node" "/.node-red/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
2021-03-27T10:28:23.493Z [err] node-pre-gyp ERR! cwd /.node-red/node_modules/bcrypt
2021-03-27T10:28:23.498Z [err] node-pre-gyp
2021-03-27T10:28:23.500Z [err]
2021-03-27T10:28:23.503Z [err] ERR!
2021-03-27T10:28:23.514Z [err] node -v v8.16.1
2021-03-27T10:28:23.514Z [err] node-pre-gyp ERR! node-pre-gyp -v v1.0.1
2021-03-27T10:28:23.514Z [err] node-pre-gyp ERR! not ok
2021-03-27T10:28:23.521Z [out] Failed to execute '/usr/bin/node /usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/.node-red/node_modules/bcrypt/lib/binding/napi-v3/bcrypt_lib.node --module_name=bcrypt_lib --module_path=/.node-red/node_modules/bcrypt/lib/binding/napi-v3 --napi_version=4 --node_abi_napi=napi --napi_build_version=3 --node_napi_label=napi-v3' (1)
2021-03-27T10:28:30.259Z [err] npm
2021-03-27T10:28:30.261Z [err]
2021-03-27T10:28:30.263Z [err] ERR!
2021-03-27T10:28:30.273Z [err] code ELIFECYCLE
2021-03-27T10:28:30.273Z [err] npm ERR! errno 1
2021-03-27T10:28:30.286Z [err] npm
2021-03-27T10:28:30.288Z [err]
2021-03-27T10:28:30.290Z [err] ERR!
2021-03-27T10:28:30.292Z [err] [email protected] install: `node-pre-gyp install --fallback-to-build`
2021-03-27T10:28:30.303Z [err] npm ERR! Exit status 1
2021-03-27T10:28:30.303Z [err] npm ERR!
2021-03-27T10:28:30.303Z [err] npm ERR! Failed at the [email protected] install script.
2021-03-27T10:28:30.303Z [err] npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2021-03-27T10:28:30.470Z [err]
2021-03-27T10:28:30.474Z [err] npm
2021-03-27T10:28:30.475Z [err]
2021-03-27T10:28:30.483Z [err] ERR! A complete log of this run can be found in:
2021-03-27T10:28:30.483Z [err] npm ERR! /.npm/_logs/2021-03-27T10_28_30_430Z-debug.log
2021-03-27T10:28:30.573Z rc=1
kr Oliver
If you follow the link to the node's github repository you will find that it is a dead link, so presumably the node is no longer supported, which is not a good start.
I don't know why it won't install though. Whether it is worth investigating for a dead contrib node I don't know.
Not fixed on a special node, only need a node to read CanBus data from our PLC.
(canbus utils already working)
I have tried another node:
-----------------------------------------------------------
2021-03-27T11:14:55.300Z installieren : node-red-contrib-can 1.1.2
2021-03-27T11:14:55.797Z npm install --no-audit --no-update-notifier --no-fund --save --save-prefix="~" --production [email protected]
2021-03-27T11:15:34.827Z [out]
2021-03-27T11:15:34.827Z [out] > [email protected] install /.node-red/node_modules/socketcan
2021-03-27T11:15:34.827Z [out] > node-gyp rebuild
2021-03-27T11:15:34.827Z [out]
2021-03-27T11:15:45.943Z [err] gyp
2021-03-27T11:15:45.949Z [err]
2021-03-27T11:15:45.951Z [err] ERR!
2021-03-27T11:15:45.953Z [err]
2021-03-27T11:15:45.955Z [err] configure error
2021-03-27T11:15:45.957Z [err]
2021-03-27T11:15:45.971Z [err] gyp
2021-03-27T11:15:45.973Z [err]
2021-03-27T11:15:45.975Z [err] ERR!
2021-03-27T11:15:45.977Z [err]
2021-03-27T11:15:45.985Z [err] stack Error: Command failed: /usr/bin/python -c import sys; print "%s.%s.%s" % sys.version_info[:3];
2021-03-27T11:15:45.985Z [err] gyp ERR! stack File "<string>", line 1
2021-03-27T11:15:45.985Z [err] gyp ERR! stack import sys; print "%s.%s.%s" % sys.version_info[:3];
2021-03-27T11:15:45.985Z [err] gyp ERR!
2021-03-27T11:15:46.015Z [err]
2021-03-27T11:15:46.017Z [err] stack
2021-03-27T11:15:46.025Z [err] ^
2021-03-27T11:15:46.025Z [err] gyp ERR! stack SyntaxError: invalid syntax
2021-03-27T11:15:46.025Z [err] gyp ERR! stack
2021-03-27T11:15:46.025Z [err] gyp ERR! stack at ChildProcess.exithandler (child_process.js:281:12)
2021-03-27T11:15:46.025Z [err] gyp ERR!
2021-03-27T11:15:46.026Z [err] stack
2021-03-27T11:15:46.028Z [err] at emitTwo (events.js:126:13)
2021-03-27T11:15:46.030Z [err] gyp
2021-03-27T11:15:46.031Z [err]
2021-03-27T11:15:46.045Z [err] ERR! stack at ChildProcess.emit (events.js:214:7)
2021-03-27T11:15:46.045Z [err] gyp ERR! stack at maybeClose (internal/child_process.js:915:16)
2021-03-27T11:15:46.045Z [err] gyp ERR! stack at Socket.stream.socket.on (internal/child_process.js:336:11)
2021-03-27T11:15:46.045Z [err] gyp ERR! stack at emitOne (events.js:116:13)
2021-03-27T11:15:46.045Z [err] gyp ERR! stack at Socket.emit (events.js:211:7)
2021-03-27T11:15:46.045Z [err] gyp ERR! stack at Pipe._handle.close [as _onclose] (net.js:561:12)
2021-03-27T11:15:46.045Z [err] gyp
2021-03-27T11:15:46.047Z [err]
2021-03-27T11:15:46.048Z [err] ERR!
2021-03-27T11:15:46.050Z [err]
2021-03-27T11:15:46.052Z [err] System
2021-03-27T11:15:46.065Z [err] Linux 4.14.195
2021-03-27T11:15:46.065Z [err] gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
2021-03-27T11:15:46.065Z [err] gyp ERR! cwd /.node-red/node_modules/socketcan
2021-03-27T11:15:46.065Z [err] gyp ERR! node -v v8.16.1
2021-03-27T11:15:46.065Z [err] gyp ERR! node-gyp -v v3.8.0
2021-03-27T11:15:46.065Z [err] gyp ERR! not ok
2021-03-27T11:15:46.977Z [err] npm
2021-03-27T11:15:46.980Z [err]
2021-03-27T11:15:46.982Z [err] ERR!
2021-03-27T11:15:46.983Z [err]
2021-03-27T11:15:46.995Z [err] code ELIFECYCLE
2021-03-27T11:15:46.995Z [err] npm ERR! errno 1
2021-03-27T11:15:47.007Z [err] npm
2021-03-27T11:15:47.009Z [err]
2021-03-27T11:15:47.010Z [err] ERR!
2021-03-27T11:15:47.013Z [err] [email protected] install: `node-gyp rebuild`
2021-03-27T11:15:47.025Z [err] npm ERR! Exit status 1
2021-03-27T11:15:47.025Z [err] npm ERR!
2021-03-27T11:15:47.025Z [err] npm ERR! Failed at the [email protected] install script.
2021-03-27T11:15:47.025Z [err] npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2021-03-27T11:15:47.092Z [err]
2021-03-27T11:15:47.095Z [err] npm
2021-03-27T11:15:47.097Z [err]
2021-03-27T11:15:47.098Z [err] ERR!
2021-03-27T11:15:47.105Z [err] A complete log of this run can be found in:
2021-03-27T11:15:47.105Z [err] npm ERR! /.npm/_logs/2021-03-27T11_15_47_056Z-debug.log
2021-03-27T11:15:47.143Z rc=1