PaulStoffregen / OneWire

Library for Dallas/Maxim 1-Wire Chips
http://www.pjrc.com/teensy/td_libs_OneWire.html
579 stars 382 forks source link

Fix 'rtc_gpio_desc was not declared' compile error with arduino-esp32 v2.0.0 #102

Closed codepam closed 2 years ago

codepam commented 2 years ago

When using arduino-esp32 v2.0.0, the call to rtc_gpio_desc is replaced by rtc_io_desc and the io number is assigned by rtc_io_number_get.

Fixes #100 Fixes #103

Michal-Szczepaniak commented 2 years ago

+1 works perfectly on my esp32

PaulStoffregen commented 2 years ago

Thanks!

damianjwilliams commented 2 years ago

Not working on my ESP32-S2-WROOM. The error disappears and it compiles but the temperatures are wrong.

18:52:03.339 -> -127.00ºC
18:52:03.339 -> -196.60ºF

There are six DS18B20 sensors so should be multiple readings (around 25C)

*Edited - I wrote the wrong module so changed WROVER to WROOM

PaulStoffregen commented 2 years ago

I'm waiting on more ESP32 user feedback before publishing a new OneWire version. So far only 3 people have reported results with #102 applied.

Michal-Szczepaniak said "+1 works perfectly on my esp32" damianjwilliams said "Not working on my ESP32-S2-WROVER" ClemensGruber said "I downgraded to Arduino ESP core 1.0.6 and code is still compiling and DS18B20 working as expected".

Now is the time to contribute by just installing the latest and running on your ESP32 hardware, then post clear feedback. Is this ready to publish as a new version to Arduino's library manager?

Michal-Szczepaniak commented 2 years ago

@damianjwilliams are you using parasitic power? I only have one thermometer, connected on 1m wire or just directly to the board (both wtih the 4.7k resistor), without parasitic power. Also i have esp-wroom-32. I can check it on esp32-s2 on top of saola r1

damianjwilliams commented 2 years ago

@Michal-Szczepaniak I'm using the regular 3.3 V output from the module. It all seems to work fine on my ESP-32-WROOM. Also @PaulStoffregen I wrote the wrong module, now edited to ESP-32-S2-WROOM. Thanks!

Michal-Szczepaniak commented 2 years ago

now we know that issue might be related to esp32-s2 :)

pberna67 commented 2 years ago

This is a copy of the replay of the problem declared in the OneWire Forum named:

New ESP32 v2.0.0 package seems doesn't compile a sketch which include oneWire lib

https://forum.pjrc.com/threads/68370-New-ESP32-v2-0-0-package-seems-doesn-t-compilea-sketch-which-include-oneWire-lib?p=290452#post290452

Dear Paul

"I would be a part a part of this ", but franking speaking I would like to solve the old instability problem of Dallas Temperature lib which includes the OneWire lib, and I still don't know in which lib/s the problem is. This is the reason because I'm trying to make an update of the ESP basic package, hoping it can solve that problem. I'm using the 2.3.5 version of OneWire at the moment

Unfortunately I'm not very familiar with GitHub, so when you ask to download the code from GitHub, is it correct to download the package from

https://github.com/PaulStoffregen/OneWire.git

and that its file name is OneWire-master.zip ?

Assuming that it is, I have substitute the OneWire subfolders under {Documents}/Arduino/libraries folder. with the subbloders of the package OneWire-master.zip and finnaly I have recompiled the sketch. With this lib it seems that the compilation process is completed without errors

See the attached the ComilerVerboseReport.zip

Now I will check if the instability problem if DallasTemperature is also solved

Compiler Verbose report: ComilerVerboseReport.zip Sketch project : TemperatureMonitor8MQTTClient_GitHub.zip

rodrigorrm commented 2 years ago

This patch worked for me too.

codepam commented 2 years ago

Sorry for not replying earlier, @damianjwilliams has the problem been solved? If an ESP32-S2 board is selected, the compiler seems to be entering both preprocessor checks, but I have no access to such a board so as to test the code. What is so different with S2 boards?

PaulStoffregen commented 2 years ago

I'm relying on feedback from the ESP32 community about whether to publish a release...

codepam commented 2 years ago

@PaulStoffregen no problem, I understand.

@damianjwilliams is your code working properly with arduino-esp32 v1.0.6 and which GPIO are you using for 1-wire? Also, which is your board with the ESP32-S2-WROOM module (or is it custom)?

damianjwilliams commented 2 years ago

@codepam, I'm afraid there is no ESP32-S2 board option on v1.0.6, so have to use 2.0.0. I've been using GPIO 8 (although can use different pins with the same problem). The board is an ESP32-S2 Saola 1R Dev Kit featuring ESP32-S2 WROOM.

codepam commented 2 years ago

@damianjwilliams, could you test the changes in https://github.com/codepam/OneWire/commit/12771c5733db3565f6c921d21f8173a009c9a3f4?

The code has been improved using the esp32-hal-gpio.c of arduino-esp32 v2.0.0 so OneWire should be compatible with ESP32-S2, ESP32-S3 and ESP32-C3. Thanks for indicating the problem.

damianjwilliams commented 2 years ago

@codepam still same problem - displays the wrong temperature (the same as if the sensor is not attached). Just to confirm - I am the development release of ESP32-S2 core from the https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_dev_index.json, and the zip file from https://github.com/codepam/OneWire/tree/arduino_esp32_2_0_0

dukess commented 2 years ago

@PaulStoffregen Hi! One more report about OneWire + ESP32 SDK 2.0.x: I use Olimex ESP32-EVB board. When i tried to run current version MCU can't found sensors on bus. When i use patch https://github.com/PaulStoffregen/OneWire/pull/93 , MCU found sensors without problem.