Activating the Cooling Fan in VIM3 running Libreelec

Не стоит зацикливаться ! это опен сорс - можно всегда поправить как кому угодно! это утилитка не закончена 1 - создавалась для определенный целей 2 - под скорою руку для теста - 3 - подождите пару дней - попробую учесть все пожелания )

Между прочим - ты|вы не преподователем информатики работаешь ? )))

Такие вопросы - в личку. :slight_smile:

hello,@hyphop
I use Armbian_19.11.3_Aml-g12_buster_legacy_5.3.0_20191126 on VIM2 with 3705 Cooling Fan
and after install apt-get install i2c-tools,run ./fan 1
[i] i2c device not found by 0x18 0x88

thanks

plz check this post Activating the Cooling Fan in VIM3 running Libreelec - #15 by hyphop

looks like incorrect dts (lost i2c node)

hi @hyphop ,here is the info. of mine,Isn’t that right? how to fix this problem

root@armbian:~# cat /boot/uEnv.ini
dtb_name=/dtb/amlogic/meson-gxm-khadas-vim2.dtb
bootargs=root=LABEL=ROOT_EMMC rootflags=data=writeback rw console=ttyAML0,115200n8 console=tty0 no_console_suspend consoleblank=0 fsck.fix=yes fsck.repair=yes net.ifnames=0

root@armbian:~# ls /dev/i2c-?
/dev/i2c-0 /dev/i2c-1 /dev/i2c-2

root@armbian:~# i2c_scan | grep 18
i2c_scan: command not found

root@armbian:~# zgrep I2C /proc/config.gz | grep =y
CONFIG_REGMAP_I2C=y
CONFIG_TCG_TIS_I2C_INFINEON=y
CONFIG_I2C=y
CONFIG_ACPI_I2C_OPREGION=y
CONFIG_I2C_BOARDINFO=y
CONFIG_I2C_COMPAT=y
CONFIG_I2C_CHARDEV=y
CONFIG_I2C_MUX=y
CONFIG_I2C_MUX_PCA954x=y
CONFIG_I2C_MUX_PINCTRL=y
CONFIG_I2C_DEMUX_PINCTRL=y
CONFIG_I2C_HELPER_AUTO=y
CONFIG_I2C_ALGOBIT=y
CONFIG_I2C_DESIGNWARE_CORE=y
CONFIG_I2C_DESIGNWARE_PLATFORM=y
CONFIG_I2C_MESON=y
CONFIG_I2C_RK3X=y
CONFIG_I2C_CROS_EC_TUNNEL=y
CONFIG_I2C_SLAVE=y
CONFIG_BATTERY_BQ27XXX_I2C=y
CONFIG_MFD_AXP20X_I2C=y
CONFIG_MFD_WM831X_I2C=y
CONFIG_MFD_WM8350_I2C=y
CONFIG_VIDEO_V4L2_I2C=y
CONFIG_DRM_I2C_CH7006=y
CONFIG_DRM_I2C_SIL164=y
CONFIG_DRM_I2C_NXP_TDA998X=y
CONFIG_DRM_I2C_NXP_TDA9950=y
CONFIG_DRM_I2C_ADV7533=y
CONFIG_DRM_I2C_ADV7511_CEC=y
CONFIG_SND_SOC_I2C_AND_SPI=y
CONFIG_RTC_I2C_AND_SPI=y
CONFIG_CROS_EC_I2C=y

sorry try this one

for i in 0 1 2 ; do i2cdetect -y $i; done

must works

You mean before I run fan shell script,do this first?

root@aml:~# for i in 0 1 2 ; do i2cdetect -y $i; done
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: – -- – -- – -- – -- – -- – -- –
10: – -- – -- – -- – -- – -- – -- – -- – --
20: – -- – -- – -- – -- – -- – -- – -- – --
30: – -- – -- – -- – -- – -- – -- – -- – --
40: – -- – -- – -- – -- – -- – -- – -- – --
50: – -- – -- – -- – -- – -- – -- – -- – --
60: – -- – -- – -- – -- – -- – -- – -- – --
70: – -- – -- – -- – --
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: – -- – -- – -- – -- – -- – -- –
10: – -- – -- – -- – -- 18 – -- – -- – -- –
20: – -- – -- – -- – -- – -- – -- – -- – --
30: – -- – -- – -- – -- – -- – -- – -- – --
40: – -- – -- – -- – -- – -- – -- – -- – --
50: – 51 – -- – -- – -- – -- – -- – -- – --
60: – -- – -- – -- – -- – -- – -- – -- – --
70: – -- – -- – -- – --
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: – -- – -- – -- – -- – -- – -- –
10: – -- – -- – -- – -- – -- – -- – -- – --
20: – -- – -- – -- – -- – -- – -- – -- – --
30: 30 – -- – -- – -- 37 – -- – -- – -- – --
40: – -- – -- – -- – -- – -- – -- – -- – --
50: 50 – -- – 54 – -- – -- – -- – -- – -- –
60: – -- – -- – -- – -- – -- – -- – -- – --
70: – -- – -- – -- – --
root@aml:~# ./fan 3
[i] set FUN SPEED: 3

BUT here is noting happend,fan was not running,then I try

root@aml:~# ./fan 2
[i] i2c device not found by 0x18 0x88

the error was shown again,then I do

root@aml:~# for i in 0 1 2 ; do i2cdetect -y $i; done
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: – -- – -- – -- – -- – -- – -- –
10: – -- – -- – -- – -- – -- – -- – -- – --
20: – -- – -- – -- – -- – -- – -- – -- – --
30: – -- – -- – -- – -- – -- – -- – -- – --
40: – -- – -- – -- – -- – -- – -- – -- – --
50: – -- – -- – -- – -- – -- – -- – -- – --
60: – -- – -- – -- – -- – -- – -- – -- – --
70: – -- – -- – -- – --
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: – -- – -- – -- – -- – -- – -- –
10: – -- – -- – -- – -- – -- – -- – -- – --
20: – -- – -- – -- – -- – -- – -- – -- – --
30: – -- – -- – -- – -- – -- – -- – -- – --
40: – -- – -- – -- – -- – -- – -- – -- – --
50: – -- – -- – -- – -- – -- – -- – -- – --
60: – -- – -- – -- – -- – -- – -- – -- – --
70: – -- – -- – -- – --
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: – -- – -- – -- – -- – -- – -- –
10: – -- – -- – -- – -- – -- – -- – -- – --
20: – -- – -- – -- – -- – -- – -- – -- – --
30: 30 – -- – -- – -- 37 – -- – -- – -- – --
40: – -- – -- – -- – -- – -- – -- – -- – --
50: 50 – -- – 54 – -- – -- – -- – -- – -- –
60: – -- – -- – -- – -- – -- – -- – -- – --
70: – -- – -- – -- – --
root@aml:~# ./fan 2
[i] i2c device not found by 0x18 0x88
root@aml:~#

ok first try we have i2c 18 add at 1 node
but after its lost - this one strange behavior
plz check dmesc -c

I also have a VIM3 running coreelec 9.2.1, and I have no problem running this fan script.
for this VIM2 there is VIM2_Nougat_V190518 on emmc,and fan is ok in android, If I switch to Armbian_19.11.3_Aml-g12_buster_legacy_5.3.0_20191126 on usb stick ,the “for i in 0 1 2 ; do i2cdetect -y $i; done” check looks ok first time,running fan 3 show me looks like correct “fan set to 3” ,but the fan is not running.then run it again the error “i2c device not found by 0x18 0x88” was shown up.reboot do it again,the problem is the same.switch to android on emmc,the fan was not working.I need unplug the power,the cooling fan will return to normal on android.Anyway as soon as I switch to the ARMBIAN and execute the fan script,this problem will appear.I don’t know if it is related to uboot version?

Here’s the dmesc -c message, when the error occurs

[ 0.000000] Booting Linux on physical CPU 0x0000000000 [0x410fd034]
[ 0.000000] Linux version 5.3.0-aml-g12 (root@vbox) (gcc version 7.4.1 20181213 [linaro-7.4-2019.02 revision 56ec6f6b99cc167ff0c2f8e1a2eed33b1edc85d4] (Linaro GCC 7.4-2019.02)) #19.11.3 SMP PREEMPT Wed Nov 27 10:01:23 MSK 2019
[ 0.000000] Machine model: Khadas VIM2
[ 0.000000] efi: Getting EFI parameters from FDT:
[ 0.000000] efi: UEFI not found.
[ 0.000000] Reserved memory: created CMA memory pool at 0x000000007b400000, size 896 MiB
[ 0.000000] OF: reserved mem: initialized node linux,cma, compatible id shared-dma-pool
[ 0.000000] NUMA: No NUMA configuration found
[ 0.000000] NUMA: Faking a node at [mem 0x0000000001000000-0x00000000b7ffffff]
[ 0.000000] NUMA: NODE_DATA [mem 0xb7a2a840-0xb7a2bfff]
[ 0.000000] Zone ranges:
[ 0.000000] DMA32 [mem 0x0000000001000000-0x00000000b7ffffff]
[ 0.000000] Normal empty
[ 0.000000] Movable zone start for each node
[ 0.000000] Early memory node ranges
[ 0.000000] node 0: [mem 0x0000000001000000-0x0000000004ffffff]
[ 0.000000] node 0: [mem 0x0000000007300000-0x000000000fffffff]
[ 0.000000] node 0: [mem 0x0000000010200000-0x00000000b7ffffff]
[ 0.000000] Initmem setup node 0 [mem 0x0000000001000000-0x00000000b7ffffff]
[ 0.000000] On node 0 totalpages: 740096
[ 0.000000] DMA32 zone: 11712 pages used for memmap
[ 0.000000] DMA32 zone: 0 pages reserved
[ 0.000000] DMA32 zone: 740096 pages, LIFO batch:63
[ 0.000000] psci: probing for conduit method from DT.
[ 0.000000] psci: PSCIv0.2 detected in firmware.
[ 0.000000] psci: Using standard PSCI v0.2 function IDs
[ 0.000000] psci: Trusted OS migration not required
[ 0.000000] percpu: Embedded 23 pages/cpu s57240 r8192 d28776 u94208
[ 0.000000] pcpu-alloc: s57240 r8192 d28776 u94208 alloc=23*4096
[ 0.000000] pcpu-alloc: [0] 0 [0] 1 [0] 2 [0] 3 [0] 4 [0] 5 [0] 6 [0] 7
[ 0.000000] Detected VIPT I-cache on CPU0
[ 0.000000] CPU features: detected: ARM erratum 845719
[ 0.000000] Built 1 zonelists, mobility grouping on. Total pages: 728384
[ 0.000000] Policy zone: DMA32
[ 0.000000] Kernel command line: root=LABEL=ROOTFS rootflags=data=writeback rw console=ttyAML0,115200n8 console=tty0 no_console_suspend consoleblank=0 fsck.fix=yes fsck.repair=yes net.ifnames=0 mac=c8:63:14:70:3d:5c
[ 0.000000] Dentry cache hash table entries: 524288 (order: 10, 4194304 bytes, linear)
[ 0.000000] Inode-cache hash table entries: 262144 (order: 9, 2097152 bytes, linear)
[ 0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[ 0.000000] Memory: 1942004K/2960384K available (15932K kernel code, 1490K rwdata, 5924K rodata, 3776K init, 821K bss, 100876K reserved, 917504K cma-reserved)
[ 0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=8, Nodes=1
[ 0.000000] rcu: Preemptible hierarchical RCU implementation.
[ 0.000000] rcu: RCU restricting CPUs from NR_CPUS=64 to nr_cpu_ids=8.
[ 0.000000] Tasks RCU enabled.
[ 0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 25 jiffies.
[ 0.000000] rcu: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=8
[ 0.000000] NR_IRQS: 64, nr_irqs: 64, preallocated irqs: 0
[ 0.000000] GIC: Using split EOI/Deactivate mode
[ 0.000000] irq_meson_gpio: 110 to 8 gpio interrupt mux initialized
[ 0.000000] random: get_random_bytes called from start_kernel+0x2f4/0x494 with crng_init=0
[ 0.000000] arch_timer: cp15 timer(s) running at 24.00MHz (phys).
[ 0.000000] clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0x588fe9dc0, max_idle_ns: 440795202592 ns
[ 0.000004] sched_clock: 56 bits at 24MHz, resolution 41ns, wraps every 4398046511097ns
[ 0.000396] Console: colour dummy device 80x25
[ 0.000777] printk: console [tty0] enabled
[ 0.000867] Calibrating delay loop (skipped), value calculated using timer frequency… 48.00 BogoMIPS (lpj=96000)
[ 0.000889] pid_max: default: 32768 minimum: 301
[ 0.000972] LSM: Security Framework initializing
[ 0.001010] SELinux: Initializing.
[ 0.001055] *** VALIDATE SELinux ***
[ 0.001112] Mount-cache hash table entries: 8192 (order: 4, 65536 bytes, linear)
[ 0.001141] Mountpoint-cache hash table entries: 8192 (order: 4, 65536 bytes, linear)
[ 0.001627] *** VALIDATE proc ***
[ 0.001848] *** VALIDATE cgroup1 ***
[ 0.001863] *** VALIDATE cgroup2 ***
[ 0.024011] ASID allocator initialised with 32768 entries
[ 0.031992] rcu: Hierarchical SRCU implementation.
[ 0.042476] EFI services will not be available.
[ 0.048049] smp: Bringing up secondary CPUs …
[ 0.080289] Detected VIPT I-cache on CPU1
[ 0.080343] CPU1: Booted secondary processor 0x0000000001 [0x410fd034]
[ 0.112332] Detected VIPT I-cache on CPU2
[ 0.112376] CPU2: Booted secondary processor 0x0000000002 [0x410fd034]
[ 0.144382] Detected VIPT I-cache on CPU3
[ 0.144425] CPU3: Booted secondary processor 0x0000000003 [0x410fd034]
[ 0.176449] Detected VIPT I-cache on CPU4
[ 0.176503] CPU4: Booted secondary processor 0x0000000100 [0x410fd034]
[ 0.208472] Detected VIPT I-cache on CPU5
[ 0.208498] CPU5: Booted secondary processor 0x0000000101 [0x410fd034]
[ 0.240524] Detected VIPT I-cache on CPU6
[ 0.240550] CPU6: Booted secondary processor 0x0000000102 [0x410fd034]
[ 0.272575] Detected VIPT I-cache on CPU7
[ 0.272601] CPU7: Booted secondary processor 0x0000000103 [0x410fd034]
[ 0.272693] smp: Brought up 1 node, 8 CPUs
[ 0.272814] SMP: Total of 8 processors activated.
[ 0.272826] CPU features: detected: 32-bit EL0 Support
[ 0.272838] CPU features: detected: CRC32 instructions
[ 0.273596] CPU: All CPU(s) started at EL2
[ 0.273638] alternatives: patching kernel code
[ 0.274810] devtmpfs: initialized
[ 0.280272] Registered cp15_barrier emulation handler
[ 0.280303] Registered setend emulation handler
[ 0.280690] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns
[ 0.280722] futex hash table entries: 2048 (order: 5, 131072 bytes, linear)
[ 0.305003] xor: measuring software checksum speed
[ 0.344554] 8regs : 2303.000 MB/sec
[ 0.384583] 32regs : 2831.000 MB/sec
[ 0.424615] arm64_neon: 2474.000 MB/sec
[ 0.424625] xor: using function: 32regs (2831.000 MB/sec)
[ 0.424690] pinctrl core: initialized pinctrl subsystem
[ 0.425400] DMI not present or invalid.
[ 0.425751] NET: Registered protocol family 16
[ 0.426355] audit: initializing netlink subsys (disabled)
[ 0.426546] audit: type=2000 audit(0.424:1): state=initialized audit_enabled=0 res=1
[ 0.427831] cpuidle: using governor menu
[ 0.428287] hw-breakpoint: found 6 breakpoint and 4 watchpoint registers.
[ 0.433470] DMA: preallocated 256 KiB pool for atomic allocations
[ 0.434222] Serial: AMBA PL011 UART driver
[ 0.450751] HugeTLB registered 1.00 GiB page size, pre-allocated 0 pages
[ 0.450777] HugeTLB registered 32.0 MiB page size, pre-allocated 0 pages
[ 0.450790] HugeTLB registered 2.00 MiB page size, pre-allocated 0 pages
[ 0.450803] HugeTLB registered 64.0 KiB page size, pre-allocated 0 pages
[ 0.454249] cryptd: max_cpu_qlen set to 1000
[ 0.528850] raid6: neonx8 gen() 1727 MB/s
[ 0.596905] raid6: neonx8 xor() 1579 MB/s
[ 0.665012] raid6: neonx4 gen() 1594 MB/s
[ 0.733046] raid6: neonx4 xor() 1494 MB/s
[ 0.801117] raid6: neonx2 gen() 1238 MB/s
[ 0.869181] raid6: neonx2 xor() 1250 MB/s
[ 0.937251] raid6: neonx1 gen() 768 MB/s
[ 1.005301] raid6: neonx1 xor() 882 MB/s
[ 1.073363] raid6: int64x8 gen() 1006 MB/s
[ 1.141390] raid6: int64x8 xor() 761 MB/s
[ 1.209480] raid6: int64x4 gen() 1094 MB/s
[ 1.277506] raid6: int64x4 xor() 781 MB/s
[ 1.345606] raid6: int64x2 gen() 731 MB/s
[ 1.413621] raid6: int64x2 xor() 619 MB/s
[ 1.481670] raid6: int64x1 gen() 486 MB/s
[ 1.549727] raid6: int64x1 xor() 453 MB/s
[ 1.549738] raid6: using algorithm neonx8 gen() 1727 MB/s
[ 1.549747] raid6: … xor() 1579 MB/s, rmw enabled
[ 1.549757] raid6: using neon recovery algorithm
[ 1.550318] fbcon: Taking over console
[ 1.550366] ACPI: Interpreter disabled.
[ 1.552034] vgaarb: loaded
[ 1.552462] SCSI subsystem initialized
[ 1.552649] libata version 3.00 loaded.
[ 1.552878] usbcore: registered new interface driver usbfs
[ 1.552924] usbcore: registered new interface driver hub
[ 1.553008] usbcore: registered new device driver usb
[ 1.553480] pps_core: LinuxPPS API ver. 1 registered
[ 1.553494] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti giometti@linux.it
[ 1.553518] PTP clock support registered
[ 1.553660] EDAC MC: Ver: 3.0.0
[ 1.554268] FPGA manager framework
[ 1.554362] Advanced Linux Sound Architecture Driver Initialized.
[ 1.554872] NetLabel: Initializing
[ 1.554886] NetLabel: domain hash size = 128
[ 1.554894] NetLabel: protocols = UNLABELED CIPSOv4 CALIPSO
[ 1.554955] NetLabel: unlabeled traffic allowed by default
[ 1.555506] clocksource: Switched to clocksource arch_sys_counter
[ 1.555741] VFS: Disk quotas dquot_6.6.0
[ 1.555805] VFS: Dquot-cache hash table entries: 512 (order 0, 4096 bytes)
[ 1.555928] FS-Cache: Loaded
[ 1.555949] *** VALIDATE hugetlbfs ***
[ 1.556129] pnp: PnP ACPI: disabled
[ 1.561124] thermal_sys: Registered thermal governor ‘step_wise’
[ 1.561129] thermal_sys: Registered thermal governor ‘power_allocator’
[ 1.561672] NET: Registered protocol family 2
[ 1.562157] tcp_listen_portaddr_hash hash table entries: 2048 (order: 3, 32768 bytes, linear)
[ 1.562223] TCP established hash table entries: 32768 (order: 6, 262144 bytes, linear)
[ 1.562447] TCP bind hash table entries: 32768 (order: 7, 524288 bytes, linear)
[ 1.562858] TCP: Hash tables configured (established 32768 bind 32768)
[ 1.563043] UDP hash table entries: 2048 (order: 4, 65536 bytes, linear)
[ 1.563135] UDP-Lite hash table entries: 2048 (order: 4, 65536 bytes, linear)
[ 1.563402] NET: Registered protocol family 1
[ 1.563979] RPC: Registered named UNIX socket transport module.
[ 1.564003] RPC: Registered udp transport module.
[ 1.564013] RPC: Registered tcp transport module.
[ 1.564021] RPC: Registered tcp NFSv4.1 backchannel transport module.
[ 1.564039] NET: Registered protocol family 44
[ 1.564061] PCI: CLS 0 bytes, default 64
[ 1.564260] Trying to unpack rootfs image as initramfs…
[ 1.940923] Freeing initrd memory: 8868K
[ 1.942107] hw perfevents: enabled with armv8_cortex_a53 PMU driver, 7 counters available
[ 1.942457] kvm [1]: IPA Size Limit: 40bits
[ 1.943202] kvm [1]: vgic interrupt IRQ1
[ 1.943374] kvm [1]: Hyp mode initialized successfully
[ 2.369577] Initialise system trusted keyrings
[ 2.369804] workingset: timestamp_bits=44 max_order=20 bucket_order=0
[ 2.374768] zbud: loaded
[ 2.376261] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[ 2.376536] FS-Cache: Netfs ‘nfs’ registered for caching
[ 2.377052] NFS: Registering the id_resolver key type
[ 2.377094] Key type id_resolver registered
[ 2.377103] Key type id_legacy registered
[ 2.377123] nfs4filelayout_init: NFSv4 File Layout Driver Registering…
[ 2.377136] Installing knfsd (copyright © 1996 okir@monad.swb.de).
[ 2.378165] FS-Cache: Netfs ‘cifs’ registered for caching
[ 2.378463] Key type cifs.spnego registered
[ 2.378481] Key type cifs.idmap registered
[ 2.378504] ntfs: driver 2.1.32 [Flags: R/W].
[ 2.379054] JFS: nTxBlock = 8192, nTxLock = 65536
[ 2.383695] SGI XFS with ACLs, security attributes, realtime, no debug enabled
[ 2.385298] ocfs2: Registered cluster interface o2cb
[ 2.385546] OCFS2 User DLM kernel interface loaded
[ 2.387193] gfs2: GFS2 installed
[ 2.388146] aufs 5.3-20191021
[ 2.417689] Key type asymmetric registered
[ 2.417714] Asymmetric key parser ‘x509’ registered
[ 2.417779] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 244)
[ 2.417948] io scheduler mq-deadline registered
[ 2.417962] io scheduler kyber registered
[ 2.418147] io scheduler bfq registered
[ 2.424763] EINJ: ACPI disabled.
[ 2.430924] soc soc0: Amlogic Meson GXM (S912) Revision 22:a (82:2) Detected
[ 2.434552] Serial: 8250/16550 driver, 5 ports, IRQ sharing enabled
[ 2.436319] Serial: AMBA driver
[ 2.436692] c11084c0.serial: ttyAML6 at MMIO 0xc11084c0 (irq = 10, base_baud = 1500000) is a meson_uart
[ 2.436849] serial serial0: tty port ttyAML6 registered
[ 2.437074] c81004c0.serial: ttyAML0 at MMIO 0xc81004c0 (irq = 15, base_baud = 1500000) is a meson_uart
[ 3.521127] printk: console [ttyAML0] enabled
[ 3.525989] c81004e0.serial: ttyAML1 at MMIO 0xc81004e0 (irq = 16, base_baud = 1500000) is a meson_uart
[ 3.540161] brd: module loaded
[ 3.544678] loop: module loaded
[ 3.547169] libphy: Fixed MDIO Bus: probed
[ 3.547639] tun: Universal TUN/TAP device driver, 1.6
[ 3.552036] thunder_xcv, ver 1.0
[ 3.554487] thunder_bgx, ver 1.0
[ 3.557686] nicpf, ver 1.0
[ 3.560762] hclge is initializing
[ 3.563612] hns3: Hisilicon Ethernet Network Driver for Hip08 Family - version
[ 3.570765] hns3: Copyright © 2017 Huawei Corporation.
[ 3.576093] e1000e: Intel® PRO/1000 Network Driver - 3.2.6-k
[ 3.581805] e1000e: Copyright© 1999 - 2015 Intel Corporation.
[ 3.587706] igb: Intel® Gigabit Ethernet Network Driver - version 5.6.0-k
[ 3.594570] igb: Copyright © 2007-2014 Intel Corporation.
[ 3.600121] igbvf: Intel® Gigabit Virtual Function Network Driver - version 2.4.0-k
[ 3.607854] igbvf: Copyright © 2009 - 2012 Intel Corporation.
[ 3.613880] sky2: driver version 1.30
[ 3.618309] meson8b-dwmac c9410000.ethernet: PTP uses main clock
[ 3.623309] meson8b-dwmac c9410000.ethernet: no reset control found
[ 3.630046] meson8b-dwmac c9410000.ethernet: User ID: 0x11, Synopsys ID: 0x37
[ 3.636596] meson8b-dwmac c9410000.ethernet: DWMAC1000
[ 3.641753] meson8b-dwmac c9410000.ethernet: DMA HW capability register supported
[ 3.649168] meson8b-dwmac c9410000.ethernet: RX Checksum Offload Engine supported
[ 3.656585] meson8b-dwmac c9410000.ethernet: COE Type 2
[ 3.661758] meson8b-dwmac c9410000.ethernet: TX Checksum insertion supported
[ 3.668744] meson8b-dwmac c9410000.ethernet: Wake-Up On Lan supported
[ 3.675161] meson8b-dwmac c9410000.ethernet: Normal descriptors
[ 3.680995] meson8b-dwmac c9410000.ethernet: Ring mode enabled
[ 3.686771] meson8b-dwmac c9410000.ethernet: Enable RX Mitigation via HW Watchdog Timer
[ 3.694709] meson8b-dwmac c9410000.ethernet: device MAC address aa:78:56:56:86:61
[ 3.702247] libphy: stmmac: probed
[ 3.706810] VFIO - User Level meta-driver version: 0.3
[ 3.712159] dwc3 c9000000.dwc3: Failed to get clk ‘ref’: -2
[ 3.717389] ehci_hcd: USB 2.0 ‘Enhanced’ Host Controller (EHCI) Driver
[ 3.722611] ehci-pci: EHCI PCI platform driver
[ 3.727011] ehci-platform: EHCI generic platform driver
[ 3.732333] ohci_hcd: USB 1.1 ‘Open’ Host Controller (OHCI) Driver
[ 3.738282] ohci-pci: OHCI PCI platform driver
[ 3.742702] ohci-platform: OHCI generic platform driver
[ 3.748540] usbcore: registered new interface driver uas
[ 3.753146] usbcore: registered new interface driver usb-storage
[ 3.760624] mousedev: PS/2 mouse device common for all mice
[ 3.765488] i2c /dev entries driver
[ 3.772243] sdhci: Secure Digital Host Controller Interface driver
[ 3.774135] sdhci: Copyright© Pierre Ossman
[ 3.778597] Synopsys Designware Multimedia Card Interface Driver
[ 3.786034] meson-gx-mmc d0072000.mmc: Got CD GPIO
[ 3.816773] meson-gx-mmc d0074000.mmc: allocated mmc-pwrseq
[ 3.844103] sdhci-pltfm: SDHCI platform and OF driver helper
[ 3.845321] ledtrig-cpu: registered to indicate activity on CPUs
[ 3.850713] meson-sm: secure-monitor enabled
[ 3.854622] hidraw: raw HID events driver © Jiri Kosina
[ 3.860033] usbcore: registered new interface driver usbhid
[ 3.865239] usbhid: USB HID core driver
[ 3.869429] platform-mhu c883c404.mailbox: Platform MHU Mailbox registered
[ 3.880662] NET: Registered protocol family 17
[ 3.882220] Key type dns_resolver registered
[ 3.887038] registered taskstats version 1
[ 3.890302] Loading compiled-in X.509 certificates
[ 3.895169] zswap: loaded using pool lzo/zbud
[ 3.900414] Btrfs loaded, crc32c=crc32c-generic
[ 3.925983] Key type encrypted registered
[ 3.942073] meson-drm d0100000.vpu: Queued 2 outputs on vpu
[ 3.942404] [drm] Supports vblank timestamp caching Rev 2 (21.10.2013).
[ 3.948664] [drm] No driver support for vblank timestamp query.
[ 3.954672] meson-drm d0100000.vpu: CVBS Output connector not available
[ 3.978469] mmc1: new HS200 MMC card at address 0001
[ 3.979641] mmcblk1: mmc1:0001 CJNB4R 58.2 GiB
[ 3.982958] mmcblk1boot0: mmc1:0001 CJNB4R partition 1 4.00 MiB
[ 3.987562] meson-dw-hdmi c883a000.hdmi-tx: Detected HDMI TX controller v2.01a with HDCP (meson_dw_hdmi_phy)
[ 3.988847] mmcblk1boot1: mmc1:0001 CJNB4R partition 2 4.00 MiB
[ 3.998479] meson-dw-hdmi c883a000.hdmi-tx: registered DesignWare HDMI I2C bus driver
[ 4.003889] mmcblk1rpmb: mmc1:0001 CJNB4R partition 3 4.00 MiB, chardev (240:0)
[ 4.012249] meson-drm d0100000.vpu: bound c883a000.hdmi-tx (ops meson_dw_hdmi_ops)
[ 4.026906] [drm] Initialized meson 1.0.0 20161109 for d0100000.vpu on minor 0
[ 4.121684] random: fast init done
[ 4.503931] Console: switching to colour frame buffer device 480x135
[ 4.620016] meson-drm d0100000.vpu: fb0: mesondrmfb frame buffer device
[ 4.627140] libphy: mdio_mux: probed
[ 4.638223] libphy: mdio_mux: probed
[ 4.690997] phy phy-d0078080.phy.3: unsupported PHY mode 5
[ 4.694192] xhci-hcd xhci-hcd.0.auto: xHCI Host Controller
[ 4.696427] xhci-hcd xhci-hcd.0.auto: new USB bus registered, assigned bus number 1
[ 4.704152] xhci-hcd xhci-hcd.0.auto: hcc params 0x0228f664 hci version 0x100 quirks 0x0000000002010010
[ 4.713346] xhci-hcd xhci-hcd.0.auto: irq 37, io mem 0xc9000000
[ 4.719454] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 5.03
[ 4.727382] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[ 4.734523] usb usb1: Product: xHCI Host Controller
[ 4.739359] usb usb1: Manufacturer: Linux 5.3.0-aml-g12 xhci-hcd
[ 4.745305] usb usb1: SerialNumber: xhci-hcd.0.auto
[ 4.750581] hub 1-0:1.0: USB hub found
[ 4.753882] hub 1-0:1.0: 3 ports detected
[ 4.758147] xhci-hcd xhci-hcd.0.auto: xHCI Host Controller
[ 4.763259] xhci-hcd xhci-hcd.0.auto: new USB bus registered, assigned bus number 2
[ 4.770851] xhci-hcd xhci-hcd.0.auto: Host supports USB 3.0 SuperSpeed
[ 4.777358] usb usb2: We don’t know the algorithms for LPM for this host, disabling LPM.
[ 4.785404] usb usb2: New USB device found, idVendor=1d6b, idProduct=0003, bcdDevice= 5.03
[ 4.793528] usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[ 4.800676] usb usb2: Product: xHCI Host Controller
[ 4.805508] usb usb2: Manufacturer: Linux 5.3.0-aml-g12 xhci-hcd
[ 4.811456] usb usb2: SerialNumber: xhci-hcd.0.auto
[ 4.816715] hub 2-0:1.0: USB hub found
[ 4.820021] hub 2-0:1.0: config failed, hub doesn’t have any ports! (err -19)
[ 4.828745] meson-gx-mmc d0070000.mmc: allocated mmc-pwrseq
[ 4.860875] scpi_protocol scpi: SCP Protocol legacy pre-1.0 firmware
[ 4.886226] hctosys: unable to open rtc device (rtc0)
[ 4.887042] ALSA device list:
[ 4.888901] No soundcards found.
[ 4.892537] mmc2: queuing unknown CIS tuple 0x80 (2 bytes)
[ 4.895440] Freeing unused kernel memory: 3776K
[ 4.899741] mmc2: queuing unknown CIS tuple 0x80 (3 bytes)
[ 4.902413] Run /init as init process
[ 4.909658] mmc2: queuing unknown CIS tuple 0x80 (3 bytes)
[ 4.920437] mmc2: queuing unknown CIS tuple 0x80 (7 bytes)
[ 4.926690] mmc2: queuing unknown CIS tuple 0x81 (9 bytes)
[ 4.997973] mmc2: new SDIO card at address 0001
[ 5.091576] usb 1-1: new high-speed USB device number 2 using xhci-hcd
[ 5.230671] input: adc-keys as /devices/platform/adc-keys/input/input0
[ 5.239878] usb 1-1: New USB device found, idVendor=1a40, idProduct=0801, bcdDevice= 1.00
[ 5.242584] usb 1-1: New USB device strings: Mfr=0, Product=1, SerialNumber=0
[ 5.249704] usb 1-1: Product: USB 2.0 Hub
[ 5.289698] hub 1-1:1.0: USB hub found
[ 5.289928] hub 1-1:1.0: 4 ports detected
[ 5.419906] usb 1-3: new high-speed USB device number 3 using xhci-hcd
[ 5.569989] usb 1-3: New USB device found, idVendor=1f75, idProduct=0903, bcdDevice= 0.01
[ 5.574607] usb 1-3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 5.581696] usb 1-3: Product: PenDrive
[ 5.585342] usb 1-3: Manufacturer: Innostor
[ 5.589469] usb 1-3: SerialNumber: 000000000000000048
[ 5.598651] usb-storage 1-3:1.0: USB Mass Storage device detected
[ 5.602338] scsi host0: usb-storage 1-3:1.0
[ 5.667644] usb 1-1.2: new full-speed USB device number 4 using xhci-hcd
[ 5.792172] usb 1-1.2: New USB device found, idVendor=046d, idProduct=c52e, bcdDevice=23.01
[ 5.797023] usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ 5.804220] usb 1-1.2: Product: USB Receiver
[ 5.808424] usb 1-1.2: Manufacturer: Logitech
[ 5.904263] input: Logitech USB Receiver as /devices/platform/soc/soc:usb@c9000000/c9000000.dwc3/xhci-hcd.0.auto/usb1/1-1/1-1.2/1-1.2:1.0/0003:046D:C52E.0001/input/input1
[ 5.972114] hid-generic 0003:046D:C52E.0001: input,hidraw0: USB HID v1.11 Keyboard [Logitech USB Receiver] on usb-xhci-hcd.0.auto-1.2/input0
[ 5.984898] input: Logitech USB Receiver Mouse as /devices/platform/soc/soc:usb@c9000000/c9000000.dwc3/xhci-hcd.0.auto/usb1/1-1/1-1.2/1-1.2:1.1/0003:046D:C52E.0002/input/input2
[ 5.995803] input: Logitech USB Receiver Consumer Control as /devices/platform/soc/soc:usb@c9000000/c9000000.dwc3/xhci-hcd.0.auto/usb1/1-1/1-1.2/1-1.2:1.1/0003:046D:C52E.0002/input/input3
[ 6.071917] input: Logitech USB Receiver System Control as /devices/platform/soc/soc:usb@c9000000/c9000000.dwc3/xhci-hcd.0.auto/usb1/1-1/1-1.2/1-1.2:1.1/0003:046D:C52E.0002/input/input4
[ 6.083626] hid-generic 0003:046D:C52E.0002: input,hiddev0,hidraw1: USB HID v1.11 Mouse [Logitech USB Receiver] on usb-xhci-hcd.0.auto-1.2/input1
[ 6.626809] scsi 0:0:0:0: Direct-Access Innostor Innostor 1.00 PQ: 0 ANSI: 6
[ 6.637094] sd 0:0:0:0: [sda] 31205621 512-byte logical blocks: (16.0 GB/14.9 GiB)
[ 6.640428] sd 0:0:0:0: [sda] Write Protect is off
[ 6.644597] sd 0:0:0:0: [sda] Mode Sense: 23 00 00 00
[ 6.645155] sd 0:0:0:0: [sda] Write cache: disabled, read cache: disabled, doesn’t support DPO or FUA
[ 6.656103] sda: sda1 sda2
[ 6.658368] sd 0:0:0:0: [sda] Attached SCSI removable disk
[ 7.601800] EXT4-fs (sda2): mounted filesystem with writeback data mode. Opts: data=writeback
[ 8.312348] systemd[1]: System time before build time, advancing clock.
[ 8.425932] NET: Registered protocol family 10
[ 8.505233] Segment Routing with IPv6
[ 8.550256] 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)
[ 8.568221] systemd[1]: Detected architecture arm64.
[ 8.590025] systemd[1]: Set hostname to .
[ 8.597306] systemd[1]: Failed to bump fs.file-max, ignoring: Invalid argument
[ 9.252418] random: systemd: uninitialized urandom read (16 bytes read)
[ 9.263937] random: systemd: uninitialized urandom read (16 bytes read)
[ 9.268901] systemd[1]: Created slice User and Session Slice.
[ 9.272024] random: systemd: uninitialized urandom read (16 bytes read)
[ 9.277926] systemd[1]: Listening on fsck to fsckd communication Socket.
[ 9.284759] systemd[1]: Reached target Remote File Systems.
[ 9.296194] systemd[1]: Listening on Syslog Socket.
[ 9.336405] systemd[1]: Started Forward Password Requests to Wall Directory Watch.
[ 9.374775] systemd[1]: Condition check resulted in Arbitrary Executable File Formats File System Automount Point being skipped.
[ 9.742153] EXT4-fs (sda2): re-mounted. Opts: commit=600,errors=remount-ro
[ 10.336721] systemd-journald[465]: Received request to flush runtime journal from PID 1
[ 10.444211] random: crng init done
[ 10.444224] random: 7 urandom warning(s) missed due to ratelimiting
[ 10.721885] gpio-fan gpio-fan: GPIO fan initialized
[ 10.729213] Registered IR keymap rc-khadas
[ 10.739368] Registered IR keymap rc-cec
[ 10.739687] rc rc1: meson_ao_cec as /devices/platform/soc/c8100000.bus/c8100100.cec/rc/rc1
[ 10.739883] input: meson_ao_cec as /devices/platform/soc/c8100000.bus/c8100100.cec/rc/rc1/input8
[ 10.747372] debugfs: Directory ‘c1105400.audio’ with parent ‘regmap’ already present!
[ 10.748941] IR NEC protocol handler initialized
[ 10.763179] Registered IR keymap rc-cec
[ 10.763409] rc rc2: dw_hdmi as /devices/platform/soc/c883a000.hdmi-tx/rc/rc2
[ 10.765866] input: dw_hdmi as /devices/platform/soc/c883a000.hdmi-tx/rc/rc2/input9
[ 10.775794] rc rc0: meson-ir as /devices/platform/soc/c8100000.bus/c8100580.ir/rc/rc0
[ 10.776014] input: meson-ir as /devices/platform/soc/c8100000.bus/c8100580.ir/rc/rc0/input7
[ 10.776964] rc rc0: lirc_dev: driver meson-ir registered at minor = 0, raw IR receiver, no transmitter
[ 10.778386] meson-ir c8100580.ir: receiver initialized
[ 10.798809] panfrost d00c0000.gpu: clock rate = 666666666
[ 10.798985] panfrost d00c0000.gpu: mali-t820 id 0x820 major 0x1 minor 0x0 status 0x0
[ 10.798995] panfrost d00c0000.gpu: features: 00000000,101e76ff, issues: 00000000,24040400
[ 10.799004] panfrost d00c0000.gpu: Features: L2:0x07110206 Shader:0x00000000 Tiler:0x00000809 Mem:0x1 MMU:0x00002821 AS:0xff JS:0x7
[ 10.799010] panfrost d00c0000.gpu: shader_present=0x7 l2_present=0x1
[ 10.802094] [drm] Initialized panfrost 1.0.0 20180908 for d00c0000.gpu on minor 1
[ 10.856689] sd 0:0:0:0: Attached scsi generic sg0 type 0
[ 10.921458] Bluetooth: Core ver 2.22
[ 10.921467] Bluetooth: Starting self testing
[ 10.936996] Bluetooth: ECDH test passed in 15150 usecs
[ 10.939680] Bluetooth: SMP test passed in 2536 usecs
[ 10.939725] Bluetooth: Finished self testing
[ 10.939858] NET: Registered protocol family 31
[ 10.939862] Bluetooth: HCI device and connection manager initialized
[ 10.939887] Bluetooth: HCI socket layer initialized
[ 10.939895] Bluetooth: L2CAP socket layer initialized
[ 10.939917] Bluetooth: SCO socket layer initialized
[ 10.973161] asoc-simple-card sound: i2s-hifi <-> meson-aiu-i2s.4.auto mapping ok
[ 10.973248] asoc-simple-card sound: ASoC: no DMI vendor name!
[ 11.025693] Bluetooth: HCI UART driver ver 2.3
[ 11.025702] Bluetooth: HCI UART protocol H4 registered
[ 11.025705] Bluetooth: HCI UART protocol BCSP registered
[ 11.025780] Bluetooth: HCI UART protocol LL registered
[ 11.025782] Bluetooth: HCI UART protocol ATH3K registered
[ 11.025811] Bluetooth: HCI UART protocol Three-wire (H5) registered
[ 11.026071] Bluetooth: HCI UART protocol Intel registered
[ 11.026369] Bluetooth: HCI UART protocol Broadcom registered
[ 11.026409] Bluetooth: HCI UART protocol QCA registered
[ 11.026412] Bluetooth: HCI UART protocol AG6XX registered
[ 11.026465] Bluetooth: HCI UART protocol Marvell registered
[ 11.026646] hci_uart_bcm serial0-0: serial0-0 supply vbat not found, using dummy regulator
[ 11.026776] hci_uart_bcm serial0-0: serial0-0 supply vddio not found, using dummy regulator
[ 11.188143] Bluetooth: hci1: BCM: chip id 121
[ 11.188440] Bluetooth: hci1: BCM: features 0x0e
[ 11.190027] Bluetooth: hci1: BCM4359C0
[ 11.190038] Bluetooth: hci1: BCM4359C0 (003.001.006) build 0000
[ 11.191745] bluetooth hci1: Direct firmware load for brcm/BCM4359C0.hcd failed with error -2
[ 11.191755] bluetooth hci1: Falling back to sysfs fallback for: brcm/BCM4359C0.hcd
[ 11.193782] Bluetooth: hci1: BCM: Patch brcm/BCM4359C0.hcd not found
[ 11.972869] zram: Added device: zram0
[ 11.973795] zram: Added device: zram1
[ 11.974631] zram: Added device: zram2
[ 12.016157] meson8b-dwmac c9410000.ethernet eth0: PHY [0.2009087f:00] driver [RTL8211F Gigabit Ethernet]
[ 12.016170] meson8b-dwmac c9410000.ethernet eth0: phy: setting supported 00,00000000,000062ff advertising 00,00000000,000062ff
[ 12.031624] meson8b-dwmac c9410000.ethernet eth0: No Safety Features support found
[ 12.031647] meson8b-dwmac c9410000.ethernet eth0: PTP not supported by HW
[ 12.031663] meson8b-dwmac c9410000.ethernet eth0: configuring for phy/rgmii link mode
[ 12.031685] meson8b-dwmac c9410000.ethernet eth0: phylink_mac_config: mode=phy/rgmii/Unknown/Unknown adv=00,00000000,000062ff pause=10 link=0 an=1
[ 12.032885] zram1: detected capacity change from 0 to 1073741824
[ 12.036902] meson8b-dwmac c9410000.ethernet eth0: phy link down rgmii/Unknown/Unknown
[ 12.091675] Adding 1048572k swap on /dev/zram1. Priority:5 extents:1 across:1048572k SSFS
[ 12.249464] zram0: detected capacity change from 0 to 52428800
[ 12.389513] EXT4-fs (zram0): mounted filesystem without journal. Opts: discard
[ 14.578454] meson8b-dwmac c9410000.ethernet eth0: phy link up rgmii/1Gbps/Full
[ 14.578468] meson8b-dwmac c9410000.ethernet eth0: phylink_mac_config: mode=phy/rgmii/1Gbps/Full adv=00,00000000,00000000 pause=0f link=1 an=0
[ 14.581017] meson8b-dwmac c9410000.ethernet eth0: Link is Up - 1Gbps/Full - flow control rx/tx

Be sure i2c not used - first !!!
find /sys | grep khadas-mcu
or
zcat /proc/config.gz | grep KHADAS
CONFIG_KHADAS_MCU=y

if u have kernel support for khadas mcu
u no need this script

u need just simple simple config like this

echo 1 > /sys/class/fan/enable
echo 2 > /sys/class/fan/level 
....

The return is shown empty,my kernel does not support khadas-mcu
This script is used here because it does not depend on the kernel

Now the strange thing is that every time I unplug power and startup VIM2, execute the fan script for the first time, the fan doesn’t run, although the on-screen return is correct.
after this “I2c device not found by 0x18 0x88” is prompted every time a fan script is executed.