One Wire Temp Sensor

So just declare additional owc buses? I will have to try that.

hint.owc.0.at=gpiobus0
hint.owc.0.pin_list="62"
hint.owc.1.at=gpiobus0
hint.owc.1.pin_list="63"
 
I have been using this method on Arm boards too.
uname
Code:
FreeBSD Hummingboard 12.4-RC2 FreeBSD 12.4-RC2 r372725 GENERIC  arm

The hints method is much easier than compiling an overlay for each pin.
devinfo
Code:
[SNIP]
     simplebus1
        simplebus2
          uart0
        gpio0
          gpiobus0
          gpioc0
        gpio1
          gpiobus1
          gpioc1
        gpio2
          gpiobus2
            owc0
              ow0
                ow_temp0
            owc1
              ow1
                ow_temp1
                ow_temp2
                ow_temp3
          gpioc2
        gpio3

/boot/loader.conf
Code:
ow_load="YES"
owc_load="YES"
ow_temp_load="YES"
hint.owc.0.at=gpiobus2
hint.owc.0.pin_list=9
hint.owc.1.at=gpiobus2
hint.owc.1.pin_list=7
 
Like I mentioned I want to use 2 distinct gpio pins and busses.
One of the reasons is the outside group is on a long wire and that line seems to need less than a 4K7 resistor.

I saw some interesting reading where people put a capacitor at the end of their onewire bus wire on long runs.
It acts as a terminator for the string.
These ds1820 sensors are very versatile. In combination with the dht22 sensors I can really have some deluxe temperature and humidity monitoring.

The drawback of the dht11/22 is each one requires a gpio pin whereas onewire allows daisy-chaining.
The positives are the addition of humidity readings.

 
My hardware is RPI-4B.
ow, owc and ow_temp were added to the kernel, and the kernel was recompiled and loaded.

uname -a

FreeBSD generic 14.0-CURRENT FreeBSD 14.0-CURRENT #0: Sat Dec 3 20:32:12 UTC 2022 root@generic:/usr/obj/usr/src/arm64.aarch64/sys/MYKERNEL arm64


devinfo

nexus0
ofwbus0
psci0
simplebus0
bcm2835_clkman0
mbox0
gpio0
gpiobus0
gpioc0
uart0
spi0
spibus0
iichb0
iicbus0
iic0
gic0
simple_mfd0
bcm_dma0
bcmwd0
bcmrng0
bcm2835_firmware0
ofw_clkbus1
gpio1
gpiobus1
gpioc1
sdhci_bcm0
mmc0
fb0
fbd0
ofw_clkbus0
clk_fixed0
clk_fixed1
usb_nop_xceiv0
clk_fixed2
clk_fixed3
simplebus1
sdhci_bcm1
mmc1
mmcsd0
pmu0
generic_timer0
cpulist0
cpu0
bcm2835_cpufreq0
cpufreq0
cpu1
cpu2
cpu3
simplebus2
pcib0
pci0
pcib1
pci1
bcm_xhci0
usbus0
uhub0
uhub1
genet0
miibus0
brgphy0
gpioled0
gpioregulator0
regfix0
regfix1
regfix2
simplebus3
cryptosoft0

dmesg | grep "ow_temp"

module_register: cannot register ow/ow_temp from kernel; already loaded from ow_temp.ko
Module ow/ow_temp failed to register: 17

What should I do?
 
There is no need to add the onewire modules to the kernel. They are already built in.
Just load them on bootup in /boot/loader.conf
ow_load="YES"
owc_load="YES"
ow_temp_load="YES"
 
In my opinion the handbook is a little wonky in this regard.
It acts like you must rebuild kernel and include the modules.
Then gives directions on loading the module in /boot/loader.conf
.
The module is available as a loadable driver versus compiling the onewire driver into the kernel.
 
Back
Top