Port-arm archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Using 1-wire on ODROID C2



Vincent DEFERT <vincent.defert%posteo.net@localhost> writes:

> Hi!
>
> I have successfully configured my GPIO and attached gpioow, and drvctl 
> -t -l now shows:
>
>        simplebus5
>          mesonpinctrl0
>            gpio0
>              gpioow0
>                onewire0
>
> There's no /dev/onewire0, and I have no clue as to how is my application 
> is supposed to communicate with the DS18B20 connected to this GPIO line.
> I have seen owtemp.c, but it's intended for use with envsys and I can't 
> find any owtemp.kmod either.
> Google comes up at best with owtemp's man page, or irrelevant Linux stuff.
>
> Any hint, or pointer to relevant documentation?
>
> Vincent


Some of the onewire and related infrastructure hasn't been modularized
yet, hence the lack of kmods.  I do this on RPIs:

# 1-Wire support
gpioow*        at gpio0 offset 25 mask 0x1
onewire*       at gpioow?

# 1-Wire devices
owtemp*        at onewire?

The offset is the GPIO pin.

You will then see a device with the envstat command called owtemp0 (or
whatever, if you have more then one).  The DS18B20 and friends is a very
slow device, and it will take almost a second for envstat to return
anything.  I have a bunch of scripts that parse envstat output and feed
it to a Elasticsearch instance as there is no other interface to the
device, so that part really isn't hard ... just string parsing...  or
you could use the XML output envstat can provide.

If you need something that responses faster than the DS18B20 then you
will want to use one of the I2C temperature sensors.  There are a number
of drivers for several of them (and more will come in the next year or
so) in -current.




-- 
Brad Spencer - brad%anduin.eldar.org@localhost - KC8VKS - http://anduin.eldar.org


Home | Main Index | Thread Index | Old Index