file_path
stringlengths
3
280
file_language
stringclasses
66 values
content
stringlengths
1
1.04M
repo_name
stringlengths
5
92
repo_stars
int64
0
154k
repo_description
stringlengths
0
402
repo_primary_language
stringclasses
108 values
developer_username
stringlengths
1
25
developer_name
stringlengths
0
30
developer_company
stringlengths
0
82
src/tls/tls_handshake.cc
C++
/** * @file tls_handshake.cc * @brief TLS 1.3 Handshake Messages Implementation */ #include "tls/tls_handshake.h" #include "quic/quic_frame.h" #include "quic/quic_crypto.h" #include <esp_log.h> #include <cstring> #include <vector> static const char* TAG = "TlsHandshake"; namespace esp_http3 { namespace tls { us...
78/esp-http3
13
A QUIC HTTP/3 Client for ESP32, ported from Python implementation
C++
78
Xiaoxia
include/at_modem.h
C/C++ Header
#ifndef _AT_MODEM_H_ #define _AT_MODEM_H_ #include <cstddef> #include <string> #include <vector> #include <list> #include <functional> #include <mutex> #include <memory> #include <freertos/FreeRTOS.h> #include <freertos/task.h> #include <freertos/queue.h> #include <freertos/event_groups.h> #include <driver/gpio.h> #in...
78/esp-ml307
69
ESP32 ML307 AT Modem
C++
78
Xiaoxia
include/at_uart.h
C/C++ Header
#ifndef _AT_UART_H_ #define _AT_UART_H_ #include <string> #include <vector> #include <functional> #include <mutex> #include <list> #include <cstdlib> #include <memory> #include <freertos/FreeRTOS.h> #include <freertos/task.h> #include <freertos/queue.h> #include <freertos/event_groups.h> #include <driver/gpio.h> #incl...
78/esp-ml307
69
ESP32 ML307 AT Modem
C++
78
Xiaoxia
include/esp_network.h
C/C++ Header
#ifndef ESP_NETWORK_H #define ESP_NETWORK_H #include "network_interface.h" class EspNetwork : public NetworkInterface { public: EspNetwork(); ~EspNetwork(); std::unique_ptr<Http> CreateHttp(int connect_id = -1) override; std::unique_ptr<Tcp> CreateTcp(int connect_id = -1) override; std::unique_pt...
78/esp-ml307
69
ESP32 ML307 AT Modem
C++
78
Xiaoxia
include/http.h
C/C++ Header
#ifndef HTTP_H #define HTTP_H #include <string> #include <map> #include <functional> class Http { public: virtual ~Http() = default; // Set timeout virtual void SetTimeout(int timeout_ms) = 0; // 设置 HTTP 请求头 virtual void SetHeader(const std::string& key, const std::string& value) = 0; // 设置...
78/esp-ml307
69
ESP32 ML307 AT Modem
C++
78
Xiaoxia
include/http_client.h
C/C++ Header
#ifndef HTTP_CLIENT_H #define HTTP_CLIENT_H #include "http.h" #include "tcp.h" #include <freertos/FreeRTOS.h> #include <freertos/event_groups.h> #include <map> #include <string> #include <functional> #include <mutex> #include <condition_variable> #include <optional> #include <memory> #include <deque> #include <cstrin...
78/esp-ml307
69
ESP32 ML307 AT Modem
C++
78
Xiaoxia
include/mqtt.h
C/C++ Header
#ifndef MQTT_INTERFACE_H #define MQTT_INTERFACE_H #include <string> #include <functional> class Mqtt { public: virtual ~Mqtt() {} void SetKeepAlive(int keep_alive_seconds) { keep_alive_seconds_ = keep_alive_seconds; } virtual bool Connect(const std::string broker_address, int broker_port, const std::stri...
78/esp-ml307
69
ESP32 ML307 AT Modem
C++
78
Xiaoxia
include/network_interface.h
C/C++ Header
#ifndef NETWORK_INTERFACE_H #define NETWORK_INTERFACE_H #include <memory> #include "http.h" #include "tcp.h" #include "udp.h" #include "mqtt.h" #include "web_socket.h" class NetworkInterface { public: virtual ~NetworkInterface() = default; // 连接创建接口(纯虚函数,由子类实现) virtual std::unique_ptr<Http> CreateHttp(in...
78/esp-ml307
69
ESP32 ML307 AT Modem
C++
78
Xiaoxia
include/tcp.h
C/C++ Header
#ifndef TCP_H #define TCP_H #include <string> #include <functional> class Tcp { public: virtual ~Tcp() = default; virtual bool Connect(const std::string& host, int port) = 0; virtual void Disconnect() = 0; virtual int Send(const std::string& data) = 0; virtual void OnStream(std::function<void(co...
78/esp-ml307
69
ESP32 ML307 AT Modem
C++
78
Xiaoxia
include/udp.h
C/C++ Header
#ifndef UDP_H #define UDP_H #include <string> #include <functional> class Udp { public: virtual ~Udp() = default; virtual bool Connect(const std::string& host, int port) = 0; virtual void Disconnect() = 0; virtual int Send(const std::string& data) = 0; virtual void OnMessage(std::function<void(c...
78/esp-ml307
69
ESP32 ML307 AT Modem
C++
78
Xiaoxia
include/web_socket.h
C/C++ Header
#ifndef WEBSOCKET_H #define WEBSOCKET_H #include <functional> #include <string> #include <map> #include <vector> #include <mutex> #include <memory> #include <freertos/FreeRTOS.h> #include <freertos/event_groups.h> #include "tcp.h" class NetworkInterface; class WebSocket { public: WebSocket(NetworkInterface* net...
78/esp-ml307
69
ESP32 ML307 AT Modem
C++
78
Xiaoxia
src/at_modem.cc
C++
#include "at_modem.h" #include "ml307/ml307_at_modem.h" #include "ec801e/ec801e_at_modem.h" #include <esp_log.h> #include <esp_err.h> #include <sstream> #include <iomanip> #include <cstring> static const char* TAG = "AtModem"; std::unique_ptr<AtModem> AtModem::Detect(gpio_num_t tx_pin, gpio_num_t rx_pin, gpio_num_t d...
78/esp-ml307
69
ESP32 ML307 AT Modem
C++
78
Xiaoxia
src/at_uart.cc
C++
#include "at_uart.h" #include <esp_log.h> #include <esp_err.h> #include <esp_pm.h> #include <esp_sleep.h> #include <algorithm> #include <cstring> #include <cstdlib> #include <cstdint> #include <sstream> #define TAG "AtUart" // RX data item for queue - stores the buffer pointer for later return struct RxDataItem { ...
78/esp-ml307
69
ESP32 ML307 AT Modem
C++
78
Xiaoxia
src/ec801e/ec801e_at_modem.cc
C++
#include "ec801e_at_modem.h" #include <esp_log.h> #include <esp_err.h> #include <cassert> #include <sstream> #include <iomanip> #include <cstring> #include "ec801e_ssl.h" #include "ec801e_tcp.h" #include "ec801e_udp.h" #include "ec801e_mqtt.h" #include "http_client.h" #include "web_socket.h" #define TAG "Ec801EAtModem...
78/esp-ml307
69
ESP32 ML307 AT Modem
C++
78
Xiaoxia
src/ec801e/ec801e_at_modem.h
C/C++ Header
#ifndef _EC801E_AT_MODEM_H_ #define _EC801E_AT_MODEM_H_ #include "at_modem.h" class Ec801EAtModem : public AtModem { public: Ec801EAtModem(std::shared_ptr<AtUart> at_uart); ~Ec801EAtModem() override = default; bool SetSleepMode(bool enable, int delay_seconds=0) override; // 实现基类的纯虚函数 std::unique...
78/esp-ml307
69
ESP32 ML307 AT Modem
C++
78
Xiaoxia
src/ec801e/ec801e_mqtt.cc
C++
#include "ec801e_mqtt.h" #include <esp_log.h> #define TAG "Ec801EMqtt" Ec801EMqtt::Ec801EMqtt(std::shared_ptr<AtUart> at_uart, int mqtt_id) : at_uart_(at_uart), mqtt_id_(mqtt_id) { event_group_handle_ = xEventGroupCreate(); urc_callback_it_ = at_uart_->RegisterUrcCallback([this](const std::string& command, c...
78/esp-ml307
69
ESP32 ML307 AT Modem
C++
78
Xiaoxia
src/ec801e/ec801e_mqtt.h
C/C++ Header
#ifndef EC801E_MQTT_H #define EC801E_MQTT_H #include "mqtt.h" #include "at_uart.h" #include <freertos/FreeRTOS.h> #include <freertos/task.h> #include <freertos/event_groups.h> #include <string> #include <functional> #define EC801E_MQTT_CONNECT_TIMEOUT_MS 10000 #define EC801E_MQTT_CONNECTED_EVENT BIT1 #define EC801E...
78/esp-ml307
69
ESP32 ML307 AT Modem
C++
78
Xiaoxia
src/ec801e/ec801e_ssl.cc
C++
#include "ec801e_ssl.h" #include <esp_log.h> #define TAG "Ec801ESsl" Ec801ESsl::Ec801ESsl(std::shared_ptr<AtUart> at_uart, int ssl_id) : at_uart_(at_uart), ssl_id_(ssl_id) { event_group_handle_ = xEventGroupCreate(); urc_callback_it_ = at_uart_->RegisterUrcCallback([this](const std::string& command, const ...
78/esp-ml307
69
ESP32 ML307 AT Modem
C++
78
Xiaoxia
src/ec801e/ec801e_ssl.h
C/C++ Header
#ifndef EC801E_SSL_H #define EC801E_SSL_H #include "tcp.h" #include "at_uart.h" #include <freertos/FreeRTOS.h> #include <freertos/event_groups.h> #define EC801E_SSL_CONNECTED BIT0 #define EC801E_SSL_DISCONNECTED BIT1 #define EC801E_SSL_ERROR BIT2 #define EC801E_SSL_SEND_COMPLETE BIT3 #define EC801E_SSL_SEND_FAILED B...
78/esp-ml307
69
ESP32 ML307 AT Modem
C++
78
Xiaoxia
src/ec801e/ec801e_tcp.cc
C++
#include "ec801e_tcp.h" #include <esp_log.h> #define TAG "Ec801ETcp" Ec801ETcp::Ec801ETcp(std::shared_ptr<AtUart> at_uart, int tcp_id) : at_uart_(at_uart), tcp_id_(tcp_id) { event_group_handle_ = xEventGroupCreate(); urc_callback_it_ = at_uart_->RegisterUrcCallback([this](const std::string& command, const ...
78/esp-ml307
69
ESP32 ML307 AT Modem
C++
78
Xiaoxia
src/ec801e/ec801e_tcp.h
C/C++ Header
#ifndef EC801E_TCP_H #define EC801E_TCP_H #include "tcp.h" #include "at_uart.h" #include <freertos/FreeRTOS.h> #include <freertos/event_groups.h> #include <string> #define EC801E_TCP_CONNECTED BIT0 #define EC801E_TCP_DISCONNECTED BIT1 #define EC801E_TCP_ERROR BIT2 #define EC801E_TCP_SEND_COMPLETE BIT3 #define EC801E...
78/esp-ml307
69
ESP32 ML307 AT Modem
C++
78
Xiaoxia
src/ec801e/ec801e_udp.cc
C++
#include "ec801e_udp.h" #include <esp_log.h> #define TAG "Ec801EUdp" Ec801EUdp::Ec801EUdp(std::shared_ptr<AtUart> at_uart, int udp_id) : at_uart_(at_uart), udp_id_(udp_id) { event_group_handle_ = xEventGroupCreate(); urc_callback_it_ = at_uart_->RegisterUrcCallback([this](const std::string& command, const ...
78/esp-ml307
69
ESP32 ML307 AT Modem
C++
78
Xiaoxia
src/ec801e/ec801e_udp.h
C/C++ Header
#ifndef EC801E_UDP_H #define EC801E_UDP_H #include "udp.h" #include "at_uart.h" #include <freertos/FreeRTOS.h> #include <freertos/event_groups.h> #define EC801E_UDP_CONNECTED BIT0 #define EC801E_UDP_DISCONNECTED BIT1 #define EC801E_UDP_ERROR BIT2 #define EC801E_UDP_SEND_COMPLETE BIT3 #define EC801E_UDP_SEND_FAILED B...
78/esp-ml307
69
ESP32 ML307 AT Modem
C++
78
Xiaoxia
src/esp/esp_mqtt.cc
C++
#include "esp_mqtt.h" #include <esp_crt_bundle.h> #include <esp_log.h> static const char *TAG = "esp_mqtt"; EspMqtt::EspMqtt() { event_group_handle_ = xEventGroupCreate(); } EspMqtt::~EspMqtt() { Disconnect(); if (event_group_handle_ != nullptr) { vEventGroupDelete(event_group_handle_); } } ...
78/esp-ml307
69
ESP32 ML307 AT Modem
C++
78
Xiaoxia
src/esp/esp_mqtt.h
C/C++ Header
#ifndef ESP_MQTT_H #define ESP_MQTT_H #include "mqtt.h" #include <mqtt_client.h> #include <freertos/FreeRTOS.h> #include <freertos/task.h> #include <freertos/event_groups.h> #include <string> #include <functional> #define MQTT_CONNECT_TIMEOUT_MS 10000 #define MQTT_INITIALIZED_EVENT BIT0 #define MQTT_CONNECTED_EVENT...
78/esp-ml307
69
ESP32 ML307 AT Modem
C++
78
Xiaoxia
src/esp/esp_network.cc
C++
#include "esp_network.h" #include "esp_tcp.h" #include "esp_ssl.h" #include "esp_udp.h" #include "esp_mqtt.h" #include "http_client.h" #include "web_socket.h" EspNetwork::EspNetwork() { } EspNetwork::~EspNetwork() { } std::unique_ptr<Http> EspNetwork::CreateHttp(int connect_id) { return std::make_unique<Http...
78/esp-ml307
69
ESP32 ML307 AT Modem
C++
78
Xiaoxia
src/esp/esp_ssl.cc
C++
#include "esp_ssl.h" #include <esp_log.h> #include <esp_crt_bundle.h> #include <cstring> #include <unistd.h> static const char *TAG = "EspSsl"; EspSsl::EspSsl() { event_group_ = xEventGroupCreate(); } EspSsl::~EspSsl() { Disconnect(); if (event_group_ != nullptr) { vEventGroupDelete(event_group_...
78/esp-ml307
69
ESP32 ML307 AT Modem
C++
78
Xiaoxia
src/esp/esp_ssl.h
C/C++ Header
#ifndef _ESP_SSL_H_ #define _ESP_SSL_H_ #include "tcp.h" #include <esp_tls.h> #include <freertos/FreeRTOS.h> #include <freertos/event_groups.h> #include <freertos/task.h> #define ESP_SSL_EVENT_RECEIVE_TASK_EXIT 1 class EspSsl : public Tcp { public: EspSsl(); ~EspSsl(); bool Connect(const std::string& h...
78/esp-ml307
69
ESP32 ML307 AT Modem
C++
78
Xiaoxia
src/esp/esp_tcp.cc
C++
#include "esp_tcp.h" #include <esp_log.h> #include <unistd.h> #include <cstring> #include <arpa/inet.h> #include <sys/socket.h> #include <netdb.h> #include <errno.h> static const char *TAG = "EspTcp"; EspTcp::EspTcp() { event_group_ = xEventGroupCreate(); } EspTcp::~EspTcp() { Disconnect(); if (event_g...
78/esp-ml307
69
ESP32 ML307 AT Modem
C++
78
Xiaoxia
src/esp/esp_tcp.h
C/C++ Header
#ifndef _ESP_TCP_H_ #define _ESP_TCP_H_ #include "tcp.h" #include <freertos/FreeRTOS.h> #include <freertos/event_groups.h> #include <freertos/task.h> #define ESP_TCP_EVENT_RECEIVE_TASK_EXIT 1 class EspTcp : public Tcp { public: EspTcp(); ~EspTcp(); bool Connect(const std::string& host, int port) overri...
78/esp-ml307
69
ESP32 ML307 AT Modem
C++
78
Xiaoxia
src/esp/esp_udp.cc
C++
#include "esp_udp.h" #include <esp_log.h> #include <unistd.h> #include <cstring> #include <arpa/inet.h> #include <sys/socket.h> #include <netdb.h> #include <errno.h> static const char *TAG = "EspUdp"; EspUdp::EspUdp() : udp_fd_(-1) { event_group_ = xEventGroupCreate(); } EspUdp::~EspUdp() { Disconnect(); ...
78/esp-ml307
69
ESP32 ML307 AT Modem
C++
78
Xiaoxia
src/esp/esp_udp.h
C/C++ Header
#ifndef ESP_UDP_H #define ESP_UDP_H #include "udp.h" #include <freertos/FreeRTOS.h> #include <freertos/event_groups.h> #include <freertos/task.h> #define ESP_UDP_EVENT_RECEIVE_TASK_EXIT 1 class EspUdp : public Udp { public: EspUdp(); ~EspUdp(); bool Connect(const std::string& host, int port) override; ...
78/esp-ml307
69
ESP32 ML307 AT Modem
C++
78
Xiaoxia
src/http_client.cc
C++
#include "http_client.h" #include "network_interface.h" #include <esp_log.h> #include <cstring> #include <cstdlib> #include <sstream> #include <chrono> #include <algorithm> #include <cctype> static const char *TAG = "HttpClient"; HttpClient::HttpClient(NetworkInterface* network, int connect_id) : network_(network), c...
78/esp-ml307
69
ESP32 ML307 AT Modem
C++
78
Xiaoxia
src/ml307/ml307_at_modem.cc
C++
#include "ml307_at_modem.h" #include <esp_log.h> #include <esp_err.h> #include <cassert> #include <sstream> #include <iomanip> #include <cstring> #include "ml307_tcp.h" #include "ml307_ssl.h" #include "ml307_udp.h" #include "ml307_mqtt.h" #include "ml307_http.h" #include "web_socket.h" #define TAG "Ml307AtModem" Ml3...
78/esp-ml307
69
ESP32 ML307 AT Modem
C++
78
Xiaoxia
src/ml307/ml307_at_modem.h
C/C++ Header
#ifndef _ML307_AT_MODEM_H_ #define _ML307_AT_MODEM_H_ #include "at_modem.h" #include "tcp.h" #include "udp.h" #include "http.h" #include "mqtt.h" #include "web_socket.h" class Ml307AtModem : public AtModem { public: Ml307AtModem(std::shared_ptr<AtUart> at_uart); ~Ml307AtModem() override = default; void R...
78/esp-ml307
69
ESP32 ML307 AT Modem
C++
78
Xiaoxia
src/ml307/ml307_http.cc
C++
#include "ml307_http.h" #include <esp_log.h> #include <cstring> #include <sstream> #include <chrono> static const char *TAG = "Ml307Http"; Ml307Http::Ml307Http(std::shared_ptr<AtUart> at_uart) : at_uart_(at_uart) { event_group_handle_ = xEventGroupCreate(); urc_callback_it_ = at_uart_->RegisterUrcCallback([t...
78/esp-ml307
69
ESP32 ML307 AT Modem
C++
78
Xiaoxia
src/ml307/ml307_http.h
C/C++ Header
#ifndef ML307_HTTP_TRANSPORT_H #define ML307_HTTP_TRANSPORT_H #include "at_uart.h" #include "http.h" #include <freertos/FreeRTOS.h> #include <freertos/event_groups.h> #include <map> #include <string> #include <functional> #include <mutex> #include <condition_variable> #include <optional> #define ML307_HTTP_EVENT_INI...
78/esp-ml307
69
ESP32 ML307 AT Modem
C++
78
Xiaoxia
src/ml307/ml307_mqtt.cc
C++
#include "ml307_mqtt.h" #include <esp_log.h> static const char *TAG = "Ml307Mqtt"; Ml307Mqtt::Ml307Mqtt(std::shared_ptr<AtUart> at_uart, int mqtt_id) : at_uart_(at_uart), mqtt_id_(mqtt_id) { event_group_handle_ = xEventGroupCreate(); urc_callback_it_ = at_uart_->RegisterUrcCallback([this](const std::string& ...
78/esp-ml307
69
ESP32 ML307 AT Modem
C++
78
Xiaoxia
src/ml307/ml307_mqtt.h
C/C++ Header
#ifndef ML307_MQTT_H #define ML307_MQTT_H #include "mqtt.h" #include "at_uart.h" #include <freertos/FreeRTOS.h> #include <freertos/task.h> #include <freertos/event_groups.h> #include <string> #include <functional> #define MQTT_CONNECT_TIMEOUT_MS 10000 #define MQTT_INITIALIZED_EVENT BIT0 #define MQTT_CONNECTED_EVENT...
78/esp-ml307
69
ESP32 ML307 AT Modem
C++
78
Xiaoxia
src/ml307/ml307_ssl.cc
C++
#include "ml307_ssl.h" #include <esp_log.h> static const char *TAG = "Ml307Ssl"; Ml307Ssl::Ml307Ssl(std::shared_ptr<AtUart> at_uart, int tcp_id) : Ml307Tcp(at_uart, tcp_id) { } bool Ml307Ssl::ConfigureSsl(int port) { // 设置 SSL 配置 std::string command = "AT+MSSLCFG=\"auth\",0,0"; if (!at_uart_->SendCommand...
78/esp-ml307
69
ESP32 ML307 AT Modem
C++
78
Xiaoxia
src/ml307/ml307_ssl.h
C/C++ Header
#ifndef ML307_SSL_H #define ML307_SSL_H #include "ml307_tcp.h" class Ml307Ssl : public Ml307Tcp { public: Ml307Ssl(std::shared_ptr<AtUart> at_uart, int tcp_id); ~Ml307Ssl() = default; protected: // 重写SSL配置方法 bool ConfigureSsl(int port) override; }; #endif // ML307_SSL_H
78/esp-ml307
69
ESP32 ML307 AT Modem
C++
78
Xiaoxia
src/ml307/ml307_tcp.cc
C++
#include "ml307_tcp.h" #include <esp_log.h> #include <cstring> #define TAG "Ml307Tcp" Ml307Tcp::Ml307Tcp(std::shared_ptr<AtUart> at_uart, int tcp_id) : at_uart_(at_uart), tcp_id_(tcp_id) { event_group_handle_ = xEventGroupCreate(); urc_callback_it_ = at_uart_->RegisterUrcCallback([this](const std::string& co...
78/esp-ml307
69
ESP32 ML307 AT Modem
C++
78
Xiaoxia
src/ml307/ml307_tcp.h
C/C++ Header
#ifndef ML307_TCP_H #define ML307_TCP_H #include "tcp.h" #include "at_uart.h" #include <freertos/FreeRTOS.h> #include <freertos/event_groups.h> #include <string> #define ML307_TCP_CONNECTED BIT0 #define ML307_TCP_DISCONNECTED BIT1 #define ML307_TCP_ERROR BIT2 #define ML307_TCP_SEND_COMPLETE BIT4 #define ML307_TCP_IN...
78/esp-ml307
69
ESP32 ML307 AT Modem
C++
78
Xiaoxia
src/ml307/ml307_udp.cc
C++
#include "ml307_udp.h" #include <esp_log.h> #define TAG "Ml307Udp" Ml307Udp::Ml307Udp(std::shared_ptr<AtUart> at_uart, int udp_id) : at_uart_(at_uart), udp_id_(udp_id) { event_group_handle_ = xEventGroupCreate(); local_port_ = 0; urc_callback_it_ = at_uart_->RegisterUrcCallback([this](const std::string...
78/esp-ml307
69
ESP32 ML307 AT Modem
C++
78
Xiaoxia
src/ml307/ml307_udp.h
C/C++ Header
#ifndef ML307_UDP_H #define ML307_UDP_H #include "udp.h" #include "at_uart.h" #include <freertos/FreeRTOS.h> #include <freertos/event_groups.h> #define ML307_UDP_CONNECTED BIT0 #define ML307_UDP_DISCONNECTED BIT1 #define ML307_UDP_ERROR BIT2 #define ML307_UDP_RECEIVE BIT3 #define ML307_UDP_SEND_COMPLETE BIT4 #define...
78/esp-ml307
69
ESP32 ML307 AT Modem
C++
78
Xiaoxia
src/web_socket.cc
C++
#include "web_socket.h" #include "network_interface.h" #include <esp_log.h> #include <cstdlib> #include <cstring> #include <esp_pthread.h> #define TAG "WebSocket" static std::string base64_encode(const unsigned char *data, size_t len) { const char *base64_chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuv...
78/esp-ml307
69
ESP32 ML307 AT Modem
C++
78
Xiaoxia
api/ecosystem.config.js
JavaScript
module.exports = { apps : [{ name : "master", script : "./master.js", time : true }] }
78/tenbot
6
A Chatbot for Exploring Large Language Model Capabilities
Vue
78
Xiaoxia
api/master.js
JavaScript
// A socket io server for bot nodes to connect to and receive commands from the master node // -------------------------------------------------------- const express = require("express"); const cors = require("cors"); const app = express(); const http = require("http").createServer(app); const io = require("socket.io"...
78/tenbot
6
A Chatbot for Exploring Large Language Model Capabilities
Vue
78
Xiaoxia
api/node.js
JavaScript
// Socket IO node // -------------------------------------------------------- const NodeConfig = require(process.argv[2] || './deployment.config').Node; const axios = require('axios'); let currentStatus = 'offline'; let pendingStatus = false; let modelId = null; const runningTasks = {}; function updateNodeStatus(ne...
78/tenbot
6
A Chatbot for Exploring Large Language Model Capabilities
Vue
78
Xiaoxia
api/sample.config.js
JavaScript
const DeploymentConfig = { Node: { model: { id: 'qwen-110b', archecture: 'qwen', version: '1.0', }, gpu: { model: '3090', vram: 24, count: 4, }, memory: 64, masterServerUrl: 'https://api.yourdomain.com/', inferenceServerUrl: 'http://localhost:8000', ...
78/tenbot
6
A Chatbot for Exploring Large Language Model Capabilities
Vue
78
Xiaoxia
tools/ecosystem.config.js
JavaScript
module.exports = { apps : [{ name : "tools", script : "./tools_server.py", interpreter: "/root/miniconda3/envs/master/bin/python", time : true, env : { "NODE_ENV": "production", "PORT": 3020, "TAVILY_API_KEY": "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", "RERANKER_MODEL_...
78/tenbot
6
A Chatbot for Exploring Large Language Model Capabilities
Vue
78
Xiaoxia
tools/tools_server.py
Python
import time import urllib import trafilatura import sqlite3 import os from bs4 import BeautifulSoup from flask import Flask, request, jsonify from transformers import AutoTokenizer from selenium import webdriver tokenizer_path = os.environ["TOKENIZER_PATH"] db_path = './db.sqlite3' user_agent = 'Mozilla/5.0 (Windows ...
78/tenbot
6
A Chatbot for Exploring Large Language Model Capabilities
Vue
78
Xiaoxia
web/components/Chat.vue
Vue
<template> <div class="chatroom" ref="chatroom"> <a-list class="message-list" item-layout="horizontal" ref="messageList" > <template #header> <div style="text-align: center;"> <a-space> <span> Current model </span> <a-...
78/tenbot
6
A Chatbot for Exploring Large Language Model Capabilities
Vue
78
Xiaoxia
web/components/Message.vue
Vue
<template> <div class="message-box"> <a-row> <a-col :span="1"> <template v-if="item.role === 'assistant' || item.content.startsWith('✿') "> <a-avatar shape="square" :size="40" :src="assistantAvatar"></a-avatar> </template> <template v-else> <a-avatar shape="square...
78/tenbot
6
A Chatbot for Exploring Large Language Model Capabilities
Vue
78
Xiaoxia
web/components/Watermark.vue
Vue
<template> <div ref="watermark" class="watermark" /> </template> <script type="text/javascript"> export default { props: { text: { type: String, default: '' } }, watch: { text (newVal, oldVal) { this.makeImage(newVal) } }, mounted () { this.makeImage(this.text) }, ...
78/tenbot
6
A Chatbot for Exploring Large Language Model Capabilities
Vue
78
Xiaoxia
web/nuxt.config.js
JavaScript
export default { // Disable server-side rendering: https://go.nuxtjs.dev/ssr-mode ssr: false, loading: false, // Global page headers: https://go.nuxtjs.dev/config-head head: { title: 'OpenBuddy.ai', htmlAttrs: { lang: 'zh-CN' }, meta: [ { charset: 'utf-8' }, { name: 'viewpor...
78/tenbot
6
A Chatbot for Exploring Large Language Model Capabilities
Vue
78
Xiaoxia
web/pages/index.vue
Vue
<template> <a-layout style="height: 100%;"> <!-- <a-layout-sider width="320"><ThreadList/></a-layout-sider> --> <a-layout> <!-- <a-layout-header>Header</a-layout-header> --> <a-layout-content> <Chat/> </a-layout-content> </a-layout> </a-layout> </template> <style type="text/cs...
78/tenbot
6
A Chatbot for Exploring Large Language Model Capabilities
Vue
78
Xiaoxia
web/plugins/antd-ui.js
JavaScript
import Vue from 'vue' import Antd from 'ant-design-vue/lib' Vue.use(Antd)
78/tenbot
6
A Chatbot for Exploring Large Language Model Capabilities
Vue
78
Xiaoxia
web/plugins/filters.js
JavaScript
import Vue from 'vue' import moment from 'moment' moment.locale('zh-CN') function timeformat (t) { if (t) { return moment(t).format('YYYY-MM-DD HH:mm:ss') } return '' } function timespan (t) { if (t) { return moment.utc(t).fromNow(true) } return '' } function fromnow (t) { if (t) { return m...
78/tenbot
6
A Chatbot for Exploring Large Language Model Capabilities
Vue
78
Xiaoxia
include/uart_eth_modem.h
C/C++ Header
// Copyright 2025 Terrence // SPDX-License-Identifier: Apache-2.0 #pragma once #include <atomic> #include <functional> #include <memory> #include <mutex> #include <string> #include "driver/gpio.h" #include "driver/uart.h" #include "uart_uhci.h" #include "esp_err.h" #include "esp_event.h" #include "esp_netif.h" #incl...
78/uart-eth-modem
3
UART Ethernet Modem component for ESP32
C++
78
Xiaoxia
src/uart_eth_modem.cc
C++
// Copyright 2025 Terrence // SPDX-License-Identifier: Apache-2.0 #include "uart_eth_modem.h" #include <cstdio> #include <cstring> #include <esp_check.h> #include <esp_log.h> #include <esp_mac.h> #include <esp_rom_sys.h> #include <hal/gpio_ll.h> #include <lwip/dns.h> #include <lwip/tcpip.h> // Static member defini...
78/uart-eth-modem
3
UART Ethernet Modem component for ESP32
C++
78
Xiaoxia
asr-server/app.js
JavaScript
const config = require('./config'); const { WebSocketServer } = require('ws'); const { OpusEncoder } = require('@discordjs/opus'); const AsrWorkerManager = require('./manager'); const wss = new WebSocketServer({ port: config.asrFrontendPort }); const manager = new AsrWorkerManager(); wss.on('connection', (ws) => { ...
78/xiaozhi
733
Build your own AI friend
JavaScript
78
Xiaoxia
asr-server/config.js
JavaScript
module.exports = { asrFrontendPort: process.env.NODE_ENV=='dev' ? 8182 : 8082, // 用于处理前端识别连接请求 asrBackendPort: process.env.NODE_ENV=='dev' ? 8181 : 8081, // 用于与后端推理服务器通信 asrBackendPingInterval: 30000, // 30s decodeSampleRate: 16000, };
78/xiaozhi
733
Build your own AI friend
JavaScript
78
Xiaoxia
asr-server/ecosystem.config.js
JavaScript
module.exports = { apps: [ { name: 'asr-server', script: 'app.js', log_date_format: "YYYY-MM-DD HH:mm:ss.SSS", } ] };
78/xiaozhi
733
Build your own AI friend
JavaScript
78
Xiaoxia
asr-server/manager.js
JavaScript
const Emitter = require('events'); const AsrWorker = require('./worker'); const { WebSocketServer } = require('ws'); const config = require('./config'); class AsrWorkerManager extends Emitter { constructor() { super(); this.workers = new Map(); this.initTaskServer(); this.startPingInterval(); } ...
78/xiaozhi
733
Build your own AI friend
JavaScript
78
Xiaoxia
asr-server/worker.js
JavaScript
const Emitter = require('events'); const { v4: uuidv4 } = require('uuid'); class AsrWorkerSession extends Emitter { constructor(asrWorker) { super(); this.asrWorker = asrWorker; this.sessionId = uuidv4(); this.initializeBuffer(); } initializeBuffer() { const sessionIdLength = Buffer.alloc(4)...
78/xiaozhi
733
Build your own AI friend
JavaScript
78
Xiaoxia
asr-worker/app.py
Python
''' Audio Recognition Task Client 这个服务用于接收语音识别任务,并将识别结果发送给调用方。 可以运行于没有公网 IP 的环境,通过 WebSocket 连接到任务分发服务器。 terrence@tenclass.com 2024-09 ''' import logging import sys # 配置日志 logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s', stream=sys.stdout) # 加载环境变量 from dotenv import load_do...
78/xiaozhi
733
Build your own AI friend
JavaScript
78
Xiaoxia
asr-worker/audio_storage.py
Python
import threading import queue import oss2 import soundfile as sf import base64 import os class AudioStorage: def __init__(self, sample_rate): self.oss_access_key_id = os.getenv("OSS_ACCESS_KEY_ID") if self.oss_access_key_id is None: return self.auth = oss2.Auth(self.oss_access_...
78/xiaozhi
733
Build your own AI friend
JavaScript
78
Xiaoxia
tts-server/app.js
JavaScript
const WebSocket = require('ws'); const config = require('./config'); const { OpusEncoder } = require('@discordjs/opus'); const { ttsList } = require('./tts-list'); const { BytedanceTtsClient } = require('./bytedance_tts'); const { DashscopeTtsClient } = require('./dashscope_tts'); const ttsClients = { volcengine: By...
78/xiaozhi
733
Build your own AI friend
JavaScript
78
Xiaoxia
tts-server/bytedance_tts.js
JavaScript
// terrence@tenclass.com // 2024-08-27 // 大模型语音合成双向流式 API // (https://www.volcengine.com/docs/6561/1329505) require('dotenv').config(); const { WebSocket } = require('ws'); const { v4: uuidv4 } = require('uuid'); const EventEmitter = require('events'); class TtsSession extends EventEmitter { constructor(client, spe...
78/xiaozhi
733
Build your own AI friend
JavaScript
78
Xiaoxia
tts-server/config.js
JavaScript
module.exports = { // ttsFrontendPort: 8083, ttsFrontendPort: process.env.NODE_ENV=='dev' ? 8183 : 8083, };
78/xiaozhi
733
Build your own AI friend
JavaScript
78
Xiaoxia
tts-server/dashscope_tts.js
JavaScript
// terrence@tenclass.com // 2024-10-03 // 大模型语音合成双向流式 API (灵积 CosyVoice) require('dotenv').config(); const { WebSocket } = require('ws'); const { v4: uuidv4 } = require('uuid'); const EventEmitter = require('events'); class TtsSession extends EventEmitter { constructor(client, speaker, sampleRate = 22050) { sup...
78/xiaozhi
733
Build your own AI friend
JavaScript
78
Xiaoxia
tts-server/ecosystem.config.js
JavaScript
module.exports = { apps: [ { name: 'tts-server', script: 'app.js', log_date_format: "YYYY-MM-DD HH:mm:ss.SSS", } ] };
78/xiaozhi
733
Build your own AI friend
JavaScript
78
Xiaoxia
tts-server/tts-list.js
JavaScript
const ttsList = [ { name: "爽快思思/Skye", voice_source: "volcengine", voice_id: "zh_female_shuangkuaisisi_moon_bigtts", languages: ["中文", "英文"], voice_demo: "https://lf3-static.bytednsdoc.com/obj/eden-cn/lm_hz_ihsph/ljhwZthlaukjlkulzlp/portal/bigtts/Skye.mp3" }, { name: "温暖阿虎/Alvin", v...
78/xiaozhi
733
Build your own AI friend
JavaScript
78
Xiaoxia
web/index.html
HTML
<!DOCTYPE html> <html lang="zh-CN"> <head> <meta charset="UTF-8" /> <link rel="icon" type="image/svg+xml" href="/vite.svg" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>Xiaozhi AI Customization</title> </head> <body> <div id="app"></div> <script type="m...
78/xiaozhi-assets-generator
89
JavaScript
78
Xiaoxia
web/postcss.config.js
JavaScript
export default { plugins: { tailwindcss: {}, autoprefixer: {}, }, }
78/xiaozhi-assets-generator
89
JavaScript
78
Xiaoxia
web/public/workers/gif.js
JavaScript
// gif.js 0.2.0 - https://github.com/jnordberg/gif.js (function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof s...
78/xiaozhi-assets-generator
89
JavaScript
78
Xiaoxia
web/public/workers/gif.worker.js
JavaScript
// gif.worker.js 0.2.0 - https://github.com/jnordberg/gif.js (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l...
78/xiaozhi-assets-generator
89
JavaScript
78
Xiaoxia
web/src/App.vue
Vue
<template> <div class="min-h-screen bg-gray-50"> <!-- Header --> <header class="bg-white shadow-sm border-b"> <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-4"> <div class="flex flex-col sm:flex-row items-start sm:items-center justify-between gap-3 sm:gap-0"> <h1 class="...
78/xiaozhi-assets-generator
89
JavaScript
78
Xiaoxia
web/src/components/ChipConfig.vue
Vue
<template> <div class="space-y-6"> <div> <h2 class="text-xl font-semibold text-gray-900 mb-4">{{ $t('chipConfig.title') }}</h2> <p class="text-gray-600 mb-6"> <span v-if="isLoadingConfig">{{ $t('chipConfig.loadingFromDevice') }}</span> <span v-else-if="deviceConfigLoaded">{{ $t('chipCo...
78/xiaozhi-assets-generator
89
JavaScript
78
Xiaoxia
web/src/components/DeviceStatus.vue
Vue
<template> <!-- 桌面端布局 --> <div v-if="showComponent" class="hidden lg:flex items-center space-x-4" :class="deviceStatus.isOnline ? '' : 'opacity-60'"> <!-- 设备状态指示器 --> <div class="flex items-center space-x-2"> <!-- 在线状态图标 --> <div class="flex items-center space-x-1"> <div :class...
78/xiaozhi-assets-generator
89
JavaScript
78
Xiaoxia
web/src/components/GenerateModal.vue
Vue
<template> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 p-4"> <div class="bg-white rounded-lg shadow-xl max-w-2xl w-full max-h-[90vh] overflow-hidden"> <!-- 模态框头部 --> <div class="flex items-center justify-between p-6 border-b border-gray-200"> <h3 clas...
78/xiaozhi-assets-generator
89
JavaScript
78
Xiaoxia
web/src/components/GenerateSummary.vue
Vue
<template> <div class="space-y-6"> <div> <h2 class="text-xl font-semibold text-gray-900 mb-4">{{ $t('generateSummary.title') }}</h2> <p class="text-gray-600 mb-6">{{ $t('generateSummary.description') }}</p> </div> <!-- 设备预览区域 --> <div class="flex flex-col lg:flex-row gap-8"> <!-- 设备...
78/xiaozhi-assets-generator
89
JavaScript
78
Xiaoxia
web/src/components/LanguageSelector.vue
Vue
<template> <div class="relative"> <button @click="toggleDropdown" class="flex items-center space-x-2 px-3 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-md hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500" > <span>{{ cur...
78/xiaozhi-assets-generator
89
JavaScript
78
Xiaoxia
web/src/components/ThemeDesign.vue
Vue
<template> <div class="space-y-6"> <div> <h2 class="text-xl font-semibold text-gray-900 mb-4">{{ $t('themeDesign.title') }}</h2> <p class="text-gray-600 mb-6">{{ $t('themeDesign.description') }}</p> </div> <!-- Tab Navigation --> <div class="border-b border-gray-200"> <nav class="-m...
78/xiaozhi-assets-generator
89
JavaScript
78
Xiaoxia
web/src/components/icons/BoardIcon.vue
Vue
<template> <svg :class="iconClass" fill="none" stroke="currentColor" viewBox="0 0 24 24"> <!-- PCB board outline --> <rect x="4" y="4" width="16" height="16" rx="1" stroke-width="2"/> <!-- Corner mounting holes --> <circle cx="6.5" cy="6.5" r="1" stroke-width="1.5"/> <circle cx="17.5" cy="6.5" r="...
78/xiaozhi-assets-generator
89
JavaScript
78
Xiaoxia
web/src/components/icons/ChipIcon.vue
Vue
<template> <svg :class="iconClass" fill="none" stroke="currentColor" viewBox="0 0 24 24"> <rect x="7" y="7" width="10" height="10" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/> <rect x="9" y="9" width="6" height="6" stroke-width="1.5" fill="currentColor" opacity="0.1"/> <line x1="7" y1...
78/xiaozhi-assets-generator
89
JavaScript
78
Xiaoxia
web/src/components/icons/FlashIcon.vue
Vue
<template> <svg :class="iconClass" fill="none" stroke="currentColor" viewBox="0 0 24 24"> <!-- Flash chip body --> <rect x="6" y="5" width="12" height="14" rx="1" stroke-width="2"/> <!-- Pins on left --> <line x1="6" y1="8" x2="4" y2="8" stroke-width="1.5"/> <line x1="6" y1="11" x2="4" y2="11" str...
78/xiaozhi-assets-generator
89
JavaScript
78
Xiaoxia
web/src/components/icons/ScreenIcon.vue
Vue
<template> <svg :class="iconClass" fill="none" stroke="currentColor" viewBox="0 0 24 24"> <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9.75 17L9 20l-1 1h8l-1-1-.75-3M3 13h18M5 17h14a2 2 0 002-2V5a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"></path> </svg> </template> <script setup>...
78/xiaozhi-assets-generator
89
JavaScript
78
Xiaoxia
web/src/components/icons/Signal4GIcon.vue
Vue
<template> <svg :class="iconClass" fill="currentColor" viewBox="0 0 24 24"> <!-- Signal bars --> <rect x="2" y="16" width="3" height="6" rx="0.5"/> <rect x="7" y="12" width="3" height="10" rx="0.5" opacity="0.8"/> <rect x="12" y="8" width="3" height="14" rx="0.5" opacity="0.6"/> <rect x="17" y="4"...
78/xiaozhi-assets-generator
89
JavaScript
78
Xiaoxia
web/src/components/icons/WifiIcon.vue
Vue
<template> <svg :class="iconClass" fill="none" stroke="currentColor" viewBox="0 0 24 24"> <!-- WiFi waves from outer to inner --> <path d="M3 9c4.97-4.97 13.03-4.97 18 0" stroke-width="2" stroke-linecap="round"/> <path d="M6 12c3.31-3.31 8.69-3.31 12 0" stroke-width="2" stroke-linecap="round"/> <path ...
78/xiaozhi-assets-generator
89
JavaScript
78
Xiaoxia
web/src/components/icons/index.js
JavaScript
export { default as WifiIcon } from './WifiIcon.vue' export { default as Signal4GIcon } from './Signal4GIcon.vue' export { default as ChipIcon } from './ChipIcon.vue' export { default as FlashIcon } from './FlashIcon.vue' export { default as BoardIcon } from './BoardIcon.vue' export { default as ScreenIcon } from './Sc...
78/xiaozhi-assets-generator
89
JavaScript
78
Xiaoxia
web/src/components/tabs/BackgroundConfig.vue
Vue
<template> <div class="space-y-6"> <div> <h3 class="text-lg font-medium text-gray-900 mb-2">{{ $t('backgroundConfig.title') }}</h3> <p class="text-gray-600">{{ $t('backgroundConfig.description') }}</p> </div> <div class="space-y-4"> <h4 class="font-medium text-gray-900 flex items-center...
78/xiaozhi-assets-generator
89
JavaScript
78
Xiaoxia
web/src/components/tabs/EmojiConfig.vue
Vue
<template> <div class="space-y-6"> <div> <h3 class="text-lg font-medium text-gray-900 mb-2">{{ $t('emojiConfig.title') }}</h3> <p class="text-gray-600">{{ $t('emojiConfig.description') }}</p> </div> <!-- 表情类型选择 --> <div class="space-y-4"> <div class="flex flex-wrap gap-3"> <...
78/xiaozhi-assets-generator
89
JavaScript
78
Xiaoxia
web/src/components/tabs/FontConfig.vue
Vue
<template> <div class="space-y-6"> <div> <h3 class="text-lg font-medium text-gray-900 mb-2">{{ $t('fontConfig.title') }}</h3> <p class="text-gray-600">{{ $t('fontConfig.description') }}</p> </div> <!-- 字体类型选择 --> <div class="space-y-4"> <div class="flex space-x-4"> <button ...
78/xiaozhi-assets-generator
89
JavaScript
78
Xiaoxia
web/src/components/tabs/WakewordConfig.vue
Vue
<template> <div class="space-y-6"> <div> <h3 class="text-lg font-medium text-gray-900 mb-2">{{ $t('wakewordConfig.title') }}</h3> <p class="text-gray-600"> {{ $t('wakewordConfig.description') }} </p> </div> <!-- 不支持唤醒词的提示 --> <div v-if="!canUseAnyWakeword" class="bg-orange-5...
78/xiaozhi-assets-generator
89
JavaScript
78
Xiaoxia
web/src/composables/useDeviceStatus.js
JavaScript
import { ref, computed, onMounted, onUnmounted } from 'vue' // 全局共享的设备状态 const deviceStatus = ref({ isOnline: false, error: '', lastCheck: null }) const deviceInfo = ref({ chip: null, board: null, firmware: null, flash: null, assetsPartition: null, network: null, screen: null }) const token = ref...
78/xiaozhi-assets-generator
89
JavaScript
78
Xiaoxia
web/src/locales/index.js
JavaScript
import en from './en.json' import zhCN from './zh-CN.json' import zhTW from './zh-TW.json' import ja from './ja.json' import vi from './vi.json' export const messages = { en, 'zh-CN': zhCN, 'zh-TW': zhTW, ja, vi } export const languageOptions = [ { code: 'en', name: 'English', flag: '🇺🇸' }, { code: 'z...
78/xiaozhi-assets-generator
89
JavaScript
78
Xiaoxia
web/src/main.js
JavaScript
import { createApp } from 'vue' import { createI18n } from 'vue-i18n' import './style.css' import App from './App.vue' import router from './router' import { messages, getBrowserLanguage } from './locales' const i18n = createI18n({ legacy: false, locale: getBrowserLanguage(), fallbackLocale: 'en', messages }) ...
78/xiaozhi-assets-generator
89
JavaScript
78
Xiaoxia
web/src/router/index.js
JavaScript
import { createRouter, createWebHistory } from 'vue-router' const routes = [ { path: '/', name: 'Home', component: () => import('@/views/HomePage.vue') }, ] const router = createRouter({ history: createWebHistory(import.meta.env.BASE_URL), routes }) export default router
78/xiaozhi-assets-generator
89
JavaScript
78
Xiaoxia