Node-Red, Sensor Init Failed (i2c-1 error)
Hello, good day.
I'm trying to get sensor(bme280) in node-red. I installed bme280 node and ı got i2c-1 error.
"Sensor Init failed ->Error: ENOENT: no such file or directory, open '/dev/i2c-1'"
I search onion docs and found that i2c-0 comes default in device. How do ı set this i2c-1 ? or how do ı show my flow i2c-0
crispyoz last edited by
@boraertn I don't have experience with Node Red, but I would expect it has a mechanism for device discovery and/or mapping. This is where I would first look.
For a work around to possibly get you up and running before you find the proper solution.
ln -s /dev/i2c-0 /dev/i2c-1
This create a symlink to the device.
You may need to run this each time you restart, so it would be better to put this into a hotplug script. Take a look at this link for more info: https://openwrt.org/docs/guide-user/base-system/hotplug
It's a a hack, not a good solution, but in the absence of better advice you could try this for short term solution to get you going.
Hello @crispyoz thank you for answer. thats solve my problem but temporary.
But ı found solution permanent. If bme280 connect correct in omega device and if you install packages i2c packages.
in the node-red flow just click your bme280 and change bus 1 to 0. That will change to i2c-0 permanent.
how to know bme280 connect correct in omega device ?
in terminal write i2cdetect -y 0 if you see 76/77 that's means you connect correct.