User avatar
g7ruh
Posts: 67
Joined: Mon Apr 23, 2012 9:49 am
Location: Blackfield UK

Re: kernel patch for Dallas 1-wire interface

Tue Mar 12, 2013 7:21 pm

have you blogged how you went about modifying the kernel to get over the 10 sensor kernel limit, or any notes on what to do?
Hi Parkview

No, this was just tested using OWFS to see if OWFS could see all the sensors on a breadboard at the end of a long bit of cat 5 E, it could until I doubled the length. So wiring was point to point, with my issues with the "live system" I have some "star wiring" because of wiring logistics (holes in wall), and accept the potential issues that may give (good way to learn about problems too).

In the 'live system' I am using BASH scripts to read the OWFS server. This is part of my rehabilitation into the world of 'real code cutting' something I have not done for about 30 years so I am a bit rusty. Next learning process is to convert it all to Python, to learn a new language, then dabble in Pi assembler, assembler (not IBM) being where I cut my teeth, programming-wise.

The development system has Chronodot (used in place of the fake clock) , MCP23017 I/O expander, I2C temp, barometric pressure, humidity, 1-wire bridge and a serial (not I2C) ADC as well as a couple of DS18B20s. I am also constructing a focus stack stepper motor driver for my other hobby (macro photography): I have the parts and a plan, so far. Lots of metalwork for that first! That bit I will blog about when it is nearer the testing and using phase: the pi is ideal for this task.

mkj
Posts: 7
Joined: Sat Dec 08, 2012 4:22 am
Location: Perth, Australia
Contact: Website

Re: kernel patch for Dallas 1-wire interface

Thu Mar 14, 2013 11:18 am

rudiratlos wrote: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.
It's in the rpi-update firmware as of 8 March 2013.

Parkview
Posts: 56
Joined: Sun Feb 17, 2013 1:51 pm

Re: kernel patch for Dallas 1-wire interface

Wed Apr 17, 2013 12:38 pm

g7ruh wrote:
have you blogged how you went about modifying the kernel to get over the 10 sensor kernel limit, or any notes on what to do?
I am also constructing a focus stack stepper motor driver for my other hobby (macro photography): I have the parts and a plan, so far. Lots of metalwork for that first! That bit I will blog about when it is nearer the testing and using phase: the pi is ideal for this task.
LOL - been there and half done that. My notes on the project can be found here: http://www.bdug.org.au/project/macrorig/about

All the best with your projects!

- Parkview

pmk
Posts: 21
Joined: Wed Jun 20, 2012 5:27 pm

Re: kernel patch for Dallas 1-wire interface

Fri May 10, 2013 8:27 pm

Is there a way of getting around the 10 device limit ??

rmp
Posts: 2
Joined: Tue May 28, 2013 5:01 pm
Location: France

Re: kernel patch for Dallas 1-wire interface

Thu May 30, 2013 7:06 pm

pmk wrote:Is there a way of getting around the 10 device limit ??
I would try using a couple of DS2482-xxx (I2C 1-wire masters).
That way you can have multiple 1-wire buses. The 10 devices limitation is per master (and bus à fortiori).

Take a look at this project for example : http://raspberrypi.homelabs.org.uk/i2c- ... e-masters/

repton
Posts: 91
Joined: Sat Mar 17, 2012 6:06 pm
Location: North Yorkshire, UK.
Contact: Website

Re: kernel patch for Dallas 1-wire interface

Mon Jun 03, 2013 7:31 pm

rmp wrote:Take a look at this project for example : http://raspberrypi.homelabs.org.uk/i2c- ... e-masters/
We are selling DS2482-x00 based masters for the RasPi.

See http://www.sheepwalkelectronics.co.uk/RPI2.shtml and http://www.sheepwalkelectronics.co.uk/RPI3.shtml for more information.

Paul
UK Supplier of 1-Wire components, kits and modules:
http://www.sheepwalkelectronics.co.uk/

User avatar
yv1hx
Posts: 370
Joined: Sat Jul 21, 2012 10:09 pm
Location: Zulia, Venezuela
Contact: Website

Re: kernel patch for Dallas 1-wire interface

Sat Jun 15, 2013 9:03 am

Hello to all,

After reading carefully the 8+ pages on this subject, I'm still unable to detect or even read my DS18B20 temp sensor.

Following the post, I upgraded my system, then the command uname -a reports:

Code: Select all

[[email protected]~/>uname -a
Linux RaspberryPiGraph 3.1.9+ #3 PREEMPT Tue Aug 14 14:23:01 CEST 2012 armv6l GNU/Linux
[[email protected]~/>
I'm pretty sure about the wiring, (using a 4.7KOhm resistor between Data and Vcc lines), also I have about 30 ~ 40 cms of wire between the sensor and the RPi header, so a long run is discarded.

Also I'm just nothing that I lost the ability to register the SoC temperature, (I have a long time crontab logging the SoC temperature in a text file):

Code: Select all

[[email protected]~/>/opt/vc/bin/vcgencmd measure_temp
VCHI initialization failed
[[email protected]~/>
Any ideas??? :shock:
Marco-Luis
Telecom Specialist (Now Available for Hire!)

http://www.meteoven.org
http://yv1hx.ddns.net
http://twitter.com/yv1hx

Parkview
Posts: 56
Joined: Sun Feb 17, 2013 1:51 pm

Re: kernel patch for Dallas 1-wire interface

Sat Jun 15, 2013 2:50 pm

Hi yv1hx,

I presume your using the wheezy OS, and that your using pin 4 for the DS-18B20 data line.
If you have the spare parts, you could try it out on a breadboard.
Do you have a spare Raspberry Pi (is current RPi pin 4 faulty? You could test this by trying to light an LED, or inputting a 3.3V then GND on pin 4 to see if you can read these correctly)
Do you have the DS-18B20 wired up correctly?
Are the one-wire modules loaded?
It has to be either a hardware or a software issue. Try and isolate it down to one of these, the refine the troubleshooting.

Can't help you with the SoC temperature.

All the best,
Parkview.

User avatar
yv1hx
Posts: 370
Joined: Sat Jul 21, 2012 10:09 pm
Location: Zulia, Venezuela
Contact: Website

Re: kernel patch for Dallas 1-wire interface

Sat Jun 15, 2013 6:30 pm

Parkview wrote:Hi yv1hx,

I presume your using the wheezy OS, and that your using pin 4 for the DS-18B20 data line.
I'm using the wheezy OS dated from February 2013, just upgraded this morning.
Parkview wrote:If you have the spare parts, you could try it out on a breadboard.
The sensor is in good condition, came from a PicAXE project that donated one of his temp sensors. As I stated before the sensor is connected directly to the GPIO header by means of a DIL connector..
Parkview wrote:Do you have a spare Raspberry Pi (is current RPi pin 4 faulty? You could test this by trying to light an LED, or inputting a 3.3V then GND on pin 4 to see if you can read these correctly)
Yes, I have a spare RPi, I could do some testings.
Until today I never used the GPIO on any of my boards, (both were purchased brand new and worked straight out the box), so the matter is very confusing for me :?
Parkview wrote:Do you have the DS-18B20 wired up correctly?
Pretty sure :D
Parkview wrote:Are the one-wire modules loaded?
The output of lsmod command shows:

Code: Select all

Last login: Sat Jun 15 03:55:06 2013 from laptop-len-papa.local

Welcome back root
You are connected from 192.168.0.100 50229 22
[[email protected]~/>lsmod
Module                  Size  Used by
fuse                   72632  1 
w1_gpio                 1563  0 
wire                   26105  1 w1_gpio
cn                      5133  1 wire
snd_bcm2835            21641  0 
snd_pcm                81522  1 snd_bcm2835
snd_page_alloc          5379  1 snd_pcm
snd_seq                59544  0 
snd_seq_device          6936  1 snd_seq
snd_timer              21598  2 snd_seq,snd_pcm
snd                    57555  5 snd_timer,snd_seq_device,snd_seq,snd_pcm,snd_bcm2835
[[email protected]~/>
My /etc/modules file:

Code: Select all

# /etc/modules: kernel modules to load at boot time.
#
# This file contains the names of kernel modules that should be loaded
# at boot time, one per line. Lines beginning with "#" are ignored.
# Parameters can be specified after the module name.

snd-bcm2835
# 1-Wire support
# w1-gpio
# w1-therm
w1-gpio

Parkview wrote:It has to be either a hardware or a software issue. Try and isolate it down to one of these, the refine the troubleshooting.
Parkview wrote:Can't help you with the SoC temperature.

All the best,
Parkview.
No problem, I will open a separate thread for this subject. Thanks a lot :)

I'm suspecting that my OS just getting corrupted in some way, (for a almost all life Windows user like me, is not a big deal, :lol: ), I have a RPi and some spare cards, I will do some testings before wiping out my "production" card.
Marco-Luis
Telecom Specialist (Now Available for Hire!)

http://www.meteoven.org
http://yv1hx.ddns.net
http://twitter.com/yv1hx

umberto
Posts: 1
Joined: Sun Jun 16, 2013 6:55 pm

Re: kernel patch for Dallas 1-wire interface

Sun Jun 16, 2013 6:56 pm

Works like a charm!!!
I don't believe it.

Good job!

Regards
Umbi

User avatar
yv1hx
Posts: 370
Joined: Sat Jul 21, 2012 10:09 pm
Location: Zulia, Venezuela
Contact: Website

Re: kernel patch for Dallas 1-wire interface

Fri Jun 21, 2013 8:06 pm

umberto wrote:Works like a charm!!!
I don't believe it.

Good job!

Regards
Umbi
Well, For a experienced electronics professional like me, declare the following is like having a nightmare: :oops:

After checking & oscilloscoping the GPIO for input & output, following the well written tutorial http://www.cl.cam.ac.uk/projects/raspbe ... mperature/, and watching the GPIO4 for a while, I noted the nonexistence of any signals, only a flat line at 3,3Vdc, so assuming a broken sensor or wiring between the RPi and the sensor itself, I noticed that for an obscure reason, I managed to mix my temp sensors component box and take a LM335Z instead of the DS18B20, incredibly, after checking the wiring zillion of times, never noted the mix up.... so praying not to have damaged my RPi, corrected the mistake, so rebooted my RPi and voilá I get the temp sensor working as expected....

Moral: Always double check your component marking before connecting in a live circuit...

Thanks to all for help.
Marco-Luis
Telecom Specialist (Now Available for Hire!)

http://www.meteoven.org
http://yv1hx.ddns.net
http://twitter.com/yv1hx

Toriniasty
Posts: 3
Joined: Wed May 29, 2013 8:48 am

Re: kernel patch for Dallas 1-wire interface

Tue Jul 30, 2013 9:57 pm

Hi guys,
I need some help. I bought from Farnell:
MOR0S2J0472A50 RESISTOR, 0.5W 5% 4K7
DS18B20+PAR SENSOR, TEMPERATURE, NV ALARM, 3TO92

And have some problems with that. I have same problem as netomx on second page. Generally output gives me: t=85000

Code: Select all

[email protected]:/sys/devices/w1_bus_master1/28-000004b804c7# 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
[code]

Did I do something wrong? 
4.7k ohm resistor between legs 2 & 3
1 - connected to gnd
2 - #4 gpio
3 - 3.3v 

This is my breadboard setup:
[img]http://i.imgur.com/kGOR2RY.jpg[/img]

Any suggestions what might be wrong? I've tried two different ds18b20's and have the same result which is pretty annoying.
Also I must admit I've didn't actually search for that yet. How hard would be to connect second ds18b20 to rpi, is this the same setup but different gpio?

Anyway, problem sorted out. modprobe w1_gpio pullup=1 gave me reasonable output.

techfreak
Posts: 2
Joined: Sat Aug 31, 2013 8:20 pm

Re: kernel patch for Dallas 1-wire interface

Sat Aug 31, 2013 8:28 pm

Hi

I develop small temperature project http://techfreak.pl/nettemp. I can not run the sensors (DS18B20) on two lines on the raspberry pi. Someone did it?

I connect sensor like this schemat http://www.strangeparty.com/2010/12/13/ ... e-sensors/ and use 5V from rpi.

Only what i got is:
cat /sys/bus/w1/devices/28-000001faf73d/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

85 is not good temp ;)

Toriniasty
Posts: 3
Joined: Wed May 29, 2013 8:48 am

Re: kernel patch for Dallas 1-wire interface

Sat Aug 31, 2013 11:06 pm

techfreak wrote:Hi

I develop small temperature project http://techfreak.pl/nettemp. I can not run the sensors (DS18B20) on two lines on the raspberry pi. Someone did it?

I connect sensor like this schemat http://www.strangeparty.com/2010/12/13/ ... e-sensors/ and use 5V from rpi.

Only what i got is:
cat /sys/bus/w1/devices/28-000001faf73d/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

85 is not good temp ;)
Have you read my previous post?
"Anyway, problem sorted out. modprobe w1_gpio pullup=1 gave me reasonable output."
Try that, it helped me.

techfreak
Posts: 2
Joined: Sat Aug 31, 2013 8:20 pm

Re: kernel patch for Dallas 1-wire interface

Sun Sep 01, 2013 4:55 am

Indeed, you're right, it works. thank you. :oops:

rudiratlos
Posts: 109
Joined: Tue May 01, 2012 8:47 am

Re: kernel patch for Dallas 1-wire interface

Mon Sep 02, 2013 1:00 pm

I want to use OWFS with the bitbang interface over GPIO4, without using a busmaster chip.
Is that possible now?

Can i communicate with an DS2423 (DualCounter) through the Bitbanging?

Thanks,

freii
Posts: 1
Joined: Fri Sep 13, 2013 9:56 am

Re: kernel patch for Dallas 1-wire interface

Fri Sep 13, 2013 9:59 am

pmk wrote:Is there a way of getting around the 10 device limit ??
If you or anyone else are still wondering how to attach more than 10 devices, just load the module with the following argument:

Code: Select all

modprobe wire max_slave_count=15
or in /etc/modules with simply

Code: Select all

wire max_slave_count=15

Parkview
Posts: 56
Joined: Sun Feb 17, 2013 1:51 pm

Re: kernel patch for Dallas 1-wire interface

Sat Sep 14, 2013 2:59 pm

Thanks for the info there pmk. That's nice and easy to use!

devnull
Posts: 65
Joined: Sat Dec 24, 2011 7:46 am

Re: kernel patch for Dallas 1-wire interface

Thu Sep 26, 2013 11:51 am

Is it possible force an immediate check of connected devices and ignore devices that may have been disconnected in the last few minutes ?

Or is it possible to remove all devices ?

If I disconnect a sensor, then it still shows up for some time afterwards, and I am trying to implement a function that allows me to plug in a sensor one at a time and discover the device's ID, problem is it will also show other deices which have recently been connected and not what is connected right now !
> /dev/null 2>&1

sipp
Posts: 11
Joined: Thu Oct 10, 2013 6:49 pm

Re: kernel patch for Dallas 1-wire interface

Wed Oct 23, 2013 5:14 am

If I want to use both the 1-wire on GPIO 4 and other GPIO pins with wiringPi, will I run into any conflicts? Or do I just need to leave GPIO 4 as an input in order to use the 1-wire interface?

Gadgetman
Posts: 2
Joined: Mon Oct 28, 2013 8:12 pm
Location: Johannesburg, SA

Re: kernel patch for Dallas 1-wire interface

Tue Oct 29, 2013 5:57 am

rudiratlos wrote:I want to use OWFS with the bitbang interface over GPIO4, without using a busmaster chip.
Is that possible now?

Can i communicate with an DS2423 (DualCounter) through the Bitbanging?

Thanks,
I also want to do this.
From my understanding, one can use w1-gpio and OWFS...
[email protected]:/home/pi# owfs --w1

But cant find more details other than that.

riban
Posts: 1
Joined: Thu Jan 02, 2014 11:47 pm

Re: kernel patch for Dallas 1-wire interface

Thu Jan 02, 2014 11:54 pm

devnull wrote:Is it possible force an immediate check of connected devices and ignore devices that may have been disconnected in the last few minutes ?

Or is it possible to remove all devices ?

If I disconnect a sensor, then it still shows up for some time afterwards, and I am trying to implement a function that allows me to plug in a sensor one at a time and discover the device's ID, problem is it will also show other deices which have recently been connected and not what is connected right now !
If you load module "wire" with option slave_ttl=1, sensor removal is much faster. I don't know what units this is but empirically I see devices disappearing after about 5 seconds.

Also, you can:

Code: Select all

echo "device_id" >  /sys/bus/w1/devices/w1_bus_master1/w1_master_remove
This will remove a device. You need write permission on the device for this to work. The device_id is the string listed in /sys/bus/w1/device/w1_bus_master1/w1_master_slaves.

wikily
Posts: 4
Joined: Wed Feb 06, 2013 12:08 am

Re: kernel patch for Dallas 1-wire interface

Fri Jan 24, 2014 10:58 am

stephelton wrote: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.
Any luck with this.... also, how do I go about changing the resolution. I'm thinking this will involve some C level programming ?

Regards,

User avatar
pac2001man
Posts: 1
Joined: Mon May 12, 2014 6:10 pm

Re: kernel patch for Dallas 1-wire interface

Sun May 18, 2014 1:55 pm

I thought I'd add a foot-note to this topic which may help others (especially newbies) as I had the same error messages as the original poster which, in the end, had nothing to do with software.

I was having a great deal of trouble getting my DS18B20 to work with the RPi and I couldn't find any documentation anywhere specifically about the mini-board I was trying to use....all the articles I'd seen discussed a bare component.

Then after close scrutiny of the board, I could see that the circuit was printed as if a resistor was there :idea: ... the resistor is actually on the board itself... :roll:

I removed the resistor from my circuit and the thermometer was recognised.

Also, if anyone else uses this board and it isn't obvious what the terminals are, then it appears that the letters SVG are S=Signal (e.g. connect to GPIO7 to receive data input), V=3.5V and G=Ground.....and no need for a resistor!

jim_mcnally
Posts: 1
Joined: Tue Sep 09, 2014 4:29 pm

Re: kernel patch for Dallas 1-wire interface

Tue Sep 09, 2014 5:15 pm

I just bought a Dallas Semiconductor '2 Channel Digital I/O 1-Wire Card' #D2PC. I'm still looking for a modprobe module for it. Does it exist?

Return to “Interfacing (DSI, CSI, I2C, etc.)”

Who is online

Users browsing this forum: No registered users and 10 guests