Skip to content

Instantly share code, notes, and snippets.

@mdvorak
Last active May 27, 2024 09:48
Show Gist options
  • Save mdvorak/2fccca3fa9f76f5a2e11e567797c76d6 to your computer and use it in GitHub Desktop.
Save mdvorak/2fccca3fa9f76f5a2e11e567797c76d6 to your computer and use it in GitHub Desktop.
DS18B20 on BigTreeTech Pi

DS18B20 on BigTreeTech Pi v1.2

BTT Pi uses AllWinner H616 CPU, and on https://github.com/bigtreetech/CB1 system, w1-gpio kernel module does not work.

However, there is an excellent custom module https://github.com/pstolarz/w1-gpio-cl

The following steps were tested on CB1 v2.3.3.

Wiring

DS18B20 Pinout
BTT Pi GPIO

Connect sensor VCC pin to 3.3V, GND to GND (obviously), and signal pin to selected GPIO. I used PC7, since it corresponds to the default w1 pin location on the Raspberry Pi header.
Don't forget to add a pull-up resistor between 3.3V and the signal pin. A 4.7 kOhm resistor is the recommended value.

NEVER connect anything while the printer is powered on!

I did not try parasitic power mode, and I don't recommend it. Klipper will shut down on subsequent read errors, and it might ruin your prints randomly. I did not have any problems with the standard 3-wire connection yet.

Compilation on CB1 system

The easiest way is to compile it directly on the device. The official guide needed to be modified slightly.

  1. sudo apt-get install build-essential bc bison flex libssl-dev
  2. sudo apt-get install linux-headers-current-sun50iw9
  3. git clone https://github.com/pstolarz/w1-gpio-cl.git
  4. cd w1-gpio-cl
  5. ln -s /lib/modules/`uname -r`/build/include/linux w1
  6. make
  7. sudo make install

DKMS

Optionally, you can install it using DKMS

sudo dkms add .
sudo dkms install w1-gpio-cl/1.2.2

where 1.2.1 is the latest w1-gpio-cl release version.

Installation

For details, read the original README.

Pin Selection

The w1-gpio-cl module does not accept pin names; instead, it needs pin index. To list all available pins, run

sudo cat /sys/kernel/debug/pinctrl/300b000.pinctrl/pinmux-pins

Find your preferred pin (note that some pins might not work). I used PC7

pin 71 (PC7): UNCLAIMED

Now you can configure module options

echo 'options w1-gpio-cl m1="gdt:71"' | sudo tee /etc/modprobe.d/w1-gpio-cl.conf

Test Config

Try loading the module manually

sudo modprobe w1-gpio-cl

Verify that the module is loaded

lsmod | grep w1

You should see something like

w1_therm               28672  0
w1_gpio_cl             16384  0

You can verify the output of the dmesg for errors.

Automatic Loading

To load the module during boot, run

echo 'w1-gpio-cl' | sudo tee /etc/modules-load.d/w1-gpio-cl.conf

Reboot and verify that the module is properly loaded and working.

Configuration

See https://www.klipper3d.org/Config_Reference.html#ds18b20-temperature-sensor

Find out connected sensor addresses

sudo ls /sys/bus/w1/devices/

You will see output like

28-011319f769fe  w1_bus_master1

With that address, add a Klipper config section like this

[temperature_sensor my_sensor]
sensor_type: DS18B20
serial_no: 28-011319f769fe
sensor_mcu: CB1

Note that sensor_mcu must be set to the host, which is CB1 by default.

After restarting Klipper, your new temperature sensor should appear in the Mainsail/Fluidd UI automatically.

@TristanScott44
Copy link

Thank you so much for creating this guide. I would not have figured this out on my own.

@jonathjon
Copy link

Hello. I have followed your guide but not getting any ID's from the 2 sensors I have hooked up. I am running a CB1 EMMC so I don't know if that makes anything different or not. Here is my dmesg output

biqu@BTT-CB1:~$ sudo ls /sys/bus/w1/devices/
w1_bus_master1
biqu@BTT-CB1:~$ dmesg
[    0.000000] Zone ranges:
[    0.000000]   DMA      [mem 0x0000000040000000-0x000000007fffffff]
[    0.000000]   DMA32    empty
[    0.000000]   Normal   empty
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000040000000-0x000000004007ffff]
[    0.000000]   node   0: [mem 0x0000000040080000-0x000000007fffffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000040000000-0x000000007fffffff]
[    0.000000] cma: Reserved 128 MiB at 0x0000000076c00000
[    0.000000] psci: probing for conduit method from DT.
[    0.000000] psci: PSCIv1.1 detected in firmware.
[    0.000000] psci: Using standard PSCI v0.2 function IDs
[    0.000000] psci: MIGRATE_INFO_TYPE not supported.
[    0.000000] psci: SMC Calling Convention v1.2
[    0.000000] percpu: Embedded 18 pages/cpu s36504 r8192 d29032 u73728
[    0.000000] pcpu-alloc: s36504 r8192 d29032 u73728 alloc=18*4096
[    0.000000] pcpu-alloc: [0] 0 [0] 1 [0] 2 [0] 3
[    0.000000] Detected VIPT I-cache on CPU0
[    0.000000] CPU features: detected: ARM erratum 845719
[    0.000000] Fallback order for Node 0: 0
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 258048
[    0.000000] Policy zone: DMA
[    0.000000] Kernel command line: root=UUID=e345f9fc-00c8-4132-8e8e-8afa1304e8ed rootwait rootfstype=ext4 bootsplash.bootfile=bootsplash.armbian console=ttyS0,115200 console=tty1 consoleblank=0 loglevel=7 ubootpart= usb-storage.quirks=   cgroup_enable=memory swapaccount=1
[    0.000000] Unknown kernel command line parameters "ubootpart= cgroup_enable=memory", will be passed to user space.
[    0.000000] printk: log_buf_len individual max cpu contribution: 4096 bytes
[    0.000000] printk: log_buf_len total cpu_extra contributions: 12288 bytes
[    0.000000] printk: log_buf_len min size: 16384 bytes
[    0.000000] printk: log_buf_len: 32768 bytes
[    0.000000] printk: early log buf free: 14064(85%)
[    0.000000] Dentry cache hash table entries: 131072 (order: 8, 1048576 bytes, linear)
[    0.000000] Inode-cache hash table entries: 65536 (order: 7, 524288 bytes, linear)
[    0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[    0.000000] Memory: 868288K/1048576K available (13376K kernel code, 866K rwdata, 4040K rodata, 2240K init, 279K bss, 49216K reserved, 131072K cma-reserved)
[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=4, Nodes=1
[    0.000000] rcu: Hierarchical RCU implementation.
[    0.000000] rcu:     RCU restricting CPUs from NR_CPUS=8 to nr_cpu_ids=4.
[    0.000000]  Tracing variant of 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=4
[    0.000000] NR_IRQS: 64, nr_irqs: 64, preallocated irqs: 0
[    0.000000] Root IRQ handler: gic_handle_irq
[    0.000000] GIC: Using split EOI/Deactivate mode
[    0.000000] random: get_random_bytes called from start_kernel+0x4c4/0x6a4 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.000000] sched_clock: 56 bits at 24MHz, resolution 41ns, wraps every 4398046511097ns
[    0.000570] Console: colour dummy device 120x45
[    0.000916] printk: console [tty1] enabled
[    0.001007] Calibrating delay loop (skipped), value calculated using timer frequency.. 48.00 BogoMIPS (lpj=96000)
[    0.001034] pid_max: default: 32768 minimum: 301
[    0.001114] LSM: Security Framework initializing
[    0.001156] Yama: becoming mindful.
[    0.001246] AppArmor: AppArmor initialized
[    0.001299] Mount-cache hash table entries: 2048 (order: 2, 16384 bytes, linear)
[    0.001322] Mountpoint-cache hash table entries: 2048 (order: 2, 16384 bytes, linear)
[    0.002890] rcu: Hierarchical SRCU implementation.
[    0.004064] smp: Bringing up secondary CPUs ...
[    0.004538] Detected VIPT I-cache on CPU1
[    0.004612] CPU1: Booted secondary processor 0x0000000001 [0x410fd034]
[    0.005181] Detected VIPT I-cache on CPU2
[    0.005244] CPU2: Booted secondary processor 0x0000000002 [0x410fd034]
[    0.005757] Detected VIPT I-cache on CPU3
[    0.005814] CPU3: Booted secondary processor 0x0000000003 [0x410fd034]
[    0.005902] smp: Brought up 1 node, 4 CPUs
[    0.005984] SMP: Total of 4 processors activated.
[    0.005998] CPU features: detected: 32-bit EL0 Support
[    0.006012] CPU features: detected: CRC32 instructions
[    0.018947] CPU: All CPU(s) started at EL2
[    0.019014] alternatives: patching kernel code
[    0.020520] devtmpfs: initialized
[    0.027164] Registered cp15_barrier emulation handler
[    0.027212] Registered setend emulation handler
[    0.027404] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns
[    0.027438] futex hash table entries: 1024 (order: 4, 65536 bytes, linear)
[    0.031908] pinctrl core: initialized pinctrl subsystem
[    0.033154] NET: Registered PF_NETLINK/PF_ROUTE protocol family
[    0.034676] DMA: preallocated 128 KiB GFP_KERNEL pool for atomic allocations
[    0.034862] DMA: preallocated 128 KiB GFP_KERNEL|GFP_DMA pool for atomic allocations
[    0.034992] DMA: preallocated 128 KiB GFP_KERNEL|GFP_DMA32 pool for atomic allocations
[    0.035110] audit: initializing netlink subsys (disabled)
[    0.035376] audit: type=2000 audit(0.032:1): state=initialized audit_enabled=0 res=1
[    0.035868] thermal_sys: Registered thermal governor 'fair_share'
[    0.035875] thermal_sys: Registered thermal governor 'bang_bang'
[    0.035893] thermal_sys: Registered thermal governor 'step_wise'
[    0.035906] thermal_sys: Registered thermal governor 'user_space'
[    0.036497] cpuidle: using governor menu
[    0.036745] hw-breakpoint: found 6 breakpoint and 4 watchpoint registers.
[    0.036855] ASID allocator initialised with 65536 entries
[    0.037004] Serial: AMBA PL011 UART driver
[    0.048446] platform 6510000.tcon-top: Fixing up cyclic dependency with 6000000.hdmi
[    0.049125] platform 6515000.lcd-controller: Fixing up cyclic dependency with 6510000.tcon-top
[    0.050254] platform connector: Fixing up cyclic dependency with 6000000.hdmi
[    0.058393] HugeTLB registered 1.00 GiB page size, pre-allocated 0 pages
[    0.058437] HugeTLB registered 32.0 MiB page size, pre-allocated 0 pages
[    0.058453] HugeTLB registered 2.00 MiB page size, pre-allocated 0 pages
[    0.058468] HugeTLB registered 64.0 KiB page size, pre-allocated 0 pages
[    0.059058] cryptd: max_cpu_qlen set to 1000
[    0.124165] raid6: neonx8   gen()  1804 MB/s
[    0.192206] raid6: neonx8   xor()  1347 MB/s
[    0.260269] raid6: neonx4   gen()  1846 MB/s
[    0.328313] raid6: neonx4   xor()  1335 MB/s
[    0.396364] raid6: neonx2   gen()  1752 MB/s
[    0.464423] raid6: neonx2   xor()  1241 MB/s
[    0.532469] raid6: neonx1   gen()  1524 MB/s
[    0.600528] raid6: neonx1   xor()  1047 MB/s
[    0.668584] raid6: int64x8  gen()  1252 MB/s
[    0.736634] raid6: int64x8  xor()   657 MB/s
[    0.804697] raid6: int64x4  gen()  1394 MB/s
[    0.872749] raid6: int64x4  xor()   705 MB/s
[    0.940801] raid6: int64x2  gen()  1189 MB/s
[    1.008865] raid6: int64x2  xor()   613 MB/s
[    1.076931] raid6: int64x1  gen()   886 MB/s
[    1.144985] raid6: int64x1  xor()   470 MB/s
[    1.144999] raid6: using algorithm neonx4 gen() 1846 MB/s
[    1.145013] raid6: .... xor() 1335 MB/s, rmw enabled
[    1.145025] raid6: using neon recovery algorithm
[    1.147207] iommu: Default domain type: Translated
[    1.147250] iommu: DMA domain TLB invalidation policy: strict mode
[    1.147567] SCSI subsystem initialized
[    1.147759] usbcore: registered new interface driver usbfs
[    1.147813] usbcore: registered new interface driver hub
[    1.147861] usbcore: registered new device driver usb
[    1.148329] pps_core: LinuxPPS API ver. 1 registered
[    1.148346] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <[email protected]>
[    1.148372] PTP clock support registered
[    1.148734] ARM FF-A: FFA_VERSION returned not supported
[    1.149242] Advanced Linux Sound Architecture Driver Initialized.
[    1.149907] NetLabel: Initializing
[    1.149934] NetLabel:  domain hash size = 128
[    1.149947] NetLabel:  protocols = UNLABELED CIPSOv4 CALIPSO
[    1.150023] NetLabel:  unlabeled traffic allowed by default
[    1.150265] mctp: management component transport protocol core
[    1.150282] NET: Registered PF_MCTP protocol family
[    1.150934] clocksource: Switched to clocksource arch_sys_counter
[    1.151150] VFS: Disk quotas dquot_6.6.0
[    1.151214] VFS: Dquot-cache hash table entries: 512 (order 0, 4096 bytes)
[    1.151777] AppArmor: AppArmor Filesystem Enabled
[    1.157558] NET: Registered PF_INET protocol family
[    1.157737] IP idents hash table entries: 16384 (order: 5, 131072 bytes, linear)
[    1.158553] tcp_listen_portaddr_hash hash table entries: 512 (order: 1, 8192 bytes, linear)
[    1.158600] TCP established hash table entries: 8192 (order: 4, 65536 bytes, linear)
[    1.158681] TCP bind hash table entries: 8192 (order: 5, 131072 bytes, linear)
[    1.158812] TCP: Hash tables configured (established 8192 bind 8192)
[    1.158999] UDP hash table entries: 512 (order: 2, 16384 bytes, linear)
[    1.159050] UDP-Lite hash table entries: 512 (order: 2, 16384 bytes, linear)
[    1.159251] NET: Registered PF_UNIX/PF_LOCAL protocol family
[    1.159823] Trying to unpack rootfs image as initramfs...
[    1.172312] hw perfevents: enabled with armv8_cortex_a53 PMU driver, 7 counters available
[    1.173993] Initialise system trusted keyrings
[    1.174074] Key type blacklist registered
[    1.174341] workingset: timestamp_bits=44 max_order=18 bucket_order=0
[    1.179588] zbud: loaded
[    1.181123] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    1.183337] integrity: Platform Keyring initialized
[    1.226363] xor: automatically using best checksumming function   32regs
[    1.226410] async_tx: api initialized (async)
[    1.226428] Key type asymmetric registered
[    1.226442] Asymmetric key parser 'x509' registered
[    1.226650] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 247)
[    1.226950] io scheduler mq-deadline registered
[    1.226983] io scheduler kyber registered
[    1.227196] io scheduler bfq registered
[    1.238515] sun50i-h616-pinctrl 300b000.pinctrl: initialized sunXi PIO driver
[    1.239539] sun50i-h616-r-pinctrl 7022000.pinctrl: initialized sunXi PIO driver
[    1.247756] Serial: 8250/16550 driver, 6 ports, IRQ sharing disabled
[    1.249536] sun50i-h616-pinctrl 300b000.pinctrl: supply vcc-ph not found, using dummy regulator
[    1.250181] printk: console [ttyS0] disabled
[    1.250302] 5000000.serial: ttyS0 at MMIO 0x5000000 (irq = 32, base_baud = 1500000) is a 16550A
[    1.606071] Freeing initrd memory: 9036K
[    1.607535] printk: console [ttyS0] enabled
[    1.609419] misc dump reg init
[    2.276366] cacheinfo: Unable to detect cache hierarchy for CPU 0
[    2.286842] loop: module loaded
[    2.291352] mcp2515@0 enforce active low on chipselect handle
[    2.297215] sun50i-h616-pinctrl 300b000.pinctrl: supply vcc-pi not found, using dummy regulator
[    2.306074] st7789v@1 enforce active low on chipselect handle
[    2.311864] spidev@2 enforce active low on chipselect handle
[    2.318793] CAN device driver interface
[    2.323516] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    2.330076] ehci-platform: EHCI generic platform driver
[    2.335671] phy phy-5100400.phy.0: Changing dr_mode to 1
[    2.341019] ehci-platform 5101000.usb: EHCI Host Controller
[    2.346618] ehci-platform 5101000.usb: new USB bus registered, assigned bus number 1
[    2.354491] ehci-platform 5101000.usb: irq 37, io mem 0x05101000
[    2.374955] ehci-platform 5101000.usb: USB 2.0 started, EHCI 1.00
[    2.381344] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 5.16
[    2.389636] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    2.396869] usb usb1: Product: EHCI Host Controller
[    2.401757] usb usb1: Manufacturer: Linux 5.16.17-sun50iw9 ehci_hcd
[    2.408032] usb usb1: SerialNumber: 5101000.usb
[    2.413094] hub 1-0:1.0: USB hub found
[    2.416918] hub 1-0:1.0: 1 port detected
[    2.421502] ehci-platform 5200000.usb: EHCI Host Controller
[    2.427141] ehci-platform 5200000.usb: new USB bus registered, assigned bus number 2
[    2.435027] ehci-platform 5200000.usb: irq 39, io mem 0x05200000
[    2.454938] ehci-platform 5200000.usb: USB 2.0 started, EHCI 1.00
[    2.461305] usb usb2: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 5.16
[    2.469595] usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    2.476827] usb usb2: Product: EHCI Host Controller
[    2.481715] usb usb2: Manufacturer: Linux 5.16.17-sun50iw9 ehci_hcd
[    2.487994] usb usb2: SerialNumber: 5200000.usb
[    2.493059] hub 2-0:1.0: USB hub found
[    2.496883] hub 2-0:1.0: 1 port detected
[    2.501461] ehci-platform 5310000.usb: EHCI Host Controller
[    2.507102] ehci-platform 5310000.usb: new USB bus registered, assigned bus number 3
[    2.514983] ehci-platform 5310000.usb: irq 41, io mem 0x05310000
[    2.534937] ehci-platform 5310000.usb: USB 2.0 started, EHCI 1.00
[    2.541329] usb usb3: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 5.16
[    2.549620] usb usb3: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    2.556853] usb usb3: Product: EHCI Host Controller
[    2.561741] usb usb3: Manufacturer: Linux 5.16.17-sun50iw9 ehci_hcd
[    2.568015] usb usb3: SerialNumber: 5310000.usb
[    2.573081] hub 3-0:1.0: USB hub found
[    2.576908] hub 3-0:1.0: 1 port detected
[    2.581499] ehci-platform 5311000.usb: EHCI Host Controller
[    2.587137] ehci-platform 5311000.usb: new USB bus registered, assigned bus number 4
[    2.595018] ehci-platform 5311000.usb: irq 43, io mem 0x05311000
[    2.614938] ehci-platform 5311000.usb: USB 2.0 started, EHCI 1.00
[    2.621294] usb usb4: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 5.16
[    2.629583] usb usb4: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    2.636815] usb usb4: Product: EHCI Host Controller
[    2.641703] usb usb4: Manufacturer: Linux 5.16.17-sun50iw9 ehci_hcd
[    2.647978] usb usb4: SerialNumber: 5311000.usb
[    2.653057] hub 4-0:1.0: USB hub found
[    2.656884] hub 4-0:1.0: 1 port detected
[    2.661309] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[    2.667554] ohci-platform: OHCI generic platform driver
[    2.673200] ohci-platform 5101400.usb: Generic Platform OHCI controller
[    2.679867] ohci-platform 5101400.usb: new USB bus registered, assigned bus number 5
[    2.687743] ohci-platform 5101400.usb: irq 38, io mem 0x05101400
[    2.755156] usb usb5: New USB device found, idVendor=1d6b, idProduct=0001, bcdDevice= 5.16
[    2.763466] usb usb5: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    2.770699] usb usb5: Product: Generic Platform OHCI controller
[    2.776628] usb usb5: Manufacturer: Linux 5.16.17-sun50iw9 ohci_hcd
[    2.782903] usb usb5: SerialNumber: 5101400.usb
[    2.788016] hub 5-0:1.0: USB hub found
[    2.791845] hub 5-0:1.0: 1 port detected
[    2.796407] ohci-platform 5200400.usb: Generic Platform OHCI controller
[    2.803093] ohci-platform 5200400.usb: new USB bus registered, assigned bus number 6
[    2.810998] ohci-platform 5200400.usb: irq 40, io mem 0x05200400
[    2.818944] usb 1-1: new high-speed USB device number 2 using ehci-platform
[    2.879151] usb usb6: New USB device found, idVendor=1d6b, idProduct=0001, bcdDevice= 5.16
[    2.887441] usb usb6: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    2.894672] usb usb6: Product: Generic Platform OHCI controller
[    2.900590] usb usb6: Manufacturer: Linux 5.16.17-sun50iw9 ohci_hcd
[    2.906865] usb usb6: SerialNumber: 5200400.usb
[    2.911954] hub 6-0:1.0: USB hub found
[    2.915780] hub 6-0:1.0: 1 port detected
[    2.920339] ohci-platform 5310400.usb: Generic Platform OHCI controller
[    2.927029] ohci-platform 5310400.usb: new USB bus registered, assigned bus number 7
[    2.934930] ohci-platform 5310400.usb: irq 42, io mem 0x05310400
[    2.979542] usb 1-1: New USB device found, idVendor=1a40, idProduct=0101, bcdDevice= 1.11
[    2.987751] usb 1-1: New USB device strings: Mfr=0, Product=1, SerialNumber=0
[    2.994899] usb 1-1: Product: USB 2.0 Hub
[    2.999537] hub 1-1:1.0: USB hub found
[    3.003167] usb usb7: New USB device found, idVendor=1d6b, idProduct=0001, bcdDevice= 5.16
[    3.003417] hub 1-1:1.0: 4 ports detected
[    3.011597] usb usb7: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    3.022828] usb usb7: Product: Generic Platform OHCI controller
[    3.028768] usb usb7: Manufacturer: Linux 5.16.17-sun50iw9 ohci_hcd
[    3.035046] usb usb7: SerialNumber: 5310400.usb
[    3.040107] hub 7-0:1.0: USB hub found
[    3.043943] hub 7-0:1.0: 1 port detected
[    3.048499] ohci-platform 5311400.usb: Generic Platform OHCI controller
[    3.055187] ohci-platform 5311400.usb: new USB bus registered, assigned bus number 8
[    3.063075] ohci-platform 5311400.usb: irq 44, io mem 0x05311400
[    3.131161] usb usb8: New USB device found, idVendor=1d6b, idProduct=0001, bcdDevice= 5.16
[    3.139463] usb usb8: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    3.146698] usb usb8: Product: Generic Platform OHCI controller
[    3.152628] usb usb8: Manufacturer: Linux 5.16.17-sun50iw9 ohci_hcd
[    3.158904] usb usb8: SerialNumber: 5311400.usb
[    3.164005] hub 8-0:1.0: USB hub found
[    3.167830] hub 8-0:1.0: 1 port detected
[    3.172804] usbcore: registered new interface driver usb-storage
[    3.179353] usb_phy_generic usb_phy_generic.0.auto: supply vcc not found, using dummy regulator
[    3.189553] mousedev: PS/2 mouse device common for all mice
[    3.195381] usbcore: registered new interface driver usbtouchscreen
[    3.202717] sun6i-rtc 7000000.rtc: registered as rtc0
[    3.207923] sun6i-rtc 7000000.rtc: RTC enabled
[    3.212519] i2c_dev: i2c /dev entries driver
[    3.216821] Driver for 1-wire Dallas network protocol.
[    3.222942] sunxi-wdt 30090a0.watchdog: Watchdog enabled (timeout=16 sec, nowayout=0)
[    3.232377] sun50i-h616-pinctrl 300b000.pinctrl: supply vcc-pg not found, using dummy regulator
[    3.241601] sdhci: Secure Digital Host Controller Interface driver
[    3.247819] sdhci: Copyright(c) Pierre Ossman
[    3.252221] Synopsys Designware Multimedia Card Interface Driver
[    3.259054] sdhci-pltfm: SDHCI platform and OF driver helper
[    3.259890] sunxi-mmc 4021000.mmc: allocated mmc-pwrseq
[    3.265067] sun50i-h616-pinctrl 300b000.pinctrl: supply vcc-pf not found, using dummy regulator
[    3.279768] ledtrig-cpu: registered to indicate activity on CPUs
[    3.286325] SMCCC: SOC_ID: ID = jep106:091e:1823 Revision = 0x00000000
[    3.292943] hid: raw HID events driver (C) Jiri Kosina
[    3.298234] usbcore: registered new interface driver usbhid
[    3.303819] usbhid: USB HID core driver
[    3.307665] SPI driver fb_st7796 has no spi_device_id for sitronix,st7796
[    3.330320] sunxi-hdmi soc:hdmi-audio@1: snd_soc_register_card failed
[    3.337565] NET: Registered PF_INET6 protocol family
[    3.378172] Segment Routing with IPv6
[    3.381943] In-situ OAM (IOAM) with IPv6
[    3.385973] NET: Registered PF_PACKET protocol family
[    3.391062] can: controller area network core
[    3.395510] NET: Registered PF_CAN protocol family
[    3.400482] 8021q: 802.1Q VLAN Support v1.8
[    3.404841] 9pnet: Installing 9P2000 support
[    3.409192] Key type dns_resolver registered
[    3.413924] registered taskstats version 1
[    3.418065] Loading compiled-in X.509 certificates
[    3.426508] Loaded X.509 cert 'Build time autogenerated kernel key: 238e852b21ade750ccb489d783c20372a97937da'
[    3.436609] usb 1-1.2: new full-speed USB device number 3 using ehci-platform
[    3.438762] zswap: loaded using pool zstd/z3fold
[    3.449190] Key type ._fscrypt registered
[    3.453275] Key type .fscrypt registered
[    3.457213] Key type fscrypt-provisioning registered
[    3.463207] Btrfs loaded, crc32c=crc32c-generic, zoned=yes, fsverity=no
[    3.470217] Key type encrypted registered
[    3.474282] AppArmor: AppArmor sha1 policy hashing enabled
[    3.479808] evm: Initialising EVM extended attributes:
[    3.484953] evm: security.selinux (disabled)
[    3.489233] evm: security.SMACK64
[    3.492554] evm: security.SMACK64EXEC
[    3.496225] evm: security.SMACK64TRANSMUTE
[    3.499504] sunxi-mmc 4021000.mmc: initialized, max. request size: 16384 KB, uses new timings mode
[    3.500326] evm: security.SMACK64MMAP
[    3.512946] evm: security.apparmor
[    3.515414] sunxi-mmc 4021000.mmc: card claims to support voltages below defined range
[    3.516356] evm: security.ima (disabled)
[    3.528195] evm: security.capability
[    3.531777] evm: HMAC attrs: 0x1
[    3.534876] mmc0: new high speed SDIO card at address 0001
[    3.550784] platform 1100000.mixer: Fixing up cyclic dependency with 6510000.tcon-top
[    3.562442] sunxi-hdmi soc:hdmi-audio@1: snd_soc_register_card failed
[    3.570389] sunxi-hdmi soc:hdmi-audio@1: snd_soc_register_card failed
[    3.577641] of_cfs_init
[    3.580255] of_cfs_init: OK
[    3.583439] ALSA device list:
[    3.586415]   #0: sndahub
[    3.589976] Freeing unused kernel memory: 2240K
[    3.603010] Run /init as init process
[    3.606681]   with arguments:
[    3.606688]     /init
[    3.606692]   with environment:
[    3.606697]     HOME=/
[    3.606701]     TERM=linux
[    3.606705]     ubootpart=
[    3.606710]     cgroup_enable=memory
[    3.681303] usb 1-1.2: New USB device found, idVendor=04d9, idProduct=8030, bcdDevice= 1.00
[    3.689784] usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[    3.697166] usb 1-1.2: Product: BTT-HDMI7
[    3.701236] usb 1-1.2: Manufacturer: BIQU
[    3.705290] usb 1-1.2: SerialNumber: SN0000000003
[    3.715369] input: BIQU BTT-HDMI7 as /devices/platform/soc/5101000.usb/usb1/1-1/1-1.2/1-1.2:1.0/0003:04D9:8030.0001/input/input0
[    3.734572] hid-generic 0003:04D9:8030.0001: input,hidraw0: USB HID v1.10 Device [BIQU BTT-HDMI7] on usb-5101000.usb-1.2/input0
[    3.748585] sunxi-hdmi soc:hdmi-audio@1: snd_soc_register_card failed
[    3.954996] usb 1-1.4: new full-speed USB device number 4 using ehci-platform
[    4.018738] sun50i-h616-pinctrl 300b000.pinctrl: supply vcc-pa not found, using dummy regulator
[    4.029310] it's ac300, skip the ac200 init!
[    4.033714] ac200: probe of 0-0010 failed with error -22
[    4.039938] mv64xxx_i2c 7081400.i2c: can't get pinctrl, bus recovery not supported
[    4.040954] sunxi-hdmi soc:hdmi-audio@1: snd_soc_register_card failed
[    4.051908] axp20x-i2c 1-0036: AXP20x variant AXP1530 found
[    4.084932] random: fast init done
[    4.091678] axp1530-dcdc3: Bringing 1500000uV into 1220000-1220000uV
[    4.115716] axp20x-i2c 1-0036: AXP20X driver loaded
[    4.135397] sunxi-hdmi soc:hdmi-audio@1: snd_soc_register_card failed
[    4.142659] debugfs: Directory '1100000.mixer' with parent 'regmap' already present!
[    4.150579] debugfs: Directory '1100000.mixer' with parent 'regmap' already present!
[    4.174676] sun4i-drm display-engine: bound 1100000.mixer (ops 0xffff800008dd4f00)
[    4.182558] sun4i-drm display-engine: bound 6510000.tcon-top (ops 0xffff800008dd8b38)
[    4.190761] sun4i-drm display-engine: bound 6515000.lcd-controller (ops 0xffff800008dd4028)
[    4.193292] usb 1-1.4: New USB device found, idVendor=1d50, idProduct=606f, bcdDevice= 0.00
[    4.207558] usb 1-1.4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[    4.214900] usb 1-1.4: Product: stm32h723xx
[    4.219099] usb 1-1.4: Manufacturer: Klipper
[    4.223382] usb 1-1.4: SerialNumber: 3A0036001051313236343430
[    4.231043] sun8i-dw-hdmi 6000000.hdmi: Detected HDMI TX controller v2.12a with HDCP (DWC HDMI 2.0 TX PHY)
[    4.241238] sun8i-dw-hdmi 6000000.hdmi: EVENT=plugin
[    4.241415] sun8i-dw-hdmi 6000000.hdmi: registered DesignWare HDMI I2C bus driver
[    4.254636] sun4i-drm display-engine: bound 6000000.hdmi (ops 0xffff800008dd47d0)
[    4.262789] [drm] Initialized sun4i-drm 1.0.0 20150629 for display-engine on minor 0
[    4.270649] sun8i-dw-hdmi 6000000.hdmi: read_hpd result: 1
[    4.394321] bootsplash: Loading splash file (639808 bytes)
[    4.394423] bootsplash: Loaded (639808 bytes, 2 pics, 76 blobs).
[    4.463053] Console: switching to colour frame buffer device 128x37
[    4.498305] sun4i-drm display-engine: [drm] fb0: sun4i-drmdrmfb frame buffer device
[    4.519887] gmac-power0: NULL
[    4.523129] gmac-power1: NULL
[    4.526289] gmac-power2: NULL
[    5.349200] sun50i-h616-pinctrl 300b000.pinctrl: supply vcc-pc not found, using dummy regulator
[    5.386963] sunxi-mmc 4020000.mmc: initialized, max. request size: 16384 KB, uses new timings mode
[    5.387514] sunxi-mmc 4022000.mmc: initialized, max. request size: 2048 KB, uses new timings mode
[    5.515144] mmc2: new DDR MMC card at address 0001
[    5.521660] mmcblk2: mmc2:0001 BJTD4R 29.1 GiB
[    5.529225]  mmcblk2: p1 p2
[    5.535617] mmcblk2boot0: mmc2:0001 BJTD4R 4.00 MiB
[    5.542133] mmcblk2boot1: mmc2:0001 BJTD4R 4.00 MiB
[    6.592576] EXT4-fs (mmcblk2p2): mounted filesystem with writeback data mode. Opts: (null). Quota mode: none.
[    6.932690] systemd[1]: System time before build time, advancing clock.
[    6.963836] systemd[1]: systemd 247.3-7+deb11u4 running in system mode. (+PAM +AUDIT +SELINUX +IMA +APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +ZSTD +SECCOMP +BLKID +ELFUTILS +KMOD +IDN2 -IDN +PCRE2 default-hierarchy=unified)
[    6.987907] systemd[1]: Detected architecture arm64.
[    7.000560] systemd[1]: Set hostname to <BTT-CB1>.
[    7.498755] systemd[1]: /lib/systemd/system/hdmi-audio.service:10: Support for option SysVStartPriority= has been removed and it is ignored
[    7.556222] systemd[1]: Queued start job for default target Graphical Interface.
[    7.565175] random: systemd: uninitialized urandom read (16 bytes read)
[    7.574637] systemd[1]: Created slice system-getty.slice.
[    7.597887] random: systemd: uninitialized urandom read (16 bytes read)
[    7.607191] systemd[1]: Created slice system-modprobe.slice.
[    7.614368] random: systemd: uninitialized urandom read (16 bytes read)
[    7.624306] systemd[1]: Created slice system-serial\x2dgetty.slice.
[    7.649293] systemd[1]: Created slice system-systemd\x2dfsck.slice.
[    7.658828] systemd[1]: Created slice User and Session Slice.
[    7.665914] systemd[1]: Started Dispatch Password Requests to Console Directory Watch.
[    7.675064] systemd[1]: Started Forward Password Requests to Wall Directory Watch.
[    7.699208] systemd[1]: Set up automount Arbitrary Executable File Formats File System Automount Point.
[    7.710574] systemd[1]: Reached target Local Encrypted Volumes.
[    7.717470] systemd[1]: Reached target Paths.
[    7.722567] systemd[1]: Reached target Remote File Systems.
[    7.728806] systemd[1]: Reached target Slices.
[    7.733961] systemd[1]: Reached target Swap.
[    7.750987] systemd[1]: Listening on fsck to fsckd communication Socket.
[    7.759512] systemd[1]: Listening on initctl Compatibility Named Pipe.
[    7.768585] systemd[1]: Listening on Journal Audit Socket.
[    7.775832] systemd[1]: Listening on Journal Socket (/dev/log).
[    7.783461] systemd[1]: Listening on Journal Socket.
[    7.799119] systemd[1]: Listening on udev Control Socket.
[    7.806318] systemd[1]: Listening on udev Kernel Socket.
[    7.817757] systemd[1]: Mounting Huge Pages File System...
[    7.828924] systemd[1]: Mounting POSIX Message Queue File System...
[    7.840658] systemd[1]: Mounting Kernel Debug File System...
[    7.864927] systemd[1]: Condition check resulted in Kernel Trace File System being skipped.
[    7.879571] systemd[1]: Starting Restore / save the current clock...
[    7.891744] systemd[1]: Starting Create list of static device nodes for the current kernel...
[    7.905364] systemd[1]: Starting Load Kernel Module configfs...
[    7.924404] systemd[1]: Starting Load Kernel Module drm...
[    7.935532] systemd[1]: Starting Load Kernel Module fuse...
[    7.946062] systemd[1]: Started Nameserver information manager.
[    7.953800] systemd[1]: Reached target Network (Pre).
[    7.965426] fuse: init (API version 7.35)
[    7.966374] systemd[1]: Condition check resulted in Set Up Additional Binary Formats being skipped.
[    7.979279] systemd[1]: Condition check resulted in File System Check on Root Device being skipped.
[    7.995582] systemd[1]: Starting Journal Service...
[    8.007393] systemd[1]: Starting Load Kernel Modules...
[    8.018861] systemd[1]: Starting Remount Root and Kernel File Systems...
[    8.032274] systemd[1]: Starting Coldplug All udev Devices...
[    8.045259] w1_gpio_cl: loading out-of-tree module taints kernel.
[    8.050090] systemd[1]: Mounted Huge Pages File System.
[    8.051683] w1_gpio_cl: module verification failed: signature and/or required key missing - tainting kernel
[    8.066303] EXT4-fs (mmcblk2p2): re-mounted. Opts: commit=600,errors=remount-ro. Quota mode: none.
[    8.084474] systemd[1]: Mounted POSIX Message Queue File System.
[    8.091834] systemd[1]: Mounted Kernel Debug File System.
[    8.099882] systemd[1]: Finished Restore / save the current clock.
[    8.108801] systemd[1]: Finished Create list of static device nodes for the current kernel.
[    8.119738] systemd[1]: [email protected]: Succeeded.
[    8.127104] systemd[1]: Finished Load Kernel Module configfs.
[    8.139377] systemd[1]: [email protected]: Succeeded.
[    8.146145] systemd[1]: Finished Load Kernel Module drm.
[    8.153754] systemd[1]: [email protected]: Succeeded.
[    8.160648] systemd[1]: Finished Load Kernel Module fuse.
[    8.170080] systemd[1]: Finished Load Kernel Modules.
[    8.177602] systemd[1]: Finished Remount Root and Kernel File Systems.
[    8.205589] systemd[1]: Mounting FUSE Control File System...
[    8.216561] systemd[1]: Mounting Kernel Configuration File System...
[    8.225587] systemd[1]: Condition check resulted in Rebuild Hardware Database being skipped.
[    8.234701] systemd[1]: Condition check resulted in Platform Persistent Storage Archival being skipped.
[    8.249381] systemd[1]: Starting Load/Save Random Seed...
[    8.260709] systemd[1]: Starting Apply Kernel Variables...
[    8.272187] systemd[1]: Starting Create System Users...
[    8.283819] systemd[1]: Started Journal Service.
[    8.343194] systemd-journald[292]: Received client request to flush runtime journal.
[    8.350196] systemd-journald[292]: File /var/log/journal/bc065df264144c928a32b3c270f905df/system.journal corrupted or uncleanly shut down, renaming and replacing.
[    8.718444] panfrost 1800000.gpu: clock rate = 432000000
[    8.718489] panfrost 1800000.gpu: bus_clock rate = 200000000
[    8.731517] panfrost 1800000.gpu: mali-g31 id 0x7093 major 0x0 minor 0x0 status 0x0
[    8.731550] panfrost 1800000.gpu: features: 00000000,3fde77ff, issues: 00000000,00000400
[    8.731558] panfrost 1800000.gpu: Features: L2:0x07100206 Shader:0x00000000 Tiler:0x00000209 Mem:0x1 MMU:0x00002821 AS:0xff JS:0x7
[    8.731567] panfrost 1800000.gpu: shader_present=0x1 l2_present=0x1
[    8.745740] [drm] Initialized panfrost 1.2.0 20180908 for 1800000.gpu on minor 1
[    8.781594] debugfs: Directory '5096000.codec' with parent 'H616 Audio Codec' already present!
[    8.823308] cfg80211: Loading compiled-in X.509 certificates for regulatory database
[    8.832672] cfg80211: Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7'
[    8.849510] cfg80211: loaded regulatory.db is malformed or signature is missing/invalid
[    8.915596] gs_usb 1-1.4:1.0: Configuring for 1 interfaces
[    8.916534] usbcore: registered new interface driver gs_usb
[    9.003569] input: BIQU BTT-HDMI7 as /devices/platform/soc/5101000.usb/usb1/1-1/1-1.2/1-1.2:1.0/0003:04D9:8030.0001/input/input1
[    9.004210] hid-multitouch 0003:04D9:8030.0001: input,hidraw0: USB HID v1.10 Device [BIQU BTT-HDMI7] on usb-5101000.usb-1.2/input0
[    9.193491] random: crng init done
[    9.193508] random: 7 urandom warning(s) missed due to ratelimiting
[    9.612779] zram: Added device: zram0
[    9.616524] zram: Added device: zram1
[    9.618146] zram: Added device: zram2
[    9.635498] IPv6: ADDRCONF(NETDEV_CHANGE): can0: link becomes ready
[    9.810390] zram0: detected capacity change from 0 to 1010640
[    9.906220] Adding 505316k swap on /dev/zram0.  Priority:5 extents:1 across:505316k SSFS
[   10.231462] zram1: detected capacity change from 0 to 102400
[   10.485566] systemd-journald[292]: File /var/log/journal/bc065df264144c928a32b3c270f905df/user-1000.journal corrupted or uncleanly shut down, renaming and replacing.
[   11.726190] mii_bus 5030000.ethernet-0 register success!
[   13.726579] sunxi-gmac 5030000.ethernet eth0: eth0: Type(7) PHY ID 00441400 at 0 IRQ poll (5030000.ethernet-0:00)
[   15.779271] sunxi-gmac 5030000.ethernet eth0: Link is Up - 100Mbps/Full - flow control off
[   19.579211] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
[   22.351588] can: raw protocol

@mdvorak
Copy link
Author

mdvorak commented Apr 29, 2024

Hm, according to dmesg, module is loaded without error:

[    8.045259] w1_gpio_cl: loading out-of-tree module taints kernel.
[    8.051683] w1_gpio_cl: module verification failed: signature and/or required key missing - tainting kernel

Check again output of lsmod | grep w1 and then sudo ls /sys/bus/w1/devices/. If everything is OK but no devices are found, I would revisit wiring again. Also, try only one (or better, different) sensor. Cheap china clones are not always 100% functional.

@jonathjon
Copy link

sudo ls /sys/bus/w1/devices/

Here is the output I get from what you asked. Going to wire up a single sensor and give that a try. Im wondering if its because the CB1 EMMC has different GPIO numbers than the regular CB1 or BTT Pi

biqu@BTT-CB1:~$ lsmod | grep w1
w1_gpio_cl             16384  0
biqu@BTT-CB1:~$ sudo ls /sys/bus/w1/devices/
w1_bus_master1
biqu@BTT-CB1:~$

@mdvorak
Copy link
Author

mdvorak commented Apr 30, 2024

It does not seem like sw issue, so check the hw.

@jonathjon
Copy link

Just tried another single sensor. Same thing, not getting anything. Took that same sensor and hooked it up to a D1 Mini with ESP Home and I get an address from it and temp readings. Sensor is good. So its a SW issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment