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

OneWire Search not working for mixed devices (IDFGH-11938) #13017

Open
3 tasks done
rpaulbeam opened this issue Jan 19, 2024 · 3 comments
Open
3 tasks done

OneWire Search not working for mixed devices (IDFGH-11938) #13017

rpaulbeam opened this issue Jan 19, 2024 · 3 comments
Labels
Status: Opened Issue is new

Comments

@rpaulbeam
Copy link

Answers checklist.

  • I have read the documentation ESP-IDF Programming Guide and the issue is not addressed there.
  • I have updated my IDF branch (master or release) to the latest version and checked that the issue is present there.
  • I have searched the issue tracker for a similar issue and not found a similar issue.

General issue report

I'm using esp-idf 5.1.2 with ESP32-S3-DevkitC in a Windows/VS Code environment. I have 2 onewire devices (DS2408 and MAX31820) on my bus, which is just a breadboard. Using the Onewire example, it can detect either of the devices, but not both. Plugging the same "network" into a Linux SBC, both devices are detected, so I believe the wiring is correct. The ID of the DS2408 (470000003FB84629) supersedes the 31820 (0100000ED5745128), so only it is detected if both are attached.

Looking at onewire_device_iter_get_next() with the JTAG debugger, I can tell that search_direction is never 0 -- last_zero = rom_bit_index is never executed even though a discrepancy is detected. I think the issue is different device families. The problem may be that last_dispepancy is initialized as 0 and rom_bit_index is initialized as 0, so a discrepancy of the first bit will be detected as the 2nd occurrance of this discrepancy? A different implementation (esp32 bitbang onewire) initializes last_discrepancy as 64. The Analog Devices App Note initializes last discrepancy as 0, but the first bit is 1 and not 0.

@espressif-bot espressif-bot added the Status: Opened Issue is new label Jan 19, 2024
@github-actions github-actions bot changed the title OneWire Search not working for mixed devices OneWire Search not working for mixed devices (IDFGH-11938) Jan 19, 2024
@suda-morris
Copy link
Collaborator

@rpaulbeam Thanks for reporting! I don't have a MAX31820 before my hand, It would be very appreciated if you could submit a PR in this repo for the fix.

@rpaulbeam
Copy link
Author

rpaulbeam commented Jan 20, 2024 via email

@suda-morris
Copy link
Collaborator

Link in: espressif/idf-extra-components#298

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Opened Issue is new
Projects
None yet
Development

No branches or pull requests

3 participants