Categories: BeagleBone Black : Software : GPIO :

Dallas 1-Wire BeagleBone Black

Showing 1-10 of 10 messages
Dallas 1-Wire BeagleBone Black J.J. Boyd 5/1/13 1:21 PM
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. 
Re: Dallas 1-Wire BeagleBone Black pe...@icecavern.com 5/29/13 4:34 AM
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.
Re: Dallas 1-Wire BeagleBone Black cwrse...@gmail.com 5/29/13 5:35 AM


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

Re: Dallas 1-Wire BeagleBone Black Scott Baker 6/2/13 3:38 PM
I was able to read a ds18b20 on my BeagleBoneBlack with these instructions. I had to change:

echo w1 >/sys/devices/bone_capemgr.8/slots

to

echo w1 >/sys/devices/bone_capemgr.9/slots

as the first one didn't exist? Looks like the w1 module is hardcoded to use GPIO_45? Is there a way to change this? Is it possible to have multiple pins be w1 sources? I'd like to have separate buses for a couple sensor networks.
Re: Dallas 1-Wire BeagleBone Black J.J. Boyd 6/17/13 7:56 AM
Thanks! This worked like a charm! I too found it necessary to use use bone_capemgr.9
Re: Dallas 1-Wire BeagleBone Black Stephen Johnson 7/18/13 10:30 AM
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.
Re: Dallas 1-Wire BeagleBone Black John Laurence Poole 8/11/13 3:55 AM
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.


On Wednesday, May 1, 2013 1:21:39 PM UTC-7, 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. 
Re: Dallas 1-Wire BeagleBone Black Loren Amelang 12/3/13 5:13 PM
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:
Re: Dallas 1-Wire BeagleBone Black Doug Edey 12/4/13 5:51 AM
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.
Re: Dallas 1-Wire BeagleBone Black godsf...@gmail.com 1/19/14 5:42 PM
Can you post a photo of how you have them wired please?