1-Wire

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!

Hi!

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

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.

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

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 echo20 > w1_master_max_slave_coun`t
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

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!

ls -lZ w1_master_max_slave_count

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

`

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.

Hello!

the command “getenforce” are not available on my system.

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!

Check out man pages for

  • lsmod: list loaded kernel modules
  • modprobe: load or unload modules

BR