Questions with regards to ESP8266 Basic and hardware interfacing and control via Basic commands

Moderator: Mmiscool

User avatar
By livetv
#48601
forlotto wrote:hrmmm yes interesting indeed how does the address get set 0-n I almost wonder if the rom code may not have something to do with it if not then I estimate it is set on which sensor responds to reset the quickest possibly?


I'm pretty sure I know how it works based on experience with a different one-wire protocol. When devices are queried for their presence, ALL of them begin to respond bit by bit but watching the data line too. If two transmit a "1" at the same time, no harm done. If two send opposite bits, the "1" prevails and the one sending a "0" defers and stops sending, waiting for the packet to finish, ready to resend. After the prevailing response finishes, the "inferior" devices resend under the same rules until all have replied successfully. Maybe I have it backwards and the "0" prevails, but the idea is the same.

So what I think the temp command is doing is to begin with a device query and build the device lookup table (0-n cross referencing the ROM codes) first before then addressing the target device by its ROM code. I think this is a bad way to do it for two reasons: 1. As before, if a device is rendered inoperative, the software may not know, much less adjust. 2. The temp command/function would be faster if you could specify a ROM code and preclude the the initial device query altogether.

I propose that the temp function be modified to (optionally) accept a ROM code instead of a device number. I'd suggest that the ROM code be given as a string value and the device number would just be numeric. This way the function could distinguish between the two. In the instance of a ROM code being passed, the temp function would skip the device query and the lookup of device number to ROM code. The result is higher speed and a positive identification of the correct device. Since we are not adding arguments, the original temp command in Branch 2 could be modified too.
User avatar
By xtal
#49326 I'm sure I've broken all the 1-wire wiring rules , but with 7 sensors running parasite mode
I just checked log temp and since last boot have issued 10600+ to each sensor and only 3 sensors have missed responding 1 time.

I come fro PC to LinkUSB ADAPTER to TB[terminal block] ----2 runs same connecters [ie parallel]

[1] 1st run ATTIC = 1 twisted pair 20 feet to attic to Teflon TB [home brew] then 2 5 foot twisted pair runs to sensors and 1 sensor connected at TB
ATTIC TEMP - RETURN TEMP - SUPPLY TEMP

[2] 2nd run OUTSIDE AIR COND = 1 twisted pair 28 feet to inside basement wall Teflon TB [home brew] then 4 8 foot twisted pair[teflon coated] runs to outside sensors .
AIR TEMP - EXHAUST TEMP - SUCTION LINE TEMP - LIQUID LINE TEMP

I have had 3 moisture at sensor failures, 1 sensor lead corroded off,
To trouble shoot I isolate at TB's, except when 1 sensor fails.
User avatar
By forlotto
#49346 great solution on the hardware side makes for better management to be centrally located on a terminal however, it is possible as well to address them in the manner that the OP suggested according to the data sheets and the library I pointed out on below line 666 the code needs to be changed to accept these other abilities the one that really gets me is that here in the us we use F instead of C so it would be nice to have that output unlocked seeing as how it is perfectly capable of doing so. I guess it will take a bit of work to be honest and really anyone well versed enough could likely read through the libs and take care of business to make these things functional...

The other option is to go with dhtsensors or a server and separate MCU's seeing how cheap these things are and wifi equipment is one could easily run each unit off of a simple 2a 5v supply.

But I get where the OP is coming from using the code that is in place currently does not allow for much of the functionality overall that the Dallas temp sensor is capable of.

Excellent setup though enjoyed reading about it ahh the possibilities of this thing never get dull.