mirror of
https://github.com/xinnan-tech/xiaozhi-esp32-server.git
synced 2026-11-27 04:49:47 +01:00
Final localization pass over everything the audit covers, driven by the local qwen3.8:instruct endpoint (thinking disabled) with placeholder- masked, cached, resumable batches: - Python server: comments, docstrings, log/error messages, prompt text - manager-api Java: javadoc, exception messages, Swagger summaries, westernized test fixtures (locale strings, signed-URL examples) - manager-web / manager-mobile: component comments and misc leftovers (functional split regexes such as /[、;;,,]/ left byte-identical) - digital-human: HTML/UI text, JS comments, wake-word defaults aligned with the server canonical English wake words - docs: device-call guide, wakeword and search integration guides Also widens the westernization audit exception to the whole vendored generator bundle and retires the stale per-file exception list.
7.2 KiB
7.2 KiB
Inter-device mutual call plugin usage guide
Overview
The device call feature enables bidirectional communication between two configured devices via voice/data channels. When Device A calls Device B, the system follows this process:
Device A → Authorization Check → MQTT Gateway → Remote Wake-up of Device B → Connection Established → Call Established
Prerequisites for using this feature
- You must have at least two devices, each of model
ESP32-S3, because onlyESP32-S3supports remote wake-up. - Your device must have
two microphones. If your device has only asingle microphone, you can still try this feature, but expect significant lag. - You must use Full Module Deployment for this project, as you need the
Consoleto manage device permissions and communication. - You must install and configure the MQTT Gateway Service after
May 27, 2026. If you have already deployed the MQTT Gateway Service, ensure the code version is afterMay 27, 2026.
These are the mandatory prerequisites for using this feature. Detailed instructions follow.
Configuration steps
Step 1: Enable the contacts feature
- Ensure your Console version is
0.9.4or higher. - Log in to the Console backend
- Go to System Function Config
- Check the Contacts option in the left-side feature list
- Click Save Configuration to confirm
Step 2: Configure inter-device call permissions
- Click Contacts in the top menu of the Console
- Under the Agent list on the left, select Device A from the device list (search by MAC address or remark name).
- In the right-side details panel, find the nickname setting for target device B, e.g., "Xiao Wang"
- Check the Call Permission checkbox for Device B
- Click Save
Bidirectional Authorization Note: To enable communication between Device A and Device B, configure mutual permissions in the Console on both sides. For example:
- Check device B in device A's config → Device A can communicate with device B
- Check device A in device B's config → Device B can communicate with device A
Step 3: Add the call tool in the Agent config
- Click Agent Management in the top menu of the Console
- In the Agent associated with the recently configured device contact, click Edit Role
- In the right-side details panel, click Edit Features
- Check the Device-to-Device Call tool
- Click Save Configuration to confirm
- Click Save Config again on the outer layer, then restart the device
Step 4: Add the remote wake-up tool on the firmware side
- Add the remote wake-up tool MCP to the xiaozhi-esp32 codebase. Supported versions are 2.1.0 to 2.2.6 (version from May 29, 2026).
- Add the remote wake-up function declaration in application.h
void RemoteWakeup(const std::string& reason); - Add the remote wake-up function in application.cc
void Application::RemoteWakeup(const std::string& reason){ if (!protocol_) { return; } auto state = GetDeviceState(); if (state == kDeviceStateIdle) { audio_service_.EncodeWakeWord(); if (!protocol_->IsAudioChannelOpened()) { SetDeviceState(kDeviceStateConnecting); if (!protocol_->OpenAudioChannel()) { audio_service_.EnableWakeWordDetection(true); return; } } std::string wake_word = reason; #if CONFIG_USE_AFE_WAKE_WORD || CONFIG_USE_CUSTOM_WAKE_WORD // Encode and send the wake word data to the server while (auto packet = audio_service_.PopWakeWordPacket()) { protocol_->SendAudio(std::move(packet)); } // Set the chat state to wake word detected protocol_->SendWakeWordDetected(wake_word); SetListeningMode(aec_mode_ == kAecOff ? kListeningModeAutoStop : kListeningModeRealtime); #else // Set flag to play popup sound after state changes to listening // (PlaySound here would be cleared by ResetDecoder in EnableVoiceProcessing) play_popup_on_listening_ = true; SetListeningMode(aec_mode_ == kAecOff ? kListeningModeAutoStop : kListeningModeRealtime); #endif } else if (state == kDeviceStateSpeaking) { AbortSpeaking(kAbortReasonWakeWordDetected); SetDeviceState(kDeviceStateIdle); } else if (state == kDeviceStateActivating) { SetDeviceState(kDeviceStateIdle); } } - Add the remote wake-up tool in mcp_server.cc
AddUserOnlyTool("self.remote_wakeup", "Remote wakeup function with configurable parameters", PropertyList({ Property("reason", kPropertyTypeString, "Wakeup reason"), }), [this](const PropertyList& properties) -> ReturnValue { std::string reason = properties["reason"].value<std::string>(); ESP_LOGI(TAG, "Wakeup reason=%s", reason.c_str()); auto& app = Application::GetInstance(); app.RemoteWakeup(reason); return true; - Complete firmware flashing according to the Firmware Compilation and Flashing Guide
- Regardless of whether your device has a single or dual microphone, enable the AEC feature during compilation!
- Regardless of whether your device has a single or dual microphone, enable the AEC feature during compilation!
- Regardless of whether your device has a single or dual microphone, enable the AEC feature during compilation!
Step 5: Configure the MQTT gateway service
- Deploy the MQTT Gateway Service. Refer to MQTT Gateway Integration Documentation
- If already deployed, confirm the code version is from May 27, 2026
Call flow description
Prepare two devices. After configuring communication permissions in the Console and adding the call tool to the Agent, say "Call XXX" to one Xiaozhi device and observe if Device B responds.
FAQ
Q: Device B does not respond to the call?
- Check if Device B is online (Console device status)
- Ensure Device B's firmware correctly integrates the remote wake-up tool
- Check if the MQTT gateway connection is normal
- Verify if the bidirectional permission config is complete
Q: Prompt shows "No call permission"?
- Verify in the Console that Device A has granted call permissions to Device B
- Ensure the configuration is saved (not just modified)
Q: How to confirm the contacts feature is enabled?
- If the "Contacts" entry appears in the top menu of the Console, the feature is enabled
Q: I ask it to call "Zhang Shan", but it always recognizes it as "Zhang San". What should I do?
- Check the documentation for your ASR service to confirm if hotword recognition is supported.
- If you use
FunASRServer, add "Zhang Shan" to thehotword filein the container, then restart the container. - If you use
Volcano Engineservices, add ahotword filein theVolcano Engine Console, then go to theModel Configuration pagein the Console and configure thehotword file nameforVolcano Engine TTS.