GNU General Public License v2.0

技术解读

以下内容由 GitRead 中文社区 编辑团队基于项目 README 与官方资料整理, 结合中文开发者的常见使用场景补充技术选型建议。具体以项目官方文档为准。

深度技术分析:sh123/esp32_loradv

项目背景与痛点

在无线通信领域,手持对讲机(walkie-talkie)因其便携性和即时通讯能力,一直占有重要位置。特别是对于户外活动、休闲爱好者和特定行业的工作人员,传统对讲机虽然小巧便携,但在音质、带宽和续航方面往往不尽如人意。在此背景下,sh123/esp32_loradv 项目应运而生,它基于 ESP32 芯片,结合 Codec2/OPUS 音频编解码技术,实现了高质量的数字对讲设备。该项目致力于提供一个低功耗、高音质和可靠传输性能的手持设备解决方案,使得用户在长距离和复杂环境下的语音通信更加稳定可靠。

核心技术揭秘

ESP32 芯片以其灵活多样的通信协议和低功耗性能,成为了该项目的首选。此外,Codec2 和 OPUS 音频编解码器的引入,解决了传统设备音质不佳的问题。Codec2 是一种优化的低比特率语音编解码器,适合于低带宽传输环境,OPUS 则更侧重于高质量且低延迟的语音传输,适用于互联网通信场景。通过这两种编解码器的结合使用,进一步拓宽了设备的应用范围和用户体验。

项目的架构设计采用了模块化的方式,具体结构如下所示:

graph TD A[用户交互] --> B[ESP32 ADC/DAC] C[Codec2] -.- D[OPUS] E[无线通讯模块] -.- F[数据传输路径] B --> C --> E B --> D --> E G[低功耗管理] -.-> H[电源管理] B --> G E --> F F --> I[远程节点] E --> J[网络状态监测]

数据流方面,从用户交互到最终的无线传输,涉及了几大重要模块——首先是通过 ESP32 的 ADC/DAC 模块进行声音的采集和还原,然后将信号送入 Codec2 或 OPUS 编解码器进行处理,最后由无线通讯模块进行传输。整个过程中,低功耗管理模块和电源管理模块负责确保设备的电源使用效率,最大限度地延长设备使用时间。

功能亮点与差异

与其他同类型设备相比,sh123/esp32_loradv 并不仅仅是一个简单的对讲机。该项目的独特之处在于,它同时支持 Codec2 和 OPUS 两种编解码技术,用户可以根据实际通信环境灵活切换编解码器,从而在带宽和音质上找到最合适的平衡点。此外,它还通过软件定义无线电 (SDR) 技术,支持多种无线通讯协议,进一步提高了设备的兼容性和灵活性。在开源许可证的加持下,该项目也鼓励更多的开发者参与到硬件设计和软件开发中,有利于形成强大的社区生态系统。

应用场景与落地建议

在实际生产环境部署时,建议先对设备的抗干扰性和稳定性进行充分测试,以确保在复杂环境下的通信质量。此外,考虑到该项目具有高度的可定制性和扩展性,可以结合实际业务场景对音质、带宽和功耗进行优化设置。总体而言,sh123/esp32_loradv 在户外活动、工业巡检、安保巡逻等领域具备广泛的应用前景。

综合评价

sh123/esp32_loradv 提供了一种高性能、低功耗的通信设备解决方案,尤其适合需要高质量语音通信的便携设备场景。其模块化的设计思想和对多种编解码技术的支持,展现出良好的灵活性与扩展性,可适应多种业务需求。当然,项目仍存在一些需要完善的地方,如进一步优化功耗管理策略和增强极端环境下的抗干扰能力。总的来说,这是一款设计理念新颖、技术实力强悍的设备,值得开发者进一步关注和探索。

关于

GitHub 原始描述(英文)

ESP32 based Codec2/OPUS DV hobby UHF 3d printed handheld transceiver aka walkie-talkie

描述取自 GitHub 官方 API,保持仓库作者书写的原文。

简要分析

热度分
182
价值分
84
活跃状态
活跃

语言占比

C
C++

Release

贡献者

README

ESP32 Codec2/OPUS DV Handheld Transceiver

Introduction

⚠ Please note that this device is experimental and lacks any form of certification. The author holds no responsibility for any fines incurred due to spectrum misuse, legal violations, or damages caused during its use. As with any experimental project, it is essential that you fully understand what you are doing and use it at your own risk.

This project is a hobby/amateur/toy/educational radio ESP32 based LoRa/FSK Codec2/OPUS DV 3d printed handheld trasceiver a.k.a. walkie-talkie, which is using 1W/2W E22-400M30S/E22-400M33S (SX1268) radio module (UHF, 70cm band) or optionally 100mW RA-01/RA-02 (SX1278) module.

In theory, it could also be used with other modules from E22-xxxMxxS series with compatible pinouts, but targetting other bands, such as E22-868M30S/E22-900M30S (SX1262) modules (UHF, 868/915 MHz) or E22-170M33S/E22-220M30S, but not tested.

It functions like a standard FM walkie-talkie and, for simplicity and traffic optimization, does not utilize any communication protocol. Instead, it transmits audio codec frames (DV) using pre-configured digital radio modulation, such as LoRA or FSK. There are ideas to add voice over AX.25 and perhaps M17 protocol support in the future.

Overall components cost for this project is about 15-20$.

Schematics for the new board design, which includes integrated components, can be found in the extras/schematics directory. The pinouts remain compatible with the first prototype version. While there is a designated space for a GPS module, it should not be soldered as it is not currently supported; it is included solely for potential future experiments.

First prototype is based on https://github.com/sh123/esp32_loraprs modem, but uses additional peripherals:

  • I2S speaker module MAX98357A + 4-8ohm 3w speaker (40mm diameter)
  • I2S microphone INMP441
  • PTT button (new board uses right angeled push button)
  • Rotary encoder with push button (new board uses EC11 right angeled encoder)
  • Small OLED display SSD1306 128x32
  • Battery voltage monitoring (just voltage divider fed into ADC pin, see schematics)
  • Powered from a single commonly avaialble 18650 cell (for example from old laptop battery)
  • Uses combined charge + 5v boost controller based on Hotchip HT4928S (it is usually used in low capacity single cell USB power banks), but better to use controllers such as IP5305_SK or similar without auto shutdown on low current!.

Supports next features:

  • Supports LoRa and FSK (no FEC) modulation with configurable modulation parameters from settings
  • Supports Codec2 (low bit rate, 700-3200 bps) and OPUS (medium/high bit rate, 2400-512000 bps) audio codecs, codec could be selected from settings
  • Goes into ESP32 light sleep when no activity, so all power consumption is around 30-40mA when in sleep RX (even lower with built-in esp32 leds scrapped), wakes up on new data from radio module or when user starts transmitting, consumes about 90-100mA in active receive and about 700-800mA in full power 1W transmit, so single 18650 cell should last for about 48 hours when in idle RX
  • Settings menu on long encoder button click, allows to change frequency and other parameters
  • Output power tunable from settings from ~1mW (for ISM toy usage) up to 2W (for amateur radio experiments)
  • Experimental no warranty privacy option for ISM low power usage (⚠ check your country regulations if it is allowed by the ISM band plan before experimenting as it might be illegal in some countries), it is based on ChaCha20-Poly1305 stream cypher provided by rwheater/Crypto library, it is comparable to AES256, uses 256 bits key, provides message authentication, but should have lower CPU requirements and power usage.

Planned features/ideas:

  • Frequency split repeater mode, where two transceivers will be linked using espnow, so one will receive voice on RX frequency and then send packet using espnow to second transmitter which will receive packet using espnow and re-transmit it on TX frequency, this way receiver and transmitter could be positioned further apart with separate antennas thus eliminating need for duplexer
  • Bluetooth headset pairing to use with hands free, so can use headset instead of i2s speaker/mic when needed
  • Voice over AX.25, so meta data such as callsign could be included and visible on the other end
  • M17 protocol support

Build instructions

  • Modify include/config.h if needed
  • Install platformio
  • Build with platformio
  • Upload with platformio

BOM

Bill of materials (BOM) for the new board constuction (credits to n0p and his club members for collecting it)

ESP-WROOM32 30pin - https://es.aliexpress.com/item/1005005953505528.html
Modem LoRa E22-400M30S (SX1268) - https://es.aliexpress.com/item/1005003122961059.html
I2S speaker module MAX98357A - https://es.aliexpress.com/item/1005005383121121.html
4ohm 3w speaker (40mm diameter) - https://es.aliexpress.com/item/1005006684947554.html
I2S microphone INMP441 - https://es.aliexpress.com/item/1005007889064664.html
Rotary encoder with push button - https://es.aliexpress.com/item/1005008091948369.html 
Small OLED display SSD1306 128×32 - https://es.aliexpress.com/item/1005008096924594.html
Uses combined charge + 5v boost controller - https://es.aliexpress.com/item/1005008657948784.html

18650 Cell
Botón switch tactile SKHH angled - https://es.aliexpress.com/item/1005005369415986.html
SMA-J-P-X-ST-EM1 Edgemount - https://es.aliexpress.com/item/10000000835065.html
R1 - 100k 0603 - https://es.aliexpress.com/item/1005005677654015.html
R2-R7 - 10k 0603 - https://es.aliexpress.com/item/1005005677654015.html
C1, C3-C8, C10, C11 - 100nF 0603 - https://es.aliexpress.com/item/32371454429.html
C2 - Elec 100uF SMD 3×5,3 - https://es.aliexpress.com/item/1005006724593986.html
C9 - 47uF Radial D4 mm P2 mm - https://es.aliexpress.com/item/1005005022177024.html

GPS - OPTIONAL - UNSUPPORTED ON WALKIE FW - CONFLICTS WITH ON BOARD SERIAL PORT PROGRAMMER - https://es.aliexpress.com/item/1005008733474270.html

Pictures

Two fully 3d printed prototypes were built based on esp32_loraprs modem board.

Device

List of peripherals used.

Device

New board design with all components integrated into the board (except battery and charging circuit).

Device

Case for the new board version with battery compartment.

CAD

Assembled board with new design.

Device

评论

暂无评论