Giter VIP home page Giter VIP logo

Comments (9)

XxXCobraXxX avatar XxXCobraXxX commented on August 10, 2024 2

@moFries
i have the solution:

Go to the "modules/MMM-DHT-Sensor/" Folder and edit the "package.json" file as follow

replace the line #14

"postinstall": "node_modules/.bin/electron-rebuild -e ../../node_modules/electron-prebuilt"

with this line:

"postinstall": "node_modules/.bin/electron-rebuild -e ../../node_modules/electron"

and then do npm install

Another problem was that the module don't have permissions to read the values from dev/mem.

The solution for this is that you have to run MagigMirror as root

I use pm2 and have only changed the mm.sh script (added sudo command) as follows:

cd ~/MagicMirror
DISPLAY=:0 sudo npm start

from mmm-dht-sensor.

moFries avatar moFries commented on August 10, 2024 1

@XxXCobraXxX

Thx, it also works for me. But I didn't do sudo for the MM. I think it's better to do this to give the MM access to the GPIO:
sudo usermod -a -G gpio pi

from mmm-dht-sensor.

XxXCobraXxX avatar XxXCobraXxX commented on August 10, 2024

Same errors here :-(

Can anyone help us please?

from mmm-dht-sensor.

XxXCobraXxX avatar XxXCobraXxX commented on August 10, 2024

@moFries
that's right. MM with root permission are sure not a good solution.

I have deleted the sudo again from mm.sh, entered your line in the terminal and pm2 fails again with the permission from dev/mem.

Do you or anyone else have any idea?

Thx in advance

from mmm-dht-sensor.

ezar avatar ezar commented on August 10, 2024

Same here!
Help please.
Regards,

from mmm-dht-sensor.

ezar avatar ezar commented on August 10, 2024

roland-vachter/rpi-dht-sensor#2

from mmm-dht-sensor.

qwqoffice avatar qwqoffice commented on August 10, 2024

@XxXCobraXxX I have added sudo to mm.sh, but the MagicMirror is no longer start success

1|mm       | Invalid MIT-MAGIC-COOKIE-1 key
1|mm       | npm
1|mm       |  ERR! Linux 4.9.59-v7+
1|mm       | npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "start"
1|mm       | npm
1|mm       |  ERR! node v6.13.0
1|mm       | npm ERR! npm  v3.10.10
1|mm       | npm ERR! code ELIFECYCLE
1|mm       | npm ERR! [email protected] start: `sh run-start.sh`
1|mm       | npm ERR!
1|mm       |  Exit status 1
1|mm       | npm ERR!
1|mm       | npm ERR! Failed at the [email protected] start script 'sh run-start.sh'.
1|mm       | npm
1|mm       |  ERR! Make sure you have the latest version of node.js and npm installed.
1|mm       | npm ERR! If you do, this is most likely a problem with the magicmirror package,
1|mm       | npm ERR!
1|mm       |  not with npm itself.
1|mm       | npm ERR! Tell the author that this fails on your system:
1|mm       | npm ERR!     sh run-start.sh
1|mm       | npm
1|mm       |  ERR! You can get information on how to open an issue for this project with:
1|mm       | npm ERR!     npm bugs magicmirror
1|mm       | npm ERR! Or if that isn't available, you can get their info via:
1|mm       | npm ERR!     npm owner ls magicmirror
1|mm       | npm ERR! There is likely additional logging output above.
1|mm       | npm ERR! Please include the following file with any support request:
1|mm       | npm ERR!     /home/pi/MagicMirror/npm-debug.log

from mmm-dht-sensor.

ArnoStrasbourg avatar ArnoStrasbourg commented on August 10, 2024

Hi there,

I had the same issue (electron-rebuild)
After changing in package.json electron-rebuild with electron I had another issue :

electron-rebuild -e ../../node_modules/electron

✖ Rebuild Failed

An unhandled error occurred inside electron-rebuild
make : on entre dans le répertoire « /home/pi/MagicMirror/modules/MMM-DHT-Sensor/node_modules/rpi-dht-sensor/build »
CC(target) Release/obj.target/node_dht_sensor/src/bcm2835.o
CXX(target) Release/obj.target/node_dht_sensor/src/node-dht-sensor.o
In file included from /home/pi/.electron-gyp/8.5.3/include/node/node.h:63,
from ../src/node-dht-sensor.cpp:1:
/home/pi/.electron-gyp/8.5.3/include/node/v8.h:8923:75: warning: ‘MicrotasksCompletedCallback’ is deprecated [-Wdeprecated-declarations]
void AddMicrotasksCompletedCallback(MicrotasksCompletedCallback callback);
^
/home/pi/.electron-gyp/8.5.3/include/node/v8.h:8931:78: warning: ‘MicrotasksCompletedCallback’ is deprecated [-Wdeprecated-declarations]
void RemoveMicrotasksCompletedCallback(MicrotasksCompletedCallback callback);
^
../src/node-dht-sensor.cpp: In function ‘int initialize()’:
../src/node-dht-sensor.cpp:189:23: error: too few arguments to function ‘int bcm2835_init(int)’
if (!bcm2835_init())
^
In file included from ../src/node-dht-sensor.cpp:21:
../src/bcm2835.h:1008:16: note: declared here
extern int bcm2835_init(int);
^~~~~~~~~~~~
../src/node-dht-sensor.cpp: In function ‘void Read(const Nan::FunctionCallbackInfov8::Value&)’:
../src/node-dht-sensor.cpp:228:83: error: no matching function for call to ‘v8::Object::Set(v8::Localv8::String, Nan::imp::FactoryBasev8::Number::return_t)’
readout->Set(Nan::New("humidity").ToLocalChecked(), Nan::New(humidity));
^
In file included from /home/pi/.electron-gyp/8.5.3/include/node/node.h:63,
from ../src/node-dht-sensor.cpp:1:
/home/pi/.electron-gyp/8.5.3/include/node/v8.h:3611:37: note: candidate: ‘v8::Maybe v8::Object::Set(v8::Localv8::Context, v8::Localv8::Value, v8::Localv8::Value)’
V8_WARN_UNUSED_RESULT Maybe Set(Local context,
^~~
/home/pi/.electron-gyp/8.5.3/include/node/v8.h:3611:37: note: candidate expects 3 arguments, 2 provided
/home/pi/.electron-gyp/8.5.3/include/node/v8.h:3614:37: note: candidate: ‘v8::Maybe v8::Object::Set(v8::Localv8::Context, uint32_t, v8::Localv8::Value)’
V8_WARN_UNUSED_RESULT Maybe Set(Local context, uint32_t index,
^~~
/home/pi/.electron-gyp/8.5.3/include/node/v8.h:3614:37: note: candidate expects 3 arguments, 2 provided
../src/node-dht-sensor.cpp:229:89: error: no matching function for call to ‘v8::Object::Set(v8::Localv8::String, Nan::imp::FactoryBasev8::Number::return_t)’
readout->Set(Nan::New("temperature").ToLocalChecked(), Nan::New(temperature));
^
In file included from /home/pi/.electron-gyp/8.5.3/include/node/node.h:63,
from ../src/node-dht-sensor.cpp:1:
/home/pi/.electron-gyp/8.5.3/include/node/v8.h:3611:37: note: candidate: ‘v8::Maybe v8::Object::Set(v8::Localv8::Context, v8::Localv8::Value, v8::Localv8::Value)’
V8_WARN_UNUSED_RESULT Maybe Set(Local context,
^~~
/home/pi/.electron-gyp/8.5.3/include/node/v8.h:3611:37: note: candidate expects 3 arguments, 2 provided
/home/pi/.electron-gyp/8.5.3/include/node/v8.h:3614:37: note: candidate: ‘v8::Maybe v8::Object::Set(v8::Localv8::Context, uint32_t, v8::Localv8::Value)’
V8_WARN_UNUSED_RESULT Maybe Set(Local context, uint32_t index,
^~~
/home/pi/.electron-gyp/8.5.3/include/node/v8.h:3614:37: note: candidate expects 3 arguments, 2 provided
../src/node-dht-sensor.cpp:230:86: error: no matching function for call to ‘v8::Object::Set(v8::Localv8::String, Nan::imp::FactoryBasev8::Boolean::return_t)’
readout->Set(Nan::New("isValid").ToLocalChecked(), Nan::New(result == 0));
^
In file included from /home/pi/.electron-gyp/8.5.3/include/node/node.h:63,
from ../src/node-dht-sensor.cpp:1:
/home/pi/.electron-gyp/8.5.3/include/node/v8.h:3611:37: note: candidate: ‘v8::Maybe v8::Object::Set(v8::Localv8::Context, v8::Localv8::Value, v8::Localv8::Value)’
V8_WARN_UNUSED_RESULT Maybe Set(Local context,
^~~
/home/pi/.electron-gyp/8.5.3/include/node/v8.h:3611:37: note: candidate expects 3 arguments, 2 provided
/home/pi/.electron-gyp/8.5.3/include/node/v8.h:3614:37: note: candidate: ‘v8::Maybe v8::Object::Set(v8::Localv8::Context, uint32_t, v8::Localv8::Value)’
V8_WARN_UNUSED_RESULT Maybe Set(Local context, uint32_t index,
^~~
/home/pi/.electron-gyp/8.5.3/include/node/v8.h:3614:37: note: candidate expects 3 arguments, 2 provided
../src/node-dht-sensor.cpp:231:82: error: no matching function for call to ‘v8::Object::Set(v8::Localv8::String, Nan::imp::FactoryBasev8::Number::return_t)’
readout->Set(Nan::New("errors").ToLocalChecked(), Nan::New(2 - retry));
^
In file included from /home/pi/.electron-gyp/8.5.3/include/node/node.h:63,
from ../src/node-dht-sensor.cpp:1:
/home/pi/.electron-gyp/8.5.3/include/node/v8.h:3611:37: note: candidate: ‘v8::Maybe v8::Object::Set(v8::Localv8::Context, v8::Localv8::Value, v8::Localv8::Value)’
V8_WARN_UNUSED_RESULT Maybe Set(Local context,
^~~
/home/pi/.electron-gyp/8.5.3/include/node/v8.h:3611:37: note: candidate expects 3 arguments, 2 provided
/home/pi/.electron-gyp/8.5.3/include/node/v8.h:3614:37: note: candidate: ‘v8::Maybe v8::Object::Set(v8::Localv8::Context, uint32_t, v8::Localv8::Value)’
V8_WARN_UNUSED_RESULT Maybe Set(Local context, uint32_t index,
^~~
/home/pi/.electron-gyp/8.5.3/include/node/v8.h:3614:37: note: candidate expects 3 arguments, 2 provided
../src/node-dht-sensor.cpp: In function ‘void ReadSpec(const Nan::FunctionCallbackInfov8::Value&)’:
../src/node-dht-sensor.cpp:242:43: warning: ‘uint32_t v8::Value::Uint32Value() const’ is deprecated: Use maybe version [-Wdeprecated-declarations]
int sensorType = args[0]->Uint32Value();
^
In file included from /home/pi/.electron-gyp/8.5.3/include/node/node.h:63,
from ../src/node-dht-sensor.cpp:1:
/home/pi/.electron-gyp/8.5.3/include/node/v8.h:2818:47: note: declared here
V8_DEPRECATED("Use maybe version") uint32_t Uint32Value() const;
^~~~~~~~~~~
../src/node-dht-sensor.cpp:256:37: warning: ‘uint32_t v8::Value::Uint32Value() const’ is deprecated: Use maybe version [-Wdeprecated-declarations]
int gpio = args[1]->Uint32Value();
^
In file included from /home/pi/.electron-gyp/8.5.3/include/node/node.h:63,
from ../src/node-dht-sensor.cpp:1:
/home/pi/.electron-gyp/8.5.3/include/node/v8.h:2818:47: note: declared here
V8_DEPRECATED("Use maybe version") uint32_t Uint32Value() const;
^~~~~~~~~~~
../src/node-dht-sensor.cpp:266:83: error: no matching function for call to ‘v8::Object::Set(v8::Localv8::String, Nan::imp::FactoryBasev8::Number::return_t)’
readout->Set(Nan::New("humidity").ToLocalChecked(), Nan::New(humidity));
^
In file included from /home/pi/.electron-gyp/8.5.3/include/node/node.h:63,
from ../src/node-dht-sensor.cpp:1:
/home/pi/.electron-gyp/8.5.3/include/node/v8.h:3611:37: note: candidate: ‘v8::Maybe v8::Object::Set(v8::Localv8::Context, v8::Localv8::Value, v8::Localv8::Value)’
V8_WARN_UNUSED_RESULT Maybe Set(Local context,
^~~
/home/pi/.electron-gyp/8.5.3/include/node/v8.h:3611:37: note: candidate expects 3 arguments, 2 provided
/home/pi/.electron-gyp/8.5.3/include/node/v8.h:3614:37: note: candidate: ‘v8::Maybe v8::Object::Set(v8::Localv8::Context, uint32_t, v8::Localv8::Value)’
V8_WARN_UNUSED_RESULT Maybe Set(Local context, uint32_t index,
^~~
/home/pi/.electron-gyp/8.5.3/include/node/v8.h:3614:37: note: candidate expects 3 arguments, 2 provided
../src/node-dht-sensor.cpp:267:89: error: no matching function for call to ‘v8::Object::Set(v8::Localv8::String, Nan::imp::FactoryBasev8::Number::return_t)’
readout->Set(Nan::New("temperature").ToLocalChecked(), Nan::New(temperature));
^
In file included from /home/pi/.electron-gyp/8.5.3/include/node/node.h:63,
from ../src/node-dht-sensor.cpp:1:
/home/pi/.electron-gyp/8.5.3/include/node/v8.h:3611:37: note: candidate: ‘v8::Maybe v8::Object::Set(v8::Localv8::Context, v8::Localv8::Value, v8::Localv8::Value)’
V8_WARN_UNUSED_RESULT Maybe Set(Local context,
^~~
/home/pi/.electron-gyp/8.5.3/include/node/v8.h:3611:37: note: candidate expects 3 arguments, 2 provided
/home/pi/.electron-gyp/8.5.3/include/node/v8.h:3614:37: note: candidate: ‘v8::Maybe v8::Object::Set(v8::Localv8::Context, uint32_t, v8::Localv8::Value)’
V8_WARN_UNUSED_RESULT Maybe Set(Local context, uint32_t index,
^~~
/home/pi/.electron-gyp/8.5.3/include/node/v8.h:3614:37: note: candidate expects 3 arguments, 2 provided
../src/node-dht-sensor.cpp:268:86: error: no matching function for call to ‘v8::Object::Set(v8::Localv8::String, Nan::imp::FactoryBasev8::Boolean::return_t)’
readout->Set(Nan::New("isValid").ToLocalChecked(), Nan::New(result == 0));
^
In file included from /home/pi/.electron-gyp/8.5.3/include/node/node.h:63,
from ../src/node-dht-sensor.cpp:1:
/home/pi/.electron-gyp/8.5.3/include/node/v8.h:3611:37: note: candidate: ‘v8::Maybe v8::Object::Set(v8::Localv8::Context, v8::Localv8::Value, v8::Localv8::Value)’
V8_WARN_UNUSED_RESULT Maybe Set(Local context,
^~~
/home/pi/.electron-gyp/8.5.3/include/node/v8.h:3611:37: note: candidate expects 3 arguments, 2 provided
/home/pi/.electron-gyp/8.5.3/include/node/v8.h:3614:37: note: candidate: ‘v8::Maybe v8::Object::Set(v8::Localv8::Context, uint32_t, v8::Localv8::Value)’
V8_WARN_UNUSED_RESULT Maybe Set(Local context, uint32_t index,
^~~
/home/pi/.electron-gyp/8.5.3/include/node/v8.h:3614:37: note: candidate expects 3 arguments, 2 provided
../src/node-dht-sensor.cpp:269:82: error: no matching function for call to ‘v8::Object::Set(v8::Localv8::String, Nan::imp::FactoryBasev8::Number::return_t)’
readout->Set(Nan::New("errors").ToLocalChecked(), Nan::New(2 - retry));
^
In file included from /home/pi/.electron-gyp/8.5.3/include/node/node.h:63,
from ../src/node-dht-sensor.cpp:1:
/home/pi/.electron-gyp/8.5.3/include/node/v8.h:3611:37: note: candidate: ‘v8::Maybe v8::Object::Set(v8::Localv8::Context, v8::Localv8::Value, v8::Localv8::Value)’
V8_WARN_UNUSED_RESULT Maybe Set(Local context,
^~~
/home/pi/.electron-gyp/8.5.3/include/node/v8.h:3611:37: note: candidate expects 3 arguments, 2 provided
/home/pi/.electron-gyp/8.5.3/include/node/v8.h:3614:37: note: candidate: ‘v8::Maybe v8::Object::Set(v8::Localv8::Context, uint32_t, v8::Localv8::Value)’
V8_WARN_UNUSED_RESULT Maybe Set(Local context, uint32_t index,
^~~
/home/pi/.electron-gyp/8.5.3/include/node/v8.h:3614:37: note: candidate expects 3 arguments, 2 provided
../src/node-dht-sensor.cpp: In function ‘void Initialize(const Nan::FunctionCallbackInfov8::Value&)’:
../src/node-dht-sensor.cpp:286:43: warning: ‘uint32_t v8::Value::Uint32Value() const’ is deprecated: Use maybe version [-Wdeprecated-declarations]
int sensorType = args[0]->Uint32Value();
^
In file included from /home/pi/.electron-gyp/8.5.3/include/node/node.h:63,
from ../src/node-dht-sensor.cpp:1:
/home/pi/.electron-gyp/8.5.3/include/node/v8.h:2818:47: note: declared here
V8_DEPRECATED("Use maybe version") uint32_t Uint32Value() const;
^~~~~~~~~~~
../src/node-dht-sensor.cpp:294:37: warning: ‘uint32_t v8::Value::Uint32Value() const’ is deprecated: Use maybe version [-Wdeprecated-declarations]
GPIOPort = args[1]->Uint32Value();
^
In file included from /home/pi/.electron-gyp/8.5.3/include/node/node.h:63,
from ../src/node-dht-sensor.cpp:1:
/home/pi/.electron-gyp/8.5.3/include/node/v8.h:2818:47: note: declared here
V8_DEPRECATED("Use maybe version") uint32_t Uint32Value() const;
^~~~~~~~~~~
../src/node-dht-sensor.cpp: At global scope:
../src/node-dht-sensor.cpp:299:11: error: variable or field ‘Init’ declared void
void Init(Handle exports) {
^~~~~~
../src/node-dht-sensor.cpp:299:11: error: ‘Handle’ was not declared in this scope
../src/node-dht-sensor.cpp:299:11: note: suggested alternative: ‘rand_r’
void Init(Handle exports) {
^~~~~~
rand_r
../src/node-dht-sensor.cpp:299:24: error: expected primary-expression before ‘>’ token
void Init(Handle exports) {
^
../src/node-dht-sensor.cpp:299:26: error: ‘exports’ was not declared in this scope
void Init(Handle exports) {
^~~~~~~
In file included from ../src/node-dht-sensor.cpp:1:
../src/node-dht-sensor.cpp:307:30: error: ‘Init’ was not declared in this scope
NODE_MODULE(node_dht_sensor, Init);
^~~~
/home/pi/.electron-gyp/8.5.3/include/node/node.h:566:36: note: in definition of macro ‘NODE_MODULE_X’
(node::addon_register_func) (regfunc),
^~~~~~~
../src/node-dht-sensor.cpp:307:1: note: in expansion of macro ‘NODE_MODULE’
NODE_MODULE(node_dht_sensor, Init);
^~~~~~~~~~~
../src/node-dht-sensor.cpp:307:30: note: suggested alternative:
NODE_MODULE(node_dht_sensor, Init);
^~~~
/home/pi/.electron-gyp/8.5.3/include/node/node.h:566:36: note: in definition of macro ‘NODE_MODULE_X’
(node::addon_register_func) (regfunc),
^~~~~~~
../src/node-dht-sensor.cpp:307:1: note: in expansion of macro ‘NODE_MODULE’
NODE_MODULE(node_dht_sensor, Init);
^~~~~~~~~~~
/home/pi/.electron-gyp/8.5.3/include/node/node.h:221:18: note: ‘node::Init’
NODE_EXTERN void Init(int* argc,
^~~~
In file included from /home/pi/.electron-gyp/8.5.3/include/node/node.h:63,
from ../src/node-dht-sensor.cpp:1:
/home/pi/.electron-gyp/8.5.3/include/node/v8.h: In instantiation of ‘void v8::PersistentBase::SetWeak(P*, typename v8::WeakCallbackInfo

::Callback, v8::WeakCallbackType) [with P = node::ObjectWrap; T = v8::Object; typename v8::WeakCallbackInfo

::Callback = void ()(const v8::WeakCallbackInfonode::ObjectWrap&)]’:
/home/pi/.electron-gyp/8.5.3/include/node/node_object_wrap.h:84:78: required from here
/home/pi/.electron-gyp/8.5.3/include/node/v8.h:10579:16: warning: cast between incompatible function types from ‘v8::WeakCallbackInfonode::ObjectWrap::Callback’ {aka ‘void (
)(const v8::WeakCallbackInfonode::ObjectWrap&)’} to ‘Callback’ {aka ‘void ()(const v8::WeakCallbackInfo&)’} [-Wcast-function-type]
reinterpret_cast(callback), type);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/pi/.electron-gyp/8.5.3/include/node/v8.h: In instantiation of ‘void v8::PersistentBase::SetWeak(P
, typename v8::WeakCallbackInfo

::Callback, v8::WeakCallbackType) [with P = Nan::ObjectWrap; T = v8::Object; typename v8::WeakCallbackInfo

::Callback = void ()(const v8::WeakCallbackInfoNan::ObjectWrap&)]’:
../../nan/nan_object_wrap.h:65:61: required from here
/home/pi/.electron-gyp/8.5.3/include/node/v8.h:10579:16: warning: cast between incompatible function types from ‘v8::WeakCallbackInfoNan::ObjectWrap::Callback’ {aka ‘void (
)(const v8::WeakCallbackInfoNan::ObjectWrap&)’} to ‘Callback’ {aka ‘void (*)(const v8::WeakCallbackInfo&)’} [-Wcast-function-type]
../src/node-dht-sensor.cpp: In function ‘int initialize()’:
../src/node-dht-sensor.cpp:187:23: warning: control reaches end of non-void function [-Wreturn-type]
sched_setscheduler(0, SCHED_FIFO, &schedp);
~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
make: *** [node_dht_sensor.target.mk:108: Release/obj.target/node_dht_sensor/src/node-dht-sensor.o] Error 1
make : on quitte le répertoire « /home/pi/MagicMirror/modules/MMM-DHT-Sensor/node_modules/rpi-dht-sensor/build »
gyp ERR! build error
gyp ERR! stack Error: make failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/home/pi/MagicMirror/modules/MMM-DHT-Sensor/node_modules/node-gyp/lib/build.js:194: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 5.4.83-v7+
gyp ERR! command "/usr/bin/node" "/home/pi/MagicMirror/modules/MMM-DHT-Sensor/node_modules/.bin/node-gyp" "rebuild" "--target=8.5.3" "--arch=arm" "--dist-url=https://www.electronjs.org/headers" "--build-from-source"
gyp ERR! cwd /home/pi/MagicMirror/modules/MMM-DHT-Sensor/node_modules/rpi-dht-sensor
gyp ERR! node -v v10.23.2
gyp ERR! node-gyp -v v6.1.0
gyp ERR! not ok

Failed with exit code: 1

Error: make : on entre dans le répertoire « /home/pi/MagicMirror/modules/MMM-DHT-Sensor/node_modules/rpi-dht-sensor/build »
CC(target) Release/obj.target/node_dht_sensor/src/bcm2835.o
CXX(target) Release/obj.target/node_dht_sensor/src/node-dht-sensor.o
In file included from /home/pi/.electron-gyp/8.5.3/include/node/node.h:63,
from ../src/node-dht-sensor.cpp:1:
/home/pi/.electron-gyp/8.5.3/include/node/v8.h:8923:75: warning: ‘MicrotasksCompletedCallback’ is deprecated [-Wdeprecated-declarations]
void AddMicrotasksCompletedCallback(MicrotasksCompletedCallback callback);
^
/home/pi/.electron-gyp/8.5.3/include/node/v8.h:8931:78: warning: ‘MicrotasksCompletedCallback’ is deprecated [-Wdeprecated-declarations]
void RemoveMicrotasksCompletedCallback(MicrotasksCompletedCallback callback);
^
../src/node-dht-sensor.cpp: In function ‘int initialize()’:
../src/node-dht-sensor.cpp:189:23: error: too few arguments to function ‘int bcm2835_init(int)’
if (!bcm2835_init())
^
In file included from ../src/node-dht-sensor.cpp:21:
../src/bcm2835.h:1008:16: note: declared here
extern int bcm2835_init(int);
^~~~~~~~~~~~
../src/node-dht-sensor.cpp: In function ‘void Read(const Nan::FunctionCallbackInfov8::Value&)’:
../src/node-dht-sensor.cpp:228:83: error: no matching function for call to ‘v8::Object::Set(v8::Localv8::String, Nan::imp::FactoryBasev8::Number::return_t)’
readout->Set(Nan::New("humidity").ToLocalChecked(), Nan::New(humidity));
^
In file included from /home/pi/.electron-gyp/8.5.3/include/node/node.h:63,
from ../src/node-dht-sensor.cpp:1:
/home/pi/.electron-gyp/8.5.3/include/node/v8.h:3611:37: note: candidate: ‘v8::Maybe v8::Object::Set(v8::Localv8::Context, v8::Localv8::Value, v8::Localv8::Value)’
V8_WARN_UNUSED_RESULT Maybe Set(Local context,
^~~
/home/pi/.electron-gyp/8.5.3/include/node/v8.h:3611:37: note: candidate expects 3 arguments, 2 provided
/home/pi/.electron-gyp/8.5.3/include/node/v8.h:3614:37: note: candidate: ‘v8::Maybe v8::Object::Set(v8::Localv8::Context, uint32_t, v8::Localv8::Value)’
V8_WARN_UNUSED_RESULT Maybe Set(Local context, uint32_t index,
^~~
/home/pi/.electron-gyp/8.5.3/include/node/v8.h:3614:37: note: candidate expects 3 arguments, 2 provided
../src/node-dht-sensor.cpp:229:89: error: no matching function for call to ‘v8::Object::Set(v8::Localv8::String, Nan::imp::FactoryBasev8::Number::return_t)’
readout->Set(Nan::New("temperature").ToLocalChecked(), Nan::New(temperature));
^
In file included from /home/pi/.electron-gyp/8.5.3/include/node/node.h:63,
from ../src/node-dht-sensor.cpp:1:
/home/pi/.electron-gyp/8.5.3/include/node/v8.h:3611:37: note: candidate: ‘v8::Maybe v8::Object::Set(v8::Localv8::Context, v8::Localv8::Value, v8::Localv8::Value)’
V8_WARN_UNUSED_RESULT Maybe Set(Local context,
^~~
/home/pi/.electron-gyp/8.5.3/include/node/v8.h:3611:37: note: candidate expects 3 arguments, 2 provided
/home/pi/.electron-gyp/8.5.3/include/node/v8.h:3614:37: note: candidate: ‘v8::Maybe v8::Object::Set(v8::Localv8::Context, uint32_t, v8::Localv8::Value)’
V8_WARN_UNUSED_RESULT Maybe Set(Local context, uint32_t index,
^~~
/home/pi/.electron-gyp/8.5.3/include/node/v8.h:3614:37: note: candidate expects 3 arguments, 2 provided
../src/node-dht-sensor.cpp:230:86: error: no matching function for call to ‘v8::Object::Set(v8::Localv8::String, Nan::imp::FactoryBasev8::Boolean::return_t)’
readout->Set(Nan::New("isValid").ToLocalChecked(), Nan::New(result == 0));
^
In file included from /home/pi/.electron-gyp/8.5.3/include/node/node.h:63,
from ../src/node-dht-sensor.cpp:1:
/home/pi/.electron-gyp/8.5.3/include/node/v8.h:3611:37: note: candidate: ‘v8::Maybe v8::Object::Set(v8::Localv8::Context, v8::Localv8::Value, v8::Localv8::Value)’
V8_WARN_UNUSED_RESULT Maybe Set(Local context,
^~~
/home/pi/.electron-gyp/8.5.3/include/node/v8.h:3611:37: note: candidate expects 3 arguments, 2 provided
/home/pi/.electron-gyp/8.5.3/include/node/v8.h:3614:37: note: candidate: ‘v8::Maybe v8::Object::Set(v8::Localv8::Context, uint32_t, v8::Localv8::Value)’
V8_WARN_UNUSED_RESULT Maybe Set(Local context, uint32_t index,
^~~
/home/pi/.electron-gyp/8.5.3/include/node/v8.h:3614:37: note: candidate expects 3 arguments, 2 provided
../src/node-dht-sensor.cpp:231:82: error: no matching function for call to ‘v8::Object::Set(v8::Localv8::String, Nan::imp::FactoryBasev8::Number::return_t)’
readout->Set(Nan::New("errors").ToLocalChecked(), Nan::New(2 - retry));
^
In file included from /home/pi/.electron-gyp/8.5.3/include/node/node.h:63,
from ../src/node-dht-sensor.cpp:1:
/home/pi/.electron-gyp/8.5.3/include/node/v8.h:3611:37: note: candidate: ‘v8::Maybe v8::Object::Set(v8::Localv8::Context, v8::Localv8::Value, v8::Localv8::Value)’
V8_WARN_UNUSED_RESULT Maybe Set(Local context,
^~~
/home/pi/.electron-gyp/8.5.3/include/node/v8.h:3611:37: note: candidate expects 3 arguments, 2 provided
/home/pi/.electron-gyp/8.5.3/include/node/v8.h:3614:37: note: candidate: ‘v8::Maybe v8::Object::Set(v8::Localv8::Context, uint32_t, v8::Localv8::Value)’
V8_WARN_UNUSED_RESULT Maybe Set(Local context, uint32_t index,
^~~
/home/pi/.electron-gyp/8.5.3/include/node/v8.h:3614:37: note: candidate expects 3 arguments, 2 provided
../src/node-dht-sensor.cpp: In function ‘void ReadSpec(const Nan::FunctionCallbackInfov8::Value&)’:
../src/node-dht-sensor.cpp:242:43: warning: ‘uint32_t v8::Value::Uint32Value() const’ is deprecated: Use maybe version [-Wdeprecated-declarations]
int sensorType = args[0]->Uint32Value();
^
In file included from /home/pi/.electron-gyp/8.5.3/include/node/node.h:63,
from ../src/node-dht-sensor.cpp:1:
/home/pi/.electron-gyp/8.5.3/include/node/v8.h:2818:47: note: declared here
V8_DEPRECATED("Use maybe version") uint32_t Uint32Value() const;
^~~~~~~~~~~
../src/node-dht-sensor.cpp:256:37: warning: ‘uint32_t v8::Value::Uint32Value() const’ is deprecated: Use maybe version [-Wdeprecated-declarations]
int gpio = args[1]->Uint32Value();
^
In file included from /home/pi/.electron-gyp/8.5.3/include/node/node.h:63,
from ../src/node-dht-sensor.cpp:1:
/home/pi/.electron-gyp/8.5.3/include/node/v8.h:2818:47: note: declared here
V8_DEPRECATED("Use maybe version") uint32_t Uint32Value() const;
^~~~~~~~~~~
../src/node-dht-sensor.cpp:266:83: error: no matching function for call to ‘v8::Object::Set(v8::Localv8::String, Nan::imp::FactoryBasev8::Number::return_t)’
readout->Set(Nan::New("humidity").ToLocalChecked(), Nan::New(humidity));
^
In file included from /home/pi/.electron-gyp/8.5.3/include/node/node.h:63,
from ../src/node-dht-sensor.cpp:1:
/home/pi/.electron-gyp/8.5.3/include/node/v8.h:3611:37: note: candidate: ‘v8::Maybe v8::Object::Set(v8::Localv8::Context, v8::Localv8::Value, v8::Localv8::Value)’
V8_WARN_UNUSED_RESULT Maybe Set(Local context,
^~~
/home/pi/.electron-gyp/8.5.3/include/node/v8.h:3611:37: note: candidate expects 3 arguments, 2 provided
/home/pi/.electron-gyp/8.5.3/include/node/v8.h:3614:37: note: candidate: ‘v8::Maybe v8::Object::Set(v8::Localv8::Context, uint32_t, v8::Localv8::Value)’
V8_WARN_UNUSED_RESULT Maybe Set(Local context, uint32_t index,
^~~
/home/pi/.electron-gyp/8.5.3/include/node/v8.h:3614:37: note: candidate expects 3 arguments, 2 provided
../src/node-dht-sensor.cpp:267:89: error: no matching function for call to ‘v8::Object::Set(v8::Localv8::String, Nan::imp::FactoryBasev8::Number::return_t)’
readout->Set(Nan::New("temperature").ToLocalChecked(), Nan::New(temperature));
^
In file included from /home/pi/.electron-gyp/8.5.3/include/node/node.h:63,
from ../src/node-dht-sensor.cpp:1:
/home/pi/.electron-gyp/8.5.3/include/node/v8.h:3611:37: note: candidate: ‘v8::Maybe v8::Object::Set(v8::Localv8::Context, v8::Localv8::Value, v8::Localv8::Value)’
V8_WARN_UNUSED_RESULT Maybe Set(Local context,
^~~
/home/pi/.electron-gyp/8.5.3/include/node/v8.h:3611:37: note: candidate expects 3 arguments, 2 provided
/home/pi/.electron-gyp/8.5.3/include/node/v8.h:3614:37: note: candidate: ‘v8::Maybe v8::Object::Set(v8::Localv8::Context, uint32_t, v8::Localv8::Value)’
V8_WARN_UNUSED_RESULT Maybe Set(Local context, uint32_t index,
^~~
/home/pi/.electron-gyp/8.5.3/include/node/v8.h:3614:37: note: candidate expects 3 arguments, 2 provided
../src/node-dht-sensor.cpp:268:86: error: no matching function for call to ‘v8::Object::Set(v8::Localv8::String, Nan::imp::FactoryBasev8::Boolean::return_t)’
readout->Set(Nan::New("isValid").ToLocalChecked(), Nan::New(result == 0));
^
In file included from /home/pi/.electron-gyp/8.5.3/include/node/node.h:63,
from ../src/node-dht-sensor.cpp:1:
/home/pi/.electron-gyp/8.5.3/include/node/v8.h:3611:37: note: candidate: ‘v8::Maybe v8::Object::Set(v8::Localv8::Context, v8::Localv8::Value, v8::Localv8::Value)’
V8_WARN_UNUSED_RESULT Maybe Set(Local context,
^~~
/home/pi/.electron-gyp/8.5.3/include/node/v8.h:3611:37: note: candidate expects 3 arguments, 2 provided
/home/pi/.electron-gyp/8.5.3/include/node/v8.h:3614:37: note: candidate: ‘v8::Maybe v8::Object::Set(v8::Localv8::Context, uint32_t, v8::Localv8::Value)’
V8_WARN_UNUSED_RESULT Maybe Set(Local context, uint32_t index,
^~~
/home/pi/.electron-gyp/8.5.3/include/node/v8.h:3614:37: note: candidate expects 3 arguments, 2 provided
../src/node-dht-sensor.cpp:269:82: error: no matching function for call to ‘v8::Object::Set(v8::Localv8::String, Nan::imp::FactoryBasev8::Number::return_t)’
readout->Set(Nan::New("errors").ToLocalChecked(), Nan::New(2 - retry));
^
In file included from /home/pi/.electron-gyp/8.5.3/include/node/node.h:63,
from ../src/node-dht-sensor.cpp:1:
/home/pi/.electron-gyp/8.5.3/include/node/v8.h:3611:37: note: candidate: ‘v8::Maybe v8::Object::Set(v8::Localv8::Context, v8::Localv8::Value, v8::Localv8::Value)’
V8_WARN_UNUSED_RESULT Maybe Set(Local context,
^~~
/home/pi/.electron-gyp/8.5.3/include/node/v8.h:3611:37: note: candidate expects 3 arguments, 2 provided
/home/pi/.electron-gyp/8.5.3/include/node/v8.h:3614:37: note: candidate: ‘v8::Maybe v8::Object::Set(v8::Localv8::Context, uint32_t, v8::Localv8::Value)’
V8_WARN_UNUSED_RESULT Maybe Set(Local context, uint32_t index,
^~~
/home/pi/.electron-gyp/8.5.3/include/node/v8.h:3614:37: note: candidate expects 3 arguments, 2 provided
../src/node-dht-sensor.cpp: In function ‘void Initialize(const Nan::FunctionCallbackInfov8::Value&)’:
../src/node-dht-sensor.cpp:286:43: warning: ‘uint32_t v8::Value::Uint32Value() const’ is deprecated: Use maybe version [-Wdeprecated-declarations]
int sensorType = args[0]->Uint32Value();
^
In file included from /home/pi/.electron-gyp/8.5.3/include/node/node.h:63,
from ../src/node-dht-sensor.cpp:1:
/home/pi/.electron-gyp/8.5.3/include/node/v8.h:2818:47: note: declared here
V8_DEPRECATED("Use maybe version") uint32_t Uint32Value() const;
^~~~~~~~~~~
../src/node-dht-sensor.cpp:294:37: warning: ‘uint32_t v8::Value::Uint32Value() const’ is deprecated: Use maybe version [-Wdeprecated-declarations]
GPIOPort = args[1]->Uint32Value();
^
In file included from /home/pi/.electron-gyp/8.5.3/include/node/node.h:63,
from ../src/node-dht-sensor.cpp:1:
/home/pi/.electron-gyp/8.5.3/include/node/v8.h:2818:47: note: declared here
V8_DEPRECATED("Use maybe version") uint32_t Uint32Value() const;
^~~~~~~~~~~
../src/node-dht-sensor.cpp: At global scope:
../src/node-dht-sensor.cpp:299:11: error: variable or field ‘Init’ declared void
void Init(Handle exports) {
^~~~~~
../src/node-dht-sensor.cpp:299:11: error: ‘Handle’ was not declared in this scope
../src/node-dht-sensor.cpp:299:11: note: suggested alternative: ‘rand_r’
void Init(Handle exports) {
^~~~~~
rand_r
../src/node-dht-sensor.cpp:299:24: error: expected primary-expression before ‘>’ token
void Init(Handle exports) {
^
../src/node-dht-sensor.cpp:299:26: error: ‘exports’ was not declared in this scope
void Init(Handle exports) {
^~~~~~~
In file included from ../src/node-dht-sensor.cpp:1:
../src/node-dht-sensor.cpp:307:30: error: ‘Init’ was not declared in this scope
NODE_MODULE(node_dht_sensor, Init);
^~~~
/home/pi/.electron-gyp/8.5.3/include/node/node.h:566:36: note: in definition of macro ‘NODE_MODULE_X’
(node::addon_register_func) (regfunc),
^~~~~~~
../src/node-dht-sensor.cpp:307:1: note: in expansion of macro ‘NODE_MODULE’
NODE_MODULE(node_dht_sensor, Init);
^~~~~~~~~~~
../src/node-dht-sensor.cpp:307:30: note: suggested alternative:
NODE_MODULE(node_dht_sensor, Init);
^~~~
/home/pi/.electron-gyp/8.5.3/include/node/node.h:566:36: note: in definition of macro ‘NODE_MODULE_X’
(node::addon_register_func) (regfunc),
^~~~~~~
../src/node-dht-sensor.cpp:307:1: note: in expansion of macro ‘NODE_MODULE’
NODE_MODULE(node_dht_sensor, Init);
^~~~~~~~~~~
/home/pi/.electron-gyp/8.5.3/include/node/node.h:221:18: note: ‘node::Init’
NODE_EXTERN void Init(int* argc,
^~~~
In file included from /home/pi/.electron-gyp/8.5.3/include/node/node.h:63,
from ../src/node-dht-sensor.cpp:1:
/home/pi/.electron-gyp/8.5.3/include/node/v8.h: In instantiation of ‘void v8::PersistentBase::SetWeak(P*, typename v8::WeakCallbackInfo

::Callback, v8::WeakCallbackType) [with P = node::ObjectWrap; T = v8::Object; typename v8::WeakCallbackInfo

::Callback = void ()(const v8::WeakCallbackInfonode::ObjectWrap&)]’:
/home/pi/.electron-gyp/8.5.3/include/node/node_object_wrap.h:84:78: required from here
/home/pi/.electron-gyp/8.5.3/include/node/v8.h:10579:16: warning: cast between incompatible function types from ‘v8::WeakCallbackInfonode::ObjectWrap::Callback’ {aka ‘void (
)(const v8::WeakCallbackInfonode::ObjectWrap&)’} to ‘Callback’ {aka ‘void ()(const v8::WeakCallbackInfo&)’} [-Wcast-function-type]
reinterpret_cast(callback), type);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/pi/.electron-gyp/8.5.3/include/node/v8.h: In instantiation of ‘void v8::PersistentBase::SetWeak(P
, typename v8::WeakCallbackInfo

::Callback, v8::WeakCallbackType) [with P = Nan::ObjectWrap; T = v8::Object; typename v8::WeakCallbackInfo

::Callback = void ()(const v8::WeakCallbackInfoNan::ObjectWrap&)]’:
../../nan/nan_object_wrap.h:65:61: required from here
/home/pi/.electron-gyp/8.5.3/include/node/v8.h:10579:16: warning: cast between incompatible function types from ‘v8::WeakCallbackInfoNan::ObjectWrap::Callback’ {aka ‘void (
)(const v8::WeakCallbackInfoNan::ObjectWrap&)’} to ‘Callback’ {aka ‘void (*)(const v8::WeakCallbackInfo&)’} [-Wcast-function-type]
../src/node-dht-sensor.cpp: In function ‘int initialize()’:
../src/node-dht-sensor.cpp:187:23: warning: control reaches end of non-void function [-Wreturn-type]
sched_setscheduler(0, SCHED_FIFO, &schedp);
~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
make: *** [node_dht_sensor.target.mk:108: Release/obj.target/node_dht_sensor/src/node-dht-sensor.o] Error 1
make : on quitte le répertoire « /home/pi/MagicMirror/modules/MMM-DHT-Sensor/node_modules/rpi-dht-sensor/build »
gyp ERR! build error
gyp ERR! stack Error: make failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/home/pi/MagicMirror/modules/MMM-DHT-Sensor/node_modules/node-gyp/lib/build.js:194: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 5.4.83-v7+
gyp ERR! command "/usr/bin/node" "/home/pi/MagicMirror/modules/MMM-DHT-Sensor/node_modules/.bin/node-gyp" "rebuild" "--target=8.5.3" "--arch=arm" "--dist-url=https://www.electronjs.org/headers" "--build-from-source"
gyp ERR! cwd /home/pi/MagicMirror/modules/MMM-DHT-Sensor/node_modules/rpi-dht-sensor
gyp ERR! node -v v10.23.2
gyp ERR! node-gyp -v v6.1.0
gyp ERR! not ok

Failed with exit code: 1
at SafeSubscriber._error (/home/pi/MagicMirror/modules/MMM-DHT-Sensor/node_modules/spawn-rx/lib/src/index.js:267:84)
at SafeSubscriber.__tryOrUnsub (/home/pi/MagicMirror/modules/MMM-DHT-Sensor/node_modules/rxjs/internal/Subscriber.js:205:16)
at SafeSubscriber.error (/home/pi/MagicMirror/modules/MMM-DHT-Sensor/node_modules/rxjs/internal/Subscriber.js:156:26)
at Subscriber._error (/home/pi/MagicMirror/modules/MMM-DHT-Sensor/node_modules/rxjs/internal/Subscriber.js:92:26)
at Subscriber.error (/home/pi/MagicMirror/modules/MMM-DHT-Sensor/node_modules/rxjs/internal/Subscriber.js:72:18)
at MapSubscriber.Subscriber._error (/home/pi/MagicMirror/modules/MMM-DHT-Sensor/node_modules/rxjs/internal/Subscriber.js:92:26)
at MapSubscriber.Subscriber.error (/home/pi/MagicMirror/modules/MMM-DHT-Sensor/node_modules/rxjs/internal/Subscriber.js:72:18)
at SafeSubscriber._next (/home/pi/MagicMirror/modules/MMM-DHT-Sensor/node_modules/spawn-rx/lib/src/index.js:242:65)
at SafeSubscriber.__tryOrUnsub (/home/pi/MagicMirror/modules/MMM-DHT-Sensor/node_modules/rxjs/internal/Subscriber.js:205:16)
at SafeSubscriber.next (/home/pi/MagicMirror/modules/MMM-DHT-Sensor/node_modules/rxjs/internal/Subscriber.js:143:22)
npm ERR! code ELIFECYCLE
npm ERR! errno 255
npm ERR! [email protected] postinstall: electron-rebuild -e ../../node_modules/electron
npm ERR! Exit status 255
npm ERR!
npm ERR! Failed at the [email protected] postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /home/pi/.npm/_logs/2021-02-01T23_46_52_871Z-debug.log

Very big log !!
Any idea ? Thanks in advance.

from mmm-dht-sensor.

mariosgouros avatar mariosgouros commented on August 10, 2024

I also had the same problem after renaming package.json "electron-rebuild" to "electron". It seems I can't make it work no matter how many times I tried or searchd for a "google" solution.

from mmm-dht-sensor.

Related Issues (3)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.