PaulSchulz / esphome-lora-sx126x

Component to use Lora on SX126X based boards
MIT License
8 stars 5 forks source link

Heltec Lora 32V3.2 not compile #7

Open userosos opened 1 day ago

userosos commented 1 day ago

Config:

esphome:
  name: lora32-home
  friendly_name: Lora32_home
  libraries:
     - "SPI"
     - "Ticker"
     - "SX126x-Arduino"

esp32:
  board: esp32-s3-devkitc-1
  framework:
    type: arduino

external_components:
  - source:
      type: git
      url: https://github.com/PaulSchulz/esphome-lora-sx126x
      ref: main
    components: ["lora_sx126x"]

# Enable logging
logger:

# Enable Home Assistant API
api:
  encryption:
    key: ""

ota:
  - platform: esphome
    password: ""

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Lora32-Home Fallback Hotspot"
    password: ""

#
#web_server:
#  port: 80

lora_sx126x:
  # optional, with sensile defaults, if possible from board id.
  pin_lora_reset: 12
  pin_lora_dio_1: 14
  pin_lora_busy:  13
  pin_lora_nss:    8
  pin_lora_sclk:   9
  pin_lora_miso:  11
  pin_lora_mosi:  10
  radio_txen:     -1
  radio_rxen:     -1
  use_dio2_ant_switch: true
  use_dio3_tcx0:       true
  use_dxo3_ant_switch: false

  # required - depends on region and frequency band being used
  rf_frequency: 915000000
  # optional (sensible defaults)
  tx_output_power:       22
  lora_bandwidth:         0
  lora_spreading_factor:  7
  lora_codingrate:        1
  lora_preamble_length:   8
  lora_symbol_timeout:    0
#  lora_fix_length_layload_on: false
  lora_iq_inversion_on:       false
  rx_timeout_value:    3000
  tx_timeout_value:    3000

text_sensor:
  - platform: lora_sx126x
    id: message
    name: LoRa Message

# Is there a component for this in ESPHome?
# Sending a string to a component.
#text_message:
#  - platform: lora_sx126x
#    id: send_message
#    name: "Send LoRa Message"

#binary_sensor:
#  - platform: lora_sx126x
#    id: lora_sensor
#    name: LoRa Sensor
#    on_string:  "@+++"
#    off_string: "@---"

switch:
  - platform: lora_sx126x
    id: lora_switch
    name: LoRa Switch
    on_string: "@+++"
    off_string: "@---"
INFO ESPHome 2024.10.3
INFO Reading configuration /config/esphome/lora32-home.yaml...
Failed config

lora_sx126x: [source /config/esphome/lora32-home.yaml:48]
  pin_lora_reset: 12
  pin_lora_dio_1: 14
  pin_lora_busy: 13
  pin_lora_nss: 8
  pin_lora_sclk: 9
  pin_lora_miso: 11
  pin_lora_mosi: 10
  radio_txen: -1
  radio_rxen: -1

  [use_dio2_ant_switch] is an invalid option for [lora_sx126x]. Please check the indentation.
  use_dio2_ant_switch: True

  [use_dio3_tcx0] is an invalid option for [lora_sx126x]. Please check the indentation.
  use_dio3_tcx0: True

  [use_dxo3_ant_switch] is an invalid option for [lora_sx126x]. Please check the indentation.
  use_dxo3_ant_switch: False
  rf_frequency: 915000000
  tx_output_power: 22

If i uncomment sensors:

text_sensor:
  - platform: lora_sx126x
    id: message
    name: LoRa Message

# Is there a component for this in ESPHome?
# Sending a string to a component.
text_message:
  - platform: lora_sx126x
    id: send_message
    name: "Send LoRa Message"

binary_sensor:
  - platform: lora_sx126x
    id: lora_sensor
    name: LoRa Sensor
    on_string:  "@+++"
    off_string: "@---"

switch:
  - platform: lora_sx126x
    id: lora_switch
    name: LoRa Switch
    on_string: "@+++"
    off_string: "@---"

Compile:

INFO ESPHome 2024.10.3
INFO Reading configuration /config/esphome/lora32-home.yaml...
INFO Unable to import component text_message: No module named 'esphome.components.text_message'
Failed config

text_message: [source /config/esphome/lora32-home.yaml:83]

  Component not found: text_message.
  - platform: lora_sx126x
    id: send_message
    name: Send LoRa Message
userosos commented 6 hours ago

In the end, I have 2 transceivers. I want to receive and transmit data between these sensors using LoRa. One of the receivers will be located at home and will send data (toggle switches and/or receive data from remote sensors) to Home Assistant (HA) via ESPHome.

PaulSchulz commented 4 hours ago

I have committed some changes.. I have a receiver, but still need to finish the transmitter code.

On Fri, 22 Nov 2024, 21:50 userosos, @.***> wrote:

In the end, I have 2 transceivers. I want to receive and transmit data between these sensors using LoRa. One of the receivers will be located at home and will send data (toggle switches and/or receive data from remote sensors) to Home Assistant (HA) via ESPHome.

— Reply to this email directly, view it on GitHub https://github.com/PaulSchulz/esphome-lora-sx126x/issues/7#issuecomment-2493522070, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAVLALAMBLZWWPTQMAC2ZL2B4HP3AVCNFSM6AAAAABSHPKTO6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIOJTGUZDEMBXGA . You are receiving this because you are subscribed to this thread.Message ID: @.***>

userosos commented 2 hours ago

I have committed some changes.. I have a receiver, but still need to finish the transmitter code.

Ok. I wait. Thx!