fivdi / mcp-spi-adc

MCP3002/4/8, MCP3202/4/8 and MCP3304 SPI analog to digital conversion with Node.js
MIT License
62 stars 10 forks source link

Error Message #18

Closed Armin46 closed 2 years ago

Armin46 commented 2 years ago

Hello i get the Error Message

`

javascript.0 2022-08-26 20:22:10.636 info found 0 vulnerabilities
javascript.0 2022-08-26 20:22:10.629 info 7 packages are looking for funding run npm fund for details
javascript.0 2022-08-26 20:22:10.624 info added 99 packages, changed 1 package, and audited 101 packages in 38s
javascript.0 2022-08-26 20:21:40.823 error WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
javascript.0 2022-08-26 20:21:40.820 error npm
javascript.0 2022-08-26 20:21:40.711 error WARN deprecated uuid@3.4.0: 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.
javascript.0 2022-08-26 20:21:40.710 error npm
javascript.0 2022-08-26 20:21:40.609 error WARN deprecated node-inspect@2.0.0: This module is part of Node.js core and does not need to be installed separately. It is now unmaintained.
javascript.0 2022-08-26 20:21:40.607 error npm
javascript.0 2022-08-26 20:21:40.451 error WARN deprecated har-validator@5.1.5: this library is no longer supported
javascript.0 2022-08-26 20:21:40.449 error npm
javascript.0 2022-08-26 20:21:31.295 info npm install mcp-spi-adc --omit=dev (System call)

`

And when i try this Script the javascript Instanz crash in IoBroker

`createState('Analogmodul.Channel0',0,read1); createState('Analogmodul.Channel1',0,read2); createState('Analogmodul.Channel2',0,read3); createState('Analogmodul.Channel3',0,read4);

const mcpadc = require('mcp-spi-adc');

function read1(){ const input1 = mcpadc.openMcp3204(0, {busNumber: busNumber, deviceNumber:deviceNumber, speedHz: 20000}, (err) => { if (err) throw err;

setInterval(() => { input1.read((err, reading) => { if (err) throw err;

  setState("Analogmodul.Channel0",(reading.rawValue)),true;
});

}, Interval); }); }

function read2(){ const input2 = mcpadc.openMcp3204(1, {busNumber: busNumber, deviceNumber:deviceNumber, speedHz: 20000}, (err) => { if (err) throw err;

setInterval(() => { input2.read((err, reading) => { if (err) throw err;

  setState("Analogmodul.Channel1",(reading.rawValue)),true;
});

}, Interval); }); }

function read3(){ const input3 = mcpadc.openMcp3204(2, {busNumber: busNumber, deviceNumber:deviceNumber, speedHz: 20000}, (err) => { if (err) throw err;

setInterval(() => { input3.read((err, reading) => { if (err) throw err;

  setState("Analogmodul.Channel2",(reading.rawValue)),true;
});

}, Interval); }); }

function read4(){ const input4 = mcpadc.openMcp3204(3, {busNumber: busNumber, deviceNumber:deviceNumber, speedHz: 20000}, (err) => { if (err) throw err;`

Has someone an Idea?

Thanks in advance

fivdi commented 2 years ago

None of the error messages that you are seeing when installing are related to mcp-spi-adc. None of the packages that are being complained about are used by mcp-spi-adc. The error messages that you are seeing when installing must be related to other packages that you are using in your application.

Here is what I see when I install mcp-spi-adc in an empty directory:

pi@raspberrypi:~/mcp-spi-adc $ npm install mcp-spi-adc

added 6 packages, and audited 7 packages in 23s

found 0 vulnerabilities
pi@raspberrypi:~/mcp-spi-adc $ 

I am not familiar with IoBroker and can help you debug your application when using IoBroker.

Armin46 commented 2 years ago

Ok Thank you for the quick answer

fivdi commented 2 years ago

I'll go ahead and close this as there is no TODO for mcp-spi-adc.