Uncategorized

owfc notes

OWFS (One Wire File System) can at most detect four DS18B20 sensors connected to the 8-channel DS2482-800 Host Module Problem
Ask Question
Asked 4 days ago
Active today
Viewed 55 times

1

I’m about to build a heating control with DS18B20 1Wire-sensors and the Raspberry Pi 3 Model B+. For the 1Wire-interface I’m using the DS2482-800 multi-channel busmaster (more precisely this pre-assembled board: http://www.sheepwalkelectronics.co.uk/product_info.php?products_id=67).

The sensors are read over OWFS and a Node.js-script (using the owfs-module). I’m using Node.js as the Raspberry is hosting an express-webserver with all the current temperature-values.

Overall this works great, at least for the 11 sensors, which are connected to the first 4 channels of the DS2482. But as soon as I try to connect 2 additional sensors to the 5th channel, these sensors are NOT read by OWFS. Why that?

Moreover I noticed, that the virtual /mnt/1wire directory only shows 9 sensors on the first 2 channels, although I’m able to read 11 sensors (on 4 channels) with the Node.js-script without problems. How’s that possible???

/mnt/1wire directory shows 9 sensors but with the Node.js-script I’m able to read 11

For test purposes I tried to connect the 2 “new” sensors to one of the first 4 channels -> reading them works perfectly fine, so no issues with the sensors.
Because of that, I think there’s a problem with my configuration of OWFS.
My owfs.conf file looks like this:

# Sample configuration file for the OWFS suite for Debian GNU/Linux.
#
#
# This is the main OWFS configuration file. You should read the
# owfs.conf(5) manual page in order to understand the options listed
# here.

######################## SOURCES ########################
#
# With this setup, any client (but owserver) uses owserver on the
# local machine…
! server: server = localhost:4304
#
# …and owserver uses the real hardware, by default fake devices
# This part must be changed on real installation
# server: FAKE = DS18S20,DS2405
#
# USB device: DS9490
#server: usb = all

server: device = /dev/i2c-1

# Serial port: DS9097
#server: device = /dev/ttyS1
#
# owserver tcp address
#server: server = 192.168.10.1:3131
#
# random simulated device
#server: FAKE = DS18S20,DS2405

######################### OWFS ##########################
#
mountpoint = /mnt/1wire
allow_other
#
####################### OWHTTPD #########################

!http: port = 2121

####################### OWFTPD ##########################

ftp: port = 2120

####################### OWSERVER ########################

server: port = 4304
I really appreciate your support, as I couldn’t find anything helpful via Google and I’m preety stumped right now…

Thanks in advance

temperature ds18b20 1-wire
shareeditfollowflag
edited yesterday

tlfong01
2,94833 gold badges77 silver badges2121 bronze badges
asked Apr 16 at 11:18

simsnWolke
1122 bronze badges
New contributor
I read the datasheet and found that your “bus master” is (1) a “8 Channel I2C to 1-Wire host adapter, and (2) this module uses a DS2482-800 IC to provide 8 separate 1-Wire channels. So I guess it is sort of “1-Wire channel multiplier”. Please correct me if I am wrong. Now I guess you wish each of the 8 1-Wire channels to handle as many 1-Wire sensors, ie DS18B20 as possible. I had the same problem as yours. Let me se if I can find my old answer to refresh my memory. See you later. – tlfong01 Apr 16 at 12:42
Now that I found my old answer: “DS18B20 Temperature Sensor – Rpi 3/4 Driver, Wiring, Detection, and Python Programming – Asked 9 months ago Viewed 763 times”: raspberrypi.stackexchange.com/questions/100203/…. Now I remember that one Rpi GPIO pin can handle at least 12 DS18B12 sensors. In other words if you want to entertain, say 64 sensors, you need 5 GPIO pins. – tlfong01 Apr 16 at 12:50
1

Thanks for your quick answer. But you are referring to an arrangement, where the DS18B20 sensors are connected directly to the RPi GPIOs, which is NOT the case in my installation. I’m using the DS2482-800 busmaster, which comunicates with the RPi only through I2C, no other GPIOs used (it’s no multiplier, but provides “8 Channels of Independently Operated” see datasheet datasheets.maximintegrated.com/en/ds/DS2482-800.pdf ) – simsnWolke Apr 16 at 13:29
Hi @simsnWolke, yes, I agree I am not answering your question directly, but just brainstorming that you might forget the bus expander/mux/demux/ (OK, not “multiplier”) and just use GPIO instead. I am aware that GPIO wires cannot go far, so one workaround is to use I2C, plus I2C extenders and expanders, otherwise I2C alone, even at 100kHz, cannot go reliably further than a couple of meters, before hitting the 400pF impedance limit. I remember when I tested the max number of 1-wire sensor per GIPO, I read Maxim’s literature about how to do long distance sensing, using / to continue, … – tlfong01 Apr 16 at 14:18
their purposely designed extenders. Let me see if I can find Maxim’s app notes, to refresh my memory, and compare your “expander” then come back to you. Cheers. – tlfong01 Apr 16 at 14:21
I found that Ref 2 of my answer refers to the Maxim app notes mentioned above: TUTORIALS 148 GUIDELINES FOR RELIABLE LONG LINE 1-WIRE NETWORKS – Maxim maximintegrated.com/en/design/technical-documents/tutorials/1/…. I guess you must have already read it and perhaps many more papers in the subject. Anyway, let me quickly read your DS2842 datasheet and come back to you later. – tlfong01 Apr 16 at 14:29
By the way, my other brainstorming idea is to use UART instead of I2C extender, because UART can go further than I2C. I am interested to know if you have already considered this: APPLICATION NOTE 4104 CONFIGURATIONS OF 1-WIRE TIMING OF THE DS2480B. maximintegrated.com/en/design/technical-documents/app-notes/4/…. PS – I am just thinking aloud, my apologies for the typos. – tlfong01 Apr 16 at 14:34
I am skimming the datasheet, and jotting/drawing at the same time: (1) “DS2482-800 8-Channel 1-Wire Master – Maxim”: datasheets.maximintegrated.com/en/ds/DS2482-800.pdf, (2) “DS2482-800 Block Diagram – Maxim”: imgur.com/gallery/gs9SUJR. See your later. – tlfong01 Apr 16 at 14:48
My imgur image library is full and can no longer upload. So I paste more images as an answer. – tlfong01 Apr 16 at 14:56
I skimmed the DS2820 datasheet, and I think I understand 95% of what is going on there (I once played with similar I2C “expanders”, except the other ends are I2C, not 1–Wire). Now I read your question again. My first impression is that there is nothing to do with web server or node.js software. The most likely cause is some sort of impedance overloading, distorting wave form signals/time etc. But I am only 10% sure. Ah, bed time!. I call it a day. See you tomorrow or over the weekend. Good luck and cheers. – tlfong01 Apr 16 at 15:07
add a comment
start a bounty
1 Answer
Active
Oldest
Votes

0

Question

OWFS (One Wire File System) can at most detect four DS18B20 temperature sensors connected to the 8-channel DS2482-800 1-Wire host module. How to fix it?

Answer

(1) Enabling the DS2482’s SPU MOSFET, and (2) Using a lower 1-Wire speed would hopefully solve the problem. See Appendix E for more details.

References

(1) DS18B20 Temperature Sensor Setup and Programming Q&A

(2) Rpi4B buster I2C Speed Test 6.0 – tlfong01 2020mar04

(3) DS2482-100 1-Channel 1-Wire Master Datasheet – Maxim

(4) DS2482-800 8-Channel 1-Wire Master – Maxim

(5) AK-DS2482S-100 – 1-Channel 1-Wire Master Breakout Product Sheet – Artekit

(6) AK-DS2482S-100 – 1-Channel 1-Wire Master Breakout Schematic – Artekit

(7) AK-DS2482S-100 – 1-Channel 1-Wire Master Breakout User Manual – Artekit

(8) DS2482-800 8-Channel 1-Wire Master Module – SheepWalk

(9) OWFS 1-Wire File System – OWFS

(10) OWFS and OWHTTPD Project Docs – SourceForge

(11) How to enable DS2482 SPU – Ivan2 Artekit Product Comments 2018

(12) OWFS Node.js Client Library For 1-Wire Devices Using OwServer Protocol

(13) Application Note 3684 How to Use the DS2482 I2C 1-Wire Master – Maxim

(14) Kernel driver ds2482 Supported chips Maxim DS2482-100, Maxim DS2482-800

(15) Interface Driver for Maxim DS2482 1Wire-to-I2C bridge IC – Stefan Guenther

Appendices

Appendix A – DS2482-800 Application Schematic

ds2820 app sch

Appendix B – DS2482-800 Block Diagram

ds2482 block

Appendix C – DS2482-x00 Modules

ds2482 modules

Appendix D – DS2482-100 Schematic and Block Diagram

ds2482-100 schematic and block diagram

Appendix E – Enabling SPU (Strong Pull Up) of the DS2482 1-Wire Host Module

Application Note 3684 How to Use the DS2482 I2C 1-Wire Master – Maxim

How to enable DS2482 SPU – Ivan2 Artekit Product Comments 2018

The SPU pad is for the strong pull-up, to be used with the PCTLZ pin to control the on-board MOSFET. Both APU (active pull-up) and SPU (strong pull-up) must be activated using the internal registers. – Ivan2

App Note 3684 describes how to use the internal registers to (1) enalbe SKU, (2) change 1-Wire speed. One easy way to access the DS2482 registers is to use python I2C functions – tlfong01

shareeditdeleteflag
edited 23 hours ago
answered Apr 16 at 14:59

tlfong01
2,94833 gold badges77 silver badges2121 bronze badges
1

Thanks @tlfong01 for your brainstorming ideas, but tearing down the whole hardware/bustopology is not an option for me, as the 11 working sensors are already installed around the house and are working perfectly fine, so I can’t complain about my decision to go with 1wire and the DS2482 busmaster. As already mentioned my only problem is, that OWFS can’t read the upper 4 channels of the DS2482 (Even if only one sensor is connected to the 5th channel and no other channels are used). One possible solution would be to connect my two new sensors to one of the first 4 channels as /to continue… – simsnWolke Apr 16 at 15:18
1

well and it probably will work fine. But as the DS2482-800 offers 8 channels and shorter cable lengths would be better, i want to use the capacity of that chip if possible, and I’m sure there must be a way as it is a specification of the manufacturer. So, let’s focus on OWFS and how to configure it, to read all 8 channels… – simsnWolke Apr 16 at 15:19
(1) You might like to tell me (1) the length and config of the I2C wiring. As I said earlier, if your I2C wiring is longer than 1m, anything can happen. (2) same question for the 1-wiring. I usually prototype with ALL wiring shorten than 30cm, then wire by wire, try longer cables. (3) I forgot to mention if you are using 5V I2C signals which is always better than 3V3. There are a couple of other tricks applicable to I2C. My guess is that 1-Wire is more tricky than I2C. – tlfong01 Apr 17 at 13:50
And you might like to skim the posts on my experience in using I2C extenders/expanders/buffers, and 3V3/5V logic level shifters: raspberrypi.org/forums/… – tlfong01 Apr 17 at 13:56
Question: I have been using DHT22 humidity and temperature sensor all the time. I also use DS18B20 because I need water proof probes to submerge into liquids. But why are you using DS18B20, and not DHT22 etc? – tlfong01 Apr 17 at 14:04
1

(1) I think there’s a misunderstanding, the DS2482-board is directly mounted on to the RPi (e.g. like that sheepwalkelectronics.co.uk/images/RPI3-1lg.jpg ), so no issues with I2C-lenghts. (2) 1wire-lenght is about 20-30m on each channel with some 1-2m stubs. BUT AGAIN: Even only a single DS18B20 directly connected to the 5th channel can’t be read, so there can’t be an issue with cable-lenghts etc.; I’m pretty sure it must be only a little thing in configurating the DS2482 and OWFS! – simsnWolke 2 days ago
1

And why the hell should I use DHT22, when I’m not interested in humidity and 11(!) DS18B20-sensors distributed around the house are working perfectly fine!!! I really don’t mean to be rude now, but discussing other hardware-solutions for my project won’t help me, as my installed setup works excellent and the aim of my initial question only was: WHY CAN’T I READ ONE OF THE UPPER 4 1WIRE-CHANNELS OF THE DS2482-800 USING OWFS? – simsnWolke 2 days ago
My apologies for all the inappropriate brainstorming suggestions. Please also excuse my poor English standards. Let me see why I misunderstood the situation. It started from the very beginning, when I read your opening sentence: ” I’m about to build a heating control with DS18B20 …”. I wrongly interpreted that you have NOT really started, ie, not even have bought and hardware. Yes you did mention later in detail your specific problem. I must confess that I very slow in reading English, and that I actually cannot read a long sentence in full, I only try to remember the key words. – tlfong01 2 days ago
I asked about the length of I2C, because I was not aware that your board is a HAT, but when prototyping I used not to mount the HAT on top of the Rpi, For now I am testing the SIM7600 HAT. I actually have two identical HAT use long UART wires to connect, and three Rpi’s with bus extenders. When prototyping or trouble shooting, I can swap between 2 HATs and 3 Rpi’s in less than a minute. And for the UART controlled SIM7600 HAT, I actually use three USB UART and the Rpi on board UART to test, compare and contrast different configurations, / to continue, … – tlfong01 2 days ago
to find out why I could not place all 8 MCP23017s on the same bus. After many attempts, I learnt many tricks to work around, thank you for long explanation in broken English. I have a couple of more troubleshooting suggestions, (1) set I2C speed from 100kHz to 50kHz, but you need to upgrade to Rpi4B, because Rpi3B cannot not change I2C speed. (2) Shorten 1-Wire cables. Ah, supper time, see you later. PS – Just thinking aloud, sorry for all the typos. – tlfong01 2 days ago
1

I’m no native speaker either, so don’t worry about English skills 😉 Oh, I see, maybe that wasn’t the perfect opening sentence, sorry for that. Nevertheless, thanks for your brainstorming suggestions, I will see what I’m able to implement. If I can solve the problem, I will post my solution in here of course. – simsnWolke yesterday
No problem. Let’s move on. Question 1 – Do you have any schematic for the 4 RJ45 connectors? Are you aware that they are differently wired? – tlfong01 yesterday
Suggestion: If SheepWalk schematic is same as ArteKit, I would suggest to do the following: (1) Do NOT enable the two 4k7 pullups, because Rpi I2C pins already have strong 1k8 pullups. (2) Enable MOSFET strong pullup (SKU). Warning: I am just a friendly hobbyist, I have ZERO experience in DS2482x00, No guarantee Nothing would meltdown or blowup! Ah bed time! Good luck and see you tomorrow or after. Cheers. – tlfong01 yesterday

Categories: Uncategorized

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.