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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
08-08-2020, 11:03 AM
|
#1
|
Member
Registered: Jul 2004
Distribution: Custom Linux, Buildroot, Busybox, Fedora, Raspberry Pi
Posts: 151
Rep:
|
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.
|
|
|
08-12-2020, 12:45 PM
|
#2
|
LQ Guru
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 17,211
|
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?
|
|
|
08-12-2020, 12:56 PM
|
#3
|
LQ Guru
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,636
|
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.
|
|
|
08-12-2020, 02:58 PM
|
#4
|
Member
Registered: Jul 2004
Distribution: Custom Linux, Buildroot, Busybox, Fedora, Raspberry Pi
Posts: 151
Original Poster
Rep:
|
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.
|
|
|
08-13-2020, 05:59 AM
|
#5
|
LQ Guru
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 17,211
|
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?
|
|
|
08-21-2020, 02:18 PM
|
#6
|
Member
Registered: Jul 2004
Distribution: Custom Linux, Buildroot, Busybox, Fedora, Raspberry Pi
Posts: 151
Original Poster
Rep:
|
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.
|
|
|
08-22-2020, 12:28 PM
|
#7
|
LQ Guru
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 17,211
|
Sounds like the time to get a hardware techie with his 'scope on the job.
|
|
|
09-05-2020, 09:45 AM
|
#8
|
Member
Registered: Jul 2004
Distribution: Custom Linux, Buildroot, Busybox, Fedora, Raspberry Pi
Posts: 151
Original Poster
Rep:
|
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.
|
|
|
09-06-2020, 05:12 AM
|
#9
|
LQ Guru
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 17,211
|
A familiar story. It's so easily done, also.
|
|
|
All times are GMT -5. The time now is 03:14 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|