Coder Social home page Coder Social logo

Comments (8)

fivdi avatar fivdi commented on August 21, 2024 1

@gunnarsson Thank you for this additional information and for opening the issue initially. I'll reopen the issue as there is a problem with the i2c-bus dependencies. As can be seen here [email protected] depends on nan version "^2.14.2". This dependency needs to be updated to "^2.17.0".

from i2c-bus.

fivdi avatar fivdi commented on August 21, 2024 1

The problem should be resolved with [email protected] which has just been published on npm.

@gunnarsson Once again, thank you for reporting this issue.

from i2c-bus.

gunnarsson avatar gunnarsson commented on August 21, 2024 1

Fantastic! I re-started with the new version, and I can confirm that the installation went smoothly.

from i2c-bus.

fivdi avatar fivdi commented on August 21, 2024

I don't have a Raspberry Pi Zero 2 W and I'm afraid I can't reproduce the error on a Raspberry Pi 4.

If I run the following commands on a Raspberry Pi 4:

node -v
npm -v
uname -a
npm install i2c-bus
npm list --all
node node_modules/i2c-bus/example/i2cdetect
node node_modules/i2c-bus/example/i2cfuncs.js 

Everything functions as expected and this is what is see:

pi@raspberrypi:~/test $ node -v
v20.4.0
pi@raspberrypi:~/test $ npm -v
9.7.2
pi@raspberrypi:~/test $ uname -a
Linux raspberrypi 6.1.21-v8+ #1642 SMP PREEMPT Mon Apr  3 17:24:16 BST 2023 aarch64 GNU/Linux
pi@raspberrypi:~/test $ npm install i2c-bus

added 4 packages in 12s
pi@raspberrypi:~/test $ npm list --all
test@ /home/pi/test
└─┬ [email protected]
  ├─┬ [email protected]
  │ └── [email protected]
  └── [email protected]

pi@raspberrypi:~/test $ node node_modules/i2c-bus/example/i2cdetect
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --                        
pi@raspberrypi:~/test $ node node_modules/i2c-bus/example/i2cfuncs.js 
Functionalities implemented by /dev/i2c-1:
I2C                              yes
SMBus Quick Command              yes
SMBus Send Byte                  yes
SMBus Receive Byte               yes
SMBus Write Byte                 yes
SMBus Read Byte                  yes
SMBus Write Word                 yes
SMBus Read Word                  yes
SMBus Process Call               yes
SMBus Block Write                yes
SMBus Block Read                 no
SMBus Block Process Call         no
SMBus PEC                        yes
I2C Block Write                  yes
I2C Block Read                   yes
pi@raspberrypi:~/test $ 

Are you perhaps installing an old version of i2c-bus?
Exactly what command(s) are you using to install i2c-bus?
If you run the commands shown above, exactly as shown, from an empty newly created directory, what is the complete output?

from i2c-bus.

gunnarsson avatar gunnarsson commented on August 21, 2024

Thanks for looking into this so quickly! I tried what you suggested (plus an npm init in the directory) and everything works perfectly. The directory where it doesn't is an existing Node project, so I assume one of the other modules has incompatible dependencies.

After a quick look through the package tree, I think the culprit might be:

├─┬ [email protected]
│ ├─┬ [email protected]
│ │ └── [email protected]
│ └── [email protected]

... as my test directory has [email protected]. I'll fiddle around a little with it, thanks for your time!

from i2c-bus.

gunnarsson avatar gunnarsson commented on August 21, 2024

For anybody else running into this issue, manually installing the correct version of nan and then re-running the i2c-bus installation seems to have done the trick. I haven't had time to verify the installation yet, but at least it went through without any error messages.

from i2c-bus.

gunnarsson avatar gunnarsson commented on August 21, 2024

All right, that explains why it failed in the first place given these circumstances. Thanks again for looking into this!

from i2c-bus.

fivdi avatar fivdi commented on August 21, 2024

All right, that explains why it failed in the first place given these circumstances. Thanks again for looking into this!

Yes, that explains it.

from i2c-bus.

Related Issues (20)

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.