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

Fix Heltec v2 pinmap and add more Heltec pinmaps #471

Merged
merged 1 commit into from
Oct 7, 2019

Conversation

manuelbl
Copy link

@manuelbl manuelbl commented Oct 6, 2019

As described in #463 I've fixed the invalid Heltec Wifi Lora32 v2 pinmap. Additionally, I've added pinmaps for Heltec Wifi Lora v1 and Heltec Wireless Stick boards.

The changes have been tested with:

  • Heltec Wifi Lora v1
  • Heltec Wifi Lora v2
  • ttgo Lora32 v1

I would have additional ttgo boards (ttgo LoRa32 v2 and v2.1) to test but unfortunately they do not have board definitions in the Arduino framework. So a predefined pinmap cannot be automatically selected.

I've also tried to add the ttgo T-Beam board. But it uses the macro ARDUINO_T-beam, which is invalid due to the dash. And I was unable to find a working macro expression to select it. So I had to omit it. It would have worked on PlatformIO as they changed the macro to ARDUINO_T_beam.

@terrillmoore terrillmoore merged commit 403c81a into mcci-catena:issue453 Oct 7, 2019
@terrillmoore
Copy link
Member

Looks great, thanks for your contribution!

// Note: The pin constants SS, RST_LoRa and DIOx are defined in pins_arduino.h
// (board-specific variant in Arduino core). Even if it won't be used, this
// file needs to compile for all other variants as well.
#if !defined(ARDUINO_HELTEC_WIFI_LORA_32) && !defined(ARDUINO_HELTEC_WIFI_LORA_32_V2) && !defined(ARDUINO_HELTEC_WIRELESS_STICK)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I ran into an issue when trying to use this code on my Heltec WiFi LoRA ESP32 (v2), and it turned out that the Arduino IDE was defining ARDUINO_WIFI_LORA_32_V2, not ARDUINO_HELTEC_WIFI_LORA_32_V2 (no HELTEC). I assume that's because the boards.txt file here: https://github.com/Heltec-Aaron-Lee/WiFi_Kit_series/blob/master/esp32/boards.txt#L186 specifies wifi_lora_32_V2.build.board=WIFI_LORA_32_V2.
The other thing that's close the Heltec package seems to define for that board is here: https://github.com/Heltec-Aaron-Lee/WiFi_Kit_series/blob/master/esp32/variants/wifi_lora_32_V2/pins_arduino.h#L6 (#define WIFI_LoRa_32_V2 true).
I've never really got deep into Arudino, but am I missing something here? Should I be setting something somewhere in the IDE, or defining ARDUINO_HELTEC_WIFI_LORA_32_V2 in my own sketch or build arguments somewhere?
Thanks!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It comes from boards.txt. Since this worked at one time, my guess is that the boards.txt file changed. We can add the checks for the new constant. (You can patch yourself by changing the file here to add ARDUINO_WIFI_LoRa_32_V2 here, and also in the .h file:

#elif defined(ARDUINO_HELTEC_WIFI_LORA_32_V2) || defined(ARDUINO_TTGO_LoRa32_V1)

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the quick reply. I got my board working by substituting s/ARDUINO_HELTEC_WIFI_/ARDUINO_WIFI_/in the two files in arduino-lmic/src/hal/..., but I wondered what the "right" solution was, since it seemed to work for everyone but me (I didn't see any posts anywhere with the same issue I was having), but computers are often like that for me :-).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants