Problem with sht21 installation

Hi,

I'm trying to install sht21 on Raspberry with openwrt, but it turns out that by following this tutorial, https://forum.archive.openwrt.org/viewtopic.php?id=60085, I get the following errors:

root@OpenWrt:~# cat /sys/bus/i2c/devices/0-0040/temp1_input
cat: can't open '/sys/bus/i2c/devices/0-0040/temp1_input': No such file or directory

root@OpenWrt:~# cat /sys/class/hwmon/hwmon0/temp1_input
cat: read error: Remote I/O error

root@OpenWrt:~# sensors
sht21-i2c-0-40
Adapter: bcm2835 I2C adapter
temp1:            N/A


root@OpenWrt:~# i2cdetect -y 0
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: UU -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
root@OpenWrt:~# dmesg | grep i2c
[    0.640985] i2c /dev entries driver
[    6.148330] WARNING: CPU: 3 PID: 159 at drivers/i2c/i2c-core-base.c:1317 __i2c_add_numbered_adapter+0x4c/0xc8
[    6.160726] Modules linked in: i2c_gpio(+) i2c_bcm2835 i2c_smbus i2c_gpio_custom kfifo_buf industrialio i2c_algo_bit gpio_pcf857x gpio_pca953x ledtrig_gpio gpio_beeper nf_log_ipv6 nf_log_common ip6table_mangle ip6table_filter ip6_tables ip6t_REJECT x_tables nf_reject_ipv6 pinctrl_mcp23s08 regmap_i2c snd_rawmidi snd_seq_device snd_pcm_oss snd_pcm snd_timer snd_mixer_oss snd_hwdep snd_compress snd soundcore nls_utf8 vfat fat nls_iso8859_1 nls_cp437 input_polldev gpio_button_hotplug
[    6.238777] PC is at __i2c_add_numbered_adapter+0x4c/0xc8
[    6.247029] LR is at __i2c_add_numbered_adapter+0x4c/0xc8
[    6.509327] [<ffffff8008419414>] __i2c_add_numbered_adapter+0x4c/0xc8
[    6.518270] [<ffffff80084195ac>] i2c_add_numbered_adapter+0x24/0x30
[    6.534298] [<ffffff8000724ce0>] i2c_bit_add_numbered_bus+0x10/0x330 [i2c_algo_bit]
[    6.617242] [<ffffff8000767018>] init_module+0x18/0x1000 [i2c_gpio]
[    6.787488] i2c-gpio: probe of i2c-gpio.0 failed with error -16
[   59.339587] i2c i2c-0: new_device: Instantiated device sht21 at 0x40

Can someone help me?

Best regards.

find /sys/bus/i2c/devices/
cat /etc/modules.d/*gpio*
( do you have to run sensors-detect? )

Suggests that a driver has already attached to the device.

Further reinforced by

[   59.339587] i2c i2c-0: new_device: Instantiated device sht21 at 0x40

Here is the output:

root@OpenWrt:~# find /sys/bus/i2c/devices
/sys/bus/i2c/devices
/sys/bus/i2c/devices/i2c-0
root@OpenWrt:~# cat /etc/modules.d/*gpio*
gpio-button-hotplug
pinctrl-mcp23s08
gpio-beeper
ledtrig-gpio
gpio-pca953x
gpio-pcf857x
i2c-gpio-custom.ko bus0=0,18,21
i2c-gpio
leds-gpio
rotary_encoder
gpio_keys
gpio_keys_polled
spi-gpio
root@OpenWrt:~# sensors-detect
#sensors-detect revision $Revision$
#DMI data unavailable, please consider installing dmidecode 2.7
 #or later for better results.
 #Kernel: 4.14.128 aarch64
Use of uninitialized value in concatenation (.) or string at /usr/sbin/sensors-detect line 3122.
Use of uninitialized value in concatenation (.) or string at /usr/sbin/sensors-detect line 3122.
Use of uninitialized value in concatenation (.) or string at /usr/sbin/sensors-detect line 3122.
Use of uninitialized value in concatenation (.) or string at /usr/sbin/sensors-detect line 3122.
#Processor:  (//)

This program will help you determine which kernel modules you need
to load to use lm_sensors most effectively. It is generally safe
and recommended to accept the default answers to all questions,
unless you know what you're doing.

Some south bridges, CPUs or memory controllers contain embedded sensors.
Do you want to scan for them? This is totally safe. (YES/no): YES
failed to find a module named cpuid
Failed to load module cpuid.
Silicon Integrated Systems SIS5595...                       No
VIA VT82C686 Integrated Sensors...                          No
VIA VT8231 Integrated Sensors...                            No
AMD K8 thermal sensors...                                   No
AMD Family 10h thermal sensors...                           No
AMD Family 11h thermal sensors...                           No
AMD Family 12h and 14h thermal sensors...                   No
AMD Family 15h thermal sensors...                           No
AMD Family 16h thermal sensors...                           No
AMD Family 17h thermal sensors...                           No
AMD Family 15h power sensors...                             No
AMD Family 16h power sensors...                             No
Intel digital thermal sensor...                             No
Intel AMB FB-DIMM thermal sensor...                         No
Intel 5500/5520/X58 thermal sensor...                       No
VIA C7 thermal sensor...                                    No
VIA Nano thermal sensor...                                  No

Lastly, we can probe the I2C/SMBus adapters for connected hardware
monitoring devices. This is the most risky part, and while it works
reasonably well on most systems, it has been reported to cause trouble
on some systems.
Do you want to probe the I2C/SMBus adapters now? (YES/no): YES
Sorry, no supported PCI bus adapters found.

Next adapter: i2c-gpio0 (i2c-0)
Do you want to scan it? (YES/no/selectively): YES

Sorry, no sensors were detected.
Either your system has no sensors, or they are not supported, or
they are connected to an I2C or SMBus adapter that is not
supported. If you find out what chips are on your board, check
https://hwmon.wiki.kernel.org/device_support_status for driver status.

I already tried two sensors but the result is the same.

Hmmm, where is that from? If built against a different kernel, it may be the source of your problems.

Side note: The preformatted-text button </> makes "terminal output" a lot more readable.

Hi,

Could you be more explicit? I happen to be a bit confused because the kernal version for bcm2710 would have to be 4.9, following this site https://openwrt.org/packages/pkgdata/kernel, but when I do the system build it sets the kernel for the version 4.14 Is this the problem?
I've been trying to compile with version 4.9 but by doing make -j1 it always returns error.

Thanks.