Heltec v3 and Onewire problem

Help please
I need to program the heltec wireless stick v3. I can program it with examples->heltec esp32 dev-boards->LoRaWAN->LoRaWan. But i need to add ds14b20 sensor's data. So i need to use onewire library. I can use examples->onewire->ds18x20_Temperature. But when try to compile sketch that includes both "LoRaWan_APP.h" and <OneWire.h> i have the error described below
And there is an interesting moment. I can compile my sketch using onewire.h using 2.3.3 version of library. But i cannot get data from ds18b20 with this version with any esp32. Everything i get is "No more addresses"

Library Heltec ESP32 Dev-Boards has been declared precompiled:
Using precompiled library in \Heltec_ESP32_Dev-Boards\src\esp32s3
In file included from C:\Users\nik0\AppData\Local\Arduino15\packages\Heltec-esp32\hardware\esp32\3.0.2\cores\esp32/esp32-hal.h:75,
                 from C:\Users\nik0\AppData\Local\Arduino15\packages\Heltec-esp32\hardware\esp32\3.0.2\cores\esp32/Arduino.h:36,
                 from c:\Users\nik0\OneDrive\Documents\Arduino\libraries\OneWire\OneWire.cpp:147:
c:\Users\nik0\OneDrive\Documents\Arduino\libraries\OneWire\util/OneWire_direct_gpio.h: In function 'void directModeInput(uint32_t)':
C:\Users\nik0\AppData\Local\Arduino15\packages\Heltec-esp32\hardware\esp32\3.0.2\cores\esp32/esp32-hal-gpio.h:67:34: error: 'GPIO_IS_VALID_GPIO' was not declared in this scope; did you mean 'RTC_GPIO_IS_VALID_GPIO'?
   67 | #define digitalPinIsValid(pin)   GPIO_IS_VALID_GPIO(pin)
      |                                  ^~~~~~~~~~~~~~~~~~
c:\Users\nik0\OneDrive\Documents\Arduino\libraries\OneWire\util/OneWire_direct_gpio.h:214:10: note: in expansion of macro 'digitalPinIsValid'
  214 |     if ( digitalPinIsValid(pin) )
      |          ^~~~~~~~~~~~~~~~~
c:\Users\nik0\OneDrive\Documents\Arduino\libraries\OneWire\util/OneWire_direct_gpio.h: In function 'void directModeOutput(uint32_t)':
C:\Users\nik0\AppData\Local\Arduino15\packages\Heltec-esp32\hardware\esp32\3.0.2\cores\esp32/esp32-hal-gpio.h:67:34: error: 'GPIO_IS_VALID_GPIO' was not declared in this scope; did you mean 'RTC_GPIO_IS_VALID_GPIO'?
   67 | #define digitalPinIsValid(pin)   GPIO_IS_VALID_GPIO(pin)
      |                                  ^~~~~~~~~~~~~~~~~~
c:\Users\nik0\OneDrive\Documents\Arduino\libraries\OneWire\util/OneWire_direct_gpio.h:240:10: note: in expansion of macro 'digitalPinIsValid'
  240 |     if ( digitalPinIsValid(pin) && pin <= 33 ) // pins above 33 can be only inputs
      |          ^~~~~~~~~~~~~~~~~

exit status 1

Compilation error: exit status 1

when using LoRaWan_APP.h which Tools>Board did you select?
I use "Heltec WiFi LoRa (V3)

which pin is the ds14b20 connected too?

1 Like

experimentedwith a Heltec LoRa V3 and a DS14B20 and replicated your problem using ESP32 core V3.0.7
tried ESP32 core V3.0.0 - same problem
tried ESP32 core V2.0.17 which gave

LoRaWAN_OTAA_DS18B20.ino:94:13: error: 'HELTEC_BOARD' was not declared in this scope
   Mcu.begin(HELTEC_BOARD,SLOW_CLK_TPYE);
             ^~~~~~~~~~~~

it appears the the Heltec LoRa V3 was not supported by ESP32 core V2

suggest you report the problem on the Espressif ESP32 Arduino forum
in the past I have found the forum very helpful with ESP32 specific problems

1 Like

Maybe not safe but here's solution:
I just commented the lines related to "if digitalPinIsValid(pin)" in the OneWire_direct_gpio.h

Check this out GitHub - Anttibay/LoRa-Temperature-HomeAssistant: This is my first project repository for LoRa sensor pair for long range temperature measurement and integration to Home Assistant