Comments (8)
@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.
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.
Fantastic! I re-started with the new version, and I can confirm that the installation went smoothly.
from i2c-bus.
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.
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.
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.
All right, that explains why it failed in the first place given these circumstances. Thanks again for looking into this!
from i2c-bus.
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)
- Aborting with `malloc(): invalid size (unsorted)` HOT 3
- Support for 16 bit command/index HOT 3
- Does this library support different speeds? HOT 3
- installation fails with docker on ARM64 (raspberry PI 4B) HOT 2
- .openSync() works async way HOT 8
- index.d.ts HOT 4
- Crashing when declared and run HOT 2
- cannot detect i2c device of shtc3
- HC-SR04 Ultrasonic Sensor example on i2c-bus HOT 3
- writeI2cBlockSync returns a PromisifiedBus rather than the suggested number of bytes written HOT 5
- Can't it be used on orange pi 3 LTS? HOT 1
- Slave mode support? HOT 1
- Asistance with reading a register HOT 3
- Approach for device abstraction layer HOT 5
- Error: EIO, Input/output error HOT 2
- Question - Thread Safety/Mutexing - Are the methods on an I2CBus thread safe on a RaspberryPi in Node.JS? HOT 2
- How to list available adapters? HOT 6
- Error HOT 3
- Install fails on macOS Big Sur (11.1) HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from i2c-bus.