Page 7 of 10

Re: kernel patch for Dallas 1-wire interface

Posted: Tue Dec 18, 2012 3:01 pm
by szigeti
szigeti wrote: Which ASCII character is good for the "00000000" or "11111111" pin output?

Gabor
I found the answer:
echo -e '\x00' |dd of=output bs=1 count=1
and
echo -e '\xff' |dd of=output bs=1 count=1

So in this case you can set your hexadecimal value as output value.

Re: kernel patch for Dallas 1-wire interface

Posted: Thu Dec 27, 2012 2:09 pm
by rudiratlos
# uname -a
Linux raspberrypi 3.1.9+ #3 PREEMPT Tue Aug 14 14:23:01 CEST 2012 armv6l GNU/Linux

# modprobe w1_gpio pullup=1
ERROR: could not insert 'w1_gpio': Unknown symbol in module, or unknown parameter (see dmesg)

what's wrong ??

Re: kernel patch for Dallas 1-wire interface

Posted: Thu Dec 27, 2012 2:34 pm
by thsBavR10
You are using a rather outdated version of rasbian (maybe supplied from RS on SDcard ?).
Try an actual image e.g. this:
http://downloads.raspberrypi.org/images ... spbian.zip

Re: kernel patch for Dallas 1-wire interface

Posted: Thu Dec 27, 2012 4:26 pm
by rudiratlos
now upgraded to:
[email protected] ~ # uname -a
Linux raspberrypi 3.2.27+ #307 PREEMPT Mon Nov 26 23:22:29 GMT 2012 armv6l GNU/Linux

[email protected] ~ # modprobe w1_gpio pullup=1
ERROR: could not insert 'w1_gpio': Unknown symbol in module, or unknown parameter (see dmesg)

still have the error.

Re: kernel patch for Dallas 1-wire interface

Posted: Thu Dec 27, 2012 4:41 pm
by thsBavR10
please try

Code: Select all

sudo modprobe w1-gpio && lsmod
Now w1_gpio should be in the list of loaded modules.
See also http://www.frank-buss.de/raspberrypi/index.html

Re: kernel patch for Dallas 1-wire interface

Posted: Thu Dec 27, 2012 4:51 pm
by rudiratlos
I can modprobe w1-gpio
Also my 1-Wire bus runs ok, since several weeks.
But I need the internal pull-up resistor, because I want to get rid of my external resistor

Re: kernel patch for Dallas 1-wire interface

Posted: Thu Dec 27, 2012 5:08 pm
by thsBavR10
It seems, you need the patched drivers from mkj,
http://www.raspberrypi.org/phpBB3/viewt ... 56#p229425.
If it's not working, you can send him a PM.

Re: kernel patch for Dallas 1-wire interface

Posted: Fri Dec 28, 2012 4:38 am
by stephelton
When I've worked with the w1 interface before (in my Arduino days) I was able to get some extremely high performance out of the 5+ temperature probes I was using compared to the performance I get when I use this kernel module.

First, a command like "cat /sys/bus/w1/devices/28-000001d169fe/w1_slave" takes about 0.8 seconds. I assume this is because the command causes the master to (1) address the probe, (2) tell it to take a sample, and (3) get that sample after the required time has elapsed (750ms IIRC).

When I was using numerous probes, I would do something more like the following:

(1) for each probe, (a) address the probe, (b) tell it to take a temperature sample
(2) wait the required time (depends on the desired precision, I stuck with 750ms)
(3) for each probe, (a) address the probe, (b) ask the temperature

The advantage to this should be pretty clear -- in under a second, I was able to address every single probe and obtain a temperature reading with full precision.

Unless I'm missing something, this kernel module won't support that -- I need to patiently wait for every single temperature probe I have. If I'm not missing anything, any ideas for improving this? I'll be glad to help out with some programming.

Second, the desired precision affects the necessary wait time. At very low precision, a temperature probe could be read extremely quickly (something on the order of 100ms, IIRC). For some applications, this could be very desirable.

Here's a table I copied from http://datasheets.maximintegrated.com/en/ds/DS18B20.pdf

Resolution / Max Conversion Time
9 bits : 93.75 ms
10 bits : 187.5 ms
11 bits : 375 ms
12 bits : 750 ms

With my technique described above and 9 bit precision, you could get a LOT of data from these things.

Re: kernel patch for Dallas 1-wire interface

Posted: Sat Dec 29, 2012 2:10 am
by mkj
thsBavR10 wrote:It seems, you need the patched drivers from mkj,
http://www.raspberrypi.org/phpBB3/viewt ... 56#p229425.
If it's not working, you can send him a PM.
I've put the kernel and modules I'm using at http://matt.ucc.asn.au/rpi/w1-pullup-3. ... t1.tar.bz2

Put the .img in /boot, modules in /lib/modules 3.2.whatever, and set it to boot the new kernel (sorry for brevity, on a phone).

I've now tested with 3 ds18b20s and it works fine. I'll send a pull request to raspbian at some point.

Re: kernel patch for Dallas 1-wire interface

Posted: Sat Jan 05, 2013 1:40 pm
by szigeti
Hi again!
I have two questions:
A)
Anybody has an idea how can I check the read command's output (by DS2408). It was good or not?
It return so many times FF output because the set status was another and I can not read the latest right status from the output register.

B)
How can I use this switch as input? Any hints?

Many thanks,
Gabor

Re: kernel patch for Dallas 1-wire interface

Posted: Sat Jan 12, 2013 6:41 pm
by Fruity Pebbles
I want to say thanks for all the work on the kernel modules, and the info in this thread. I connected some DS18B20s to my Pi this morning and they're working great. Thanks!

Jim

Re: kernel patch for Dallas 1-wire interface

Posted: Mon Jan 14, 2013 11:42 am
by rudiratlos
Hi,
recently upgraded to
Linux raspberrypi 3.6.11+ #352 PREEMPT Wed Jan 9 17:16:53 GMT 2013 armv6l GNU/Linux

but the pullup=1 parameter is still not accepted.

Any plans to pull it to a newer distribution.

Thanks.

Re: kernel patch for Dallas 1-wire interface

Posted: Mon Jan 14, 2013 12:48 pm
by mkj
rudiratlos wrote: but the pullup=1 parameter is still not accepted.

Any plans to pull it to a newer distribution.
There's a pull request waiting for some more testing and feedback.

https://github.com/raspberrypi/linux/pull/186

Re: kernel patch for Dallas 1-wire interface

Posted: Fri Jan 18, 2013 9:24 pm
by luckygray
I chime in after reading your posts.
I have a RPI with two DS18S20 temperature sensors on GPIO 4
with kernel modules wire, w1_gpio and w1_term.
( http://www.gtkdb.de/index_7_2035.html )
This works just fine. I can read the temperatures with a local bash or a
python script.
Now I'd like to access the temperatures from another computer running
the fhem home automation. For this "owserver" should be running.
- Has anybody managed to run owserver with the mentioned configuration?
- How does the /etc/owfs.conf looks like?

Re: kernel patch for Dallas 1-wire interface

Posted: Sat Jan 19, 2013 8:19 am
by fladdy
luckygray wrote:I chime in after reading your posts.
I have a RPI with two DS18S20 temperature sensors on GPIO 4
with kernel modules wire, w1_gpio and w1_term.
( http://www.gtkdb.de/index_7_2035.html )
This works just fine. I can read the temperatures with a local bash or a
python script.
Now I'd like to access the temperatures from another computer running
the fhem home automation. For this "owserver" should be running.
- Has anybody managed to run owserver with the mentioned configuration?
- How does the /etc/owfs.conf looks like?
I'm afraid OWFS doesn't support the bitbanging kernel modules. One way to get your temperatures into fhem home automation would be to install fhem on the RPi, use the GPIO4 module from fhem contrib to get the temperature into RPi's fhem, and finally use fhem2fhem to get the data into your main fhem.

Re: kernel patch for Dallas 1-wire interface

Posted: Sat Jan 19, 2013 10:50 am
by luckygray
That was very helpful for me, thanks.

"man owserver" mentions the "w1 kernel module" by using the "--w1" option, and
"... and the implementation was still in progress as of owfs v2.7p12 and linux 2.6.30."
But "man 5 owfs.conf" does not mention the w1 kernel module as source.
Since my RPi runs owfs version 2.8p15 and "Linux raspberrypi 3.2.27+"
I had some hope that there was some progress...

Anyway, the fhem2fhem solution is good for me.

Re: kernel patch for Dallas 1-wire interface

Posted: Tue Jan 22, 2013 10:43 pm
by fehlfarbe
Hi,
I set up my RasPi and a DS18S20 as described at http://www.cl.cam.ac.uk/freshers/raspbe ... mperature/

But when I want to load the kernel modules I get these errors:

Code: Select all

[email protected] ~ $ sudo modprobe wire
ERROR: could not insert 'wire': Invalid argument
[email protected] ~ $ sudo modprobe w1-gpio
ERROR: could not insert 'w1_gpio': Invalid argument
[email protected] ~ $ sudo modprobe w1-therm
ERROR: could not insert 'w1_therm': Invalid argument
The modules should be installed. When I'm typing

Code: Select all

sudo modprobe w1<TAB>
I get a list where "w1-gpio" and "w1_therm" is included.

Re: kernel patch for Dallas 1-wire interface

Posted: Tue Jan 22, 2013 11:35 pm
by luckygray
This occurs usually when the modules are corrupt or do not match the running kernel.

My hints:
- make sure /usr/src/linux points to the running kernel
- rmmod <module>
- modprobe <module>
- If that still doesn't work, reboot.

Re: kernel patch for Dallas 1-wire interface

Posted: Wed Jan 23, 2013 12:45 am
by fehlfarbe
Reboot doesn't help.
How can I reinstall the kernel with modules? Maybe from the repositorys.

My current kernel is:

Code: Select all

Linux servberry 3.2.27+ #307 PREEMPT Mon Nov 26 23:22:29 GMT 2012 armv6l GNU/Linux

Re: kernel patch for Dallas 1-wire interface

Posted: Fri Jan 25, 2013 2:50 pm
by jpoder
So, I seem to have the same issue someone posted earlier about having the driver return 85 for the temp regardless. I am using a DS18B20 chip and have tried several different ones with the same results. I tried this using some arduino code I wrote and get the correct temperature measurement if I set the wait delay (for temp conversion) >750mS but get 85 if I set it less than that. Is this a known issue? A problem with my particular devices (DS18B20 in general, or maybe just mine)? It looks like the RPi just isn't waiting long enough for the conversion to take place. Thoughts?

Here is the output from my Arduino and from my RPi.

on arduino with 1000 mS wait time

ROM = 28 CE 9A C5 2 0 0 6F
Chip = DS18B20
Data = 1 6A 1 4B 46 7F FF 6 10 5F CRC=5F
Temperature = 22.62 Celsius, 72.72 Fahrenheit

ROM = 28 A5 A5 C5 2 0 0 BF
Chip = DS18B20
Data = 1 69 1 4B 46 7F FF 7 10 5E CRC=5E
Temperature = 22.56 Celsius, 72.61 Fahrenheit
No more addresses.

on Arduino with 500 mS wait time

ROM = 28 CE 9A C5 2 0 0 6F
Chip = DS18B20
Data = 1 50 5 4B 46 7F FF C 10 1C CRC=1C
Temperature = 85.00 Celsius, 185.00 Fahrenheit
ROM = 28 A5 A5 C5 2 0 0 BF
Chip = DS18B20
Data = 1 50 5 4B 46 7F FF C 10 1C CRC=1C
Temperature = 85.00 Celsius, 185.00 Fahrenheit
No more addresses.

On RPi:

[email protected] /sys/bus/w1/devices $ ls
28-000002c59ace 28-000002c5a5a5 w1_bus_master1
[email protected] /sys/bus/w1/devices $ cat 28-000002c59ace/w1_slave
50 05 4b 46 7f ff 0c 10 1c : crc=1c YES
50 05 4b 46 7f ff 0c 10 1c t=85000
[email protected] /sys/bus/w1/devices $ cat 28-000002c5a5a5/w1_slave
50 05 4b 46 7f ff 0c 10 1c : crc=1c YES
50 05 4b 46 7f ff 0c 10 1c t=85000
[email protected] /sys/bus/w1/devices $

Re: kernel patch for Dallas 1-wire interface

Posted: Sat Jan 26, 2013 11:41 pm
by Fruity Pebbles
jpoder wrote:So, I seem to have the same issue someone posted earlier about having the driver return 85 for the temp regardless. I am using a DS18B20 chip and have tried several different ones with the same results. I tried this using some arduino code I wrote and get the correct temperature measurement if I set the wait delay (for temp conversion) >750mS but get 85 if I set it less than that. Is this a known issue? A problem with my particular devices (DS18B20 in general, or maybe just mine)? It looks like the RPi just isn't waiting long enough for the conversion to take place. Thoughts?
I got this same result when I re-wired my sensors to use parasite power, but I don't have the updated driver that supports parasite power. When I changed back to +3.3V on the DS18B20's Vcc pin I got valid temperatures again.

Re: kernel patch for Dallas 1-wire interface

Posted: Thu Jan 31, 2013 12:54 pm
by joshmosh
Fruity Pebbles wrote:
jpoder wrote:So, I seem to have the same issue someone posted earlier about having the driver return 85 for the temp regardless. I am using a DS18B20 chip and have tried several different ones with the same results. I tried this using some arduino code I wrote and get the correct temperature measurement if I set the wait delay (for temp conversion) >750mS but get 85 if I set it less than that. Is this a known issue? A problem with my particular devices (DS18B20 in general, or maybe just mine)? It looks like the RPi just isn't waiting long enough for the conversion to take place. Thoughts?
I got this same result when I re-wired my sensors to use parasite power, but I don't have the updated driver that supports parasite power. When I changed back to +3.3V on the DS18B20's Vcc pin I got valid temperatures again.
Same here. Since I am using existing cabling, I do not have the option to supply power to the Vcc pin. You mention an updated driver supporting parasite power. I guess that driver will have a longer delay ( as mentioned in the quote above yours). Any hint where to get that updated driver ?

Thanks
Joshi

Re: kernel patch for Dallas 1-wire interface

Posted: Mon Feb 04, 2013 4:15 pm
by rudiratlos
is pullup=1 option in new kernel ?

Re: kernel patch for Dallas 1-wire interface

Posted: Tue Feb 05, 2013 11:01 am
by anbodearg
Hello Frank,

Can this patch be used on Raspbmc distro?

Alternatively, is there any utility anywhere which could be used to poll the sensor reading from GPIO4,
on demand?

Thanks.

Re: kernel patch for Dallas 1-wire interface

Posted: Sat Feb 09, 2013 7:38 am
by rena555
eikcam wrote:
netomx wrote:If mine says:
It was tried in place 2K ohm?
I was successful in 1K8 (1.8K ohms).

Code: Select all

[email protected]:/sys/bus/w1/devices/w1_bus_master1/28-0000030a0170# cat w1_slave
50 05 4b 46 7f ff 0c 10 1c : crc=1c YES
50 05 4b 46 7f ff 0c 10 1c t=85000
I'm using the wrong resistor?
85c is the initial value of the sensor on power up. It seems that your sensor isnt doing any calculations. What size resistor are you using? 4.7k?