Skip to content

Commit

Permalink
Merge pull request #57 from matthias-bs/feature-heltec-wifi-lora32-v2
Browse files Browse the repository at this point in the history
Added pin definitions for Heltec WiFi LoRa32 V2
  • Loading branch information
matthias-bs committed Jun 7, 2023
2 parents 7e22410 + a5e10c9 commit 56327fa
Show file tree
Hide file tree
Showing 5 changed files with 104 additions and 25 deletions.
1 change: 1 addition & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ jobs:
#- esp32:esp32:ttgo-lora32:Revision=TTGO_LoRa32_V2
- esp32:esp32:ttgo-lora32:Revision=TTGO_LoRa32_v21new
- esp32:esp32:heltec_wireless_stick:PSRAM=disabled
- esp32:esp32:heltec_wifi_lora_32_V2
- esp32:esp32:adafruit_feather_esp32s2
- esp32:esp32:featheresp32
- esp8266:esp8266:generic:dbg=Disabled
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ If this is not what you need, you have to switch to **Manual Configuration**
| [LILYGO®TTGO-LORA32 V1](https://github.com/Xinyuan-LilyGo/TTGO-LoRa-Series) | "TTGO LoRa32-OLED" | "TTGO LoRa32 V1 (No TFCard)" | ARDUINO_TTGO_LORA32_V1 | SX1276 (HPD13A) | - |
| [LILYGO®TTGO-LORA32 V2](https://github.com/LilyGO/TTGO-LORA32) | "TTGO LoRa32-OLED" | "TTGO LoRa32 V2" | ARDUINO_TTGO_LoRa32_V2 | SX1276 (HPD13A) | Wire DIO1 to GPIO33 |
| [LILYGO®TTGO-LORA32 V2.1](http://www.lilygo.cn/prod_view.aspx?TypeId=50060&Id=1271&FId=t3:50060:3) | "TTGO LoRa32-OLED" | "TTGO LoRa32 V2.1 (1.6.1)" | ARDUINO_TTGO_LoRa32_v21new | SX1276 (HPD13A) | - |
| [Heltec Wireless Stick](https://heltec.org/project/wireless-stick/) | "Heltec Wireless Stick" | n.a. | ARDUINO_heltec_wireless_stick | SX1276 | - |
| [Heltec Wireless Stick](https://heltec.org/project/wireless-stick/) | "Heltec Wireless Stick" | n.a. | ARDUINO_heltec_wireless_stick | SX1276 | - |
| [Heltec WiFi LoRa 32 V2](https://heltec.org/project/wifi-lora-32/) | "Heltec WiFi LoRa 32(V2)" | n.a. | ARDUINO_heltec_wifi_lora_32_V2 | SX1276 | - |
| [Adafruit Feather ESP32S2 with Adafruit LoRa Radio FeatherWing](https://github.com/matthias-bs/BresserWeatherSensorReceiver#adafruit-feather-esp32s2-with-adafruit-lora-radio-featherwing) | "Adafruit Feather ESP32-S2" | n.a. | ARDUINO_ADAFRUIT_FEATHER_ESP32S2 | SX1276 (RFM95W) | Wiring on the Featherwing:<br>E to IRQ<br>D to CS<br>C to RST<br>A to DI01 |
| [Adafruit Feather ESP32 or ThingPulse ePulse Feather with Adafruit LoRa Radio FeatherWing](https://github.com/matthias-bs/BresserWeatherSensorReceiver/blob/main/README.md#adafruit-feather-esp32-or-thingpulse-epulse-feather-with-adafruit-lora-radio-featherwing) | "Adafruit ESP32 Feather" | n.a. | ARDUINO_FEATHER_ESP32 | SX1276 (RFM95W) | Wiring on the Featherwing:<br>A to RST<br>B to DIO1<br>D to IRQ<br>E to CS |
| [DFRobot FireBeetle with FireBeetle Cover LoRa Radio 868MHz](https://github.com/matthias-bs/BresserWeatherSensorReceiver/blob/main/README.md#dfrobot-firebeetle-esp32-with-firebeetle-cover-lora-radio-868mhz) | "FireBeetle-ESP32" | n.a. | ARDUINO_ESP32_DEV & **FIREBEETLE_ESP32_COVER_LORA**<sup>1</sup> | SX1276 (LoRa1276) | Wiring on the cover: <br>D2 to RESET<br>D3 to DIO0<br>D4 to CS<br>D5 to DIO1 |
Expand Down
56 changes: 45 additions & 11 deletions examples/BresserWeatherSensorMQTTCustom/src/WeatherSensorCfg.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
// 20230330 Added pin definitions and changes for Adafruit Feather 32u4 (AVR) RFM95 LoRa Radio
// 20230412 Added workaround for Professional Wind Gauge / Anemometer, P/N 7002531
// 20230420 Added pin definitions for DFRobot FireBeetle ESP32 with FireBeetle Cover LoRa
// 20230607 Added pin definitions for Heltec WiFi LoRa 32(V2)
//
// ToDo:
// -
Expand Down Expand Up @@ -81,6 +82,10 @@
// in the Arduino IDE:
//#define ARDUINO_heltec_wireless_stick

// This define is set by selecting "Board: Heltec WiFi LoRa 32(V2)"
// in the Adruino IDE:
//#define ARDUINO_heltec_wifi_lora_32_V2

// Adafruit Feather ESP32S2 with RFM95W "FeatherWing" ADA3232
// https://github.com/espressif/arduino-esp32/blob/master/variants/adafruit_feather_esp32s2/pins_arduino.h
//
Expand Down Expand Up @@ -116,6 +121,10 @@
#pragma message("ARDUINO_heltec_wireless_stick defined; using on-board transceiver")
#define USE_SX1276

#elif defined(ARDUINO_heltec_wifi_lora_32_V2)
#pragma message("ARDUINO_heltec_wifi_lora_32_V2 defined; using on-board transceiver")
#define USE_SX1276

#elif defined(ARDUINO_ADAFRUIT_FEATHER_ESP32S2)
#pragma message("ARDUINO_ADAFRUIT_FEATHER_ESP32S2 defined; assuming RFM95W FeatherWing will be used")
#define USE_SX1276
Expand All @@ -125,15 +134,27 @@
#define USE_SX1276
#pragma message("Required wiring: A to RST, B to DIO1, D to DIO0, E to CS")

#elif defined(ARDUINO_ESP32_DEV)
#pragma message("Generic ESP32; assuming this is the LoRaWAN_Node board (DFRobot Firebeetle32 + Adafruit RFM95W LoRa Radio)")
#define LORAWAN_NODE
#define USE_SX1276

#elif defined(ARDUINO_AVR_FEATHER32U4)
#pragma message("ARDUINO_AVR_FEATHER32U4 defined; assuming this is the Arduino Feather 32u4 RFM95 LoRa Radio")
#define USE_SX1276


#elif defined(ARDUINO_ESP32_DEV)
//#define LORAWAN_NODE
#define FIREBEETLE_ESP32_COVER_LORA

#if !defined(LORAWAN_NODE) && !defined(FIREBEETLE_ESP32_COVER_LORA)
#pragma message("ARDUINO_ESP32_DEV defined; select either LORAWAN_NODE or FIREBEETLE_ESP32_COVER_LORA manually!")

#elif defined(LORAWAN_NODE)
#pragma message("LORAWAN_NODE defined; assuming this is the LoRaWAN_Node board (DFRobot Firebeetle32 + Adafruit RFM95W LoRa Radio)")
#define USE_SX1276

#elif defined(FIREBEETLE_ESP32_COVER_LORA)
#define USE_SX1276
#pragma message("FIREBEETLE_ESP32_COVER_LORA defined; assuming this is a FireBeetle ESP32 with FireBeetle Cover LoRa")
#pragma message("Required wiring: D2 to RESET, D3 to DIO0, D4 to CS, D5 to DIO1")

#endif
#endif


Expand Down Expand Up @@ -219,6 +240,7 @@

#endif


// Replacement for
// https://github.com/espressif/arduino-esp32/blob/master/cores/esp32/esp32-hal-log.h
// on Arduino AVR:
Expand Down Expand Up @@ -315,6 +337,18 @@
// RFM95W/SX127x - GPIOxx / CC1101 - RADIOLIB_NC
#define PIN_RECEIVER_RST 12

#elif defined(FIREBEETLE_ESP32_COVER_LORA)
#define PIN_RECEIVER_CS 27 // D4

// CC1101: GDO0 / RFM95W/SX127x: G0
#define PIN_RECEIVER_IRQ 26 // D3

// CC1101: GDO2 / RFM95W/SX127x: G1
#define PIN_RECEIVER_GPIO 9 // D5

// RFM95W/SX127x - GPIOxx / CC1101 - RADIOLIB_NC
#define PIN_RECEIVER_RST 25 // D2

#elif defined(ARDUINO_TTGO_LoRa32_V1) || defined(ARDUINO_TTGO_LoRa32_V2)
// Use pinning for LILIGO TTGO LoRa32-OLED
#define PIN_RECEIVER_CS LORA_CS
Expand Down Expand Up @@ -343,8 +377,8 @@
// RFM95W/SX127x - GPIOxx / CC1101 - RADIOLIB_NC
#define PIN_RECEIVER_RST LORA_RST

#elif defined(ARDUINO_heltec_wireless_stick)
// Use pinning for Heltec Wireless Stick
#elif defined(ARDUINO_heltec_wireless_stick) || defined(ARDUINO_heltec_wifi_lora_32_V2)
// Use pinning for Heltec Wireless Stick or WiFi LoRa32 V2, respectively
#define PIN_RECEIVER_CS SS

// CC1101: GDO0 / RFM95W/SX127x: G0
Expand Down Expand Up @@ -394,7 +428,7 @@

// RFM95W/SX127x - GPIOxx / CC1101 - RADIOLIB_NC
#define PIN_RECEIVER_RST 32

#elif defined(ESP8266)
// Generic pinning for ESP8266 development boards (e.g. LOLIN/WEMOS D1 mini)
#define PIN_RECEIVER_CS 15
Expand All @@ -407,9 +441,9 @@

// RFM95W/SX127x - GPIOxx / CC1101 - RADIOLIB_NC
#define PIN_RECEIVER_RST 2

#elif defined(ARDUINO_AVR_FEATHER32U4)
// Pinning for Adafruit Feather 32u4
// Pinning for Adafruit Feather 32u4
#define PIN_RECEIVER_CS 8

// CC1101: GDO0 / RFM95W/SX127x: G0
Expand Down
13 changes: 11 additions & 2 deletions src/WeatherSensorCfg.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
// 20230330 Added pin definitions and changes for Adafruit Feather 32u4 (AVR) RFM95 LoRa Radio
// 20230412 Added workaround for Professional Wind Gauge / Anemometer, P/N 7002531
// 20230420 Added pin definitions for DFRobot FireBeetle ESP32 with FireBeetle Cover LoRa
// 20230607 Added pin definitions for Heltec WiFi LoRa 32(V2)
//
// ToDo:
// -
Expand Down Expand Up @@ -81,6 +82,10 @@
// in the Arduino IDE:
//#define ARDUINO_heltec_wireless_stick

// This define is set by selecting "Board: Heltec WiFi LoRa 32(V2)"
// in the Adruino IDE:
//#define ARDUINO_heltec_wifi_lora_32_V2

// Adafruit Feather ESP32S2 with RFM95W "FeatherWing" ADA3232
// https://github.com/espressif/arduino-esp32/blob/master/variants/adafruit_feather_esp32s2/pins_arduino.h
//
Expand Down Expand Up @@ -116,6 +121,10 @@
#pragma message("ARDUINO_heltec_wireless_stick defined; using on-board transceiver")
#define USE_SX1276

#elif defined(ARDUINO_heltec_wifi_lora_32_V2)
#pragma message("ARDUINO_heltec_wifi_lora_32_V2 defined; using on-board transceiver")
#define USE_SX1276

#elif defined(ARDUINO_ADAFRUIT_FEATHER_ESP32S2)
#pragma message("ARDUINO_ADAFRUIT_FEATHER_ESP32S2 defined; assuming RFM95W FeatherWing will be used")
#define USE_SX1276
Expand Down Expand Up @@ -368,8 +377,8 @@
// RFM95W/SX127x - GPIOxx / CC1101 - RADIOLIB_NC
#define PIN_RECEIVER_RST LORA_RST

#elif defined(ARDUINO_heltec_wireless_stick)
// Use pinning for Heltec Wireless Stick
#elif defined(ARDUINO_heltec_wireless_stick) || defined(ARDUINO_heltec_wifi_lora_32_V2)
// Use pinning for Heltec Wireless Stick or WiFi LoRa32 V2, respectively
#define PIN_RECEIVER_CS SS

// CC1101: GDO0 / RFM95W/SX127x: G0
Expand Down
56 changes: 45 additions & 11 deletions src/WeatherSensorCfg.h.template
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
// 20230330 Added pin definitions and changes for Adafruit Feather 32u4 (AVR) RFM95 LoRa Radio
// 20230412 Added workaround for Professional Wind Gauge / Anemometer, P/N 7002531
// 20230420 Added pin definitions for DFRobot FireBeetle ESP32 with FireBeetle Cover LoRa
// 20230607 Added pin definitions for Heltec WiFi LoRa 32(V2)
//
// ToDo:
// -
Expand Down Expand Up @@ -81,6 +82,10 @@
// in the Arduino IDE:
//#define ARDUINO_heltec_wireless_stick

// This define is set by selecting "Board: Heltec WiFi LoRa 32(V2)"
// in the Adruino IDE:
//#define ARDUINO_heltec_wifi_lora_32_V2

// Adafruit Feather ESP32S2 with RFM95W "FeatherWing" ADA3232
// https://github.com/espressif/arduino-esp32/blob/master/variants/adafruit_feather_esp32s2/pins_arduino.h
//
Expand Down Expand Up @@ -116,6 +121,10 @@
#pragma message("ARDUINO_heltec_wireless_stick defined; using on-board transceiver")
#define USE_SX1276

#elif defined(ARDUINO_heltec_wifi_lora_32_V2)
#pragma message("ARDUINO_heltec_wifi_lora_32_V2 defined; using on-board transceiver")
#define USE_SX1276

#elif defined(ARDUINO_ADAFRUIT_FEATHER_ESP32S2)
#pragma message("ARDUINO_ADAFRUIT_FEATHER_ESP32S2 defined; assuming RFM95W FeatherWing will be used")
#define USE_SX1276
Expand All @@ -125,15 +134,27 @@
#define USE_SX1276
#pragma message("Required wiring: A to RST, B to DIO1, D to DIO0, E to CS")

#elif defined(ARDUINO_ESP32_DEV)
#pragma message("Generic ESP32; assuming this is the LoRaWAN_Node board (DFRobot Firebeetle32 + Adafruit RFM95W LoRa Radio)")
#define LORAWAN_NODE
#define USE_SX1276

#elif defined(ARDUINO_AVR_FEATHER32U4)
#pragma message("ARDUINO_AVR_FEATHER32U4 defined; assuming this is the Arduino Feather 32u4 RFM95 LoRa Radio")
#define USE_SX1276


#elif defined(ARDUINO_ESP32_DEV)
//#define LORAWAN_NODE
#define FIREBEETLE_ESP32_COVER_LORA

#if !defined(LORAWAN_NODE) && !defined(FIREBEETLE_ESP32_COVER_LORA)
#pragma message("ARDUINO_ESP32_DEV defined; select either LORAWAN_NODE or FIREBEETLE_ESP32_COVER_LORA manually!")

#elif defined(LORAWAN_NODE)
#pragma message("LORAWAN_NODE defined; assuming this is the LoRaWAN_Node board (DFRobot Firebeetle32 + Adafruit RFM95W LoRa Radio)")
#define USE_SX1276

#elif defined(FIREBEETLE_ESP32_COVER_LORA)
#define USE_SX1276
#pragma message("FIREBEETLE_ESP32_COVER_LORA defined; assuming this is a FireBeetle ESP32 with FireBeetle Cover LoRa")
#pragma message("Required wiring: D2 to RESET, D3 to DIO0, D4 to CS, D5 to DIO1")

#endif
#endif


Expand Down Expand Up @@ -219,6 +240,7 @@

#endif


// Replacement for
// https://github.com/espressif/arduino-esp32/blob/master/cores/esp32/esp32-hal-log.h
// on Arduino AVR:
Expand Down Expand Up @@ -315,6 +337,18 @@
// RFM95W/SX127x - GPIOxx / CC1101 - RADIOLIB_NC
#define PIN_RECEIVER_RST 12

#elif defined(FIREBEETLE_ESP32_COVER_LORA)
#define PIN_RECEIVER_CS 27 // D4

// CC1101: GDO0 / RFM95W/SX127x: G0
#define PIN_RECEIVER_IRQ 26 // D3

// CC1101: GDO2 / RFM95W/SX127x: G1
#define PIN_RECEIVER_GPIO 9 // D5

// RFM95W/SX127x - GPIOxx / CC1101 - RADIOLIB_NC
#define PIN_RECEIVER_RST 25 // D2

#elif defined(ARDUINO_TTGO_LoRa32_V1) || defined(ARDUINO_TTGO_LoRa32_V2)
// Use pinning for LILIGO TTGO LoRa32-OLED
#define PIN_RECEIVER_CS LORA_CS
Expand Down Expand Up @@ -343,8 +377,8 @@
// RFM95W/SX127x - GPIOxx / CC1101 - RADIOLIB_NC
#define PIN_RECEIVER_RST LORA_RST

#elif defined(ARDUINO_heltec_wireless_stick)
// Use pinning for Heltec Wireless Stick
#elif defined(ARDUINO_heltec_wireless_stick) || defined(ARDUINO_heltec_wifi_lora_32_V2)
// Use pinning for Heltec Wireless Stick or WiFi LoRa32 V2, respectively
#define PIN_RECEIVER_CS SS

// CC1101: GDO0 / RFM95W/SX127x: G0
Expand Down Expand Up @@ -394,7 +428,7 @@

// RFM95W/SX127x - GPIOxx / CC1101 - RADIOLIB_NC
#define PIN_RECEIVER_RST 32

#elif defined(ESP8266)
// Generic pinning for ESP8266 development boards (e.g. LOLIN/WEMOS D1 mini)
#define PIN_RECEIVER_CS 15
Expand All @@ -407,9 +441,9 @@

// RFM95W/SX127x - GPIOxx / CC1101 - RADIOLIB_NC
#define PIN_RECEIVER_RST 2

#elif defined(ARDUINO_AVR_FEATHER32U4)
// Pinning for Adafruit Feather 32u4
// Pinning for Adafruit Feather 32u4
#define PIN_RECEIVER_CS 8

// CC1101: GDO0 / RFM95W/SX127x: G0
Expand Down

0 comments on commit 56327fa

Please sign in to comment.