LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 08-08-2020, 10:03 AM   #1
Mike Davies
Member
 
Registered: Jul 2004
Distribution: Custom Linux, Buildroot, Busybox, Fedora, Raspberry Pi
Posts: 145

Rep: Reputation: 15
1-wire (w1) subsystem problems


We've got two temperature sensors (DS18B20) on a 1-wire bus, one measuring the room temp, and the other measuring the temp inside a case, and the idea is we can change a fan pwm depending on the temp difference etc.

And it works well, for 24hrs a day, 7 days a week, until we start getting CRC errors, from which we never seem to be able to recover.

We've told w1_master_max_slave_count we have two devices and after the master finds 2 devices we stop the master searching.

We read the sensors about every 20/30 secs, and it all works well until we start getting CRC errors.

A reboot will fix the problem, BUT, as we don't power down the one-wire subsystem during a reboot, and a reboot fixes the problem, it seems to us that there must be a software solution to these CRC errors. i.e. the DS18B20 sensors are not switching internally into some sort of "silly bugger mode" from which only powering off and on again knock them back into life.

We have tried removing drivers and reloading modules, and using w1_master_remove followed by w1_master_add, but the problem persists.

Of course the main problem are these CRC errors happen only rarely, so it's difficult to try different possible solutions.

Is the a 1-wire expert in the house ?

Can anyone give some advice ?

Oh, yeah, we did try swapping out the DS18B20's for different devices, but it made no difference.

Thanks.
 
Old 08-12-2020, 11:45 AM   #2
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,527

Rep: Reputation: 2382Reputation: 2382Reputation: 2382Reputation: 2382Reputation: 2382Reputation: 2382Reputation: 2382Reputation: 2382Reputation: 2382Reputation: 2382Reputation: 2382
No one-wire expert, but I know the general idea. Bizarre method of doing anything, but anyhow…

Can we insert a cache flush between each reading? What's going on between readings? I take it one end is unpowered, so voltage on the one line needs to be cycled to keep the capacitors charged. Could this be going low?
 
Old 08-12-2020, 11:56 AM   #3
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,386
Blog Entries: 3

Rep: Reputation: 3776Reputation: 3776Reputation: 3776Reputation: 3776Reputation: 3776Reputation: 3776Reputation: 3776Reputation: 3776Reputation: 3776Reputation: 3776Reputation: 3776
It may be that your sensors are counterfeit. Most are, even those purchased from a reputable dealer. Try checking.

I had a bunch of DS18B20s, purchased through three different highly reputable dealers over the course of a year, and I found that every last one was fake when I checked. So I've ordered new parts from another reputable vendor but one that offers a choice up front on the order form between a fake sensor or a real Maxim DS18B20.
 
Old 08-12-2020, 01:58 PM   #4
Mike Davies
Member
 
Registered: Jul 2004
Distribution: Custom Linux, Buildroot, Busybox, Fedora, Raspberry Pi
Posts: 145

Original Poster
Rep: Reputation: 15
Thanks for the replies.

We do not run these things in parasitic mode. They are powered direct to Vdd.

We are just using the sysfs interface. Someone on the team is currently mucking about with the w1-therm driver to try and get some helpful diagnostics out of it.

I guess they could be cloned chips, but they have the Dallas mark and a proper looking batch code.

We've built up another similar system and so far that one is behaving, but it could go for days before the CRC error pops up. That is what is so annoying.
 
Old 08-13-2020, 04:59 AM   #5
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,527

Rep: Reputation: 2382Reputation: 2382Reputation: 2382Reputation: 2382Reputation: 2382Reputation: 2382Reputation: 2382Reputation: 2382Reputation: 2382Reputation: 2382Reputation: 2382
Well, if you're powered to Vdd, it's hardly 1 wire, but never mind.
Have you slapped an oscilloscope on it? I found an awful lot of errors in my time on borderline voltage levels.You have Vdd(+) & signal. How does it see 0V?
 
Old 08-21-2020, 01:18 PM   #6
Mike Davies
Member
 
Registered: Jul 2004
Distribution: Custom Linux, Buildroot, Busybox, Fedora, Raspberry Pi
Posts: 145

Original Poster
Rep: Reputation: 15
We are starting to suspect there is some sort of hardware problem. We now have built 3 identical systems, and only one (the original) is giving us problems.

But it could just be too soon.
 
Old 08-22-2020, 11:28 AM   #7
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,527

Rep: Reputation: 2382Reputation: 2382Reputation: 2382Reputation: 2382Reputation: 2382Reputation: 2382Reputation: 2382Reputation: 2382Reputation: 2382Reputation: 2382Reputation: 2382
Sounds like the time to get a hardware techie with his 'scope on the job.
 
Old 09-05-2020, 08:45 AM   #8
Mike Davies
Member
 
Registered: Jul 2004
Distribution: Custom Linux, Buildroot, Busybox, Fedora, Raspberry Pi
Posts: 145

Original Poster
Rep: Reputation: 15
Solved.

Turns out it was a solder bridge.

A bit intermittent because it wasn't a full bridge, but when stuff warmed up, contact was made.
 
Old 09-06-2020, 04:12 AM   #9
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,527

Rep: Reputation: 2382Reputation: 2382Reputation: 2382Reputation: 2382Reputation: 2382Reputation: 2382Reputation: 2382Reputation: 2382Reputation: 2382Reputation: 2382Reputation: 2382
A familiar story. It's so easily done, also.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Replace 3 wire fan with 4 wire fan ? Fixit7 Linux - Hardware 4 03-28-2014 06:56 AM
Problems installing the ieee80211 subsystem HiIamBill Linux - Wireless Networking 2 07-16-2006 05:52 PM
40 wire vs 80 wire rkelsen Linux - Hardware 1 07-04-2006 05:24 PM
2 wire home monitor problems conecting bobothn Red Hat 5 08-06-2004 05:50 PM
10 wire RJ-45 not 8 wire? farhan Linux - Networking 0 11-11-2003 02:37 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 04:53 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration