Files
ESPHome/lora1.yaml

93 lines
1.6 KiB
YAML

esphome:
name: "heltec"
esp32:
variant: esp32s3
flash_size: 8MB
cpu_frequency: 240MHZ
framework:
type: esp-idf
logger:
hardware_uart: UART0
api:
ota:
platform: esphome
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
# SPI bus for LoRa radio
spi:
clk_pin: GPIO9
mosi_pin: GPIO10
miso_pin: GPIO11
# I2C for OLED display
i2c:
sda: GPIO17
scl: GPIO18
frequency: 400kHz
# FSK Radio Configuration (SX1262)
sx126x:
dio1_pin: GPIO14
cs_pin: GPIO8
busy_pin: GPIO13
rst_pin: GPIO12
pa_power: 3
bandwidth: 78_2kHz
crc_enable: true
frequency: 433920000
modulation: FSK
rx_start: true
payload_length: 0
hw_version: sx1262
bitrate: 4800
rf_switch: true
sync_value: [0x33, 0x33]
preamble_size: 4
preamble_detect: 2
tcxo_voltage: 1_8V
tcxo_delay: 5ms
on_packet:
then:
- lambda: |-
ESP_LOGD("fsk", "Packet RSSI: %.2f dBm, SNR: %.2f dB, Data: %s",
rssi, snr, format_hex(x).c_str());
button:
- platform: template
name: "Send FSK Packet"
on_press:
then:
- sx126x.send_packet:
data: [0xC5, 0x51, 0x78, 0x82, 0xB7, 0xF9, 0x9C, 0x5C]
# OLED Display
display:
- platform: ssd1306_i2c
model: "SSD1306 128x64"
reset_pin: GPIO21
address: 0x3C
lambda: |-
it.printf(0, 0, id(font1), "Heltec V3");
it.printf(0, 16, id(font1), "WiFi LoRa 32");
it.printf(0, 32, id(font1), "%.1f dBm", id(wifi_signal_db).state);
font:
- file: "gfonts://Roboto"
id: font1
size: 14
sensor:
- platform: wifi_signal
id: wifi_signal_db
name: "WiFi Signal"
update_interval: 60s