tube0013 / esphome-stream-server-v2 Goto Github PK
View Code? Open in Web Editor NEWCustom Component for ESPHome enabling Serial over TCP
Custom Component for ESPHome enabling Serial over TCP
INFO ESPHome 2023.11.6
INFO Reading configuration /config/esphome/wecker-manuel.yaml...
INFO Generating C++ source...
INFO Compiling app...
Processing wecker-manuel (board: seeed_xiao_esp32c3; framework: arduino; platform: platformio/[email protected])
--------------------------------------------------------------------------------
HARDWARE: ESP32C3 160MHz, 320KB RAM, 4MB Flash
- toolchain-riscv32-esp @ 8.4.0+2021r2-patch5
Dependency Graph
|-- WiFi @ 2.0.0
|-- ESPmDNS @ 2.0.0
|-- Update @ 2.0.0
|-- noise-c @ 0.1.4
|-- ArduinoJson @ 6.18.5
|-- WiFiClientSecure @ 2.0.0
|-- HTTPClient @ 2.0.0
Compiling .pioenvs/wecker-manuel/src/esphome/components/api/api_connection.cpp.o
Compiling .pioenvs/wecker-manuel/src/esphome/components/api/api_frame_helper.cpp.o
Compiling .pioenvs/wecker-manuel/src/esphome/components/api/api_pb2.cpp.o
Compiling .pioenvs/wecker-manuel/src/esphome/components/api/api_pb2_service.cpp.o
Compiling .pioenvs/wecker-manuel/src/esphome/components/api/api_server.cpp.o
Compiling .pioenvs/wecker-manuel/src/esphome/components/api/list_entities.cpp.o
Compiling .pioenvs/wecker-manuel/src/esphome/components/api/proto.cpp.o
Compiling .pioenvs/wecker-manuel/src/esphome/components/api/subscribe_state.cpp.o
Compiling .pioenvs/wecker-manuel/src/esphome/components/api/user_services.cpp.o
Compiling .pioenvs/wecker-manuel/src/esphome/components/esp32/core.cpp.o
Compiling .pioenvs/wecker-manuel/src/esphome/components/esp32/gpio.cpp.o
Compiling .pioenvs/wecker-manuel/src/esphome/components/esp32/preferences.cpp.o
Compiling .pioenvs/wecker-manuel/src/esphome/components/http_request/http_request.cpp.o
Compiling .pioenvs/wecker-manuel/src/esphome/components/json/json_util.cpp.o
Compiling .pioenvs/wecker-manuel/src/esphome/components/logger/logger.cpp.o
Compiling .pioenvs/wecker-manuel/src/esphome/components/md5/md5.cpp.o
Compiling .pioenvs/wecker-manuel/src/esphome/components/mdns/mdns_component.cpp.o
Compiling .pioenvs/wecker-manuel/src/esphome/components/mdns/mdns_esp32.cpp.o
Compiling .pioenvs/wecker-manuel/src/esphome/components/mdns/mdns_esp8266.cpp.o
Compiling .pioenvs/wecker-manuel/src/esphome/components/mdns/mdns_host.cpp.o
Compiling .pioenvs/wecker-manuel/src/esphome/components/mdns/mdns_libretiny.cpp.o
Compiling .pioenvs/wecker-manuel/src/esphome/components/mdns/mdns_rp2040.cpp.o
Compiling .pioenvs/wecker-manuel/src/esphome/components/network/util.cpp.o
Compiling .pioenvs/wecker-manuel/src/esphome/components/ota/ota_backend_arduino_esp32.cpp.o
Compiling .pioenvs/wecker-manuel/src/esphome/components/ota/ota_backend_arduino_esp8266.cpp.o
Compiling .pioenvs/wecker-manuel/src/esphome/components/ota/ota_backend_arduino_libretiny.cpp.o
Compiling .pioenvs/wecker-manuel/src/esphome/components/ota/ota_backend_arduino_rp2040.cpp.o
Compiling .pioenvs/wecker-manuel/src/esphome/components/ota/ota_backend_esp_idf.cpp.o
Compiling .pioenvs/wecker-manuel/src/esphome/components/ota/ota_component.cpp.o
Compiling .pioenvs/wecker-manuel/src/esphome/components/socket/bsd_sockets_impl.cpp.o
Compiling .pioenvs/wecker-manuel/src/esphome/components/socket/lwip_raw_tcp_impl.cpp.o
Compiling .pioenvs/wecker-manuel/src/esphome/components/socket/lwip_sockets_impl.cpp.o
Compiling .pioenvs/wecker-manuel/src/esphome/components/socket/socket.cpp.o
Compiling .pioenvs/wecker-manuel/src/esphome/components/stream_server/binary_sensor.cpp.o
Compiling .pioenvs/wecker-manuel/src/esphome/components/stream_server/stream_server.cpp.o
Compiling .pioenvs/wecker-manuel/src/esphome/components/uart/uart.cpp.o
In file included from src/esphome/components/stream_server/binary_sensor.cpp:17:
src/esphome/components/stream_server/binary_sensor.h:20:10: fatal error: esphome/components/binary_sensor/binary_sensor.h: No such file or directory
#include "esphome/components/binary_sensor/binary_sensor.h"
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
*** [.pioenvs/wecker-manuel/src/esphome/components/stream_server/binary_sensor.cpp.o] Error 1
========================= [FAILED] Took 39.33 seconds =========================
This is my confg-yaml
esphome:
name: wecker-manuel
friendly_name: wecker-manuel
external_components:
- source: github://tube0013/esphome-stream-server-v2
esp32:
board: seeed_xiao_esp32c3
framework:
type: arduino
uart:
id: uart_bus
tx_pin: GPIO21
rx_pin: GPIO20
baud_rate: 115200
stream_server:
uart_id: uart_bus
port: 6638
# Enable logging
logger:
baud_rate: 115200
# Enable Home Assistant API
api:
encryption:
key: "xxx"
ota:
password: "xxx"
http_request:
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
domain: .int
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Wecker-Manuel Fallback Hotspot"
password: "xxx"
Maybe the dependencies has to be chanced?
Not able to update my esphome stream server from 2023.4.4 due to the error below. Have tried to clean build files.
Compiling /data/esp32_han/.pioenvs/esp32_han/src/esphome/components/stream_server/binary_sensor.cpp.o
In file included from src/esphome/components/stream_server/binary_sensor.h:21,
from src/esphome/components/stream_server/binary_sensor.cpp:17:
src/esphome/components/stream_server/stream_server.h:28:10: fatal error: AsyncTCP.h: No such file or directory
******************************************************************
* Looking for AsyncTCP.h dependency? Check our library registry!
*
* CLI > platformio lib search "header:AsyncTCP.h"
* Web > https://registry.platformio.org/search?q=header:AsyncTCP.h
*
******************************************************************
#include <AsyncTCP.h>
^~~~~~~~~~~~
compilation terminated.
*** [/data/esp32_han/.pioenvs/esp32_han/src/esphome/components/stream_server/binary_sensor.cpp.o] Error 1
========================= [FAILED] Took 21.54 seconds =========================
Hi!
I was trying to use this component instead of the one provided by https://github.com/oxan/esphome-stream-server to expose the uart on one of my Wemos D1 mini boards. Unfortunately I am getting an error when compiling the firmware:
src/esphome/components/stream_server/stream_server.cpp: In member function 'virtual void StreamServerComponent::setup()':
src/esphome/components/stream_server/stream_server.cpp:48:43: error: 'SO_RCVTIMEO' was not declared in this scope; did you mean 'LWIP_SO_RCVTIMEO'?
48 | this->socket_->setsockopt(SOL_SOCKET, SO_RCVTIMEO, (char *)&timeout, sizeof(timeout));
| ^~~~~~~~~~~
| LWIP_SO_RCVTIMEO
Compiling .pioenvs/hallway_p1reader/src/esphome/components/time/real_time_clock.cpp.o
Compiling .pioenvs/hallway_p1reader/src/esphome/components/uart/uart.cpp.o
*** [.pioenvs/hallway_p1reader/src/esphome/components/stream_server/stream_server.cpp.o] Error 1
This is on a fresh build of the following config:
esphome:
name: hallway_p1reader
platform: ESP8266
board: d1_mini
web_server:
id: component_web_server
port: 80
logger:
id: component_logger
baud_rate: 0
level: INFO
mqtt:
broker: !secret 'mqtt_host'
username: !secret 'mqtt_user'
password: !secret 'mqtt_pwd'
port: 1883
ota:
id: component_ota
time:
- platform: sntp
timezone: CET-1CEST,M3.5.0,M10.5.0/3
id: time_sntp
update_interval: 15min
servers:
- 0.pool.ntp.org
- 1.pool.ntp.org
- 2.pool.ntp.org
switch:
- platform: restart
id: switch_restart
name: Hallway - P1 Reader Restart
disabled_by_default: false
entity_category: config
icon: mdi:restart
api:
reboot_timeout: 0s
port: 6053
wifi:
id: component_wifi
networks:
- ssid: !secret 'wifi_ssid'
password: !secret 'wifi_pwd'
external_components:
- source:
url: https://github.com/tube0013/esphome-stream-server-v2.git
type: git
uart:
- id: uart_bus
rx_pin:
number: 3
mode:
input: true
analog: false
output: false
open_drain: false
pullup: false
pulldown: false
inverted: false
baud_rate: 115200
rx_buffer_size: 1024
stop_bits: 1
data_bits: 8
parity: NONE
stream_server:
- id: ss
uart_id: uart_bus
port: 8088
binary_sensor:
- platform: stream_server
stream_server: ss
name: Hallway - P1 Reader Serial Connected
When using https://github.com/oxan/esphome-stream-server I don't see this error with the same config.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.