diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 2569c5fb..37b71c1e 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -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 diff --git a/README.md b/README.md index 53d4c3ee..21d1ef17 100644 --- a/README.md +++ b/README.md @@ -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:
E to IRQ
D to CS
C to RST
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:
A to RST
B to DIO1
D to IRQ
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**1 | SX1276 (LoRa1276) | Wiring on the cover:
D2 to RESET
D3 to DIO0
D4 to CS
D5 to DIO1 | diff --git a/examples/BresserWeatherSensorMQTTCustom/src/WeatherSensorCfg.h b/examples/BresserWeatherSensorMQTTCustom/src/WeatherSensorCfg.h index c3b47bb8..883c313b 100644 --- a/examples/BresserWeatherSensorMQTTCustom/src/WeatherSensorCfg.h +++ b/examples/BresserWeatherSensorMQTTCustom/src/WeatherSensorCfg.h @@ -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: // - @@ -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 // @@ -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 @@ -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 @@ -219,6 +240,7 @@ #endif + // Replacement for // https://github.com/espressif/arduino-esp32/blob/master/cores/esp32/esp32-hal-log.h // on Arduino AVR: @@ -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 @@ -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 @@ -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 @@ -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 diff --git a/src/WeatherSensorCfg.h b/src/WeatherSensorCfg.h index 90401767..29677823 100644 --- a/src/WeatherSensorCfg.h +++ b/src/WeatherSensorCfg.h @@ -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: // - @@ -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 // @@ -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 @@ -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 diff --git a/src/WeatherSensorCfg.h.template b/src/WeatherSensorCfg.h.template index 0a83cf9a..1418635c 100644 --- a/src/WeatherSensorCfg.h.template +++ b/src/WeatherSensorCfg.h.template @@ -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: // - @@ -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 // @@ -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 @@ -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 @@ -219,6 +240,7 @@ #endif + // Replacement for // https://github.com/espressif/arduino-esp32/blob/master/cores/esp32/esp32-hal-log.h // on Arduino AVR: @@ -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 @@ -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 @@ -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 @@ -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