Hi, Been trying to solve this for several days and no luck!
Attempting to communicate with BMP-388, Node Red debug returns
"Error: ENOENT: no such file or directory, open '/dev/i2c-1'"
Using node-red-contrib-i2c and for S&Gs tried node-red-contrib-bme280 with same results.
RasPi 4 with Docker 20.10.3
Node Red V1.2.7
NodeJS v14.15.4
nmp v7.5.1
Raspi-config i2c interface is on. Confirmed in /boot/config.txt
dtparam=i2c_arm=on
I can run all i2cdetect commands without sudo and returns expected results.
Created a BUS 4 i2c to test using:
dtoverlay=i2c-gpio,bus=4,i2c_gpio_delay_us=1,i2c_gpio_sda=23,i2c_gpio_scl=24
Same results not finding /dev/i2c-4
i2c-1 and -4 do exist in /dev and i2c-4 has 777 perms
True! When using BUS 1, SDA = GPIO 2 & SCL = GPIO 3.
Setting up a software i2c can be designated BUS 3 or BUS 4 (BUS 2 is internally designated for pi use). Bus 3 would be set up on SDA = GPIO 17 and SCL = GPIO 27.
Of course, while testing this I have moved the connections from BUS 1 to BUS 4 designated pins. However, I think it irrelevant since Node Red fails to access the i2c file.
My inclination is that the problem is related to Node Red in a Docker container not accessing the local file system even though the users are aligned and perms for the test i2c-4 are wide open. It is my understanding that enabling the i2c interface in Raspi-config opens the files to all users and should be enough, but not my case. Still testing & searching for a solution!
I set the user to 1000:998 and that got rid of my last error. Now using i2c-1 bus 1 and wired I get:
"Error: ENXIO: no such device or address, read"
with the i2c-In node and an array with a single value of 118 from i2c-scan node.
118 is not the temp and is outside of of the pressure range.
Below is the Docker Compose YAML that I used.
Still digging for the new failure resolution.