Tell me what you want, What you really, really want.

Moderator: Mmiscool

User avatar
By forlotto
#48636 Another user in the hardware section brought up the fact that it may be very useful to find which temp sensor is faulty. And this could be possibly done with rom codes of the temp sensor.

I found it to be a rather interesting proposition.

Lets say you are at a location that has 10 temp sensors strung out it would be nice to easily figure out which one is faulty via the rom code.

However it also made me think being that this is 1 wire will not all other sensors from that sensor on fail thus telling you which one has failed.

Either way there were other reasons to address temp sensors with rom codes such as quicker responses possibly or commands that would individually grab data and you would know it is from the proper temp sensor at the proper location. As it stands if you wired these from a single point out like a star for instance who is to say that your reading is going to be correct if you lose power seeing as how these sensors get addressed from 0-n I guess IDK just thinking out loud maybe 1 wire has to be chained?

The question I guess to sum it up is addressing 1wire devices temp sensors by rom code possible or worth while I have little to no experience with them personally just all talk mainly at current in the learning stages you may want to read the users post a better overview of the question.

viewtopic.php?f=153&t=10190
User avatar
By livetv
#49285 I'm that guy. Yes, I think this is exactly what should happen because I can't find a good way to tell if a sensor is disconnected/broken programatically. I did a little more testing and found that if I remove a sensor (like #0 or #1 out of 3 connected), a temperature reading similar to the next sensor in the chain is returned for that sensor number. I don't get a -127 which would suggest that the sensor is gone. Makes me wonder if a rom code lookup table is even being used at all and instead there's a general "all call" put out, discarding (n-1) responses.

When a temp sensor is restored, everything goes back to normal. I guess this is good in case of any intermittent problem but the issue still remains that we don't always know if a reading is coming from the sensor we think we are addressing by device number.

I'm pretty good at looking through code to find out how things work and sometimes can whip up a change, but I don't know where I'd go to find the code used in the temp() function. Probably buried in a library somewhere but that's all new territory for me and learning library dissection is not on my schedule for the next couple weeks. If someone could show me the code, I'd like to take a look.
User avatar
By forlotto
#49298 Looks like all of what you talk of is possible from what I can tell.
How to properly do that I am not 100% sure just yet.

https://github.com/esp8266/Basic/tree/N ... DallasTemp
User avatar
By forlotto
#49307 After a couple of hours of reading through code this is what needs to be changed I think?

A little Ironic at the page below line 666 needs modification to reflect the library
https://github.com/esp8266/Basic/blob/N ... c/Eval.ino

}
else if ( fname == F("temp") && num_args > 0 ) {
// function temp(sensor #)
// set return value
sensors.requestTemperatures();
*value = sensors.getTempCByIndex(args[0]);
return PARSER_TRUE;
}

Now if you look at the library you can request specific information but basic only allows you to request temperature Celcius but there is way way more that this temp sensor can do temp by Farenheit request temp from a specific sensor only hrmmm there is a lot of stuff look at the library ...

Good luck I can see stuff somewhat but how to make it all jive with basic hehe a bit above my level know how currently maybe in the future got a lot of easier stuff to learn first. But it did help to look at the code it really puts into perspective what work has been done...

I recall the early iterations of basic when I last looked at the code now it is like holy crap son where did all that code come from!?

Mmiscool and Cicciocb I hope you folks remember to enjoy some of the outdoors for your summer that is a pretty hefty amount of hours put in. Can't thank you folks enough.

These guys are awesome good folks to have for devs!

DON'T FORGET DONATE !