Merge pull request #35 from mrmx/lora32_v10
Initial support for TTGO LORA SX1278 ESP32 0.96 OLED 32Mbit (4MB) 433Mhz v1.0
This commit is contained in:
commit
023f6fa1e3
15
Config.h
15
Config.h
@ -35,6 +35,7 @@
|
|||||||
#define BOARD_GENERIC_ESP32 0x35
|
#define BOARD_GENERIC_ESP32 0x35
|
||||||
#define BOARD_LORA32_V2_0 0x36
|
#define BOARD_LORA32_V2_0 0x36
|
||||||
#define BOARD_LORA32_V2_1 0x37
|
#define BOARD_LORA32_V2_1 0x37
|
||||||
|
#define BOARD_LORA32_V1_0 0x39
|
||||||
#define BOARD_HELTEC32_V2 0x38
|
#define BOARD_HELTEC32_V2 0x38
|
||||||
#define BOARD_RNODE_NG_20 0x40
|
#define BOARD_RNODE_NG_20 0x40
|
||||||
#define BOARD_RNODE_NG_21 0x41
|
#define BOARD_RNODE_NG_21 0x41
|
||||||
@ -156,6 +157,20 @@
|
|||||||
const int pin_led_rx = 14;
|
const int pin_led_rx = 14;
|
||||||
const int pin_led_tx = 32;
|
const int pin_led_tx = 32;
|
||||||
#define HAS_BLUETOOTH true
|
#define HAS_BLUETOOTH true
|
||||||
|
#define HAS_CONSOLE true
|
||||||
|
#elif BOARD_MODEL == BOARD_LORA32_V1_0
|
||||||
|
const int pin_cs = 18;
|
||||||
|
const int pin_reset = 14;
|
||||||
|
const int pin_dio = 26;
|
||||||
|
#if defined(EXTERNAL_LEDS)
|
||||||
|
const int pin_led_rx = 25;
|
||||||
|
const int pin_led_tx = 2;
|
||||||
|
#else
|
||||||
|
const int pin_led_rx = 2;
|
||||||
|
const int pin_led_tx = 2;
|
||||||
|
#endif
|
||||||
|
#define HAS_DISPLAY true
|
||||||
|
#define HAS_BLUETOOTH true
|
||||||
#define HAS_CONSOLE true
|
#define HAS_CONSOLE true
|
||||||
#elif BOARD_MODEL == BOARD_LORA32_V2_0
|
#elif BOARD_MODEL == BOARD_LORA32_V2_0
|
||||||
const int pin_cs = 18;
|
const int pin_cs = 18;
|
||||||
|
11
Display.h
11
Display.h
@ -26,7 +26,7 @@
|
|||||||
#define DISP_RST 13
|
#define DISP_RST 13
|
||||||
#define DISP_ADDR 0x3D
|
#define DISP_ADDR 0x3D
|
||||||
// #define DISP_ADDR 0x3C
|
// #define DISP_ADDR 0x3C
|
||||||
#elif BOARD_MODEL == BOARD_HELTEC32_V2
|
#elif BOARD_MODEL == BOARD_HELTEC32_V2 || BOARD_MODEL == BOARD_LORA32_V1_0
|
||||||
#define DISP_RST 16
|
#define DISP_RST 16
|
||||||
#define DISP_ADDR 0x3C
|
#define DISP_ADDR 0x3C
|
||||||
#define SCL_OLED 15
|
#define SCL_OLED 15
|
||||||
@ -87,7 +87,7 @@ void set_contrast(Adafruit_SSD1306 *display, uint8_t contrast) {
|
|||||||
|
|
||||||
bool display_init() {
|
bool display_init() {
|
||||||
#if HAS_DISPLAY
|
#if HAS_DISPLAY
|
||||||
#if BOARD_MODEL == BOARD_RNODE_NG_20 || BOARD_MODEL == BOARD_LORA32_V2_0
|
#if BOARD_MODEL == BOARD_RNODE_NG_20 || BOARD_MODEL == BOARD_LORA32_V2_0 || BOARD_LORA32_V1_0
|
||||||
int pin_display_en = 16;
|
int pin_display_en = 16;
|
||||||
digitalWrite(pin_display_en, LOW);
|
digitalWrite(pin_display_en, LOW);
|
||||||
delay(50);
|
delay(50);
|
||||||
@ -96,6 +96,10 @@ bool display_init() {
|
|||||||
Wire.begin(SDA_OLED, SCL_OLED);
|
Wire.begin(SDA_OLED, SCL_OLED);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if BOARD_MODEL == BOARD_LORA32_V1_0
|
||||||
|
Wire.begin(SDA_OLED, SCL_OLED);
|
||||||
|
#endif
|
||||||
|
|
||||||
if(!display.begin(SSD1306_SWITCHCAPVCC, DISP_ADDR)) {
|
if(!display.begin(SSD1306_SWITCHCAPVCC, DISP_ADDR)) {
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
@ -106,6 +110,9 @@ bool display_init() {
|
|||||||
#elif BOARD_MODEL == BOARD_RNODE_NG_21
|
#elif BOARD_MODEL == BOARD_RNODE_NG_21
|
||||||
disp_mode = DISP_MODE_PORTRAIT;
|
disp_mode = DISP_MODE_PORTRAIT;
|
||||||
display.setRotation(3);
|
display.setRotation(3);
|
||||||
|
#elif BOARD_MODEL == BOARD_LORA32_V1_0
|
||||||
|
disp_mode = DISP_MODE_PORTRAIT;
|
||||||
|
display.setRotation(3);
|
||||||
#elif BOARD_MODEL == BOARD_LORA32_V2_0
|
#elif BOARD_MODEL == BOARD_LORA32_V2_0
|
||||||
disp_mode = DISP_MODE_PORTRAIT;
|
disp_mode = DISP_MODE_PORTRAIT;
|
||||||
display.setRotation(3);
|
display.setRotation(3);
|
||||||
|
33
Makefile
33
Makefile
@ -58,6 +58,12 @@ firmware-mega2560:
|
|||||||
firmware-tbeam:
|
firmware-tbeam:
|
||||||
arduino-cli compile --fqbn esp32:esp32:t-beam -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0x33\""
|
arduino-cli compile --fqbn esp32:esp32:t-beam -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0x33\""
|
||||||
|
|
||||||
|
firmware-lora32_v10:
|
||||||
|
arduino-cli compile --fqbn esp32:esp32:ttgo-lora32 -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0x39\""
|
||||||
|
|
||||||
|
firmware-lora32_v10_extled:
|
||||||
|
arduino-cli compile --fqbn esp32:esp32:ttgo-lora32 -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0x38\" \"-DEXTERNAL_LEDS=true\""
|
||||||
|
|
||||||
firmware-lora32_v20:
|
firmware-lora32_v20:
|
||||||
arduino-cli compile --fqbn esp32:esp32:ttgo-lora32 -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0x36\" \"-DEXTERNAL_LEDS=true\""
|
arduino-cli compile --fqbn esp32:esp32:ttgo-lora32 -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0x36\" \"-DEXTERNAL_LEDS=true\""
|
||||||
|
|
||||||
@ -99,6 +105,13 @@ upload-tbeam:
|
|||||||
@sleep 3
|
@sleep 3
|
||||||
python ./Release/esptool/esptool.py --chip esp32 --port /dev/ttyUSB1 --baud 921600 --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq 80m --flash_size 4MB 0x210000 ./Release/console_image.bin
|
python ./Release/esptool/esptool.py --chip esp32 --port /dev/ttyUSB1 --baud 921600 --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq 80m --flash_size 4MB 0x210000 ./Release/console_image.bin
|
||||||
|
|
||||||
|
upload-lora32_v10:
|
||||||
|
arduino-cli upload -p /dev/ttyUSB0 --fqbn esp32:esp32:ttgo-lora32
|
||||||
|
@sleep 1
|
||||||
|
rnodeconf /dev/ttyUSB0 --firmware-hash $$(./partition_hashes ./build/esp32.esp32.ttgo-lora32/RNode_Firmware.ino.bin)
|
||||||
|
@sleep 3
|
||||||
|
python ./Release/esptool/esptool.py --chip esp32 --port /dev/ttyUSB0 --baud 921600 --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq 80m --flash_size 4MB 0x210000 ./Release/console_image.bin
|
||||||
|
|
||||||
upload-lora32_v20:
|
upload-lora32_v20:
|
||||||
arduino-cli upload -p /dev/ttyUSB1 --fqbn esp32:esp32:ttgo-lora32
|
arduino-cli upload -p /dev/ttyUSB1 --fqbn esp32:esp32:ttgo-lora32
|
||||||
@sleep 1
|
@sleep 1
|
||||||
@ -144,7 +157,7 @@ upload-featheresp32:
|
|||||||
|
|
||||||
release: release-all
|
release: release-all
|
||||||
|
|
||||||
release-all: console-site spiffs-image release-rnode release-mega2560 release-tbeam release-lora32_v20 release-lora32_v21 release-lora32_v20_extled release-lora32_v21_extled release-featheresp32 release-genericesp32 release-heltec32_v2 release-heltec32_v2_extled release-rnode_ng_20 release-rnode_ng_21 release-hashes
|
release-all: console-site spiffs-image release-rnode release-mega2560 release-tbeam release-lora32_v10 release-lora32_v20 release-lora32_v21 release-lora32_v10_extled release-lora32_v20_extled release-lora32_v21_extled release-featheresp32 release-genericesp32 release-heltec32_v2 release-heltec32_v2_extled release-rnode_ng_20 release-rnode_ng_21 release-hashes
|
||||||
|
|
||||||
release-hashes:
|
release-hashes:
|
||||||
python ./release_hashes.py > ./Release/release.json
|
python ./release_hashes.py > ./Release/release.json
|
||||||
@ -163,6 +176,15 @@ release-tbeam:
|
|||||||
zip --junk-paths ./Release/rnode_firmware_tbeam.zip ./Release/esptool/esptool.py ./Release/console_image.bin build/rnode_firmware_tbeam.boot_app0 build/rnode_firmware_tbeam.bin build/rnode_firmware_tbeam.bootloader build/rnode_firmware_tbeam.partitions
|
zip --junk-paths ./Release/rnode_firmware_tbeam.zip ./Release/esptool/esptool.py ./Release/console_image.bin build/rnode_firmware_tbeam.boot_app0 build/rnode_firmware_tbeam.bin build/rnode_firmware_tbeam.bootloader build/rnode_firmware_tbeam.partitions
|
||||||
rm -r build
|
rm -r build
|
||||||
|
|
||||||
|
release-lora32_v10:
|
||||||
|
arduino-cli compile --fqbn esp32:esp32:ttgo-lora32 -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0x39\""
|
||||||
|
cp ~/.arduino15/packages/esp32/hardware/esp32/2.0.?/tools/partitions/boot_app0.bin build/rnode_firmware_lora32v10.boot_app0
|
||||||
|
cp build/esp32.esp32.ttgo-lora32/RNode_Firmware.ino.bin build/rnode_firmware_lora32v10.bin
|
||||||
|
cp build/esp32.esp32.ttgo-lora32/RNode_Firmware.ino.bootloader.bin build/rnode_firmware_lora32v10.bootloader
|
||||||
|
cp build/esp32.esp32.ttgo-lora32/RNode_Firmware.ino.partitions.bin build/rnode_firmware_lora32v10.partitions
|
||||||
|
zip --junk-paths ./Release/rnode_firmware_lora32v10.zip ./Release/esptool/esptool.py ./Release/console_image.bin build/rnode_firmware_lora32v10.boot_app0 build/rnode_firmware_lora32v10.bin build/rnode_firmware_lora32v10.bootloader build/rnode_firmware_lora32v10.partitions
|
||||||
|
rm -r build
|
||||||
|
|
||||||
release-lora32_v20:
|
release-lora32_v20:
|
||||||
arduino-cli compile --fqbn esp32:esp32:ttgo-lora32 -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0x36\""
|
arduino-cli compile --fqbn esp32:esp32:ttgo-lora32 -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0x36\""
|
||||||
cp ~/.arduino15/packages/esp32/hardware/esp32/2.0.?/tools/partitions/boot_app0.bin build/rnode_firmware_lora32v20.boot_app0
|
cp ~/.arduino15/packages/esp32/hardware/esp32/2.0.?/tools/partitions/boot_app0.bin build/rnode_firmware_lora32v20.boot_app0
|
||||||
@ -181,6 +203,15 @@ release-lora32_v21:
|
|||||||
zip --junk-paths ./Release/rnode_firmware_lora32v21.zip ./Release/esptool/esptool.py ./Release/console_image.bin build/rnode_firmware_lora32v21.boot_app0 build/rnode_firmware_lora32v21.bin build/rnode_firmware_lora32v21.bootloader build/rnode_firmware_lora32v21.partitions
|
zip --junk-paths ./Release/rnode_firmware_lora32v21.zip ./Release/esptool/esptool.py ./Release/console_image.bin build/rnode_firmware_lora32v21.boot_app0 build/rnode_firmware_lora32v21.bin build/rnode_firmware_lora32v21.bootloader build/rnode_firmware_lora32v21.partitions
|
||||||
rm -r build
|
rm -r build
|
||||||
|
|
||||||
|
release-lora32_v10_extled:
|
||||||
|
arduino-cli compile --fqbn esp32:esp32:ttgo-lora32 -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0x38\" \"-DEXTERNAL_LEDS=true\""
|
||||||
|
cp ~/.arduino15/packages/esp32/hardware/esp32/2.0.?/tools/partitions/boot_app0.bin build/rnode_firmware_lora32v10.boot_app0
|
||||||
|
cp build/esp32.esp32.ttgo-lora32/RNode_Firmware.ino.bin build/rnode_firmware_lora32v10.bin
|
||||||
|
cp build/esp32.esp32.ttgo-lora32/RNode_Firmware.ino.bootloader.bin build/rnode_firmware_lora32v10.bootloader
|
||||||
|
cp build/esp32.esp32.ttgo-lora32/RNode_Firmware.ino.partitions.bin build/rnode_firmware_lora32v10.partitions
|
||||||
|
zip --junk-paths ./Release/rnode_firmware_lora32v10.zip ./Release/esptool/esptool.py ./Release/console_image.bin build/rnode_firmware_lora32v10.boot_app0 build/rnode_firmware_lora32v10.bin build/rnode_firmware_lora32v10.bootloader build/rnode_firmware_lora32v10.partitions
|
||||||
|
rm -r build
|
||||||
|
|
||||||
release-lora32_v20_extled:
|
release-lora32_v20_extled:
|
||||||
arduino-cli compile --fqbn esp32:esp32:ttgo-lora32 -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0x36\" \"-DEXTERNAL_LEDS=true\""
|
arduino-cli compile --fqbn esp32:esp32:ttgo-lora32 -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0x36\" \"-DEXTERNAL_LEDS=true\""
|
||||||
cp ~/.arduino15/packages/esp32/hardware/esp32/2.0.?/tools/partitions/boot_app0.bin build/rnode_firmware_lora32v20.boot_app0
|
cp ~/.arduino15/packages/esp32/hardware/esp32/2.0.?/tools/partitions/boot_app0.bin build/rnode_firmware_lora32v20.boot_app0
|
||||||
|
@ -65,6 +65,7 @@ The RNode Firmware supports the following boards:
|
|||||||
- Handheld v2.x RNodes from [unsigned.io](https://unsigned.io/shop/product/handheld-rnode)
|
- Handheld v2.x RNodes from [unsigned.io](https://unsigned.io/shop/product/handheld-rnode)
|
||||||
- Original v1.x RNodes from [unsigned.io](https://unsigned.io/shop/product/rnode)
|
- Original v1.x RNodes from [unsigned.io](https://unsigned.io/shop/product/rnode)
|
||||||
- LilyGO T-Beam v1.1 devices
|
- LilyGO T-Beam v1.1 devices
|
||||||
|
- LilyGO LoRa32 v1.0 devices
|
||||||
- LilyGO LoRa32 v2.0 devices
|
- LilyGO LoRa32 v2.0 devices
|
||||||
- LilyGO LoRa32 v2.1 devices
|
- LilyGO LoRa32 v2.1 devices
|
||||||
- Heltec LoRa32 v2 devices
|
- Heltec LoRa32 v2 devices
|
||||||
@ -79,7 +80,7 @@ The RNode Firmware supports all transceiver modules based on **Semtech SX1276**
|
|||||||
Support for **SX1262**, **SX1268** and **SX1280** is being implemented. Please support the project with donations if you want this faster!
|
Support for **SX1262**, **SX1268** and **SX1280** is being implemented. Please support the project with donations if you want this faster!
|
||||||
|
|
||||||
## Getting Started Fast
|
## Getting Started Fast
|
||||||
You can download and flash the firmware to all the supported boards using the [RNode Config Utility](https://github.com/markqvist/rnodeconfigutil). All firmware releases are now handled and installed directly through the `rnodeconf` utility, which is inclueded in the `rns` package. It can be installed via `pip`:
|
You can download and flash the firmware to all the supported boards using the [RNode Config Utility](https://github.com/markqvist/rnodeconfigutil). All firmware releases are now handled and installed directly through the `rnodeconf` utility, which is included in the `rns` package. It can be installed via `pip`:
|
||||||
|
|
||||||
```
|
```
|
||||||
# Install rnodeconf via rns package
|
# Install rnodeconf via rns package
|
||||||
|
12
Utilities.h
12
Utilities.h
@ -123,6 +123,18 @@ uint8_t boot_vector = 0x00;
|
|||||||
void led_rx_off() { digitalWrite(pin_led_rx, LOW); }
|
void led_rx_off() { digitalWrite(pin_led_rx, LOW); }
|
||||||
void led_tx_on() { digitalWrite(pin_led_tx, LOW); }
|
void led_tx_on() { digitalWrite(pin_led_tx, LOW); }
|
||||||
void led_tx_off() { digitalWrite(pin_led_tx, HIGH); }
|
void led_tx_off() { digitalWrite(pin_led_tx, HIGH); }
|
||||||
|
#elif BOARD_MODEL == BOARD_LORA32_V1_0
|
||||||
|
#if defined(EXTERNAL_LEDS)
|
||||||
|
void led_rx_on() { digitalWrite(pin_led_rx, HIGH); }
|
||||||
|
void led_rx_off() { digitalWrite(pin_led_rx, LOW); }
|
||||||
|
void led_tx_on() { digitalWrite(pin_led_tx, HIGH); }
|
||||||
|
void led_tx_off() { digitalWrite(pin_led_tx, LOW); }
|
||||||
|
#else
|
||||||
|
void led_rx_on() { digitalWrite(pin_led_rx, HIGH); }
|
||||||
|
void led_rx_off() { digitalWrite(pin_led_rx, LOW); }
|
||||||
|
void led_tx_on() { digitalWrite(pin_led_tx, HIGH); }
|
||||||
|
void led_tx_off() { digitalWrite(pin_led_tx, LOW); }
|
||||||
|
#endif
|
||||||
#elif BOARD_MODEL == BOARD_LORA32_V2_0
|
#elif BOARD_MODEL == BOARD_LORA32_V2_0
|
||||||
#if defined(EXTERNAL_LEDS)
|
#if defined(EXTERNAL_LEDS)
|
||||||
void led_rx_on() { digitalWrite(pin_led_rx, HIGH); }
|
void led_rx_on() { digitalWrite(pin_led_rx, HIGH); }
|
||||||
|
Loading…
Reference in New Issue
Block a user