Page 1 of 1

OSError: Humidity Init Failed

Posted: Thu Jun 10, 2021 7:42 pm
by amanjosan2008
Recently my SenseHat stopped working after a Raspbian upgrade (apt upgrade & rpi-update), I guess.
I have followed many article and forum posts but none has helped so far.

I am consistenly getting these alerts in DMESG output:

Code: Select all

rpi-sense 1-0046: Block write failed
I am getting below error when trying to get Temperature information:

sudo ./temperature.py

Code: Select all

sudo ./temperature.py 
Traceback (most recent call last):
  File "./temperature.py", line 10, in <module>
    temp = sense.temp
  File "/usr/local/lib/python3.7/dist-packages/sense_hat/sense_hat.py", line 610, in temp
    return self.get_temperature_from_humidity()
  File "/usr/local/lib/python3.7/dist-packages/sense_hat/sense_hat.py", line 582, in get_temperature_from_humidity
    self._init_humidity()  # Ensure humidity sensor is initialised
  File "/usr/local/lib/python3.7/dist-packages/sense_hat/sense_hat.py", line 549, in _init_humidity
    raise OSError('Humidity Init Failed')
OSError: Humidity Init Failed
When using Python3 from console:

Code: Select all

>>> import time
>>> from sense_hat import SenseHat
>>> 
>>> sense = SenseHat()
>>> while True:
...     compass = sense.get_compass()
...     print ("compass", compass)
...     time.sleep(0.1)
... 
Traceback (most recent call last):
  File "<stdin>", line 2, in <module>
  File "/usr/local/lib/python3.7/dist-packages/sense_hat/sense_hat.py", line 760, in get_compass
    self.set_imu_config(True, False, False)
  File "/usr/local/lib/python3.7/dist-packages/sense_hat/sense_hat.py", line 660, in set_imu_config
    self._init_imu()  # Ensure imu is initialised
  File "/usr/local/lib/python3.7/dist-packages/sense_hat/sense_hat.py", line 648, in _init_imu
    raise OSError('IMU Init Failed')
OSError: IMU Init Failed
I have collected below information for diagnosis as menitioned in all of the articles:

uname -a

Code: Select all

Linux raspberrypi 5.10.17-v7+ #1421 SMP Thu May 27 13:59:01 BST 2021 armv7l GNU/Linux
cat /proc/cpuinfo

Code: Select all

Hardware	: BCM2835
Revision	        : a02082
Model		: Raspberry Pi 3 Model B Rev 1.2
sudo dtc -I fs /proc/device-tree

Code: Select all

		i2c@7e804000 {
			compatible = "brcm,bcm2835-i2c";
			clocks = < 0x07 0x14 >;
			status = "okay";
			#address-cells = < 0x01 >;
			interrupts = < 0x02 0x15 >;
			#size-cells = < 0x00 >;
			phandle = < 0x2a >;
			reg = < 0x7e804000 0x1000 >;
			clock-frequency = < 0x186a0 >;
			pinctrl-0 = < 0x17 >;
			pinctrl-names = "default";

			rpi-sense@46 {
				compatible = "rpi,rpi-sense";
				status = "okay";
				keys-int-gpios = < 0x10 0x17 0x01 >;
				reg = < 0x46 >;
			};

			lsm9ds1-accel6a {
				compatible = "st,lsm9ds1-accel";
				status = "okay";
				reg = < 0x6a >;
			};

			hts221-humid@5f {
				compatible = "st,hts221-humid";
				status = "okay";
				reg = < 0x5f >;
			};

			lps25h-press@5c {
				compatible = "st,lps25h-press";
				status = "okay";
				reg = < 0x5c >;
			};

			lsm9ds1-magn@1c {
				compatible = "st,lsm9ds1-magn";
				status = "okay";
				reg = < 0x1c >;
			};
		};


	hat {
		vendor = "Raspberry Pi";
		product = "Sense HAT";
		uuid = "a72d266e-ec98-4778-a94a-8eaee53be043";
		product_ver = "0x0001";
		product_id = "0x0001";
	};
dmesg

Code: Select all

pi@raspberrypi:~ $ sudo dmesg
[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Linux version 5.10.17-v7+ (dom@buildbot) (arm-linux-gnueabihf-gcc-8 (Ubuntu/Linaro 8.4.0-3ubuntu1) 8.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #1421 SMP Thu May 27 13:59:01 BST 2021
[    0.000000] CPU: ARMv7 Processor [410fd034] revision 4 (ARMv7), cr=10c5383d
[    0.000000] CPU: div instructions available: patching division code
[    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[    0.000000] OF: fdt: Machine model: Raspberry Pi 3 Model B Rev 1.2
[    0.000000] Memory policy: Data cache writealloc
[    0.000000] Reserved memory: created CMA memory pool at 0x34000000, size 64 MiB
[    0.000000] OF: reserved mem: initialized node linux,cma, compatible id shared-dma-pool
[    0.000000] Zone ranges:
[    0.000000]   DMA      [mem 0x0000000000000000-0x0000000037ffffff]
[    0.000000]   Normal   empty
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000000000000-0x0000000037ffffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000000000000-0x0000000037ffffff]
[    0.000000] On node 0 totalpages: 229376
[    0.000000]   DMA zone: 2016 pages used for memmap
[    0.000000]   DMA zone: 0 pages reserved
[    0.000000]   DMA zone: 229376 pages, LIFO batch:63
[    0.000000] percpu: Embedded 20 pages/cpu s50700 r8192 d23028 u81920
[    0.000000] pcpu-alloc: s50700 r8192 d23028 u81920 alloc=20*4096
[    0.000000] pcpu-alloc: [0] 0 [0] 1 [0] 2 [0] 3 
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 227360
[    0.000000] Kernel command line: coherent_pool=1M 8250.nr_uarts=1 snd_bcm2835.enable_compat_alsa=0 snd_bcm2835.enable_hdmi=1 bcm2708_fb.fbwidth=656 bcm2708_fb.fbheight=416 bcm2708_fb.fbswap=1 vc_mem.mem_base=0x3ec00000 vc_mem.mem_size=0x40000000  console=ttyAMA0,115200 console=tty1 root=PARTUUID=f9296a32-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait
[    0.000000] Kernel parameter elevator= does not have any effect anymore.
               Please use sysfs to set IO scheduler for individual devices.
[    0.000000] Dentry cache hash table entries: 131072 (order: 7, 524288 bytes, linear)
[    0.000000] Inode-cache hash table entries: 65536 (order: 6, 262144 bytes, linear)
[    0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[    0.000000] Memory: 827052K/917504K available (9216K kernel code, 1311K rwdata, 2940K rodata, 1024K init, 860K bss, 24916K reserved, 65536K cma-reserved)
[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=4, Nodes=1
[    0.000000] ftrace: allocating 31910 entries in 63 pages
[    0.000000] ftrace: allocated 63 pages with 6 groups
[    0.000000] rcu: Hierarchical RCU implementation.
[    0.000000] 	Rude variant of Tasks RCU enabled.
[    0.000000] 	Tracing variant of Tasks RCU enabled.
[    0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 10 jiffies.
[    0.000000] NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16
[    0.000000] random: get_random_bytes called from start_kernel+0x3ac/0x580 with crng_init=0
[    0.000000] arch_timer: cp15 timer(s) running at 19.20MHz (phys).
[    0.000000] clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0x46d987e47, max_idle_ns: 440795202767 ns
[    0.000004] sched_clock: 56 bits at 19MHz, resolution 52ns, wraps every 4398046511078ns
[    0.000013] Switching to timer-based delay loop, resolution 52ns
[    0.000175] Console: colour dummy device 80x30
[    0.000611] printk: console [tty1] enabled
[    0.000654] Calibrating delay loop (skipped), value calculated using timer frequency.. 38.40 BogoMIPS (lpj=192000)
[    0.000685] pid_max: default: 32768 minimum: 301
[    0.000807] LSM: Security Framework initializing
[    0.000947] Mount-cache hash table entries: 2048 (order: 1, 8192 bytes, linear)
[    0.000974] Mountpoint-cache hash table entries: 2048 (order: 1, 8192 bytes, linear)
[    0.001874] Disabling memory control group subsystem
[    0.001949] CPU: Testing write buffer coherency: ok
[    0.002258] CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
[    0.002920] Setting up static identity map for 0x100000 - 0x10003c
[    0.003027] rcu: Hierarchical SRCU implementation.
[    0.003532] smp: Bringing up secondary CPUs ...
[    0.004204] CPU1: thread -1, cpu 1, socket 0, mpidr 80000001
[    0.004925] CPU2: thread -1, cpu 2, socket 0, mpidr 80000002
[    0.005581] CPU3: thread -1, cpu 3, socket 0, mpidr 80000003
[    0.005661] smp: Brought up 1 node, 4 CPUs
[    0.005713] SMP: Total of 4 processors activated (153.60 BogoMIPS).
[    0.005729] CPU: All CPU(s) started in HYP mode.
[    0.005743] CPU: Virtualization extensions available.
[    0.006325] devtmpfs: initialized
[    0.015414] VFP support v0.3: implementor 41 architecture 3 part 40 variant 3 rev 4
[    0.015571] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.015604] futex hash table entries: 1024 (order: 4, 65536 bytes, linear)
[    0.017292] pinctrl core: initialized pinctrl subsystem
[    0.017988] NET: Registered protocol family 16
[    0.020405] DMA: preallocated 1024 KiB pool for atomic coherent allocations
[    0.023339] audit: initializing netlink subsys (disabled)
[    0.023531] audit: type=2000 audit(0.020:1): state=initialized audit_enabled=0 res=1
[    0.023861] thermal_sys: Registered thermal governor 'step_wise'
[    0.024387] hw-breakpoint: found 5 (+1 reserved) breakpoint and 4 watchpoint registers.
[    0.024419] hw-breakpoint: maximum watchpoint size is 8 bytes.
[    0.024588] Serial: AMBA PL011 UART driver
[    0.033588] bcm2835-mbox 3f00b880.mailbox: mailbox enabled
[    0.050044] raspberrypi-firmware soc:firmware: Attached to firmware from 2021-05-27T14:04:13, variant start
[    0.060051] raspberrypi-firmware soc:firmware: Firmware hash is 7d9a298cda813f747b51fe17e1e417e7bf5ca94d
[    0.089679] bcm2835-dma 3f007000.dma: DMA legacy API manager, dmachans=0x1
[    0.090956] SCSI subsystem initialized
[    0.091101] usbcore: registered new interface driver usbfs
[    0.091145] usbcore: registered new interface driver hub
[    0.091198] usbcore: registered new device driver usb
[    0.092298] clocksource: Switched to clocksource arch_sys_counter
[    0.982385] VFS: Disk quotas dquot_6.6.0
[    0.982465] VFS: Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
[    0.982581] FS-Cache: Loaded
[    0.982758] CacheFiles: Loaded
[    0.988418] NET: Registered protocol family 2
[    0.989097] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 6144 bytes, linear)
[    0.989145] TCP established hash table entries: 8192 (order: 3, 32768 bytes, linear)
[    0.989218] TCP bind hash table entries: 8192 (order: 4, 65536 bytes, linear)
[    0.989326] TCP: Hash tables configured (established 8192 bind 8192)
[    0.989440] UDP hash table entries: 512 (order: 2, 16384 bytes, linear)
[    0.989481] UDP-Lite hash table entries: 512 (order: 2, 16384 bytes, linear)
[    0.989745] NET: Registered protocol family 1
[    0.990170] RPC: Registered named UNIX socket transport module.
[    0.990188] RPC: Registered udp transport module.
[    0.990203] RPC: Registered tcp transport module.
[    0.990218] RPC: Registered tcp NFSv4.1 backchannel transport module.
[    0.991148] hw perfevents: enabled with armv7_cortex_a7 PMU driver, 7 counters available
[    0.993215] Initialise system trusted keyrings
[    0.993389] workingset: timestamp_bits=14 max_order=18 bucket_order=4
[    0.998252] zbud: loaded
[    0.999350] FS-Cache: Netfs 'nfs' registered for caching
[    0.999844] NFS: Registering the id_resolver key type
[    0.999882] Key type id_resolver registered
[    0.999898] Key type id_legacy registered
[    0.999990] nfs4filelayout_init: NFSv4 File Layout Driver Registering...
[    1.000653] Key type asymmetric registered
[    1.000670] Asymmetric key parser 'x509' registered
[    1.000709] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 249)
[    1.000730] io scheduler mq-deadline registered
[    1.000746] io scheduler kyber registered
[    1.003511] bcm2708_fb soc:fb: FB found 1 display(s)
[    1.010426] Console: switching to colour frame buffer device 82x26
[    1.014072] bcm2708_fb soc:fb: Registered framebuffer for display 0, size 656x416
[    1.018465] Serial: 8250/16550 driver, 1 ports, IRQ sharing enabled
[    1.020958] bcm2835-rng 3f104000.rng: hwrng registered
[    1.022470] vc-mem: phys_addr:0x00000000 mem_base=0x3ec00000 mem_size:0x40000000(1024 MiB)
[    1.025469] gpiomem-bcm2835 3f200000.gpiomem: Initialised: Registers at 0x3f200000
[    1.034359] brd: module loaded
[    1.042128] loop: module loaded
[    1.044399] Loading iSCSI transport class v2.0-870.
[    1.046653] libphy: Fixed MDIO Bus: probed
[    1.048134] usbcore: registered new interface driver lan78xx
[    1.049496] usbcore: registered new interface driver smsc95xx
[    1.050805] dwc_otg: version 3.00a 10-AUG-2012 (platform bus)
[    1.780062] Core Release: 2.80a
[    1.781308] Setting default values for core params
[    1.782583] Finished setting default values for core params
[    1.984064] Using Buffer DMA mode
[    1.985331] Periodic Transfer Interrupt Enhancement - disabled
[    1.986622] Multiprocessor Interrupt Enhancement - disabled
[    1.987900] OTG VER PARAM: 0, OTG VER FLAG: 0
[    1.989142] Dedicated Tx FIFOs mode

[    1.990629] WARN::dwc_otg_hcd_init:1074: FIQ DMA bounce buffers: virt = b4104000 dma = 0xf4104000 len=9024
[    1.994129] FIQ FSM acceleration enabled for :
               Non-periodic Split Transactions
               Periodic Split Transactions
               High-Speed Isochronous Endpoints
               Interrupt/Control Split Transaction hack enabled
[    1.999605] dwc_otg: Microframe scheduler enabled

[    1.999646] WARN::hcd_init_fiq:457: FIQ on core 1

[    2.001818] WARN::hcd_init_fiq:458: FIQ ASM at 807be568 length 36

[    2.004053] WARN::hcd_init_fiq:497: MPHI regs_base at b8810000
[    2.006298] dwc_otg 3f980000.usb: DWC OTG Controller
[    2.007462] dwc_otg 3f980000.usb: new USB bus registered, assigned bus number 1
[    2.008655] dwc_otg 3f980000.usb: irq 89, io mem 0x00000000
[    2.009837] Init: Port Power? op_state=1
[    2.010960] Init: Power Port (0)
[    2.012241] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 5.10
[    2.014570] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    2.015812] usb usb1: Product: DWC OTG Controller
[    2.016999] usb usb1: Manufacturer: Linux 5.10.17-v7+ dwc_otg_hcd
[    2.018204] usb usb1: SerialNumber: 3f980000.usb
[    2.019823] hub 1-0:1.0: USB hub found
[    2.021056] hub 1-0:1.0: 1 port detected
[    2.022810] dwc_otg: FIQ enabled
[    2.022816] dwc_otg: NAK holdoff enabled
[    2.022822] dwc_otg: FIQ split-transaction FSM enabled
[    2.022832] Module dwc_common_port init
[    2.023021] usbcore: registered new interface driver usb-storage
[    2.024364] mousedev: PS/2 mouse device common for all mice
[    2.026227] bcm2835-wdt bcm2835-wdt: Broadcom BCM2835 watchdog timer
[    2.028559] sdhci: Secure Digital Host Controller Interface driver
[    2.029831] sdhci: Copyright(c) Pierre Ossman
[    2.031442] sdhost-bcm2835 3f202000.mmc: could not get clk, deferring probe
[    2.032893] sdhci-pltfm: SDHCI platform and OF driver helper
[    2.035461] ledtrig-cpu: registered to indicate activity on CPUs
[    2.036962] hid: raw HID events driver (C) Jiri Kosina
[    2.038347] usbcore: registered new interface driver usbhid
[    2.039632] usbhid: USB HID core driver
[    2.043637] Initializing XFRM netlink socket
[    2.044966] NET: Registered protocol family 17
[    2.046296] Key type dns_resolver registered
[    2.047848] Registering SWP/SWPB emulation handler
[    2.049128] registered taskstats version 1
[    2.050283] Loading compiled-in X.509 certificates
[    2.051898] Key type ._fscrypt registered
[    2.053051] Key type .fscrypt registered
[    2.054165] Key type fscrypt-provisioning registered
[    2.061202] uart-pl011 3f201000.serial: there is not valid maps for state default
[    2.063704] uart-pl011 3f201000.serial: cts_event_workaround enabled
[    2.064964] 3f201000.serial: ttyAMA0 at MMIO 0x3f201000 (irq = 114, base_baud = 0) is a PL011 rev2
[    3.113633] printk: console [ttyAMA0] enabled
[    3.120712] bcm2835-power bcm2835-power: Broadcom BCM2835 power domains driver
[    3.130104] sdhost: log_buf @ (ptrval) (f4107000)
[    3.184233] mmc0: sdhost-bcm2835 loaded - DMA enabled (>1)
[    3.192512] of_cfs_init
[    3.196308] of_cfs_init: OK
[    3.200836] Waiting for root device PARTUUID=f9296a32-02...
[    3.232401] Indeed it is in host mode hprt0 = 00021501
[    3.322894] random: fast init done
[    3.334733] mmc0: host does not support reading read-only switch, assuming write-enable
[    3.349657] mmc0: new high speed SDHC card at address aaaa
[    3.356989] mmcblk0: mmc0:aaaa SL32G 28.8 GiB
[    3.364568]  mmcblk0: p1 p2
[    3.394661] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
[    3.405548] VFS: Mounted root (ext4 filesystem) readonly on device 179:2.
[    3.423431] devtmpfs: mounted
[    3.431324] Freeing unused kernel memory: 1024K
[    3.442319] usb 1-1: new high-speed USB device number 2 using dwc_otg
[    3.450178] Indeed it is in host mode hprt0 = 00001101
[    3.516888] Run /sbin/init as init process
[    3.522275]   with arguments:
[    3.522289]     /sbin/init
[    3.522294]   with environment:
[    3.522300]     HOME=/
[    3.522306]     TERM=linux
[    3.692546] usb 1-1: New USB device found, idVendor=0424, idProduct=9514, bcdDevice= 2.00
[    3.703425] usb 1-1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[    3.712495] hub 1-1:1.0: USB hub found
[    3.717758] hub 1-1:1.0: 5 ports detected
[    4.042349] usb 1-1.1: new high-speed USB device number 3 using dwc_otg
[    4.108588] systemd[1]: System time before build time, advancing clock.
[    4.172539] usb 1-1.1: New USB device found, idVendor=0424, idProduct=ec00, bcdDevice= 2.00
[    4.183755] usb 1-1.1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[    4.195071] smsc95xx v2.0.0
[    4.259819] NET: Registered protocol family 10
[    4.266581] Segment Routing with IPv6
[    4.301088] libphy: smsc95xx-mdiobus: probed
[    4.307565] smsc95xx 1-1.1:1.0 eth0: register 'smsc95xx' at usb-3f980000.usb-1.1, smsc95xx USB 2.0 Ethernet, b8:27:eb:1a:41:70
[    4.342689] systemd[1]: systemd 241 running in system mode. (+PAM +AUDIT +SELINUX +IMA +APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD -IDN2 +IDN -PCRE2 default-hierarchy=hybrid)
[    4.369363] systemd[1]: Detected architecture arm.
[    4.436978] systemd[1]: Set hostname to <raspberrypi>.
[    4.556862] uart-pl011 3f201000.serial: no DMA platform data
[    5.107645] random: systemd: uninitialized urandom read (16 bytes read)
[    5.124477] random: systemd: uninitialized urandom read (16 bytes read)
[    5.133155] systemd[1]: Listening on udev Kernel Socket.
[    5.141781] random: systemd: uninitialized urandom read (16 bytes read)
[    5.149837] systemd[1]: Reached target Swap.
[    5.158372] systemd[1]: Created slice User and Session Slice.
[    5.167289] systemd[1]: Reached target Slices.
[    5.175433] systemd[1]: Set up automount Arbitrary Executable File Formats File System Automount Point.
[    5.189388] systemd[1]: Started Forward Password Requests to Wall Directory Watch.
[    5.201493] systemd[1]: Started Dispatch Password Requests to Console Directory Watch.
[    5.262398] usb 1-1.2: new high-speed USB device number 4 using dwc_otg
[    5.394102] usb 1-1.2: New USB device found, idVendor=0bc2, idProduct=ab24, bcdDevice= 1.00
[    5.405003] usb 1-1.2: New USB device strings: Mfr=2, Product=3, SerialNumber=1
[    5.413726] usb 1-1.2: Product: BUP Slim BL
[    5.419200] usb 1-1.2: Manufacturer: Seagate
[    5.424793] usb 1-1.2: SerialNumber: NA7ZPM7M
[    5.431186] usb 1-1.2: The driver for the USB controller dwc_otg_hcd does not support scatter-gather which is
[    5.443775] usb 1-1.2: required by the UAS driver. Please try an other USB controller if you wish to use UAS.
[    5.456365] usb-storage 1-1.2:1.0: USB Mass Storage device detected
[    5.465970] scsi host0: usb-storage 1-1.2:1.0
[    5.474081] i2c /dev entries driver
[    5.851793] EXT4-fs (mmcblk0p2): re-mounted. Opts: (null)
[    5.923804] systemd-journald[114]: Received request to flush runtime journal from PID 1
[    6.461342] usbcore: registered new interface driver uas
[    6.473167] scsi 0:0:0:0: Direct-Access     Seagate  BUP Slim BL      0304 PQ: 0 ANSI: 6
[    6.475230] sd 0:0:0:0: [sda] Spinning up disk...
[    6.614695] vc_sm_cma: module is from the staging directory, the quality is unknown, you have been warned.
[    6.616059] bcm2835_vc_sm_cma_probe: Videocore shared memory driver
[    6.616074] [vc_sm_connected_init]: start
[    6.617900] [vc_sm_connected_init]: installed successfully
[    6.622158] mc: Linux media interface: v0.10
[    6.664599] videodev: Linux video capture interface: v2.00
[    6.714212] bcm2835_mmal_vchiq: module is from the staging directory, the quality is unknown, you have been warned.
[    6.714216] bcm2835_mmal_vchiq: module is from the staging directory, the quality is unknown, you have been warned.
[    6.715745] bcm2835_mmal_vchiq: module is from the staging directory, the quality is unknown, you have been warned.
[    6.727114] bcm2835_v4l2: module is from the staging directory, the quality is unknown, you have been warned.
[    6.734695] bcm2835_isp: module is from the staging directory, the quality is unknown, you have been warned.
[    6.744261] bcm2835_codec: module is from the staging directory, the quality is unknown, you have been warned.
[    6.752985] bcm2835-isp bcm2835-isp: Device node output[0] registered as /dev/video13
[    6.753354] bcm2835-isp bcm2835-isp: Device node capture[0] registered as /dev/video14
[    6.753661] bcm2835-isp bcm2835-isp: Device node capture[1] registered as /dev/video15
[    6.754016] bcm2835-codec bcm2835-codec: Device registered as /dev/video10
[    6.754048] bcm2835-codec bcm2835-codec: Loaded V4L2 decode
[    6.754598] bcm2835-isp bcm2835-isp: Device node stats[2] registered as /dev/video16
[    6.754618] bcm2835-isp bcm2835-isp: Register output node 0 with media controller
[    6.754631] bcm2835-isp bcm2835-isp: Register capture node 1 with media controller
[    6.754643] bcm2835-isp bcm2835-isp: Register capture node 2 with media controller
[    6.754654] bcm2835-isp bcm2835-isp: Register capture node 3 with media controller
[    6.754813] bcm2835-isp bcm2835-isp: Loaded V4L2 bcm2835-isp
[    6.773183] bcm2835-codec bcm2835-codec: Device registered as /dev/video11
[    6.773277] bcm2835-codec bcm2835-codec: Loaded V4L2 encode
[    6.785150] bcm2835-codec bcm2835-codec: Device registered as /dev/video12
[    6.785189] bcm2835-codec bcm2835-codec: Loaded V4L2 isp
[    6.815724] sd 0:0:0:0: Attached scsi generic sg0 type 0
[    7.018584] rpi-sense 1-0046: Raspberry Pi Sense HAT firmware version 0
[    7.096977] input: Raspberry Pi Sense HAT Joystick as /devices/virtual/input/input0
[    7.251628] fb1: RPi-Sense FB frame buffer device
[    7.512323] .ready
[    7.512710] sd 0:0:0:0: [sda] 1953525167 512-byte logical blocks: (1.00 TB/932 GiB)
[    7.552544] sd 0:0:0:0: [sda] Write Protect is off
[    7.552557] sd 0:0:0:0: [sda] Mode Sense: 4f 00 00 00
[    7.552950] sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[    7.658321]  sda: sda1
[    7.660896] sd 0:0:0:0: [sda] Attached SCSI disk
[    8.224006] fuse: init (API version 7.32)
[    9.897867] random: crng init done
[    9.897900] random: 7 urandom warning(s) missed due to ratelimiting
[   10.297999] 8021q: 802.1Q VLAN Support v1.8
[   10.487646] cfg80211: Loading compiled-in X.509 certificates for regulatory database
[   10.577168] cfg80211: Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7'
[   10.722425] Adding 102396k swap on /var/swap.  Priority:-2 extents:1 across:102396k SSFS
[   10.864660] SMSC LAN8700 usb-001:003:01: attached PHY driver [SMSC LAN8700] (mii_bus:phy_addr=usb-001:003:01, irq=POLL)
[   10.865077] smsc95xx 1-1.1:1.0 eth0: hardware isn't capable of remote wakeup
[   10.874092] smsc95xx 1-1.1:1.0 eth0: Link is Down
[   16.073027] smsc95xx 1-1.1:1.0 eth0: Link is Up - 100Mbps/Full - flow control off
[   16.073062] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
[   17.599026] ICMPv6: process `dhcpcd' is using deprecated sysctl (syscall) net.ipv6.neigh.eth0.retrans_time - use net.ipv6.neigh.eth0.retrans_time_ms instead
[   40.102717] rpi-sense 1-0046: Block write failed
[   42.022531] rpi-sense 1-0046: Block write failed
[   42.092762] rpi-sense 1-0046: Block write failed
[   42.162973] rpi-sense 1-0046: Block write failed
[   42.233182] rpi-sense 1-0046: Block write failed
ls /dev/fb*

Code: Select all

/dev/fb0  /dev/fb1
i2cdetect -y 1

Code: Select all

     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: -- -- -- -- -- -- -- --                         
raspi-gpio get

Code: Select all

BANK0 (GPIO 0 to 27):
GPIO 0: level=1 fsel=0 func=INPUT
GPIO 1: level=1 fsel=0 func=INPUT
GPIO 2: level=1 fsel=4 alt=0 func=SDA1
GPIO 3: level=1 fsel=0 func=INPUT
GPIO 4: level=1 fsel=0 func=INPUT
GPIO 5: level=1 fsel=0 func=INPUT
GPIO 6: level=1 fsel=0 func=INPUT
GPIO 7: level=1 fsel=0 func=INPUT
GPIO 8: level=1 fsel=0 func=INPUT
GPIO 9: level=0 fsel=0 func=INPUT
GPIO 10: level=0 fsel=0 func=INPUT
GPIO 11: level=0 fsel=0 func=INPUT
GPIO 12: level=0 fsel=0 func=INPUT
GPIO 13: level=0 fsel=0 func=INPUT
GPIO 14: level=1 fsel=4 alt=0 func=TXD0
GPIO 15: level=1 fsel=4 alt=0 func=RXD0
GPIO 16: level=0 fsel=0 func=INPUT
GPIO 17: level=0 fsel=0 func=INPUT
GPIO 18: level=0 fsel=0 func=INPUT
GPIO 19: level=0 fsel=0 func=INPUT
GPIO 20: level=0 fsel=0 func=INPUT
GPIO 21: level=0 fsel=0 func=INPUT
GPIO 22: level=0 fsel=0 func=INPUT
GPIO 23: level=0 fsel=0 func=INPUT
GPIO 24: level=0 fsel=0 func=INPUT
GPIO 25: level=1 fsel=0 func=INPUT
GPIO 26: level=0 fsel=0 func=INPUT
GPIO 27: level=0 fsel=0 func=INPUT
BANK1 (GPIO 28 to 45):
GPIO 28: level=0 fsel=0 func=INPUT
GPIO 29: level=1 fsel=0 func=INPUT
GPIO 30: level=0 fsel=0 func=INPUT
GPIO 31: level=0 fsel=0 func=INPUT
GPIO 32: level=0 fsel=0 func=INPUT
GPIO 33: level=0 fsel=0 func=INPUT
GPIO 34: level=1 fsel=0 func=INPUT
GPIO 35: level=1 fsel=0 func=INPUT
GPIO 36: level=1 fsel=0 func=INPUT
GPIO 37: level=1 fsel=0 func=INPUT
GPIO 38: level=1 fsel=0 func=INPUT
GPIO 39: level=1 fsel=0 func=INPUT
GPIO 40: level=0 fsel=4 alt=0 func=PWM0
GPIO 41: level=0 fsel=4 alt=0 func=PWM1
GPIO 42: level=0 fsel=4 alt=0 func=GPCLK1
GPIO 43: level=1 fsel=4 alt=0 func=GPCLK2
GPIO 44: level=1 fsel=0 func=INPUT
GPIO 45: level=1 fsel=0 func=INPUT
BANK2 (GPIO 46 to 53):
GPIO 46: level=1 fsel=0 func=INPUT
GPIO 47: level=1 fsel=1 func=OUTPUT
GPIO 48: level=0 fsel=4 alt=0 func=SD0_CLK
GPIO 49: level=1 fsel=4 alt=0 func=SD0_CMD
GPIO 50: level=1 fsel=4 alt=0 func=SD0_DAT0
GPIO 51: level=1 fsel=4 alt=0 func=SD0_DAT1
GPIO 52: level=1 fsel=4 alt=0 func=SD0_DAT2
GPIO 53: level=1 fsel=4 alt=0 func=SD0_DAT3
config.txt

Code: Select all

disable_overscan=0
dtparam=i2c_arm=on
dtparam=spi=off
#hdmi_force_hotplug=1
[pi4]
max_framebuffers=2
[all]
gpu_mem=128
[all]
dtoverlay=disable-wifi
dtoverlay=disable-bt
dtoverlay=rpi-sense
#dtoverlay=rpi.sense
#force_turbo=1
vcgencmd version

Code: Select all

May 27 2021 14:04:13 
Copyright (c) 2012 Broadcom
version 7d9a298cda813f747b51fe17e1e417e7bf5ca94d (clean) (release) (start)

cat /etc/udev/rules.d/99-i2c.rules

Code: Select all

KERNEL=="i2c-[0-7]",MODE="0666"

sudo vcdbg log msg

Code: Select all

001234.356: brfs: File read: /mfs/sd/config.txt
001235.536: brfs: File read: 1957 bytes
001288.492: HDMI0:EDID error reading EDID block 0 attempt 0
001289.757: HDMI0:EDID error reading EDID block 0 attempt 1
001291.023: HDMI0:EDID error reading EDID block 0 attempt 2
001292.287: HDMI0:EDID error reading EDID block 0 attempt 3
001293.553: HDMI0:EDID error reading EDID block 0 attempt 4
001294.818: HDMI0:EDID error reading EDID block 0 attempt 5
001296.084: HDMI0:EDID error reading EDID block 0 attempt 6
001297.348: HDMI0:EDID error reading EDID block 0 attempt 7
001298.614: HDMI0:EDID error reading EDID block 0 attempt 8
001299.879: HDMI0:EDID error reading EDID block 0 attempt 9
001300.903: HDMI0:EDID giving up on reading EDID block 0
001303.527: brfs: File read: /mfs/sd/config.txt
001304.641: gpioman: gpioman_get_pin_num: pin LEDS_PWR_OK not defined
001324.384: brfs: File read: 1957 bytes
001509.189: gpioman: gpioman_get_pin_num: pin DISPLAY_DSI_PORT not defined
001510.515: gpioman: gpioman_get_pin_num: pin LEDS_PWR_OK not defined
001510.569: *** Restart logging
001511.719: hdmi: HDMI0:EDID error reading EDID block 0 attempt 0
001512.990: hdmi: HDMI0:EDID error reading EDID block 0 attempt 1
001514.258: hdmi: HDMI0:EDID error reading EDID block 0 attempt 2
001515.528: hdmi: HDMI0:EDID error reading EDID block 0 attempt 3
001516.795: hdmi: HDMI0:EDID error reading EDID block 0 attempt 4
001518.065: hdmi: HDMI0:EDID error reading EDID block 0 attempt 5
001519.334: hdmi: HDMI0:EDID error reading EDID block 0 attempt 6
001520.603: hdmi: HDMI0:EDID error reading EDID block 0 attempt 7
001521.870: hdmi: HDMI0:EDID error reading EDID block 0 attempt 8
001523.139: hdmi: HDMI0:EDID error reading EDID block 0 attempt 9
001524.165: hdmi: HDMI0:EDID giving up on reading EDID block 0
001524.500: hdmi: HDMI0:EDID error reading EDID block 0 attempt 0
001525.770: hdmi: HDMI0:EDID error reading EDID block 0 attempt 1
001527.038: hdmi: HDMI0:EDID error reading EDID block 0 attempt 2
001528.307: hdmi: HDMI0:EDID error reading EDID block 0 attempt 3
001529.574: hdmi: HDMI0:EDID error reading EDID block 0 attempt 4
001530.844: hdmi: HDMI0:EDID error reading EDID block 0 attempt 5
001532.112: hdmi: HDMI0:EDID error reading EDID block 0 attempt 6
001533.382: hdmi: HDMI0:EDID error reading EDID block 0 attempt 7
001534.649: hdmi: HDMI0:EDID error reading EDID block 0 attempt 8
001535.918: hdmi: HDMI0:EDID error reading EDID block 0 attempt 9
001536.944: hdmi: HDMI0:EDID giving up on reading EDID block 0
001537.243: hdmi: HDMI:hdmi_get_state is deprecated, use hdmi_get_display_state instead
001537.267: HDMI0: hdmi_pixel_encoding: 162000000
001537.512: vec: vec_middleware_power_on: vec_base: 0x7e806000 rev-id 0x00002708 @ vec: 0x7e806100 @ 0x00000420 enc: 0x7e806060 @ 0x00000220 cgmsae: 0x7e80605c @ 0x00000000
001634.660: dtb_file 'bcm2710-rpi-3-b.dtb'
001639.364: brfs: File read: /mfs/sd/bcm2710-rpi-3-b.dtb
001639.389: Loading 'bcm2710-rpi-3-b.dtb' to 0x100 size 0x6ee8
001653.009: brfs: File read: 28392 bytes
001668.551: brfs: File read: /mfs/sd/overlays/overlay_map.dtb
001735.622: brfs: File read: 1523 bytes
001739.356: brfs: File read: /mfs/sd/config.txt
001747.353: Loaded HAT overlay
001747.369: dtparam: i2c_arm=on
001755.777: dtparam: spi=off
001784.345: brfs: File read: 1957 bytes
001788.173: brfs: File read: /mfs/sd/overlays/disable-wifi.dtbo
001798.591: Loaded overlay 'disable-wifi'
001814.347: brfs: File read: 387 bytes
001817.304: brfs: File read: /mfs/sd/overlays/disable-bt.dtbo
001832.769: Loaded overlay 'disable-bt'
001871.133: brfs: File read: 1073 bytes
001873.024: brfs: File read: /mfs/sd/cmdline.txt
001873.074: Read command line from file 'cmdline.txt':
001873.094: 'console=serial0,115200 console=tty1 root=PARTUUID=f9296a32-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait'
003692.896: gpioman: gpioman_get_pin_num: pin EMMC_ENABLE not defined
003764.162: brfs: File read: 121 bytes
004204.516: brfs: File read: /mfs/sd/kernel7.img
004204.539: Loading 'kernel7.img' to 0x8000 size 0x607300
004204.569: Device tree loaded to 0x2eff8a00 (size 0x75ba)
004207.123: gpioman: gpioman_get_pin_num: pin SDCARD_CONTROL_POWER not defined
007963.698: vchiq_core: vchiq_init_state: slot_zero = 0xf4180000, is_master = 1
lsmod | grep sense

Code: Select all

rpisense_fb            16384  0
syscopyarea            16384  1 rpisense_fb
sysfillrect            16384  1 rpisense_fb
sysimgblt              16384  1 rpisense_fb
fb_sys_fops            16384  1 rpisense_fb
rpisense_js            16384  0
rpisense_core          16384  2 rpisense_js,rpisense_fb

sudo RTIMULibDrive11

Code: Select all

Settings file RTIMULib.ini loaded
Failed to open SPI bus 0, select 0
Failed to open SPI bus 0, select 1
No IMU detected
Using fusion algorithm RTQF
Failed to open SPI bus 0, select 1
No pressure sensor detected
Failed to open SPI bus 0, select 1
No humidity sensor detected
No IMU found

I am also to see the Rainbow pattern in the LEDs when powering it on.
I have also tried to reseat the SensHat on the Raspberry pi 3 as well. The screws are tightened as well.
Everything was working fine before the upgrade and following reboot.
A similar issue occurred 3-4 months before as well, which got resolved after subsequent updates.
Please help in troubleshooting the issue.

Re: OSError: Humidity Init Failed

Posted: Tue Jun 22, 2021 2:21 pm
by ShiftPlusOne
I couldn't reproduce the issue, but I notice that your raspi-gpio output has:

Code: Select all

GPIO 3: level=1 fsel=0 func=INPUT
But it should be:

Code: Select all

GPIO 3: level=1 fsel=4 alt=0 func=SCL1
In config.txt, please remove the dtoverlay line for rpi-sense, it's not needed. Instead, add dtdebug=1, reboot and post the output of "sudo vcgencmd log msg".

At a glance, it looks like something is hijacking gpio3 after you've booted. Do you have any software running that might be doing that?

Re: OSError: Humidity Init Failed

Posted: Tue Jun 22, 2021 2:52 pm
by ShiftPlusOne
You can verify by running "raspi-gpio set 3 a0" and then running your temp check python script again.

Re: OSError: Humidity Init Failed

Posted: Tue Jun 22, 2021 8:12 pm
by amanjosan2008
ShiftPlusOne wrote:
Tue Jun 22, 2021 2:21 pm
I couldn't reproduce the issue, but I notice that your raspi-gpio output has:

Code: Select all

GPIO 3: level=1 fsel=0 func=INPUT
But it should be:

Code: Select all

GPIO 3: level=1 fsel=4 alt=0 func=SCL1
In config.txt, please remove the dtoverlay line for rpi-sense, it's not needed. Instead, add dtdebug=1, reboot and post the output of "sudo vcgencmd log msg".

At a glance, it looks like something is hijacking gpio3 after you've booted. Do you have any software running that might be doing that?
Bravo.. You found the issue.
It was indeed a script running at boot up (to shut down Raspberry pi using GPIO switch).
My bad failed to notice it did all sorts of other troubleshooting.. :oops:
Thank you so much for your help.