Heltec_unofficial.h compile problem in .cpp file

I can run the example demo sketch that ping pong integers back and forth between two Heltek WIFI Lora v3 boards with no problems.

But when making .h or .cpp files of my own I get compiler errors when I include the heltec_unofficial.h header file in any of those files. The errors show multiple declarations of pins, for example.

c:\Users\chief\OneDrive\Projects\Arduino\libraries\Heltec_ESP32_LoRa_v3\src/heltec_unofficial.h:35:19: error: ‘const uint8_t GPIO_NUM_8’ redeclared as different kind of entity
35 | #define SS GPIO_NUM_8
| ^~~~~~~~~~
C:\Users\chief\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.0.5\variants\heltec_wifi_kit_32_V3/pins_arduino.h:22:22: note: in expansion of macro ‘SS’
22 | static const uint8_t SS = 8;
| ^~

The heltec_unofficial.h is exactly that, unofficial - someone else’s creation that doesn’t seem to be used much here. I’d suggest you lodge an issue on GitHub to see if they have tested with v3.0.5

Thanks for the reply. Actually, I am only using heltec_unofficial.h because I couldn’t figure out how to use anything else. Most of the documentation took me to broken links at heltec. I would really like to use this board for my projects. But I came to the conclusion that I was not going anywhere with heltec documentation.

Perhaps I missed something along the way.

You could also look into why you might be using the WiFi Kit 32 V3 pins_arduino.h file (second error message) rather than the one for the WiFi LoRa 32 V3 board. This may be related to something that’s going on in the heltec_unofficial.h library but I can’t imagine that this would be helping matters.

If you were to post the code that was causing the errors, we might be able to offer a little more help.

I had the same problem as the original poster and found a solution here: https://github.com/ropg/heltec_esp32_lora_v3/issues/6

The solution was to comment the following lines in the .pio/libdeps/heltec_wifi_lora_32_V3/Heltec_ESP32_LoRa_v3/src/heltec_unofficial.h
from

// SPI pins
#define SS        GPIO_NUM_8
#define MOSI      GPIO_NUM_10
#define MISO      GPIO_NUM_11
#define SCK       GPIO_NUM_9
// Radio pins
#define DIO1      GPIO_NUM_14
#define RST_LoRa  GPIO_NUM_12
#define BUSY_LoRa GPIO_NUM_13
// Display pins
#define SDA_OLED  GPIO_NUM_17
#define SCL_OLED  GPIO_NUM_18
#define RST_OLED  GPIO_NUM_21

to:

// SPI pins
//#define SS        GPIO_NUM_8
//#define MOSI      GPIO_NUM_10
//#define MISO      GPIO_NUM_11
//#define SCK       GPIO_NUM_9
// Radio pins
#define DIO1      GPIO_NUM_14
//#define RST_LoRa  GPIO_NUM_12
//#define BUSY_LoRa GPIO_NUM_13
// Display pins
//#define SDA_OLED  GPIO_NUM_17
//#define SCL_OLED  GPIO_NUM_18
//#define RST_OLED  GPIO_NUM_21