1-Wire

90 views
Skip to first unread message

hoerting...@gmx.at

unread,
Apr 28, 2016, 9:52:40 AM4/28/16
to BeagleBoard
Hello,

I want to use 1-wire DS18B20+ sensors with the BBB.
On my breadcrump is work with 2 sensors.

My question:
with:
cat w1_bus_master1/w1_master_max_slave_count

he show me max 10 sensors ... why?

I need around 25 sensors with a wire length of 50m.

Is this possible?

I use all 3 wires (GND, VCC (5V) and Data)

Thank you!

TJF

unread,
Apr 28, 2016, 11:27:18 AM4/28/16
to BeagleBoard, hoerting...@gmx.at
Hi!


Am Donnerstag, 28. April 2016 15:52:40 UTC+2 schrieb hoerting...@gmx.at:
Hello,

I want to use 1-wire DS18B20+ sensors with the BBB.
On my breadcrump is work with 2 sensors.

My question:
with:
cat w1_bus_master1/w1_master_max_slave_count
he show me max 10 sensors ... why?

AFAIR this is a default value in the kernel driver. You can echo a larger number in order to override it.
 
I need around 25 sensors with a wire length of 50m.

Is this possible?

I use all 3 wires (GND, VCC (5V) and Data)

When you sample 25 sensors by the kernel driver, each conversation takes about 750 ms, in total ~19 seconds. So your process must not have high temperatur gradients. You can speed up conversations by broadcast triggering (~1 second in total). This isn't supported by the kernel driver.

What do you mean by cable length? The weight or the radius?
  • The radius of a network is the wire distance from the master end to the most distant slave.
  • The weight of a network is the total amount of connected wire in the network.
In a thermal solar system I use eight sensors with a bus radius of 15 m and a weight of 45 m (BBB GPIO, no additional hardware, simple cable and RJ12 connectors).

BR

hoerting...@gmx.at

unread,
Apr 28, 2016, 1:40:19 PM4/28/16
to BeagleBoard, hoerting...@gmx.at
Hello!

1. Max sensors
When I try:
echo 20 > w1_master_max_slave_count

I get:
bash: w1_master_max_slave_count: Permission denied
(of course I´m root)

2. Polling time
Well, 19sec in total is OK! It are just room temperatur and this must not update so fast. But can I add more as 10 sensors because of Point 3?

3. max cable length
I mean the total cable length of the 1-Wire bus ... when I connect in Daisy-Chain I have around 50m to the last 1-Wire sensor.

evilwulfie

unread,
Apr 28, 2016, 1:44:11 PM4/28/16
to beagl...@googlegroups.com
50m is rather pushing the max way past recomended

https://www.maximintegrated.com/en/app-notes/index.mvp/id/148

and thats using twisted pair ethernet
--
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...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/78193f8e-87c7-4350-aab7-917a30f08df3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



Virus-free. www.avast.com

TJF

unread,
Apr 28, 2016, 11:30:01 PM4/28/16
to BeagleBoard, hoerting...@gmx.at


Am Donnerstag, 28. April 2016 19:40:19 UTC+2 schrieb hoerting...@gmx.at:
Hello!

1. Max sensors
When I try:
echo 20 > w1_master_max_slave_count

I get:
bash: w1_master_max_slave_count: Permission denied
(of course I´m root
 
sudo su
echo
20 > w1_master_max_slave_count
exit
 
2. Polling time
Well, 19sec in total is OK! It are just room temperatur and this must not update so fast. But can I add more as 10 sensors because of Point 3?

3. max cable length
I mean the total cable length of the 1-Wire bus ... when I connect in Daisy-Chain I have around 50m to the last 1-Wire sensor.

Of course, it depends on the electro-magnetic pollution in your area. Ie. frequency converters with heavy loads are crititcal.

I read about networks with a weight of 200 m using additional w1 drivrer chips with 5V power supply. But I didn't test it.

It's recommended to avoid Daisy-Chain configuration. Instead think about a tree structure: one root connected to the master and several terminals with short wiring to the slaves or further terminals. More than 20 sensors shouldn't be an issue when the radius is small (< 20 m, when I tried a radius of 25 m in my system, I had to reduce the pullup from 4k7 to 3k3.)

BR

hoerting...@gmx.at

unread,
Apr 29, 2016, 7:45:29 AM4/29/16
to BeagleBoard, hoerting...@gmx.at
Hello,

thank you for the infos. But I´m not able to write the max slave count value.
Of course I´m root with "sudo su".

But:
root@c0a80090:/sys/bus/w1/devices/w1_bus_master1# echo 20 > w1_master_max_slave_count
bash: w1_master_max_slave_count: Permission denied


Why I can´t increase the value?

Thank you!

Przemek Klosowski

unread,
Apr 29, 2016, 12:49:07 PM4/29/16
to beagl...@googlegroups.com
On Fri, Apr 29, 2016 at 1:08 AM, <hoerting...@gmx.at> wrote:


root@c0a80090:/sys/bus/w1/devices/w1_bus_master1# echo 20 > w1_master_max_slave_count
bash: w1_master_max_slave_count: Permission denied



Could you provide the result of running
ls -lZ  w1_master_max_slave_count

hoerting...@gmx.at

unread,
May 2, 2016, 11:22:48 AM5/2/16
to BeagleBoard
Hello!

Here the result:
root@c0a80090:/sys/devices/w1_bus_master1# ls -lZ  w1_master_max_slave_count
-r--r--r-- 1 root root ? 4096 May  2 14:45 w1_master_max_slave_count

I try to use "chmod 777 w1_master_max_slave_count" and then the command again, but then I get:
root@c0a80090:/sys/devices/w1_bus_master1# ls -lZ  w1_master_max_slave_count
-rwxrwxrwx 1 root root ? 4096 May  2 15:18 w1_master_max_slave_count
root@c0a80090:/sys/devices/w1_bus_master1# echo 20 > w1_master_max_slave_count
bash: echo: write error: Input/output error


Przemek Klosowski

unread,
May 2, 2016, 2:34:41 PM5/2/16
to beagl...@googlegroups.com
OK, I am out of ideas---you have correctly modified the Unix filesystem permissions, but it still doesn't work.
I see that SELinux data is missing (the '?' part). I don't remember and can't check right now which SElinux mode is Debian in (off/permissive/enforcing).
Check the result of 'getenforce' command.

 

hoerting...@gmx.at

unread,
May 3, 2016, 7:25:45 AM5/3/16
to BeagleBoard
Hello!

the command "getenforce" are not available on my system.

TJF

unread,
May 3, 2016, 10:41:57 AM5/3/16
to BeagleBoard, hoerting...@gmx.at
What happens when you pass the parameter at module load time? (In order to test, unload the kernel driver and reload with option w1_max_slave_count=30 )

hoerting...@gmx.at

unread,
May 3, 2016, 11:46:38 AM5/3/16
to BeagleBoard, hoerting...@gmx.at


Am Dienstag, 3. Mai 2016 16:41:57 UTC+2 schrieb TJF:
What happens when you pass the parameter at module load time? (In order to test, unload the kernel driver and reload with option w1_max_slave_count=30 )

Hello!

Many thanks for your help, but I don´t know how to load at module load time.

You mean when the BBB starts?

Unload the kernel driver:
well, waybe you have the command for this!

Thank you! 

TJF

unread,
May 3, 2016, 2:13:29 PM5/3/16
to BeagleBoard, hoerting...@gmx.at
Check out man pages for
  • lsmod: list loaded kernel modules
  • modprobe: load or unload modules

BR

Reply all
Reply to author
Forward
0 new messages