- Saved searches
- Use saved searches to filter your results more quickly
- License
- oxan/esphome-stream-server
- Name already in use
- Sign In Required
- Launching GitHub Desktop
- Launching GitHub Desktop
- Launching Xcode
- Launching Visual Studio Code
- Latest commit
- Git stats
- Files
- README.md
- Arduino.ru
- Stream server (serial-to-wifi bridge) for ESPHome
- Using virtual-serial port with socat + stm32flash
- Unreliable connections with ESPHome > 2021.9
- Idea: Use UARTStream instead of hardcoded UARTComponent
- Component not found: stream_server.
- System Health
Saved searches
Use saved searches to filter your results more quickly
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.
Stream server (serial-to-wifi bridge) for ESPHome
License
oxan/esphome-stream-server
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Sign In Required
Please sign in to use Codespaces.
Launching GitHub Desktop
If nothing happens, download GitHub Desktop and try again.
Launching GitHub Desktop
If nothing happens, download GitHub Desktop and try again.
Launching Xcode
If nothing happens, download Xcode and try again.
Launching Visual Studio Code
Your codespace will open once ready.
There was a problem preparing your codespace, please try again.
Latest commit
Git stats
Files
Failed to load latest commit information.
README.md
Stream server for ESPHome
Custom component for ESPHome to expose a UART stream over WiFi or Ethernet. Provides a serial-to-wifi bridge as known from ESPLink or ser2net, using ESPHome.
This component creates a TCP server listening on port 6638 (by default), and relays all data between the connected clients and the serial port. It doesn’t support any control sequences, telnet options or RFC 2217, just raw data.
Requires ESPHome v2022.3.0 or newer.
external_components: - source: github://oxan/esphome-stream-server stream_server:
You can set the UART ID and port to be used under the stream_server component.
uart: id: uart_bus # add further configuration for the UART here stream_server: uart_id: uart_bus port: 1234
The server provides a binary sensor that signals whether there currently is a client connected:
binary_sensor: - platform: stream_server connected: name: Connected
It also provides a numeric sensor that indicates the number of connected clients:
sensor: - platform: stream_server connection_count: name: Number of connections
It is possible to define multiple stream servers for multiple UARTs simultaneously:
uart: - id: uart1 # . - id: uart2 # . stream_server: - uart_id: uart1 port: 1234 - uart_id: uart2 port: 1235
The stream server has an internal buffer into which UART data is read before it is transmitted over TCP. The size of this buffer can be changed using the buffer_size option, and must be a power of two. Increasing the buffer size above the default of 128 bytes can help to achieve optimal throughput, and is especially helpful when using high baudrates. It can also be necessary to increase the rx_buffer_size option of the UART itself.
stream_server: buffer_size: 2048
Arduino.ru
Добрый день всем, уважаемые форумчане, у меня к Вам вопрос- возможно ли на базе arduino выполнить преобразователь интерфейсов RS 232 в wi-fi или ehternet (в идиале и то и то) ?
Есть у кого нибудь идеи по этому поводу.
Спасибо, вопрос, без платы arduino это являеться преобразователем интерфесов?
1. Принимаете данные из RS 232 (через RS232-TTL конвертер).
2. Отправляете принятые данные в wi-fi или ehternet.
Если достаточно только WiFi, то Ардуино не понадобится, всё сделает ESP8266.
вопрос заключаеться в ледующем- нуже преобразоватье для опроса приборов учета потребления тепла (СПТ 943 там есть rs 232) я использовал вот такую хрень http://usriot.com/Product/46.html если Ваше предолжение работаспасобно в данной задече зачем платить больше)))?
ESP8266 имеет три режима — точка доступа, клиент и точка доступа + клиент, на выходе UART, сам модуль может программироваться без дополнительных контроллеров, есть поддержка модуля в среде Arduino IDE. Огромное сообщество и огромное количество материала по этому модулю. Изучайте.
Стандартный пример одной из библиотек модуля:
/* WiFiTelnetToSerial - Example Transparent UART to Telnet Server for esp8266 Copyright (c) 2015 Hristo Gochkov. All rights reserved. This file is part of the ESP8266WiFi library for Arduino environment. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include //how many clients should be able to telnet to this ESP8266 #define MAX_SRV_CLIENTS 1 const char* ssid = "**********"; const char* password = "**********"; WiFiServer server(23); WiFiClient serverClients[MAX_SRV_CLIENTS]; void setup() < Serial1.begin(115200); WiFi.begin(ssid, password); Serial1.print("\nConnecting to "); Serial1.println(ssid); uint8_t i = 0; while (WiFi.status() != WL_CONNECTED && i++ < 20) delay(500); if(i == 21)< Serial1.print("Could not connect to"); Serial1.println(ssid); while(1) delay(500); >//start UART and the server Serial.begin(115200); server.begin(); server.setNoDelay(true); Serial1.print("Ready! Use 'telnet "); Serial1.print(WiFi.localIP()); Serial1.println(" 23' to connect"); > void loop() < uint8_t i; //check if there are any new clients if (server.hasClient())< for(i = 0; i < MAX_SRV_CLIENTS; i++)< //find free/disconnected spot if (!serverClients[i] || !serverClients[i].connected())< if(serverClients[i]) serverClients[i].stop(); serverClients[i] = server.available(); Serial1.print("New client: "); Serial1.print(i); continue; >> //no free/disconnected spot so reject WiFiClient serverClient = server.available(); serverClient.stop(); > //check clients for data for(i = 0; i < MAX_SRV_CLIENTS; i++)< if (serverClients[i] && serverClients[i].connected())< if(serverClients[i].available())< //get data from the telnet client and push it to the UART while(serverClients[i].available()) Serial.write(serverClients[i].read()); >> > //check UART for data if(Serial.available()) < size_t len = Serial.available(); uint8_t sbuf[len]; Serial.readBytes(sbuf, len); //push UART data to all connected telnet clients for(i = 0; i < MAX_SRV_CLIENTS; i++)< if (serverClients[i] && serverClients[i].connected())< serverClients[i].write(sbuf, len); delay(1); >> > >
Stream server (serial-to-wifi bridge) for ESPHome
Custom component for ESPHome to expose a UART stream over WiFi or Ethernet. Can be used as a serial-to-wifi bridge as known from ESPLink or ser2net by using ESPHome.
This component creates a TCP server listening on port 6638 (by default), and relays all data between the connected clients and the serial port. It doesn’t support any control sequences, telnet options or RFC 2217, just raw data.
Requires ESPHome v1.18.0 or higher.
external_components: - source: github://oxan/esphome-stream-server stream_server:
You can set the UART ID and port to be used under the stream_server component.
uart: id: uart_bus # add further configuration for the UART here stream_server: uart_id: uart_bus port: 1234
You might also like.
Tuya IoTOS Embeded SDK WiFi & BLE for BK7231T
Tuya IoTOS Embedded Wi-Fi and BLE SDK for BK7231T 中文版 | English Overview Developed independently by Tuya Smart, Tuya IoTOS is the world’s only IoT ope
WiFi-enabled soil moisture sensor
w-parasite w-parasite is an open source, WiFi-enabled soil moisture sensor for house plants. This repo contains all the hardware design files (schemat
T-Watch 2020 v1 compatible firmware providing WiFi and BLE testing tools (and also, a watch :D)
ESP-IDF template app This is a template application to be used with Espressif IoT Development Framework. Please check ESP-IDF docs for getting started
Netstick client for Nintendo 3DS — turn your portable console into a Linux compatible WiFi gamepad!
Netstick turns your 3DS into a wifi enabled gamepad! Control any linux-based device (such as a Raspberry Pi running Retropie) using your 3DS!
WiFi/MQTT Code For the ThingPulse ESPGateway
ESP32-Paxcounter with ThingPulse ESPGateway This project lets you run the ESP32-Paxcounter project on the ThingPulse ESPGateway. The ESPGateway has tw
ESP8266 WiFi Connection manager with fallback web configuration portal
ESP8266 WiFi Connection manager with fallback web configuration portal
owfuzz: a WiFi protocol fuzzing tool using openwifi.
Openwifi is an open-source WiFi protocol stack based on SDR that is fully compatible with Linux mac80211. It’s driver takes advantage of the Linux kernel’s supports (mac80211, cfg80211) for WiFi high MAC, so it can provide an interface to the application layer like a common WiFi USB dongle.
Wifi MQTT Data Logging via an esp8266 for the Ikea VINDRIKTNING PM2.5 air quality sensor
MQTT connectivity for the Ikea VINDRIKTNING This repository contains an ESP8266 firmware, which adds MQTT to the Ikea VINDRIKTNING PM2.5 air quality s
A simple and easy WiFi-enabled ESP8266-powered WSPR and FT8 beacon which uses NTP + DS3231 RTC for timing.
Easy-Digital-Beacons-v1 A simple and easy WiFi-enabled ESP8266-powered WSPR and FT8 beacon which uses NTP + DS3231 RTC for timing. The whole design is
Comments
Using virtual-serial port with socat + stm32flash
Hello, I’m using the espHome to communicate with a device using the serial port, specially a STM32 device. I’m able to listen the RX/TX with screen: socat -v -d -d pty,raw,echo=0 tcp:192.168.2.105:1234 then screen /dev/ttys005 115200 And it seems to work very nice here, I`m able read all the msgs, except sometimes it seems to lag a bit. Now I’m tryng to use it with stm32flash: sudo stm32flash -b 115200 /dev/ttys005 socat debug: https://pastebin.com/baxDTWL2 Could someone give a tip if I can improve and make it work for this purpose? YAML settings:
external_components: - source: github://oxan/esphome-stream-server logger: baud_rate: 0 uart: id: uart_bus tx_pin: GPIO1 rx_pin: GPIO3 baud_rate: 115200 rx_buffer_size: 4096 stream_server: uart_id: uart_bus port: 1234 custom_component: - lambda: |- auto stream_server = new StreamServerComponent(id(uart_bus)); return ;
Unreliable connections with ESPHome > 2021.9
Serial connections are very unreliable when using this component with any ESPHome Version greater than 2021.9. By unreliable I mean the connection resets every few hours.
Idea: Use UARTStream instead of hardcoded UARTComponent
First of all thanks for writing this component. Some years ago I found an older version and I’ve been putting it to great use since. While reading through the code, I couldn’t help but notice the comments of «ESPHome doesn’t know the Stream abstraction yet, so hardcode to use a UART for now.» Somewhere around the same time, I stumbled upon this from the Midea component: https://www.esphome.io/api/appliance__base_8h_source.html It implements a UARTStream class that takes the UARTcomponent and wraps the Stream class around it. Although it wouldn’t change the functionality, it might be more in line with what you envisioned when you wrote this component.
Component not found: stream_server.
INFO Reading configuration /config/esphome/test123.yaml. Failed config stream_server: [source /config/esphome/test123.yaml:14] Component not found: stream_server.
--- substitutions: devicename: test123 upper_devicename: "TEST123" esphome: name: $ platform: ESP8266 board: esp01_1m external_components: - source: github://oxan/esphome-stream-server stream_server:
System Health
version | core-2022.2.9 — | — installation_type | Home Assistant OS dev | false hassio | true docker | true user | root virtualenv | false python_version | 3.9.7 os_name | Linux os_version | 5.10.98 arch | x86_64 timezone | Europe/Amsterdam Home Assistant Cloud logged_in | false — | — can_reach_cert_server | ok can_reach_cloud_auth | ok can_reach_cloud | ok Home Assistant Supervisor host_os | Home Assistant OS 7.4 — | — update_channel | stable supervisor_version | supervisor-2022.01.1 docker_version | 20.10.9 disk_total | 30.8 GB disk_used | 8.2 GB healthy | true supported | true board | ova supervisor_api | ok version_api | ok installed_addons | SSH & Web Terminal (10.0.2), Studio Code Server (4.1.0), Portainer (2.11.0-3), ESPHome (2022.2.5) Lovelace dashboards | 1 — | — resources | 0 mode | auto-gen