tech-embed archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: ds18b20 Temperature Sensor
Greg, thank you for your reply and suggestions!
> > Here is what I have tried in my /etc/gpio.conf.
> > #gpio0 4 set inout #does not work
> > #gpio0 4 set in #works
> > #gpio0 4 set out #works
> > #gpio0 4 set inout #does not work
> > #gpio0 4 set gpioow # does not work
> > #gpio0 attach gpioow 4 0x01 #does not work
> >
> You say "does not work" and "works", but I think you mean something like
> "{error, no error} at config time". Please try to be much more specific.
"works" means that upon reboot, I get output from "gpioctl gpio0"
indicating that 1 pin is configured.
"does not work" means that after reboot "gpioctl gpio0" says that 0
pins are configured.
> You did not say which you are trying to do:
>
> use the gpioow support in the kernel
>
> use some program in user space to access the gpio pin and speak the
> onewire protocol. (and if so, you didn't say if you are writing it,
> or using some existing program and which one)
I just want the temperature. The simpler the approach the better. It
seems that it could be easiest to use the gpioow/owtemp/onewire
support in the kernel since that code has already been written and
tested. My thinking was that with either approach, I would first have
to configure the pin. My thought was first to try to get the pin
working for "inout" and then go from there. So far, I have not been
able to configure the pin for bidirectional use. Should I expect to
see the pin configured from the output of "gpioctl gpio0"?
> Read the man pages for gpio(4), gpioctl(8), gpioow(4), onewire(4), and
> owtemp(4). Luckily, you are trying to do something that has been done
> before.
>
> In gpioow(4), there are kernel config lines. It seems obvious that the
> first is for hard-wiring a gpio pin in the kernel, and the second for
> having a gpioow device that is not connected at boot, that you can
> connect with gpioctl commands.
I did find and read those man pages. Per your suggestion, I just
reread them and I am missing something. I run "man 4 gpioow" and I
don't see information about "kernel config". Is the part at the top
("gpioow* at gpio? offset 0 mask 0x1")?
> However, the commands are going to fail if the device is not compiled
> into the kernel.
> A quick egrep of the kenrel configs shows that onewire is not compiled
> into the evbarm GENERIC, used on RPI.
> However there is a modules, so you can proably add owtemp to
> /etc/modules.conf and reboot.
I tried creating "/etc/modules.conf" and adding "owtemp" to it and
then rebooting. I do not see a change. I also found "modstat" and
"modload". Below is the contents of the file.
# /etc/modules.conf
# owtemp # does not show up in output from "modstat"
onewire # this shows up in output of "modstat"
Do you think this means that I need to recompile my kernel with
support for "owtemp"?
Home |
Main Index |
Thread Index |
Old Index