- slow down fan speed to reduce the noise
sudo nano /boot/firmware/config.txt
add:
dtparam=fan_temp0=60000
dtparam=fan_temp0_hyst=5000
- If it did not work then it could be bearings worn out
sudo nano /boot/firmware/config.txt
add:
dtparam=fan_temp0=60000
dtparam=fan_temp0_hyst=5000
I have raspberry pi 4 with raspbian os lite installed and the OS is directly installed on SSD which is connected with USB3.0 with connector USB-to-SATA. Whenever the power outage happens the pi some time boots and sometime it doesn’t and it also takes lots of time to boot 10min+
root@lp-arm-3:~# systemd-analyze blame
1min 36.522s docker.service
51.427s containerd.service
50.609s rpi-eeprom-update.service
50.590s user@1000.service
50.221s ModemManager.service
49.702s NetworkManager-wait-online.service
38.108s apt-daily-upgrade.service
32.277s dpkg-db-backup.service
2.558s dev-sda2.device
1.281s raspi-config.service
670ms man-db.service
613ms NetworkManager.service
583ms keyboard-setup.service
536ms systemd-logind.service
512ms systemd-udev-trigger.service
429ms systemd-journald.service
root@lp-arm-3:~# systemd-analyze
Startup finished in 36.419s (kernel) + 2min 33.375s (userspace) = 3min 9.794s
multi-user.target reached after 2min 33.318s in userspace.
root@lp-arm-3:~# systemd-analyze critical-chain
The time when unit became active or started is printed after the "@" character.
The time the unit took to start is printed after the "+" character.
multi-user.target @2min 33.318s
└─kubelet.service @1min 6.646s
└─network-online.target @55.038s
└─NetworkManager-wait-online.service @5.315s +49.702s
└─NetworkManager.service @4.687s +613ms
└─dbus.service @4.552s +97ms
└─basic.target @4.509s
└─sockets.target @4.509s
└─docker.socket @4.485s +23ms
└─sysinit.target @4.468s
└─systemd-timesyncd.service @4.091s +375ms
└─systemd-tmpfiles-setup.service @3.805s +208ms
└─local-fs.target @3.777s
└─run-user-1000.mount @5.576s
└─local-fs-pre.target @1.650s
└─keyboard-setup.service @1.065s +583ms
└─systemd-journald.socket @1.019s
└─-.mount @946ms
└─-.slice @946ms
journalctl --list-boots
journalctl -b -1
show only error
journalctl -b -1 -p err
Feb 07 20:40:53 lp-arm-3.home kernel: sd 0:0:0:0: [sda] tag#9 uas_eh_abort_handler 0 uas-tag 15 inflight: CMD OUT Feb 07 20:40:53 lp-arm-3.home kernel: sd 0:0:0:0: [sda] tag#9 CDB: opcode=0x2a 2a 00 01 50 21 78 00 00 08 00 Feb 07 20:40:53 lp-arm-3.home kernel: sd 0:0:0:0: [sda] tag#4 uas_eh_abort_handler 0 uas-tag 6 inflight: CMD Feb 07 20:40:53 lp-arm-3.home kernel: sd 0:0:0:0: [sda] tag#4 CDB: opcode=0x35 35 00 00 00 00 00 00 00 00 00 Feb 07 20:40:53 lp-arm-3.home kernel: scsi host0: uas_eh_device_reset_handler start Feb 07 20:40:53 lp-arm-3.home kernel: usb 2-2: reset SuperSpeed USB device number 2 using xhci_hcd Feb 07 20:40:53 lp-arm-3.home kernel: scsi host0: uas_eh_device_reset_handler success Feb 07 20:40:53 lp-arm-3.home kernel: sd 0:0:0:0: [sda] tag#8 UNKNOWN(0x2003) Result: hostbyte=0x07 driverbyte=DRIVER_OK cmd_age=61s Feb 07 20:40:53 lp-arm-3.home kernel: sd 0:0:0:0: [sda] tag#8 CDB: opcode=0x28 28 00 00 5e dc f8 00 00 10 00 Feb 07 20:40:53 lp-arm-3.home kernel: I/O error, dev sda, sector 6216952 op 0x0:(READ) flags 0x80700 phys_seg 2 prio class 2 Feb 07 20:40:53 lp-arm-3.home kernel: sd 0:0:0:0: [sda] tag#2 UNKNOWN(0x2003) Result: hostbyte=0x07 driverbyte=DRIVER_OK cmd_age=61s Feb 07 20:40:53 lp-arm-3.home kernel: sd 0:0:0:0: [sda] tag#2 CDB: opcode=0x28 28 00 02 88 f5 e0 00 00 30 00 Feb 07 20:40:53 lp-arm-3.home kernel: I/O error, dev sda, sector 42530272 op 0x0:(READ) flags 0x80700 phys_seg 6 prio class 2 Feb 07 20:40:53 lp-arm-3.home kernel: sd 0:0:0:0: [sda] tag#1 UNKNOWN(0x2003) Result: hostbyte=0x07 driverbyte=DRIVER_OK cmd_age=61s Feb 07 20:40:53 lp-arm-3.home kernel: sd 0:0:0:0: [sda] tag#1 CDB: opcode=0x28 28 00 00 5e cb c8 00 01 00 00 Feb 07 20:40:53 lp-arm-3.home kernel: I/O error, dev sda, sector 6212552 op 0x0:(READ) flags 0x80700 phys_seg 32 prio class 2 Feb 07 20:40:53 lp-arm-3.home kernel: sd 0:0:0:0: [sda] tag#3 UNKNOWN(0x2003) Result: hostbyte=0x07 driverbyte=DRIVER_OK cmd_age=61s Feb 07 20:40:53 lp-arm-3.home kernel: sd 0:0:0:0: [sda] tag#3 CDB: opcode=0x28 28 00 02 84 ee 68 00 00 50 00 Feb 07 20:40:53 lp-arm-3.home kernel: I/O error, dev sda, sector 42266216 op 0x0:(READ) flags 0x80700 phys_seg 10 prio class 2 Feb 07 20:40:53 lp-arm-3.home kernel: sd 0:0:0:0: [sda] tag#6 UNKNOWN(0x2003) Result: hostbyte=0x07 driverbyte=DRIVER_OK cmd_age=55s Feb 07 20:40:53 lp-arm-3.home kernel: sd 0:0:0:0: [sda] tag#6 CDB: opcode=0x28 28 00 02 80 6e 38 00 00 90 00 Feb 07 20:40:53 lp-arm-3.home kernel: I/O error, dev sda, sector 41971256 op 0x0:(READ) flags 0x80700 phys_seg 18 prio class 2 Feb 07 20:40:53 lp-arm-3.home kernel: sd 0:0:0:0: [sda] tag#7 UNKNOWN(0x2003) Result: hostbyte=0x07 driverbyte=DRIVER_OK cmd_age=49s Feb 07 20:40:53 lp-arm-3.home kernel: sd 0:0:0:0: [sda] tag#7 CDB: opcode=0x28 28 00 02 80 3c d0 00 00 58 00 Feb 07 20:40:53 lp-arm-3.home kernel: I/O error, dev sda, sector 41958608 op 0x0:(READ) flags 0x80700 phys_seg 11 prio class 2
lsusb
#get the USB ID eg 7825:a2a4
vi /boot/firmware/cmdline.txt
append this line at the end
usb-storage.quirks=7825:a2a4:u
reboot
root@lp-arm-3:~# lsusb -t
/: Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/4p, 5000M
|__ Port 2: Dev 2, If 0, Class=Mass Storage, Driver=usb-storage, 5000M
/: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/1p, 480M
|__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/4p, 480M
usb-storage (BOT):
sends one command at a time
waits for completion
has simpler recovery
tolerates retries and delays
pip3 install git+https://github.com/thinq-connect/pythinqconnect.git --break-system-packages
https://connect-pat.lgthinq.com/tokens
import asyncio
from aiohttp import ClientSession
# Assuming a library structure like pythinqconnect
from thinqconnect.thinq_api import ThinQApi
############## Get device ID ###############
async def test_devices_list():
# Setup your credentials and personal access token (PAT)
async with ClientSession() as session:
thinq_api = ThinQApi(
session=session,
access_token='PAT',
country_code='', # Example: US, KR, NL
client_id='your_client_id'
)
# Fetch device list
response = await thinq_api.async_get_device_list()
print("device_list : %s", response)
# Run the async function
asyncio.run(test_devices_list())
async def get_indoor_temperature_c():
async with ClientSession() as session:
api = ThinQApi(
session=session,
access_token="PAT",
country_code="",
client_id="YOUR_CLIENT_ID"
)
status = await api.async_get_device_status(DEVICE_ID)
temp_c = status["temperature"]["currentTemperature"]
print(temp_c)
return temp_c
asyncio.run(get_indoor_temperature_c())
@home:~/Downloads/c$ python3 lg.py
29.5
https://smartsolution.developer.lge.com/en/apiManage/device_profile?s=1734593490507#tag/overview
root@pi5:~# i2cdetect -y 1
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- 76 --
root@pi5:~# i2cdetect -y 1
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- 77
raspistill -o image_$(date +%s).jpg -w 480 -h 360
root@lp-arm-4:~# raspistill -o image_$(date +%s).jpg -w 480 -h 360
mmal: Cannot read camera info, keeping the defaults for OV5647
mmal: mmal_vc_component_create: failed to create component 'vc.ril.camera' (1:ENOMEM)
mmal: mmal_component_create_core: could not create component 'vc.ril.camera' (1)
mmal: Failed to create camera component
mmal: main: Failed to create camera component
mmal: Only 76M of gpu_mem is configured. Try running "sudo raspi-config" and ensure that "memory_split" has a value of 128 or greater
/boot/firmware/config.txt add gpu_mem=128
apt install rpi-connect
rpi-connect on
# Only remote shell access
apt install rpi-connect-lite
rpi-connect on
rpi-connect signin
Only for Raspberry Pi OS Bookworm


rpi-eeprom-config -e
| Value | Mode | Description |
|---|---|---|
| 0x0 | SD CARD DETECT | Try SD then wait for card-detect to indicate that the card has changed – deprecated now that 0xf (RESTART) is available. |
| 0x1 | SD CARD | SD card (or eMMC on Compute Module 4). |
| 0x2 | NETWORK | Network boot – See Network boot server tutorial |
| 0x3 | RPIBOOT | RPIBOOT – See usbboot |
| 0x4 | USB-MSD | USB mass storage boot – See USB mass storage boot |
| 0x5 | BCM-USB-MSD | USB 2.0 boot from USB Type C socket (CM4: USB type A socket on CM4IO board). Not available on Raspberry Pi 5. |
| 0x6 | NVME | CM4 and Pi 5 only: boot from an NVMe SSD connected to the PCIe interface. See NVMe boot for more details. |
| 0x7 | HTTP | HTTP boot over ethernet. See HTTP boot for more details. |
| 0xe | STOP | Stop and display error pattern. A power cycle is required to exit this state. |
| 0xf | RESTART | Restart from the first boot-mode in the BOOT_ORDER field i.e. loop |
boot order: https://www.raspberrypi.com/documentation/computers/raspberry-pi.html#BOOT_ORDER
Note: withdrawing more current(~15mA) from GPIO can affect the Rpi
https://raspberrypi.stackexchange.com/questions/9298/what-is-the-maximum-current-the-gpio-pins-can-output
import RPi.GPIO as GPIO
from time import sleep
import sys
GPIO.setwarnings(False)
GPIO.setmode(GPIO.BCM)
GPIO.setup(21, GPIO.OUT, initial=GPIO.HIGH)
if sys.argv[1] == "on":
GPIO.output(21, GPIO.LOW)
#print("on")
exit()


root@lp-arm-4:~# dmesg | grep -i vid
--More--
[ 13.071843] bcm2835-isp bcm2835-isp: Device node output[0] registered as /dev/video13
[ 13.615235] bcm2835-isp bcm2835-isp: Device node capture[0] registered as /dev/video14
[ 13.615709] bcm2835-isp bcm2835-isp: Device node capture[1] registered as /dev/video15
[ 13.616053] bcm2835-isp bcm2835-isp: Device node stats[2] registered as /dev/video16
[ 13.626826] bcm2835-codec bcm2835-codec: Device registered as /dev/video10
[ 13.631504] bcm2835-codec bcm2835-codec: Device registered as /dev/video11
[ 13.667772] : bcm2835_codec_get_supported_fmts: port has more encoding than we provided space for. Some are dropped.
[ 13.702795] bcm2835-v4l2: V4L2 device registered as video0 - stills mode > 1280x720
[ 13.708226] bcm2835-v4l2: Broadcom 2835 MMAL video capture ver 0.0.2 loaded.
[ 13.744213] bcm2835-codec bcm2835-codec: Device registered as /dev/video12
--More--
apt install libraspberrypi-bin
vcgencmd get_camera
One of the issue that i face with my raspberry pi 4 SD card. I removed it when it was in the pi case. Which broke the SD card chip in half internally.
Lesson : Always remove the SD carefully.
broke my 32 GB SD card while removing from Pi. I tried formatting with fdisk, mkfs.ext4 and Windows but none of them worked.
I have attached screenshot of fdisk /dev/sda where I have created 1 partition but when i try to delete the same it’s giving error No partition is defined yet!

Here is the lsblk output:
root@lp-arm-1:~# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
loop0 7:0 0 88.1M 1 loop /snap/core/11803
loop1 7:1 0 48.9M 1 loop /snap/core18/2127
loop2 7:2 0 49M 1 loop /snap/core18/2248
loop3 7:3 0 57.4M 1 loop /snap/core20/1171
loop4 7:4 0 88.1M 1 loop /snap/core/11996
loop5 7:5 0 60.4M 1 loop /snap/lxd/21544
loop6 7:6 0 28.2M 1 loop /snap/snapd/13269
loop7 7:7 0 57.4M 1 loop /snap/core20/1084
loop8 7:8 0 62M 1 loop /snap/lxd/21032
loop9 7:9 0 28.2M 1 loop /snap/snapd/13643
sda 8:0 1 30.6M 0 disk
mmcblk0 179:0 0 59.7G 0 disk
├─mmcblk0p1 179:1 0 256M 0 part /boot/firmware
└─mmcblk0p2 179:2 0 59.4G 0 part /
Note: mmcblk0 is another working SD card
When try to format it with widows OS.
