junkfix / esp32-ds18b20

Arduino Library for ESP32 DS18B20 Non Blocking Onewire RMT protocol, no dependencies, minimal
MIT License
15 stars 4 forks source link

I have a problem that the devices are not detected on the bus. #2

Closed EmileSpecialProducts closed 11 months ago

EmileSpecialProducts commented 11 months ago

I have a problem that the devices are not detected on the bus. This is in the OneWire32::search() as the first reset fails. and then it will report that there are no items.

08:57:54.652 -> Setup Started 08:57:54.652 -> reset () found =0 item=1 rx_size=4 Level0=1 Duration0=1 Level1=0 Duration1=481 08:57:54.652 -> reset () found =1 item=1 rx_size=8 Level0=0 Duration0=481 Level1=1 Duration1=33 08:57:54.694 -> 0: 0xc90000001b94f828,

I have resolved this by adding an extra reset() before starting the search.

Device ESP32-S3

PS: Add some default TX,RX buffer for the diffrent Devices. as not all devices support RX/TX on all buffers. OneWire32 ds(ONEWIRE_PIN, 0, 4, 0); //gpio pin, tx, rx, parasite power

uint8_t OneWire32::search(uint64_t addresses[], uint8_t total) { uint8_t last_src; int8_t last_dev = -1; uint8_t found = 0; uint8_t loop = 1; if(!drvrx){return found;} reset(); // reset the Bus once before discovery while(loop && found < total){ uint64_t addr = 0; loop = 0; last_src = last_dev; if(!reset()){ found = 0; break; }

htmltiger commented 11 months ago

done,

what do you mean by TX RX buffers? mem_block_num?