mirror of
https://github.com/justLV/onju-v2
synced 2026-04-21 15:47:55 +00:00
PTT devices (--device name=ip:ptt): skip VAD, buffer audio until packets stop, skip LED commands, interrupt in-flight responses on new audio. Auto-detected from multicast "PTT" announcement. HTTP control server on :3002 for runtime device management: POST/GET/DELETE /devices Firmware: replace per-chunk DC offset with IIR filter to eliminate zipper noise at chunk boundaries (m5_echo + onjuino). Protocol: TCP timeouts use actual timeout param, failures are silent for non-critical commands (LED blink). Pipeline: labeled error logging (ASR/LLM/TTS), env var resolution warning, Gemini OpenAI-compatible endpoint support. Test scripts: rewritten to use pipeline modules, delete redundant test_opus_tts.py, add pyproject.toml (replaces requirements.txt).
15 lines
433 B
Python
15 lines
433 B
Python
#!/usr/bin/env python3
|
|
"""Quick test: can we receive UDP on port 3000?"""
|
|
import socket
|
|
|
|
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
|
|
sock.bind(("0.0.0.0", 3000))
|
|
sock.settimeout(15)
|
|
print("Listening on :3000 — press PTT on M5 within 15s...")
|
|
try:
|
|
data, addr = sock.recvfrom(2048)
|
|
print(f"Got {len(data)}B from {addr}")
|
|
except socket.timeout:
|
|
print("No packets received (timeout)")
|
|
finally:
|
|
sock.close()
|