Installation woes raspbian-lite -Bluetooth-hci-socket probs


#1

Hi I have a node-red server hosted on a Pi-0-W running a full desktop version of Raspbian stretch. Node-RED was installed and subsiquently updated following the instructions on the Node-Red.org Pi page.

Now i wish to replicate the system on a raspbian-lite based system.
so i have downloaded and verified the raspbian-lite image, burnt it to an sd card,
updated and upgraded, and installed and configured my mqtt broker to autostart.
(after failure #1 i repeated the above and then installed the prerequisits and a scrip polling ble sensors, configured this and ran it to confirm BLE coms were fully up and running with success)
Then I installed Node-Red including systemd start/stop scripts as per the Node-Red.org Pi page. And once up and running i pointed a browser at Node-Red and started using the Pallet Manager to install the extra nodes that my flows use.

Here i hit problems.. On attempting to install the 'node-red-contrib-xiaomi-ble' node, it reported that it had installed, and the new node was initially available in the gui list under Bluetooth iirc.
So I copied in a small flow (18? nodes ) via the clipboard, and had failures on deployment.

After a system restart the BLE node was no longer available in the gui list and an unknown node was circled in red in its place in my flow.
I started by stopping node-red and attempting a cli npm install of the node.
This provided errors indicating a problem with bluetooth-hci-socket.
I attempted to install that and following its github readme libudev-devvia apt-get in advance.
the npm install of bluetooth-hci-socket, fell back on a recompile which raised many exceptions based on depreciated references and too ultimately failed.

Im kinda stuck now .. my googlefu has failed me and im sat in disbelief that no one else has attempted to host node red on a version of raspbian lite using the `xiaomi-ble node

i have installed and verified 2 x raspbian lite images onto 2 x 16gb sdhc cards and run into the same stumbling block.

On checking the /var/log/nodered-install.log there are many of simmilar exceptions listed as i witnessed durring my failed npm installation attempts.

Can i host node-RED on raspbiaan-Lite??

> Blockquote**************************************

Started : Sun 10 Feb 13:47:10 GMT 2019
Running for user pi at /home/pi
Failed to stop nodered.service: Unit nodered.service not loaded.
Found global nodes: :
Reading package lists...
Building dependency tree...
Reading state information...
Package 'nodered' is not installed, so not removed
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Reading package lists...
Building dependency tree...
Reading state information...
Package 'nodejs-legacy' is not installed, so not removed
Package 'npm' is not installed, so not removed
Package 'nodejs' is not installed, so not removed
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
dpkg: warning: ignoring request to remove nodejs which isn't installed
dpkg: warning: ignoring request to remove node which isn't installed
Reading package lists...
Building dependency tree...
Reading state information...
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
/usr/bin/npm -> /usr/lib/node_modules/npm/bin/npm-cli.js
/usr/bin/npx -> /usr/lib/node_modules/npm/bin/npx-cli.js

  • npm@6.7.0
    added 52 packages from 7 contributors, removed 13 packages and updated 41 packages in 169.383s
    npm WARN deprecated nodemailer@1.11.0: All versions below 4.0.1 of Nodemailer are deprecated. See https://nodemailer.com/status/
    npm WARN deprecated mailparser@0.6.2: Mailparser versions older than v2.3.0 are deprecated
    npm WARN deprecated mimelib@0.3.1: This project is unmaintained
    npm WARN deprecated mailcomposer@2.1.0: This project is unmaintained
    npm WARN deprecated buildmail@2.0.0: This project is unmaintained
    /usr/bin/node-red -> /usr/lib/node_modules/node-red/red.js
    /usr/bin/node-red-pi -> /usr/lib/node_modules/node-red/bin/node-red-pi

bcrypt@2.0.1 install /usr/lib/node_modules/node-red/node_modules/bcrypt
node-pre-gyp install --fallback-to-build

node-pre-gyp ERR! Tried to download(404): https://github.com/kelektiv/node.bcrypt.js/releases/download/v2.0.1/bcrypt_lib-v2.0.1-node-v64-linux-arm-glibc.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for bcrypt@2.0.1 and node@10.15.1 (node-v64 ABI, glibc) (falling back to source compile with node-gyp)
make: Entering directory '/usr/lib/node_modules/node-red/node_modules/bcrypt/build'
CXX(target) Release/obj.target/bcrypt_lib/src/blowfish.o
CXX(target) Release/obj.target/bcrypt_lib/src/bcrypt.o
CXX(target) Release/obj.target/bcrypt_lib/src/bcrypt_node.o
../src/bcrypt_node.cc: In function ‘char {anonymous}::ToCharVersion(v8::Localv8::String)’:
../src/bcrypt_node.cc:66:30: warning: ‘v8::String::Utf8Value::Utf8Value(v8::Localv8::Value)’ is deprecated: Use Isolate version [-Wdeprecated-declarations]
String::Utf8Value value(str);
^
In file included from /root/.node-gyp/10.15.1/include/node/v8.h:26:0,
from /root/.node-gyp/10.15.1/include/node/node.h:63,
from ../../nan/nan.h:51,
from ../src/bcrypt_node.cc:1:
/root/.node-gyp/10.15.1/include/node/v8.h:2892:28: note: declared here
explicit Utf8Value(Localv8::Value obj));
^
/root/.node-gyp/10.15.1/include/node/v8config.h:324:3: note: in definition of macro ‘V8_DEPRECATED’
declarator attribute((deprecated(message)))
^~~~~~~~~~
SOLINK_MODULE(target) Release/obj.target/bcrypt_lib.node
COPY Release/bcrypt_lib.node
COPY /usr/lib/node_modules/node-red/node_modules/bcrypt/lib/binding/bcrypt_lib.node
TOUCH Release/obj.target/action_after_build.stamp
make: Leaving directory '/usr/lib/node_modules/node-red/node_modules/bcrypt/build'

  • node-red@0.19.5
    added 396 packages from 341 contributors in 288.193s
    0.19.5
    Installing extra nodes: node-red-node-random node-red-contrib-ibm-watson-iot node-red-node-ping node-red-contrib-play-audio node-red-node-smooth node-red-node-serialport :

serialport@6.2.2 install /home/pi/.node-red/node_modules/serialport
prebuild-install || node-gyp rebuild

prebuild-install WARN install No prebuilt binaries found (target=10.15.1 runtime=node arch=arm platform=linux)
make: Entering directory '/home/pi/.node-red/node_modules/serialport/build'
CXX(target) Release/obj.target/serialport/src/serialport.o
../src/serialport.cpp: In function ‘Nan::NAN_METHOD_RETURN_TYPE Open(Nan::NAN_METHOD_ARGS_TYPE)’:
../src/serialport.cpp:41:49: warning: ‘v8::String::Utf8Value::Utf8Value(v8::Localv8::Value)’ is deprecated: Use Isolate version [-Wdeprecated-declarations]
v8::String::Utf8Value path(info[0]->ToString());
^
In file included from /home/pi/.node-gyp/10.15.1/include/node/v8.h:26:0,
from /home/pi/.node-gyp/10.15.1/include/node/node.h:63,
from ../../nan/nan.h:53,
from ../src/./serialport.h:6,
from ../src/serialport.cpp:1:
/home/pi/.node-gyp/10.15.1/include/node/v8.h:2892:28: note: declared here
explicit Utf8Value(Localv8::Value obj));
^
/home/pi/.node-gyp/10.15.1/include/node/v8config.h:324:3: note: in definition of macro ‘V8_DEPRECATED’
declarator attribute((deprecated(message)))
^~~~~~~~~~
../src/serialport.cpp:48:53: warning: ‘v8::Localv8::Object v8::Value::ToObject() const’ is deprecated: Use maybe version [-Wdeprecated-declarations]
v8::Localv8::Object options = info[1]->ToObject();
^
In file included from /home/pi/.node-gyp/10.15.1/include/node/node.h:63:0,
from ../../nan/nan.h:53,
from ../src/./serialport.h:6,
from ../src/serialport.cpp:1:
/home/pi/.node-gyp/10.15.1/include/node/v8.h:10046:15: note: declared here
Local Value::ToObject() const {
^~~~~
../src/serialport.cpp: In function ‘void EIO_AfterOpen(uv_work_t*)’:
../src/serialport.cpp:95:30: warning: ‘v8::Localv8::Value Nan::Callback::Call(int, v8::Localv8::Value) const’ is deprecated [-Wdeprecated-declarations]
data->callback.Call(2, argv);
^
In file included from ../src/./serialport.h:6:0,
from ../src/serialport.cpp:1:
../../nan/nan.h:1674:3: note: declared here
Call(int argc, v8::Localv8::Value argv[]) const {
^~~~
../src/serialport.cpp: In function ‘Nan::NAN_METHOD_RETURN_TYPE Update(Nan::NAN_METHOD_ARGS_TYPE)’:
../src/serialport.cpp:113:53: warning: ‘v8::Localv8::Object v8::Value::ToObject() const’ is deprecated: Use maybe version [-Wdeprecated-declarations]
v8::Localv8::Object options = info[1]->ToObject();
^
In file included from /home/pi/.node-gyp/10.15.1/include/node/node.h:63:0,
from ../../nan/nan.h:53,
from ../src/./serialport.h:6,
from ../src/serialport.cpp:1:
/home/pi/.node-gyp/10.15.1/include/node/v8.h:10046:15: note: declared here
Local Value::ToObject() const {
^~~~~
../src/serialport.cpp: In function ‘void EIO_AfterUpdate(uv_work_t
)’:
../src/serialport.cpp:150:30: warning: ‘v8::Localv8::Value Nan::Callback::Call(int, v8::Localv8::Value) const’ is deprecated [-Wdeprecated-declarations]
data->callback.Call(1, argv);
^
In file included from ../src/./serialport.h:6:0,
from ../src/serialport.cpp:1:
../../nan/nan.h:1674:3: note: declared here
Call(int argc, v8::Localv8::Value argv[]) const {
^~~~
../src/serialport.cpp: In function ‘void EIO_AfterClose(uv_work_t
)’:
../src/serialport.cpp:188:30: warning: ‘v8::Localv8::Value Nan::Callback::Call(int, v8::Localv8::Value) const’ is deprecated [-Wdeprecated-declarations]
data->callback.Call(1, argv);
^
In file included from ../src/./serialport.h:6:0,
from ../src/serialport.cpp:1:
../../nan/nan.h:1674:3: note: declared here
Call(int argc, v8::Localv8::Value argv[]) const {
^~~~
../src/serialport.cpp: In function ‘void EIO_AfterFlush(uv_work_t
)’:
../src/serialport.cpp:231:30: warning: ‘v8::Localv8::Value Nan::Callback::Call(int, v8::Localv8::Value) const’ is deprecated [-Wdeprecated-declarations]
data->callback.Call(1, argv);
^
In file included from ../src/./serialport.h:6:0,
from ../src/serialport.cpp:1:
../../nan/nan.h:1674:3: note: declared here
Call(int argc, v8::Localv8::Value argv[]) const {
^~~~
../src/serialport.cpp: In function ‘Nan::NAN_METHOD_RETURN_TYPE Set(Nan::NAN_METHOD_ARGS_TYPE)’:
../src/serialport.cpp:250:53: warning: ‘v8::Localv8::Object v8::Value::ToObject() const’ is deprecated: Use maybe version [-Wdeprecated-declarations]
v8::Localv8::Object options = info[1]->ToObject();
^
In file included from /home/pi/.node-gyp/10.15.1/include/node/node.h:63:0,
from ../../nan/nan.h:53,
from ../src/./serialport.h:6,
from ../src/serialport.cpp:1:
/home/pi/.node-gyp/10.15.1/include/node/v8.h:10046:15: note: declared here
Local Value::ToObject() const {
^~~~~
../src/serialport.cpp: In function ‘void EIO_AfterSet(uv_work_t
)’:
../src/serialport.cpp:285:30: warning: ‘v8::Localv8::Value Nan::Callback::Call(int, v8::Localv8::Value) const’ is deprecated [-Wdeprecated-declarations]
data->callback.Call(1, argv);
^
In file included from ../src/./serialport.h:6:0,
from ../src/serialport.cpp:1:
../../nan/nan.h:1674:3: note: declared here
Call(int argc, v8::Localv8::Value argv[]) const {
^~~~
../src/serialport.cpp: In function ‘void EIO_AfterGet(uv_work_t
)’:
../src/serialport.cpp:336:30: warning: ‘v8::Localv8::Value Nan::Callback::Call(int, v8::Localv8::Value) const’ is deprecated [-Wdeprecated-declarations]
data->callback.Call(2, argv);
^
In file included from ../src/./serialport.h:6:0,
from ../src/serialport.cpp:1:
../../nan/nan.h:1674:3: note: declared here
Call(int argc, v8::Localv8::Value argv[]) const {
^~~~
../src/serialport.cpp: In function ‘void EIO_AfterGetBaudRate(uv_work_t
)’:
../src/serialport.cpp:383:30: warning: ‘v8::Localv8::Value Nan::Callback::Call(int, v8::Localv8::Value) const’ is deprecated [-Wdeprecated-declarations]
data->callback.Call(2, argv);
^
In file included from ../src/./serialport.h:6:0,
from ../src/serialport.cpp:1:
../../nan/nan.h:1674:3: note: declared here
Call(int argc, v8::Localv8::Value argv[]) const {
^~~~
../src/serialport.cpp: In function ‘void EIO_AfterDrain(uv_work_t
)’:
../src/serialport.cpp:424:30: warning: ‘v8::Localv8::Value Nan::Callback::Call(int, v8::Localv8::Value) const’ is deprecated [-Wdeprecated-declarations]
data->callback.Call(1, argv);
^
In file included from ../src/./serialport.h:6:0,
from ../src/serialport.cpp:1:
../../nan/nan.h:1674:3: note: declared here
Call(int argc, v8::Localv8::Value argv[]) const {
^~~~
CXX(target) Release/obj.target/serialport/src/serialport_unix.o
CXX(target) Release/obj.target/serialport/src/poller.o
../src/poller.cpp: In static member function ‘static void Poller::onData(uv_poll_t
, int, int)’:
../src/poller.cpp:69:29: warning: ‘v8::Localv8::Value Nan::Callback::Call(int, v8::Localv8::Value*) const’ is deprecated [-Wdeprecated-declarations]
obj->callback.Call(2, argv);
^
In file included from ../src/poller.cpp:1:0:
../../nan/nan.h:1674:3: note: declared here
Call(int argc, v8::Localv8::Value argv[]) const {
^~~~
CXX(target) Release/obj.target/serialport/src/serialport_linux.o
SOLINK_MODULE(target) Release/obj.target/serialport.node
COPY Release/serialport.node
make: Leaving directory '/home/pi/.node-red/node_modules/serialport/build'
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN node-red-project@0.0.1 No repository field.
npm WARN node-red-project@0.0.1 No license field.

  • node-red-node-ping@0.0.16
  • node-red-contrib-ibm-watson-iot@0.2.8
  • node-red-node-random@0.1.2
  • node-red-node-serialport@0.6.8
  • node-red-contrib-play-audio@2.3.2
  • node-red-node-smooth@0.1.0
    added 273 packages from 125 contributors and audited 857 packages in 242.103s
    found 0 vulnerabilities

The user pi' is already a member ofgpio'.
Finished : Sun 10 Feb 13:47:10 GMT 2019


#2

Did you see the note on the pi install page that on minimal systems you must do
sudo apt-get install build-essential
before running the bash <(curl script?
It's not node-red.org by the way, it is nodered.org
https://nodered.org/docs/hardware/raspberrypi


#3

No, I totally overlooked that. Whoops!!
Many Thanks...


#4

Also ... the serialport build may be struggling as you are on Node v10. We are still using serialport v6 (not the latest v7) - as we currently support Node v4 still... We are dropping that in the next (0.20) release of Node-RED and at that point will update the serialport package to v7, which may help.


#5

Not the fix im afraid..

I have tried a few options including an apt-get dist-upgrade instead of the usual upgrade option.

so on top of a fresh raspbian-lite i installed used raspi-config to set up wifi, change pi pw, and enable ssh and serial coms and finally expand the f/s

ssh-ing back in over a router assigned static ip for wifi (im sure thats not relevant)
i executed

sudo apt-get update
sudo aptget-upgrade
sudo apt install -y mosquitto mosquitto-clients
sudo systemctl enable mosquitto.service
sudo apt-get install build-essential
bash <(curl -sL https://raw.githubusercontent.com/node-red/raspbian-deb-package/master/resources/update-nodejs-and-nodered)

I will attach the full nodered-install.log file but i suspect a lot of the text in that is the result of cascading problems form something indicated early on??

Started : Sun 10 Feb 18:31:26 GMT 2019
Running for user pi at /home/pi
Failed to stop nodered.service: Unit nodered.service not loaded.
Found global nodes:   :
Reading package lists...
Building dependency tree...
Reading state information...
Package 'nodered' is not installed, so not removed
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Reading package lists...
Building dependency tree...
Reading state information...
Package 'nodejs-legacy' is not installed, so not removed
Package 'npm' is not installed, so not removed
Package 'nodejs' is not installed, so not removed
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
dpkg: warning: ignoring request to remove nodejs which isn't installed
dpkg: warning: ignoring request to remove node which isn't installed
Reading package lists...
Building dependency tree...
Reading state information...
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
/usr/bin/npm -> /usr/lib/node_modules/npm/bin/npm-cli.js
/usr/bin/npx -> /usr/lib/node_modules/npm/bin/npx-cli.js
+ npm@6.7.0
added 52 packages from 7 contributors, removed 13 packages and updated 41 packages in 200.02s
npm WARN deprecated mailparser@0.6.2: Mailparser versions older than v2.3.0 are deprecated
npm WARN deprecated nodemailer@1.11.0: All versions below 4.0.1 of Nodemailer are deprecated. See https://nodemailer.com/status/
npm WARN deprecated mimelib@0.3.1: This project is unmaintained
npm WARN deprecated mailcomposer@2.1.0: This project is unmaintained
npm WARN deprecated buildmail@2.0.0: This project is unmaintained
/usr/bin/node-red -> /usr/lib/node_modules/node-red/red.js
/usr/bin/node-red-pi -> /usr/lib/node_modules/node-red/bin/node-red-pi

> bcrypt@2.0.1 install /usr/lib/node_modules/node-red/node_modules/bcrypt
> node-pre-gyp install --fallback-to-build

node-pre-gyp ERR! Tried to download(404): https://github.com/kelektiv/node.bcrypt.js/releases/download/v2.0.1/bcrypt_lib-v2.0.1-node-v64-linux-arm-glibc.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for bcrypt@2.0.1 and node@10.15.1 (node-v64 ABI, glibc) (falling back to source compile with node-gyp)
.
.

So Ive tried to install Node v10.15.1 Npm 6.7.0 with Node-Red core 0.19.5
onto raspbian-lite
.

Any suggestions as to what versions of Node Npm and or components i should be using??
and how to get that done would be appreciated..nodered-install-log.txt (3.8 KB)


#6

The log seems to say that it installed OK... bcrypt is an optional module so not a problem...
the final

+ node-red@0.19.5
added 396 packages from 341 contributors in 342.462s
0.19.5

doesn't report an error - so I think its installed OK. (so far)


#7

Perhaps But as soon as i start to install the nodes i am using in the full desktop version of raspbian hosting the same version of node red 0.19.5
The nodes fail, NPM installs result in an audit report indicating npm debug needs upgrading but atempts to do so result in the same error cycle..
Gui installs result in the node not present in the palette and in the palette manager the entry has a 'stop/warning' triangle icon

installations and fix attempts all seem to cycle back to the same result, a prompt to run npmaudit fix to rectify 3 problems. 1 attempt fails leaving an nmp audit report

sorry about formatting..

┌──────────────────────────────────────────────────────────────────────────────┐
│                                Manual Review                                 │
│            Some vulnerabilities require your attention to resolve            │
│                                                                              │
│         Visit https://go.npm.me/audit-guide for additional guidance          │
└──────────────────────────────────────────────────────────────────────────────┘
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ Low           │ Regular Expression Denial of Service                         │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package       │ debug                                                        │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in    │ >= 2.6.9 < 3.0.0 || >= 3.1.0                                 │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ node-red-contrib-xiaomi-ble                                  │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path          │ node-red-contrib-xiaomi-ble > noble > debug                  │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info     │ https://npmjs.com/advisories/534                             │
└───────────────┴──────────────────────────────────────────────────────────────┘
found 1 low severity vulnerability in 114 scanned packages

an npm list does show a debug v2.0 installed under the Xiaomi-ble node lower in the list but higher on the 'branches' than the versions 2.9.6 embedded deeper in the nodes structure.

Im now running the full desktop raspbian system on the device as that at least works and can continue to log the temperatures.. I can slip the Lite sd card back in to determina any further details..


#8

posted in error


#9

I am still going round in circles here..
Having tracked the problem down to the nobel sources https://github.com/noble/noble I have ensured all its dependencies have been installed,
belt n braces..
git clone https://github.com/noble/node-bluetooth-hci-socket.git
cd ./node-bluetooth-hci-socket.git
sudo npm install
rm -fR ~/node-bluetooth-hci-socket

And still the same error on attmpting to install the node-red-contrib-xiaomi-ble node which boils down to the debug element of the nobel package. (forgive me if i am using the wrong nomenclature as i am learning as i go here..

I seem to have 2 versions installed as indicated by this section of the npm list output

├─┬ node-red-contrib-xiaomi-ble@1.2.3
│ └─┬ noble@1.9.1
│ ├─┬ UNMET OPTIONAL DEPENDENCY bluetooth-hci-socket@0.5.1
│ │ ├─┬ UNMET OPTIONAL DEPENDENCY debug@2.6.9
│ │ │ └── UNMET OPTIONAL DEPENDENCY ms@2.0.0
│ │ ├── nan@2.12.1 deduped
│ │ └── usb@1.5.0 deduped
│ ├── bplist-parser@0.0.6
│ ├─┬ debug@2.2.0
│ │ └── ms@0.7.1
│ └─┬ UNMET OPTIONAL DEPENDENCY xpc-connection@0.1.4
│ └── nan@2.12.1 dedupe

The known issue https://www.npmjs.com/advisories/534 suggests that for V2.xx installations of the debug (sub?)node V2.6.9 or above should be used, But V 2.2.0 is sat higher in the tree.

so it seems v 2.2.0 been inserted to patch the V2.6.9 failure which generates the link to the above known issue
but it seems its the failure of node.js/usb?

-pre-gyp https download
node-pre-gyp WARN Tried to download(404): https://github.com/tessel/node-usb/releases/download/1.5.0/usb_bindings-v1.5.0-node-v64-linux-arm.tar.gz
node-pre-gyp WARN Pre-built binaries not found for usb@1.5.0 and node@10.15.1 (node-v64 ABI, glibc) (falling back to source compile with node-gyp)

Am i even in the right rabbit hole ??