Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getAddress return the first address available even if not found the device #229

Open
NilsRo opened this issue Oct 17, 2022 · 2 comments
Open

Comments

@NilsRo
Copy link

NilsRo commented Oct 17, 2022

I prepared 3 sensors but only 1 is connected. A call to getAddress is false but the last address found is written to the variable given.

There should be no explicit address returned if the device is not found.

Reproduction: Call a device number that is not available with at least one device connected.

milesburton/DallasTemperature@^3.11.0

image
image

@RobTillaart
Copy link
Contributor

RobTillaart commented Oct 18, 2022

Can you post a minimal sketch that shows the problem?

The image just does not give information about the content of the variables before your call.

e.g initialize the address with all 0xFF before any call.

@NilsRo
Copy link
Author

NilsRo commented Oct 31, 2022

Attached a simple sketch.

Output with one DS18B20 connected:

ets Jun 8 2016 00:22:57

rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
flash read err, 1000
ets_main.c 371
ets Jun 8 2016 00:22:57

rst:0x10 (RTCWDT_RTC_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0030,len:1344
load:0x40078000,len:13864
load:0x40080400,len:3608
entry 0x400805f0
289D8F16A8013C7A
289D8F16A8013C7A

Output with no DS18B20 connected:

rst:0x10 (RTCWDT_RTC_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0030,len:1344
load:0x40078000,len:13864
load:0x40080400,len:3608
entry 0x400805f0
0000000000000000
0000000000000000

Expected result in first example would be:
289D8F16A8013C7A
0000000000000000

Dalles_Fehler.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants