Code Monkey home page Code Monkey logo

esphome-component-ping's Introduction

esphome-component-ping

A esphome sensor component that sends and receives ICMP. It implements two sensors: loss and latency. loss publishes packet loss rate of an ICMP session, and latency publishes arithmetic mean of latencies in an ICMP session.

Visualization of ICMP latency and packet loss on ESP8266

This is my first attempt to learn esphome sensor component.

I have almost zero C++ knowledge. You have been warned.

Bugs

  • the target must be IP address
  • multiple targets are not supported

Limitations

The device sticks to weak BSSID

esphome does not implement roaming between WiFi APs (see Issue 732) This means the device does not switch to better WiFi coverage, e.g. when the closest AP is not available, the device connects to another AP available, and will not switch to the closest one even when the closest AP is back online again. This is often okay, but sometimes becomes an issue. The only workaround is to reboot the device. Be sure to add restart component to the device when you have multiple WiFi APs.

Status

  • Works on esp8266, esp32, and esp32c3
  • the component works fine on esp8266. The longest uptime so far is more than 3 days.
  • For esp32c3, framework must be esp-idf (see config/ping-esp32c3.yaml)
  • Requires esphome 2022.3.0 due to a breaking change

Requirements

  • python 3.8
  • pipenv (only if you do not have a working esphome installation)

Usage

If you do not have a working esphome, install it. Or, install it with pipenv.

pipenv install

Run your shell in the python virtual environment.

pipenv shell

Copy secrets.yaml. You probably want to modify it, i.e. password, SSID, etc.

cp config/secrets.yaml.dist config/secrets.yaml

Compile ping.yaml in the python virtual environment.

esphome compile config/ping.yaml

Usage in your project

See External Components.

Note that, for esp8266, you need to include a library AsyncPing. Make sure your config includes it by libraries.

Since 2021.11.4 release, esphome disabled lib_ldf_mode in platformio. ESP8266WiFi, which AsyncPing depends on, must be listed on libraries.

esphome:
  name: ${my_name}
  platform: ESP8266
  board: nodemcuv2
  libraries:
    - ESP8266WiFi
    - https://github.com/akaJes/AsyncPing#95ac7e4

With local

Create components directory in your project root.

mkdir components

Clone, or submodule, the repository in the components directory.

cd components
git clone https://github.com/trombik/esphome-component-ping.git

In the configuration file, set path in external_components.

external_components:
  - source:
      type: local
      path: ../components/esphome-component-ping/components

With git

Add external_components to the configuration file. ref should be git ref; tag, branch, or commit.

external_components:
  - source:
      type: git
      url: https://github.com/trombik/esphome-component-ping
      ref: main

Example

See config/ping.yaml.

If you want to take actions on sensor values, see config/influxdb.yaml. In the example, on_value runs an automation (sending the value to influxdb whenever a value is available). Use on_value_range (the documentation) when the sensor value is above, below, or both.

Log

esp8266

INFO Reading configuration config/ping.yaml...
INFO Starting log output from ping.local using esphome API
INFO Connecting to ping.local:6053 (192.168.99.16)
INFO Successfully connected to ping.local
[18:30:54][I][app:105]: ESPHome version 1.19.4 compiled on Jul 19 2021, 17:42:16
[18:30:54][C][wifi:484]: WiFi:
[18:30:54][C][wifi:344]:   SSID: [redacted]
[18:30:54][C][wifi:345]:   IP Address: 192.168.99.16
[18:30:54][C][wifi:347]:   BSSID: [redacted]
[18:30:54][C][wifi:348]:   Hostname: 'ping'
[18:30:54][C][wifi:352]:   Signal strength: -60 dB ▂▄▆█
[18:30:54][C][wifi:356]:   Channel: 1
[18:30:54][C][wifi:357]:   Subnet: 255.255.255.0
[18:30:54][C][wifi:358]:   Gateway: 192.168.99.254
[18:30:54][C][wifi:359]:   DNS1: 192.168.99.251
[18:30:54][C][wifi:360]:   DNS2: (IP unset)
[18:30:54][C][logger:189]: Logger:
[18:30:54][C][logger:190]:   Level: DEBUG
[18:30:54][C][logger:191]:   Log Baud Rate: 115200
[18:30:54][C][logger:192]:   Hardware UART: UART0
[18:30:54][C][captive_portal:148]: Captive Portal:
[18:30:54][C][web_server:136]: Web Server:
[18:30:54][C][web_server:137]:   Address: ping.local:80
[18:30:54][C][ota:029]: Over-The-Air Updates:
[18:30:54][C][ota:030]:   Address: ping.local:8266
[18:30:54][C][ota:032]:   Using Password.
[18:30:55][C][api:095]: API Server:
[18:30:55][C][api:096]:   Address: ping.local:6053
[18:31:20][D][sensor:117]: 'Packet loss': Sending state 0.00000 % with 0 decimals of accuracy
[18:31:20][D][sensor:117]: 'Latency': Sending state 41.00000 ms with 0 decimals of accuracy
[18:31:20][I][ping:037]: 64 bytes from 156.154.100.3: icmp_seq=1 ttl=55 time=48 ms
[18:31:21][I][ping:037]: 64 bytes from 156.154.100.3: icmp_seq=2 ttl=55 time=39 ms
[18:31:22][I][ping:037]: 64 bytes from 156.154.100.3: icmp_seq=3 ttl=55 time=40 ms
[18:31:23][I][ping:037]: 64 bytes from 156.154.100.3: icmp_seq=4 ttl=55 time=43 ms
[18:31:24][I][ping:037]: 64 bytes from 156.154.100.3: icmp_seq=5 ttl=55 time=41 ms
[18:31:25][I][ping:037]: 64 bytes from 156.154.100.3: icmp_seq=6 ttl=55 time=39 ms
[18:31:26][I][ping:037]: 64 bytes from 156.154.100.3: icmp_seq=7 ttl=55 time=40 ms
[18:31:27][I][ping:037]: 64 bytes from 156.154.100.3: icmp_seq=8 ttl=55 time=39 ms
[18:31:28][I][ping:037]: 64 bytes from 156.154.100.3: icmp_seq=9 ttl=55 time=39 ms
[18:31:29][I][ping:037]: 64 bytes from 156.154.100.3: icmp_seq=10 ttl=55 time=41 ms
[18:31:30][I][ping:037]: 64 bytes from 156.154.100.3: icmp_seq=11 ttl=55 time=39 ms
[18:31:31][I][ping:037]: 64 bytes from 156.154.100.3: icmp_seq=12 ttl=55 time=43 ms
[18:31:32][I][ping:037]: 64 bytes from 156.154.100.3: icmp_seq=13 ttl=55 time=41 ms
[18:31:33][I][ping:063]: packet loss: 0.0 % latency: 40 ms

esp32

[C][logger:189]: Logger:
[C][logger:190]:   Level: DEBUG
[C][logger:191]:   Log Baud Rate: 115200
[C][logger:192]:   Hardware UART: UART0
[C][captive_portal:148]: Captive Portal:
[C][web_server:136]: Web Server:
[C][web_server:137]:   Address: ping_sensor.local:80
[C][ota:029]: Over-The-Air Updates:
[C][ota:030]:   Address: ping_sensor.local:3232
[C][ota:032]:   Using Password.
[I][ping_esp32:063]: 64 bytes from 8.8.8.8 icmp_seq=1 ttl=117 time=448 ms
[I][ping_esp32:063]: 64 bytes from 8.8.8.8 icmp_seq=2 ttl=117 time=42 ms
[I][ping_esp32:063]: 64 bytes from 8.8.8.8 icmp_seq=3 ttl=117 time=42 ms
[I][ping_esp32:063]: 64 bytes from 8.8.8.8 icmp_seq=4 ttl=117 time=39 ms
[I][ping_esp32:063]: 64 bytes from 8.8.8.8 icmp_seq=5 ttl=117 time=41 ms
[I][ping_esp32:063]: 64 bytes from 8.8.8.8 icmp_seq=6 ttl=117 time=40 ms
[I][ping_esp32:063]: 64 bytes from 8.8.8.8 icmp_seq=7 ttl=117 time=40 ms
[I][ping_esp32:063]: 64 bytes from 8.8.8.8 icmp_seq=8 ttl=117 time=43 ms
[I][ping_esp32:063]: 64 bytes from 8.8.8.8 icmp_seq=9 ttl=117 time=40 ms
[I][ping_esp32:063]: 64 bytes from 8.8.8.8 icmp_seq=10 ttl=117 time=41 ms
[I][ping_esp32:063]: 64 bytes from 8.8.8.8 icmp_seq=11 ttl=117 time=42 ms
[I][ping_esp32:063]: 64 bytes from 8.8.8.8 icmp_seq=12 ttl=117 time=42 ms
[I][ping_esp32:063]: 64 bytes from 8.8.8.8 icmp_seq=13 ttl=117 time=45 ms
[I][ping_esp32:063]: 64 bytes from 8.8.8.8 icmp_seq=14 ttl=117 time=43 ms
[I][ping_esp32:063]: 64 bytes from 8.8.8.8 icmp_seq=15 ttl=117 time=40 ms
[I][ping_esp32:102]: From 8.8.8.8 icmp_seq=16 timeout
[I][ping_esp32:102]: From 8.8.8.8 icmp_seq=17 timeout
[I][ping_esp32:084]: --- 8.8.8.8 ping statistics ---
[I][ping_esp32:089]: 17 packets transmitted, 15 received, 11% packet loss, total time 3028ms avg time 68ms
[D][sensor:117]: 'Packet loss': Sending state 11.00000 % with 0 decimals of accuracy
[D][sensor:117]: 'Latency': Sending state 0.06800 s with 3 decimals of accuracy

esphome-component-ping's People

Contributors

trombik 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

esphome-component-ping's Issues

[REQ] change log level of the messages

The component is a bit chatty, it prints too many details in INFO level.

...
[15:50:31][I][ping_esp32:083]: 64 bytes from 8.8.4.4 icmp_seq=3 ttl=116 time=3 ms
[15:50:32][I][ping_esp32:083]: 64 bytes from 8.8.4.4 icmp_seq=4 ttl=116 time=3 ms
[15:50:33][I][ping_esp32:083]: 64 bytes from 8.8.4.4 icmp_seq=5 ttl=116 time=3 ms
[15:50:34][I][ping_esp32:083]: 64 bytes from 8.8.4.4 icmp_seq=6 ttl=116 time=3 ms
[15:50:35][I][ping_esp32:104]: --- 8.8.4.4 ping statistics ---
[15:50:35][I][ping_esp32:109]: 6 packets transmitted, 6 received, 0% packet loss, total time 428ms avg time 71ms

In ESPHome this kind of information should go to to DEBUG and VERBOSE level. One sets log level to INFO to avoid loading the device and the API with repeated messages.

 DEBUG (Default)
     Everything up to this log level is logged. Debug messages include the current readings from a sensor and status messages. Color: cyan
 VERBOSE
     Like debug, but a few more messages that are usually deemed to be spam are also included. Color: grey

My suggestion would be to move the individual pings to VERBOSE and the result statisitics to DEBUG level.

increase time resolution

As far as I notice time is being reported only in integer miliseconds, but it would be better to have 2 more decimals, like normal operating systems support it. So no only eg. 3ms, but let's see if it's 3.12 or 2.78 ms.
We'd use accuracy_decimals: 5 then.

AsyncPing.cpp:3:25: fatal error: ESP8266WiFi.h: No such file or directory

with recent arduino (or esphome, i'm not sure which caused regression), compile fails.

> esphome compile config/501-sensor-ping.yaml
INFO Reading configuration config/501-sensor-ping.yaml...
INFO Generating C++ source...
INFO Compiling app...
Processing 501-sensor-ping (board: nodemcuv2; framework: arduino; platform: platformio/espressif8266 @ 2.6.3)
---------------------------------------------------------------------------------------------------------------------------------------
HARDWARE: ESP8266 80MHz, 80KB RAM, 4MB Flash
Dependency Graph
|-- <AsyncPing(esp8266)> 1.1.0+sha.95ac7e4
|-- <ESP8266WiFi> 1.0
|-- <ArduinoJson-esphomelib> 5.13.3
|-- <ESP8266HTTPClient> 1.2
|-- <ESP8266mDNS> 1.2
Compiling .pioenvs/501-sensor-ping/lib7c0/AsyncPing_esp8266_/AsyncPing.cpp.o
Compiling .pioenvs/501-sensor-ping/lib3b8/ESP8266WiFi/ESP8266WiFiAP.cpp.o
Compiling .pioenvs/501-sensor-ping/lib3b8/ESP8266WiFi/ESP8266WiFiGeneric.cpp.o
.piolibdeps/501-sensor-ping/AsyncPing_esp8266_/src/AsyncPing.cpp:3:25: fatal error: ESP8266WiFi.h: No such file or directory

*********************************************************************
* Looking for ESP8266WiFi.h dependency? Check our library registry!
*
* CLI  > platformio lib search "header:ESP8266WiFi.h"
* Web  > https://platformio.org/lib/search?query=header:ESP8266WiFi.h
*
*********************************************************************

 #include "ESP8266WiFi.h"
                         ^
compilation terminated.
Compiling .pioenvs/501-sensor-ping/lib3b8/ESP8266WiFi/ESP8266WiFiGratuitous.cpp.o
Compiling .pioenvs/501-sensor-ping/lib3b8/ESP8266WiFi/ESP8266WiFiMulti.cpp.o
Compiling .pioenvs/501-sensor-ping/lib3b8/ESP8266WiFi/ESP8266WiFiSTA-WPS.cpp.o
Compiling .pioenvs/501-sensor-ping/lib3b8/ESP8266WiFi/ESP8266WiFiSTA.cpp.o
*** [.pioenvs/501-sensor-ping/lib7c0/AsyncPing_esp8266_/AsyncPing.cpp.o] Error 1
Compiling .pioenvs/501-sensor-ping/lib3b8/ESP8266WiFi/ESP8266WiFiScan.cpp.o
===================================================== [FAILED] Took 2.55 seconds =====================================================
> esphome version 
Version: 2021.11.1
framework-arduinoespressif8266 3.20704.0 (2.7.4)

very slow responds when used as watchdog

Hi.
I'm trying to configure watchdog - if my TV responds to ping esp should enable relay with connected speakers and turn off when tv does not respond.
Problem is that if tv is turned on it takes about 1 minute to switch on relay, the same for turning off.

This is my configuration:

sensor:
  - platform: ping
    ip_address: 192.168.10.99
    num_attempts: 1
    timeout: 500ms
    loss:
      name: Packet loss
      id: loss
      on_value_range:
        - above: 99
          then:
          - switch.turn_off: relay
        - below: 1
          then:
          - switch.turn_on: relay

It seems that esp is 'blocked' between ping attempts for about 1minute.

multiple ping sensors

I see in the readme as known bug multiple targets are not supported. What does this exactly mean?

What I try to use is:

- platform: ping
  ip_address: 8.8.4.4
  update_interval: 120s
  num_attempts: 6
  timeout: 1sec
  latency:
    name: WAN Latency
    icon: mdi:console-network-outline
    accuracy_decimals: 3
  loss:
    id: loss_wan
    icon: mdi:console-network-outline
    name: WAN Packet loss
- platform: ping
  ip_address: 192.168.1.1
  update_interval: 120s
  num_attempts: 2
  timeout: 1sec
  loss:
    id: loss_gw
    icon: mdi:console-network-outline
    name: GW Packet loss

So one sensor is for 8.8.4.4, the other one is for 192.168.1.1. Is this supported or not?
I experienced reboots of the ESP32 (with Ethernet) every 1-2 hours...

Remove dependency on AyncPing

this will be resolved when icmp application in ESP8266 RTOS SDK is fixed (the last time i checked was a year ago).

rule to switch on/off relay

Hi. I flashed sonoff basic and I want to switch on relay if test device is responding to ping and switch off when it does not respond. How can I do that? Please provide more examples. I'm trying to power off my all multimedia devices when TV is off.

loss sensor doesn't report value

I've configured my ping sensor like this:

sensor:
  - platform: ping
    ip_address: 8.8.8.8
    num_attempts: 15
    timeout: 60sec
    loss:
      name: Packet Loss
      id: loss
      on_value:
      then:
        - switch.turn_off: relay
        - delay: 15s
        - switch.turn_on: relay

     update_interval: 30s

However, its state only shows up as "NA" in the esphome webui, or "Unknown" in Home Assistant. I've tested with it being able to reach 8.8.8.8 and also having a firewall rule that drops ICMP from its IP address, and the logs reflect that (ping success and failure), but the sensor value doesn't change at all. Am I missing something?

Platform not found: 'sensor.ping'

I think the latest version of ESPHome (2022.3.0) introduced a breaking change that may have affected this project. The signature of the sensor.sensor_schema() method has changed and we probably need to pass in keyword instead of positional arguments to this method here.

INFO Reading configuration /config/esphome/kookeiland.yaml...
ERROR Unable to load component ping.sensor:
Traceback (most recent call last):
  File "/esphome/esphome/loader.py", line 162, in _lookup_module
    module = importlib.import_module(f"esphome.components.{domain}")
  File "/usr/lib/python3.9/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 790, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "/config/esphome/.esphome/external_components/43f13ef2/components/ping/sensor.py", line 59, in <module>
    cv.Optional(CONF_LOSS): sensor.sensor_schema(
TypeError: sensor_schema() takes from 0 to 1 positional arguments but 5 were given
Failed config

sensor.ping: [source /config/esphome/kookeiland.yaml:142]
  
  Platform not found: 'sensor.ping'.

AsyncPing does not support ESP32

~/github/trombik/esphome-component-ping/ esphome compile config/ping-esp32.yaml       
INFO Reading configuration config/ping-esp32.yaml...
INFO Generating C++ source...
INFO Core config or version changed, cleaning build files...
INFO Deleting config/ping_sensor/.pioenvs
INFO Deleting config/ping_sensor/.piolibdeps
INFO Compiling app...
INFO Running:  platformio run -d config/ping_sensor
Processing ping_sensor (board: lolin_d32; framework: arduino; platform: platformio/[email protected])
--------------------------------------------------------------------------------------------------------------------------------------
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
PACKAGES: 
 - framework-arduinoespressif32 3.10006.210326 (1.0.6) 
 - tool-esptoolpy 1.30000.201119 (3.0.0) 
 - toolchain-xtensa32 2.50200.0 (5.2.0)
Library Manager: Installing esphome/AsyncTCP-esphome @ 1.2.2
Library Manager: AsyncTCP-esphome @ 1.2.2 has been installed!
Library Manager: Installing git+https://github.com/akaJes/AsyncPing#95ac7e4
git version 2.31.1
Cloning into '/usr/home/trombik/.platformio/.cache/tmp/pkg-installing-dsolfjai'...
HEAD is now at 95ac7e4 Fixes crash that occurs when an AsynPing object is destroyed while timers are running (#4)
Library Manager: AsyncPing(esp8266) @ 1.1.0+sha.95ac7e4 has been installed!
Library Manager: Installing ESPAsyncWebServer-esphome @ 1.2.7
Library Manager: ESPAsyncWebServer-esphome @ 1.2.7 has been installed!
Library Manager: Installing dependencies...
Library Manager: Installing ESPAsyncTCP-esphome
Library Manager: ESPAsyncTCP-esphome @ 1.2.3 has been installed!
Library Manager: Installing Hash
Library Manager: Already installed, built-in library
Library Manager: Installing Hash
Library Manager: Already installed, built-in library
Library Manager: Installing ArduinoJson-esphomelib @ 5.13.3
Library Manager: ArduinoJson-esphomelib @ 5.13.3 has been installed!
Dependency Graph
|-- <AsyncTCP-esphome> 1.2.2
|-- <AsyncPing(esp8266)> 1.1.0+sha.95ac7e4
|-- <FS> 1.0
|-- <ESPAsyncWebServer-esphome> 1.2.7
|   |-- <AsyncTCP-esphome> 1.2.2
|   |-- <FS> 1.0
|   |-- <WiFi> 1.0
|   |-- <ArduinoJson-esphomelib> 5.13.3
|-- <ESPmDNS> 1.0
|   |-- <WiFi> 1.0
|-- <ArduinoJson-esphomelib> 5.13.3
|-- <DNSServer> 1.1.0
|   |-- <WiFi> 1.0
|-- <Update> 1.0
|-- <WiFi> 1.0
Compiling .pioenvs/ping_sensor/src/esphome/components/captive_portal/captive_portal.cpp.o
Compiling .pioenvs/ping_sensor/src/esphome/components/json/json_util.cpp.o
Compiling .pioenvs/ping_sensor/src/esphome/components/logger/logger.cpp.o
Compiling .pioenvs/ping_sensor/src/esphome/components/ota/ota_component.cpp.o
Compiling .pioenvs/ping_sensor/src/esphome/components/sensor/automation.cpp.o
Compiling .pioenvs/ping_sensor/src/esphome/components/sensor/filter.cpp.o
Compiling .pioenvs/ping_sensor/src/esphome/components/sensor/sensor.cpp.o
Compiling .pioenvs/ping_sensor/src/esphome/components/web_server/web_server.cpp.o
Compiling .pioenvs/ping_sensor/src/esphome/components/web_server_base/web_server_base.cpp.o
Compiling .pioenvs/ping_sensor/src/esphome/components/wifi/wifi_component.cpp.o
Compiling .pioenvs/ping_sensor/src/esphome/components/wifi/wifi_component_esp32.cpp.o
Compiling .pioenvs/ping_sensor/src/esphome/components/wifi/wifi_component_esp8266.cpp.o
Compiling .pioenvs/ping_sensor/src/esphome/core/application.cpp.o
Compiling .pioenvs/ping_sensor/src/esphome/core/component.cpp.o
Compiling .pioenvs/ping_sensor/src/esphome/core/controller.cpp.o
Compiling .pioenvs/ping_sensor/src/esphome/core/esphal.cpp.o
Compiling .pioenvs/ping_sensor/src/esphome/core/helpers.cpp.o
Compiling .pioenvs/ping_sensor/src/esphome/core/log.cpp.o
Compiling .pioenvs/ping_sensor/src/esphome/core/preferences.cpp.o
Compiling .pioenvs/ping_sensor/src/esphome/core/scheduler.cpp.o
Compiling .pioenvs/ping_sensor/src/esphome/core/util.cpp.o
Compiling .pioenvs/ping_sensor/src/main.cpp.o
Generating partitions .pioenvs/ping_sensor/partitions.bin
In file included from src/esphome/components/ping/ping.h:3:0,
                 from src/esphome.h:6,
                 from src/main.cpp:3:
.piolibdeps/ping_sensor/AsyncPing_esp8266_/src/AsyncPing.h:8:30: fatal error: user_interface.h: No such file or directory

esphome/components/wifi/wifi_component.h has ifdef.

#ifdef ARDUINO_ARCH_ESP32
#include <esp_wifi.h>
#include <WiFiType.h>
#include <WiFi.h>
#endif

#ifdef ARDUINO_ARCH_ESP8266
#include <ESP8266WiFiType.h>
#include <ESP8266WiFi.h>

#ifdef ARDUINO_ESP8266_RELEASE_2_3_0
extern "C" {
#include <user_interface.h>
};
#endif
#endif

Cannot compile on homeassistant

Hi I am attempting to compile this on esphome on homeassistant, but am facing the following error:

INFO ESPHome 2024.3.1
INFO Reading configuration /config/esphome/playbulb-candle.yaml...
INFO Generating C++ source...
INFO Compiling app...
Processing playbulb-candle (board: esp01_1m; framework: arduino; platform: platformio/[email protected])
--------------------------------------------------------------------------------
HARDWARE: ESP8266 80MHz, 80KB RAM, 1MB Flash
Dependency Graph
|-- ESPAsyncTCP-esphome @ 2.0.0
|-- ESPAsyncWebServer-esphome @ 3.1.0
|-- DNSServer @ 1.1.1
|-- ESP8266WiFi @ 1.0
|-- ESP8266mDNS @ 1.2
|-- noise-c @ 0.1.4
|-- NeoPixelBus @ 2.7.3
Compiling .pioenvs/playbulb-candle/src/main.cpp.o
In file included from src/main.cpp:45:
src/ping_esp8266.h:22:10: fatal error: esphome/components/sensor/sensor.h: No such file or directory
   22 | #include "esphome/components/sensor/sensor.h"
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
*** [.pioenvs/playbulb-candle/src/main.cpp.o] Error 1

========================== [FAILED] Took 1.44 seconds ==========================

I have included the libraries below:

esphome:
  name: playbulb-candle
  friendly_name: playbulb-candle
  includes:
    - ping/ping_esp8266.h          #file located here: /config/Keypad_I2C.h
    - asyncping/AsyncPing.h

esp8266:
  board: esp01_1m

# Enable logging
logger:

Any ideas what I am doing wrong here?
Thanks

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.