Giter Club home page Giter Club logo

esphome-hs2xx3a-custom-component's Introduction

This repo houses development of a custom component to support the LeapMMW HS2xx3A series of mmWave sensors, also branded as the DFRobot sen0395.

Installation:

  • Download the leapmmw_sensor.h file into your esphome configuration directory
  • Include the following in the YAML configuration for your ESP board:
    substitutions:
      device_name: leapmmw
    
      # This will vary based on your board
      uart_tx_pin: TX
      
      # This will vary based on your board
      uart_rx_pin: RX
      
      # This will vary based on your board
      gpio_pin: D0
      
      # (Optional) Path to the leapmmw_sensor.h file relative to your esphome configuration directory.
      # header_file: leapmmw_sensor.h
    
    packages:
      remote_package:
        url: https://github.com/hjmcnew/esphome-hs2xx3a-custom-component
        ref: release
        files: [packages/uart.yml, packages/leapmmw_sensor.yml]
        # For additional debugging replace the above line with:
        # files: [packages/uart_debug.yml, packages/leapmmw_sensor.yml]
    

esphome-hs2xx3a-custom-component's People

Contributors

agrant-dxc avatar crlogic avatar hjmcnew avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

esphome-hs2xx3a-custom-component's Issues

Compilation error

Since update of ESPHome to version 2023.4.0 I get this error when trying to compile the firmware

Processing mps-vardagsrummet (board: esp32dev; framework: arduino; platform: platformio/espressif32 @ 5.3.0)

HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash

  • toolchain-xtensa-esp32 @ 8.4.0+2021r2-patch5
    Dependency Graph
    |-- WiFi @ 2.0.0
    |-- ESPmDNS @ 2.0.0
    |-- Update @ 2.0.0
    |-- noise-c @ 0.1.4
    | |-- libsodium @ 1.10018.1
    |-- Wire @ 2.0.0
    Compiling /data/mps-vardagsrummet/.pioenvs/mps-vardagsrummet/src/main.cpp.o
    Compiling /data/mps-vardagsrummet/.pioenvs/mps-vardagsrummet/lib64d/WiFi/WiFiScan.cpp.o
    Compiling /data/mps-vardagsrummet/.pioenvs/mps-vardagsrummet/lib64d/WiFi/WiFiServer.cpp.o
    Compiling /data/mps-vardagsrummet/.pioenvs/mps-vardagsrummet/lib64d/WiFi/WiFiUdp.cpp.o
    In file included from src/main.cpp:116:
    src/leapmmw_sensor.h: In function 'void publishTarget(std::__cxx11::string, float, float)':
    src/leapmmw_sensor.h:9:33: error: 'class esphome::StringRef' has no member named 'substr'; did you mean 'c_str'?
    if(name.size() > 10 && name.substr(0, 8) == target) {
    ^~~~~~
    c_str
    src/leapmmw_sensor.h:10:15: error: 'class esphome::StringRef' has no member named 'substr'; did you mean 'c_str'?
    if(name.substr(9, 3) == "dis") {
    ^~~~~~
    c_str
    src/leapmmw_sensor.h:12:22: error: 'class esphome::StringRef' has no member named 'substr'; did you mean 'c_str'?
    } else if(name.substr(9, 3) == "SNR") {
    ^~~~~~
    c_str
    Compiling /data/mps-vardagsrummet/.pioenvs/mps-vardagsrummet/lib915/ESPmDNS/ESPmDNS.cpp.o
    Archiving /data/mps-vardagsrummet/.pioenvs/mps-vardagsrummet/lib64d/libWiFi.a
    Compiling /data/mps-vardagsrummet/.pioenvs/mps-vardagsrummet/libbc6/Update/HttpsOTAUpdate.cpp.o
    Compiling /data/mps-vardagsrummet/.pioenvs/mps-vardagsrummet/libbc6/Update/Updater.cpp.o
    Compiling /data/mps-vardagsrummet/.pioenvs/mps-vardagsrummet/lib106/libsodium/crypto_aead/chacha20poly1305/sodium/aead_chacha20poly1305.c.o
    *** [/data/mps-vardagsrummet/.pioenvs/mps-vardagsrummet/src/main.cpp.o] Error 1
    ========================== [FAILED] Took 2.57 seconds ==========================

Build errors with esp-idf instead of arduino framework

When building with the arduino framework we see:

In file included from src/main.cpp:122:
src/leapmmw_sensor.h: In member function 'virtual void leapmmw::loop()':
src/leapmmw_sensor.h:167:28: warning: 'setled_state' may be used uninitialized in this function [-Wmaybe-uninitialized]
  167 |               publishSwitch("led", setled_state);
      |               ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~

When building with the esp-idf framework this is treated as an error:

In file included from src/main.cpp:107:
src/leapmmw_sensor.h: In member function 'virtual void leapmmw::loop()':
src/leapmmw_sensor.h:167:28: error: 'setled_state' may be used uninitialized in this function [-Werror=maybe-uninitialized]
               publishSwitch("led", setled_state);
               ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
[...snip...]
cc1plus: some warnings being treated as errors
*** [/data/devtest/.pioenvs/devtest/src/main.o] Error 1

Workaround

While this may break LED functionality comment out line 167 in the .h file.

From

publishSwitch("led", setled_state);

To

// publishSwitch("led", setled_state);

I haven't tested the workaround with real hardware because I don't have an esp-idf board with the sensor attached. Will work on getting that set up.

UART RX not working

I'm having trouble getting the items based on UART working. The sensor itself is working, so the GPIO is working correctly. UART TX is also working; I'm able to turn the led on/off and adjusting the sensitivity seems to work as well. However, everything that relies on UART RX shows as unknown. Based on the logs, it seems to receiving exactly what it sends. My config and logs are below.

I'm using a Wemos D1 Mini32 with the DFRobot SEN0395 wired up with TX - IO22, RX - IO21, IO1 - IO17, IO2 - IO16, GND - GND, and V - VCC:

image

Config:

esphome:
  name: living_room_mmwave_sensor
  platform: ESP32
  board: wemos_d1_mini32

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_pass
  manual_ip:
    static_ip: 192.168.5.45
    gateway: 192.168.5.1
    subnet: 255.255.255.0

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Living Room mmWave Sensor"
    password: !secret wifi_fallback_pass

captive_portal:

logger:

# Enable Home Assistant API
api:
  password: !secret api_pass
  encryption:
    key: !secret api_key
ota:
  password: !secret ota_pass

# Sensor Setup
substitutions:
  device_name: leapmmw

  # This will vary based on your board
  uart_tx_pin: GPIO21

  # This will vary based on your board
  uart_rx_pin: GPIO22

  # This will vary based on your board
  gpio_pin: GPIO16

  header_file: leapmmw_sensor.h

packages:
  remote_package:
    url: https://github.com/hjmcnew/esphome-hs2xx3a-custom-component
    ref: release
    # files: [packages/uart.yml, packages/leapmmw_sensor.yml]
    # For additional debugging replace the above line with:
    files: [packages/uart_debug.yml, packages/leapmmw_sensor.yml]

Logs:

[15:39:17][C][wifi:491]: WiFi:
[15:39:17][C][wifi:353]:   Local MAC: 94:B5:55:2C:76:4C
[15:39:17][C][wifi:354]:   SSID: [redacted]
[15:39:17][C][wifi:355]:   IP Address: 192.168.5.45
[15:39:17][C][wifi:357]:   BSSID: [redacted]
[15:39:17][C][wifi:358]:   Hostname: 'living_room_mmwave_sensor'
[15:39:17][C][wifi:360]:   Signal strength: -62 dB ▂▄▆█
[15:39:17][C][wifi:364]:   Channel: 1
[15:39:17][C][wifi:365]:   Subnet: 255.255.255.0
[15:39:17][C][wifi:366]:   Gateway: 192.168.5.1
[15:39:17][C][wifi:367]:   DNS1: 0.0.0.0
[15:39:17][C][wifi:368]:   DNS2: 0.0.0.0
[15:39:17][C][logger:275]: Logger:
[15:39:17][C][logger:276]:   Level: DEBUG
[15:39:17][C][logger:277]:   Log Baud Rate: 115200
[15:39:17][C][logger:278]:   Hardware UART: UART0
[15:39:17][C][logger:280]:   Level for 'sensor': INFO
[15:39:17][C][uart.arduino_esp32:107]: UART Bus:
[15:39:17][C][uart.arduino_esp32:108]:   TX Pin: GPIO21
[15:39:17][C][uart.arduino_esp32:109]:   RX Pin: GPIO22
[15:39:17][C][uart.arduino_esp32:111]:   RX Buffer Size: 256
[15:39:17][C][uart.arduino_esp32:113]:   Baud Rate: 115200 baud
[15:39:17][C][uart.arduino_esp32:114]:   Data Bits: 8
[15:39:17][C][uart.arduino_esp32:115]:   Parity: NONE
[15:39:17][C][uart.arduino_esp32:116]:   Stop bits: 1
[15:39:17][C][template.sensor:023]: Template Sensor 'target_1_distance_m'
[15:39:17][C][template.sensor:023]:   State Class: ''
[15:39:17][C][template.sensor:023]:   Unit of Measurement: ''
[15:39:17][C][template.sensor:023]:   Accuracy Decimals: 1
[15:39:17][C][template.sensor:024]:   Update Interval: 60.0s
[15:39:17][C][template.sensor:023]: Template Sensor 'target_2_distance_m'
[15:39:17][C][template.sensor:023]:   State Class: ''
[15:39:17][C][template.sensor:023]:   Unit of Measurement: ''
[15:39:17][C][template.sensor:023]:   Accuracy Decimals: 1
[15:39:17][C][template.sensor:024]:   Update Interval: 60.0s
[15:39:18][C][template.sensor:023]: Template Sensor 'target_3_distance_m'
[15:39:18][C][template.sensor:023]:   State Class: ''
[15:39:18][C][template.sensor:023]:   Unit of Measurement: ''
[15:39:18][C][template.sensor:023]:   Accuracy Decimals: 1
[15:39:18][C][template.sensor:024]:   Update Interval: 60.0s
[15:39:18][C][template.sensor:023]: Template Sensor 'target_4_distance_m'
[15:39:18][C][template.sensor:023]:   State Class: ''
[15:39:18][C][template.sensor:023]:   Unit of Measurement: ''
[15:39:18][C][template.sensor:023]:   Accuracy Decimals: 1
[15:39:18][C][template.sensor:024]:   Update Interval: 60.0s
[15:39:18][C][template.sensor:023]: Template Sensor 'target_1_SNR'
[15:39:18][C][template.sensor:023]:   State Class: ''
[15:39:18][C][template.sensor:023]:   Unit of Measurement: ''
[15:39:18][C][template.sensor:023]:   Accuracy Decimals: 1
[15:39:18][C][template.sensor:024]:   Update Interval: 60.0s
[15:39:18][C][template.sensor:023]: Template Sensor 'target_2_SNR'
[15:39:18][C][template.sensor:023]:   State Class: ''
[15:39:18][C][template.sensor:023]:   Unit of Measurement: ''
[15:39:18][C][template.sensor:023]:   Accuracy Decimals: 1
[15:39:18][C][template.sensor:024]:   Update Interval: 60.0s
[15:39:18][C][template.sensor:023]: Template Sensor 'target_3_SNR'
[15:39:18][C][template.sensor:023]:   State Class: ''
[15:39:18][C][template.sensor:023]:   Unit of Measurement: ''
[15:39:18][C][template.sensor:023]:   Accuracy Decimals: 1
[15:39:18][C][template.sensor:024]:   Update Interval: 60.0s
[15:39:18][C][template.sensor:023]: Template Sensor 'target_4_SNR'
[15:39:18][C][template.sensor:023]:   State Class: ''
[15:39:18][C][template.sensor:023]:   Unit of Measurement: ''
[15:39:18][C][template.sensor:023]:   Accuracy Decimals: 1
[15:39:18][C][template.sensor:024]:   Update Interval: 60.0s
[15:39:18][C][template.sensor:023]: Template Sensor 'num_targets'
[15:39:18][C][template.sensor:023]:   State Class: ''
[15:39:18][C][template.sensor:023]:   Unit of Measurement: ''
[15:39:18][C][template.sensor:023]:   Accuracy Decimals: 0
[15:39:18][C][template.sensor:024]:   Update Interval: 60.0s
[15:39:18][C][template.switch:058]: Template Switch 'show_target_stats'
[15:39:18][C][template.switch:059]:   Restore State: NO
[15:39:18][C][template.switch:060]:   Optimistic: YES
[15:39:18][C][template.switch:058]: Template Switch 'mmwave_sensor'
[15:39:18][C][template.switch:059]:   Restore State: NO
[15:39:18][C][template.switch:060]:   Optimistic: YES
[15:39:18][C][template.switch:058]: Template Switch 'led'
[15:39:18][C][template.switch:059]:   Restore State: NO
[15:39:18][C][template.switch:060]:   Optimistic: YES
[15:39:18][C][template.number:050]: Template Number 'distance'
[15:39:18][C][template.number:050]:   Unit of Measurement: 'M'
[15:39:18][C][template.number:051]:   Optimistic: NO
[15:39:18][C][template.number:052]:   Update Interval: 60.0s
[15:39:18][C][template.number:050]: Template Number 'latency'
[15:39:18][C][template.number:050]:   Unit of Measurement: 's'
[15:39:18][C][template.number:051]:   Optimistic: NO
[15:39:18][C][template.number:052]:   Update Interval: 60.0s
[15:39:18][C][template.number:050]: Template Number 'sensitivity'
[15:39:18][C][template.number:051]:   Optimistic: NO
[15:39:18][C][template.number:052]:   Update Interval: 60.0s
[15:39:18][C][gpio.binary_sensor:015]: GPIO Binary Sensor 'mmwave_presence_detection'
[15:39:18][C][gpio.binary_sensor:015]:   Device Class: 'motion'
[15:39:18][C][gpio.binary_sensor:016]:   Pin: GPIO16
[15:39:18][C][safe_mode_switch:026]: Safe Mode Switch 'use_safe_mode'
[15:39:18][C][safe_mode_switch:026]:   Icon: 'mdi:restart-alert'
[15:39:18][C][restart.button:017]: Restart Button 'Restart_ESP_leapmmw'
[15:39:18][C][captive_portal:088]: Captive Portal:
[15:39:18][C][mdns:094]: mDNS:
[15:39:18][C][mdns:095]:   Hostname: living_room_mmwave_sensor
[15:39:18][C][ota:085]: Over-The-Air Updates:
[15:39:18][C][ota:086]:   Address: 192.168.5.45:3232
[15:39:18][C][ota:089]:   Using Password.
[15:39:18][C][api:138]: API Server:
[15:39:18][C][api:139]:   Address: 192.168.5.45:6053
[15:39:18][C][api:141]:   Using noise encryption: YES
[15:39:25][D][binary_sensor:036]: 'mmwave_presence_detection': Sending state OFF
[15:39:44][D][uart_debug:158]: >>> "getSensitivity\r"
[15:39:44][D][uart_debug:158]: <<< "getSensitivity\r"
[15:39:47][D][binary_sensor:036]: 'mmwave_presence_detection': Sending state ON
[15:39:50][D][uart_debug:158]: >>> "getLatency\r"
[15:39:50][D][uart_debug:158]: <<< "getLatency\r"
[15:40:00][D][binary_sensor:036]: 'mmwave_presence_detection': Sending state OFF
[15:40:04][D][binary_sensor:036]: 'mmwave_presence_detection': Sending state ON
[15:40:04][D][uart_debug:158]: >>> "getRange\r"
[15:40:05][D][uart_debug:158]: <<< "getRange\r"
[15:40:10][D][binary_sensor:036]: 'mmwave_presence_detection': Sending state OFF
[15:40:11][D][api:102]: Accepted ::FFFF:C0A8:13F
[15:40:11][D][api.connection:861]: Home Assistant 2022.8.7 (::FFFF:C0A8:13F): Connected successfully
[15:40:12][D][binary_sensor:036]: 'mmwave_presence_detection': Sending state ON
[15:40:20][D][binary_sensor:036]: 'mmwave_presence_detection': Sending state OFF
[15:40:25][D][binary_sensor:036]: 'mmwave_presence_detection': Sending state ON
[15:40:33][D][binary_sensor:036]: 'mmwave_presence_detection': Sending state OFF
[15:40:35][D][binary_sensor:036]: 'mmwave_presence_detection': Sending state ON
[15:40:41][D][binary_sensor:036]: 'mmwave_presence_detection': Sending state OFF
[15:40:44][D][uart_debug:158]: >>> "getSensitivity\r"
[15:40:44][D][uart_debug:158]: <<< "getSensitivity\r"
[15:40:48][D][binary_sensor:036]: 'mmwave_presence_detection': Sending state ON
[15:40:50][D][uart_debug:158]: >>> "getLatency\r"
[15:40:50][D][uart_debug:158]: <<< "getLatency\r"
[15:41:04][D][uart_debug:158]: >>> "getRange\r"
[15:41:05][D][uart_debug:158]: <<< "getRange\r"
[15:41:05][D][binary_sensor:036]: 'mmwave_presence_detection': Sending state OFF
[15:41:27][D][binary_sensor:036]: 'mmwave_presence_detection': Sending state ON
[15:41:33][D][binary_sensor:036]: 'mmwave_presence_detection': Sending state OFF
[15:41:44][D][uart_debug:158]: >>> "getSensitivity\r"
[15:41:44][D][uart_debug:158]: <<< "getSensitivity\r"
[15:41:44][D][binary_sensor:036]: 'mmwave_presence_detection': Sending state ON
[15:41:50][D][uart_debug:158]: >>> "getLatency\r"
[15:41:50][D][uart_debug:158]: <<< "getLatency\r"
[15:41:54][D][binary_sensor:036]: 'mmwave_presence_detection': Sending state OFF
[15:41:57][D][binary_sensor:036]: 'mmwave_presence_detection': Sending state ON
[15:42:03][D][binary_sensor:036]: 'mmwave_presence_detection': Sending state OFF
[15:42:04][D][uart_debug:158]: >>> "getRange\r"
[15:42:05][D][uart_debug:158]: <<< "getRange\r"
[15:42:05][D][binary_sensor:036]: 'mmwave_presence_detection': Sending state ON
[15:42:11][D][binary_sensor:036]: 'mmwave_presence_detection': Sending state OFF
[15:42:19][D][binary_sensor:036]: 'mmwave_presence_detection': Sending state ON
[15:42:25][D][binary_sensor:036]: 'mmwave_presence_detection': Sending state OFF
[15:42:35][D][binary_sensor:036]: 'mmwave_presence_detection': Sending state ON
[15:42:44][D][uart_debug:158]: >>> "getSensitivity\r"
[15:42:44][D][uart_debug:158]: <<< "getSensitivity\r"
[15:42:45][D][binary_sensor:036]: 'mmwave_presence_detection': Sending state OFF
[15:42:50][D][uart_debug:158]: >>> "getLatency\r"
[15:42:50][D][uart_debug:158]: <<< "getLatency\r"
[15:42:58][D][binary_sensor:036]: 'mmwave_presence_detection': Sending state ON
[15:43:04][D][binary_sensor:036]: 'mmwave_presence_detection': Sending state OFF
[15:43:05][D][uart_debug:158]: >>> "getRange\r"
[15:43:05][D][uart_debug:158]: <<< "getRange\r"
[15:43:28][D][binary_sensor:036]: 'mmwave_presence_detection': Sending state ON
[15:43:39][D][binary_sensor:036]: 'mmwave_presence_detection': Sending state OFF
[15:43:44][D][uart_debug:158]: >>> "getSensitivity\r"
[15:43:44][D][uart_debug:158]: <<< "getSensitivity\r"
[15:43:50][D][uart_debug:158]: >>> "getLatency\r"
[15:43:50][D][uart_debug:158]: <<< "getLatency\r"
[15:43:50][D][binary_sensor:036]: 'mmwave_presence_detection': Sending state ON
[15:44:04][D][uart_debug:158]: >>> "getRange\r"
[15:44:05][D][uart_debug:158]: <<< "getRange\r"
[15:44:13][I][ota:105]: Boot seems successful, resetting boot loop counter.
[15:44:13][D][esp32.preferences:113]: Saving 1 preferences to flash...
[15:44:13][D][esp32.preferences:142]: Saving 1 preferences to flash: 0 cached, 1 written, 0 failed
[15:44:44][D][uart_debug:158]: >>> "getSensitivity\r"
[15:44:44][D][uart_debug:158]: <<< "getSensitivity\r"
[15:44:50][D][uart_debug:158]: >>> "getLatency\r"
[15:44:50][D][uart_debug:158]: <<< "getLatency\r"
[15:45:05][D][uart_debug:158]: >>> "getRange\r"
[15:45:05][D][uart_debug:158]: <<< "getRange\r"
[15:45:15][D][binary_sensor:036]: 'mmwave_presence_detection': Sending state OFF
[15:45:23][D][binary_sensor:036]: 'mmwave_presence_detection': Sending state ON
[15:45:34][D][binary_sensor:036]: 'mmwave_presence_detection': Sending state OFF
[15:45:40][D][binary_sensor:036]: 'mmwave_presence_detection': Sending state ON
[15:45:44][D][uart_debug:158]: >>> "getSensitivity\r"
[15:45:44][D][uart_debug:158]: <<< "getSensitivity\r"
[15:45:50][D][uart_debug:158]: >>> "getLatency\r"
[15:45:50][D][uart_debug:158]: <<< "getLatency\r"
[15:46:04][D][uart_debug:158]: >>> "getRange\r"
[15:46:05][D][uart_debug:158]: <<< "getRange\r"
[15:46:44][D][uart_debug:158]: >>> "getSensitivity\r"
[15:46:44][D][uart_debug:158]: <<< "getSensitivity\r"
[15:46:50][D][uart_debug:158]: >>> "getLatency\r"
[15:46:50][D][uart_debug:158]: <<< "getLatency\r"
[15:47:04][D][uart_debug:158]: >>> "getRange\r"
[15:47:05][D][uart_debug:158]: <<< "getRange\r"
[15:47:44][D][uart_debug:158]: >>> "getSensitivity\r"
[15:47:44][D][uart_debug:158]: <<< "getSensitivity\r"
[15:47:50][D][uart_debug:158]: >>> "getLatency\r"
[15:47:50][D][uart_debug:158]: <<< "getLatency\r"

Error installing onto NodeMCU esp32

Hi guys,

I get the following when trying to install onto my esp32. I have tried a few different pin descriptions into GPIO34, D34 etc but it doesnt seem to like it.

I only have a low level of expertise in this...

INFO Reading configuration /config/esphome/lr-motion.yaml...
Failed config

substitutions: None
device_name: leapmmw
uart_tx_pin: TX
uart_rx_pin: RX

Must be string, got <class 'esphome.helpers.EInt'>. did you forget putting quotes around the value?.
gpio_pin: 32
header_file: leapmmw_sensor.h

compile errors

validate works fine no problems but compile fails
my YAML

esphome:
name: esp32-sensor-farm1

esp32:
board: nodemcu-32s
framework:
type: arduino

packages:

remote_package:
url: https://github.com/hjmcnew/esphome-hs2xx3a-custom-component
ref: release
files: [packages/uart.yml, packages/leapmmw_sensor.yml]

substitutions:

device_name: leapmmw

This will vary based on your board

uart_tx_pin: GPIO17

This will vary based on your board

uart_rx_pin: GPIO16

This will vary based on your board

gpio_pin: GPIO19

#header_file: /config/esphome/leapmmw_sensor.h

I left out wifi password and ssid

Failed compile message

Compiling /data/esp32-sensor-farm1/.pioenvs/esp32-sensor-farm1/src/esphome/components/api/api_connection.cpp.o
sh: 1: xtensa-esp32-elf-g++: not found
Compiling /data/esp32-sensor-farm1/.pioenvs/esp32-sensor-farm1/src/esphome/components/api/api_frame_helper.cpp.o
sh: 1: xtensa-esp32-elf-g++: not found
Compiling /data/esp32-sensor-farm1/.pioenvs/esp32-sensor-farm1/src/esphome/components/api/api_pb2.cpp.o
sh: 1: xtensa-esp32-elf-g++: not found
*** [/data/esp32-sensor-farm1/.pioenvs/esp32-sensor-farm1/src/esphome/components/api/api_connection.cpp.o] Error 127
*** [/data/esp32-sensor-farm1/.pioenvs/esp32-sensor-farm1/src/esphome/components/api/api_frame_helper.cpp.o] Error 127
*** [/data/esp32-sensor-farm1/.pioenvs/esp32-sensor-farm1/src/esphome/components/api/api_pb2.cpp.o] Error 127
Compiling /data/esp32-sensor-farm1/.pioenvs/esp32-sensor-farm1/src/esphome/components/api/api_pb2_service.cpp.o
sh: 1: xtensa-esp32-elf-g++: not found
*** [/data/esp32-sensor-farm1/.pioenvs/esp32-sensor-farm1/src/esphome/components/api/api_pb2_service.cpp.o] Error 127
========================== [FAILED] Took 5.23 seconds ==========================

Trouble with Sensitivity

Unable to set sensitivity.
Under device configuration I move the sensitivity to any other number just keeps going back to 7.
All other controls seem to work fine.

Compile error on latest esp home

In file included from src/main.cpp:316:
src/leapmmw_sensor.h: In function 'void publishTarget(std::__cxx11::string, float, float)':
src/leapmmw_sensor.h:9:33: error: 'class esphome::StringRef' has no member named 'substr'; did you mean 'c_str'?
if(name.size() > 10 && name.substr(0, 8) == target) {
^~~~~~

Setting values not getting set, can't turn led on/off

This is likely not an issue with this code, but I'm hoping someone can give me advice. I'm using a generic esp8266 board with configuration set as below. In home assistant I'm getting motion detected/cleared as expected but the tx/rx appears not to be working, though there are no errors in the log.

  device_name: leapmmw

  # This will vary based on your board
  uart_tx_pin: TX
  
  # This will vary based on your board
  uart_rx_pin: RX
  
  # This will vary based on your board
  gpio_pin: GPIO16
  
  # (Optional) Path to the leapmmw_sensor.h file relative to your esphome configuration directory.
  header_file: leapmmw_sensor.h

packages:
  remote_package:
    url: https://github.com/hjmcnew/esphome-hs2xx3a-custom-component
    ref: release
    # files: [packages/uart.yml, packages/leapmmw_sensor.yml]
    # For additional debugging replace the above line with:
    files: [packages/uart_debug.yml, packages/leapmmw_sensor.yml]

The logs show it reaching out to get the values:

[12:26:02][D][uart_debug:158]: >>> "getLatency\r"
[12:26:24][D][uart_debug:158]: >>> "getRange\r"
[12:26:59][D][uart_debug:158]: >>> "getSensitivity\r"
[12:27:02][D][uart_debug:158]: >>> "getLatency\r"
[12:27:24][D][uart_debug:158]: >>> "getRange\r"

And also shows it "Sending" the commands to turn the led on and off, but nothing ever happens and the range/latency values never show up in home assistant.

[12:38:12][D][switch:013]: 'led' Turning ON.
[12:38:12][D][switch:017]: 'mmwave_sensor' Turning OFF.
[12:38:12][D][switch:037]: 'mmwave_sensor': Sending state OFF
[12:38:12][D][switch:037]: 'led': Sending state ON
[12:38:12][D][uart_debug:158]: >>> "sensorStop"
[12:38:13][D][uart_debug:158]: >>> "setLedMode 1 0"
[12:38:14][D][uart_debug:158]: >>> "getLedMode 1\r"
[12:38:15][D][switch:013]: 'mmwave_sensor' Turning ON.
[12:38:15][D][switch:037]: 'mmwave_sensor': Sending state ON
[12:38:15][D][uart_debug:158]: >>> "setUartOutput 1 0"
[12:38:16][D][uart_debug:158]: >>> "setUartOutput 2 1 1 2"
[12:38:17][D][uart_debug:158]: >>> "saveConfig"
[12:38:20][D][uart_debug:158]: >>> "sensorStart"
[12:38:24][D][uart_debug:158]: >>> "getRange\r"

I've checked and double-checked the tx/rx connections to make sure they're on the correct pins. Any advice is appreciated.

Input configuration for D1 mini does not work with INPUT_PULLDOWN

If a pin other than GPIO16 is selected as the gpio_pin on a Wemos D1 mini device (esp8266) compilation fails with the following error:


binary_sensor.gpio: [source .esphome/packages/ebf3255d/packages/leapmmw_sensor.yml:29]
  platform: gpio
  name: mmwave_presence_detection
  id: mmwave_presence_detection
  device_class: motion
  pin: 
    number: D5
    
    Only GPIO16 supports pulldown.
    mode: INPUT_PULLDOWN

Changing the mode to INPUT instead of INPUT_PULLDOWN in the packages/leapmmw_sensor.yml file allows it to compile and function normally.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.