BUG: OneWire missing GPIO definition with ESP32-C6

dr_glenn

New member
I am using OneWire 2.3.7 in Arduino IDE 2.3.2 with a "SparkFun ESP32-C6 WROOM Qwiic Pocket".
The sketch compile fails with:
Arduino\libraries\OneWire\util/OneWire_direct_gpio.h:134:17: error: 'GPIO' was not declared in this scope; did you mean 'PI'?
134 | return (GPIO.in >> pin) & 0x1;


I can see that soc/gpio_struct.h defines GPIO, but it is not included in OneWire_direct_gpio.h. Putting #include <soc/gpio_sruct.h> in my sketch is no help, because it is the OneWire lib that needs it and I assume that OneWire lib gets compiled for my board whenever I compile my sketch. Therefore I think this needs to be fixed in OneWire.

However I don't know how to do that - I put #include <soc/gpio_sruct.h> in OneWire.h, but now the compile fails because it can't find gpio_struct.h
 
I think you ought to go onto an ESP32 site for that sort of answer.
It's not applicable to Teensy.
 
This might be caused by a missing
util/OneWire_direct_gpio.h

Note the comment in that code:

Code:
#elif defined(ARDUINO_ARCH_ESP8266)
// Special note: I depend on the ESP community to maintain these definitions and
// submit good pull requests.  I can not answer any ESP questions or help you
// resolve any problems related to ESP chips.  Please do not contact me and please
// DO NOT CREATE GITHUB ISSUES for ESP support.  All ESP questions must be asked
// on ESP community forums.
 
Sorry, but w/o reading deeply I didn't realize that OneWire was originally only for Teensy devices.
I'm new to ESP32 and never used Arduino, so I was surprised to find libraries that can be compiled for such a large variety of controllers.
I suppose I should delve into the OneWire Github and see where the ESP32 updates come from, because I have no idea which ESP community I should go to.
 
I'll go to arduino-esp32 and see if I can't figure out how to file a bug report.
Elsewhere I was referred to the Tasmota sensor library that includes ds18b20 and it works for me. But the one referenced by PaulS is smaller and I will try it.
 
Back
Top