Re: Dallas 1-Wire BeagleBone Black

5,644 views
Skip to first unread message

pe...@icecavern.com

unread,
May 29, 2013, 7:34:00 AM5/29/13
to beagl...@googlegroups.com
Yes I'm also interesting in this.

dmesg | grep w1 doesn't show anything so I'm guessing it's not compiled into the kernel. I'm working on finding out why but this is my first venture into linux so it's slow going learning where everything is.



On Wednesday, May 1, 2013 9:21:39 PM UTC+1, J.J. Boyd wrote:
I am attempting to get the Dallas ds18b20 going on the BeagleBone Black and I can't seem to get this going. I am assuming this is due to the fact the emmc is on the same pin this w1 driver was originally compiled for.  I do not currently have the skills to move this w1 driver to another pin unless someone helps me :) I would enjoy learning how to cross compile the kernel after changing the gpio pin. Thanks in advance for any advice on this matter. 

J.J. Boyd

unread,
Jun 17, 2013, 10:56:31 AM6/17/13
to beagl...@googlegroups.com, cwrse...@gmail.com
Thanks! This worked like a charm! I too found it necessary to use use bone_capemgr.9


On Wednesday, May 29, 2013 8:35:29 AM UTC-4, cwrse...@gmail.com wrote:


On Wednesday, May 1, 2013 9:21:39 PM UTC+1, J.J. Boyd wrote:
I am attempting to get the Dallas ds18b20 going on the BeagleBone Black and I can't seem to get this going. I am assuming this is due to the fact the emmc is on the same pin this w1 driver was originally compiled for.  I do not currently have the skills to move this w1 driver to another pin unless someone helps me :) I would enjoy learning how to cross compile the kernel after changing the gpio pin. Thanks in advance for any advice on this matter.
 
This works with the release version of Angstrom.  You have to reload
the capemanager after every boot, unless you decompile, update and
recompile the arm device tree used on boot - I've forgotten the name.

The data pin is 8_11 - you need the full three wire bus with a 4.7K
pullup to get a reading.  And don't do as I did, and plug the power
line into the P9 5v supply by mistake.

The dts file is:

/*
* Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
/dts-v1/;
/plugin/;

/ {
   compatible = "ti,beaglebone", "ti,beaglebone-black";
   part-number = "BBB-W1";
   version = "00A0";

   fragment@0 {
       target = <&am33xx_pinmux>;
       __overlay__ {
            w1_pins: pinmux_w1_pins {
                pinctrl-single,pins = <
                    0x34 0x37     /* gpmc_ad13.gpio1_13, OMAP_PIN_INPUT_PULLUP | OMAP_MUX_MODE7 - w1-gpio */
                >;
            };
       };
   };

   fragment@1 {
       target = <&ocp>;
       __overlay__ {
           onewire@0 {
               compatible      = "w1-gpio";
               pinctrl-names   = "default";
               pinctrl-0       = <&w1_pins>;
               status          = "okay";

               gpios = <&gpio2 13 0>;
           };
       };
   };
};


The build script is:

#!/bin/bash
# Build the one-wire dtb file.
dtc -O dtb -o w1-00A0.dtbo -b 0 -@ w1.dts
# Copy dtbo file into /lib/firmware

The install script is:

#!/bin/bash
# Initialise one wire (may use bone_capemgr.9)
echo w1 >/sys/devices/bone_capemgr.8/slots

Will

steve...@gmail.com

unread,
Jul 18, 2013, 1:30:17 PM7/18/13
to beagl...@googlegroups.com
I'm glad to have found this post as I literally just broke out my breadboard and noticed the DS1820 on it.  Having just received by BeagleBone Black last week, I was thinking about connecting it to a gpio...  So I'm glad that I searched here first and hopefully headed off some difficulties.

I was thinking that I'd be writing a driver for the 1-wire ... but it's nice to know one already exists.

John Laurence Poole

unread,
Aug 11, 2013, 6:55:31 AM8/11/13
to beagl...@googlegroups.com
If you are considering something beyond just a breadboard, like putting temperature monitors all over your house, you will have consider a host a consideration that are introduced when you have long lines and more than one sensor on the wire. A must read: http://www.1wire.org/Files/Articles/1-Wire-Design%20Guide%20v1.0.pdf 

In theory 1-wire lets you have several sensors on a bus line, but after you read or skim the Wire Design Guide you'll see there are several restrictions on possible network topologies.  The complexity about 1-wire design for anything beyond 10 feet quickly makes it a very expensive deployment -- probably have to have intermediary multiplexers, a single line for each sensor, and patch connectors at the multiplexer station.

It almost makes wireless nodes such as Zigbee back in the running simply based on expense.  I wish I had studied carefully the network topology gotchas before even thinking about 1-wire of dreaming of a project that would monitors many stations to create a thermal mapping.

lorena...@gmail.com

unread,
Dec 3, 2013, 8:13:31 PM12/3/13
to beagl...@googlegroups.com
Thinking of replacing the dedicated microcontroller that runs my house with a BBB. Being able to read the existing 1-Wire network will be critical. Currently have 12 18B20 sensors on one bus, need more. Can the kernel module described here actually address and read multiple sensors on the same bus? Can it search and retrieve addresses from unknown sensors? 

I see people selling 8-port capes, as if maybe this is a simple one device per bus routine...  Wouldn't help me! 

As for the "considerations" of long buses, yes there was a learning curve. I have both active pull-up and active pull-down, with careful source-end termination. All cable is CAT-5, and all sensors are within 1m of a single linear topology installation. In several cases the bus goes out one pair of the CAT-5 to a distant sensor and comes back on another pair of the same cable to continue to the next destination. Branching.in a star fashion is death to 1-Wire. My current system works, reliably controlling serious solar hot water and outdoor wood boiler operation that could blow off expensive antifreeze fluid (a huge hassle to recharge) if anything overheated. 

Great long-bus reference:

Doug Edey

unread,
Dec 4, 2013, 8:51:26 AM12/4/13
to beagl...@googlegroups.com, lorena...@gmail.com
I've got 3 DS18B20 sensors on my bus at the moment, providing you've got the sensors running in non-parasitic mode, I think you'll be fine.

godsf...@gmail.com

unread,
Jan 19, 2014, 8:42:49 PM1/19/14
to beagl...@googlegroups.com, lorena...@gmail.com
Can you post a photo of how you have them wired please?

Mark A. Yoder

unread,
Oct 26, 2016, 10:23:07 AM10/26/16
to BeagleBoard, lorena...@gmail.com, godsf...@gmail.com
I've just posted[1] updated instructions on how to use Dallas 1-wire devices on the Bone.  I'm running:
bone$ uname -a
Linux yoder-debian-bone 4.4.21-ti-r47 #1 SMP Fri Sep 23 22:23:02 UTC 2016 armv7l GNU/Linux
bone$ cat /ID.txt 
BeagleBoard.org Debian Image 2016-08-28

The instructions show how to deconfigure  P9_12 so the 1-wire driver can run on it.

--Mark

William Hermans

unread,
Oct 26, 2016, 6:20:41 PM10/26/16
to beagl...@googlegroups.com
Shouldn't

The t=24437 is the temperature in C times 1000. Warm up the probe and see what happens to the temp.

Be:
The t=24437 is the temperature in C times .001. Warm up the probe and see what happens to the temp.

?

I do like your courses though. Really easy for someone like me , who has yet had experience with one-wire devices.

--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to the Google Groups "BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/6a937fdb-7316-48b0-8b84-543757958c8c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Dennis Lee Bieber

unread,
Oct 27, 2016, 8:16:56 AM10/27/16
to beagl...@googlegroups.com
{Crawling out of the shadows}

On Wed, 26 Oct 2016 15:20:32 -0700, William Hermans
<yyr...@gmail.com> declaimed the following:
>The *t=24437* is the temperature in C times 1000. Warm up the probe and see
>> what happens to the temp.
>>
>> Be:
>
>The *t=24437* is the temperature in C times .001. Warm up the probe and see
>> what happens to the temp.
>>
>

My interpretation would say the original is correct ... For a "real"
temperature of 24.437degC, the device returns 24437... or "C times 1000".
--
Wulfraed Dennis Lee Bieber AF6VN
wlf...@ix.netcom.com HTTP://wlfraed.home.netcom.com/

Jason Kridner

unread,
Oct 27, 2016, 10:38:58 AM10/27/16
to beagl...@googlegroups.com


On Oct 26, 2016, at 3:20 PM, William Hermans <yyr...@gmail.com> wrote:

Shouldn't

The t=24437 is the temperature in C times 1000. Warm up the probe and see what happens to the temp.


I believe this is stated properly, but could be confusing. 

Be:
The t=24437 is the temperature in C times .001. Warm up the probe and see what happens to the temp.

?

Perhaps you mean:
Given t=24437, you can determine the temperature in C by multiplying t by .001. Warm up the probe and see what happens to the temp.

You could also say by dividing by 1000. Mark's language was right because he was describing how t is derived from the temperature and not the other way around. 

To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/CALHSORoZHnv1PArG9zyCfV36esCb8T_%2BtJ-1zy7amx8TMOQocA%40mail.gmail.com.

Mark A. Yoder

unread,
Oct 27, 2016, 10:44:01 AM10/27/16
to BeagleBoard
So it was a bit unclear, I only teach for a living :->.  I've fixed it a bit.

This must be an interesting topic.  Over 5000 views in this group and 100 views of the eLinux page.

--Mark
To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/6a937fdb-7316-48b0-8b84-543757958c8c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

William Hermans

unread,
Oct 27, 2016, 2:59:58 PM10/27/16
to beagl...@googlegroups.com
Yeah, I guess I read that wrong. Isn't fixed point fun ?!

To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/e6fb6f5d-8ce2-470e-923e-c1a63109774a%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages