Frequently Asked Questions
How does FoloToy Server work?
There are three key steps:
- Recording Receive real-time recording data sent by the toy through UDP, and call the STT (Sound-To-Text) API to convert the sound into text. Currently supported STT options include:
openai-whisper
、azure-stt
、azure-whisper
、dify-stt
、aliyun-asr
- Thinking: After receiving the previous text, the LLM (Large-Language-Model) API will be immediately called to obtain sentences generated by the LLM in a streaming manner. Then, the TTS (Text-To-Sound) API is called to convert the sentences into human speech. Currently supported LLM options include:
openai
、azure-openai
、gemini
、qianfan
、dify
Or llm proxied by One-Api. As well as other large model services compatible with OpenAI interfaces, such as moonshot.. - Play audio: Toys will receive TTS (Text-To-Sound) audio file streams generated by the FoloToy Server and play them according to the order. Currently supported TTS options include:
openai-tts
,azure-tts
,elevenlabs
,edge-tts
(Free),aliyun-tts
.
Can't connect to your own server?
Please check if the following ports are open. If the hosting provider has a firewall or access rules set up, these ports also need to be opened.
In the default configuration of folotoy-server-self-hosting docker-compose.yml, the following ports are used: 1883/tcp, 8082/tcp, 18083/tcp, 8083/tcp, and 8085/udp:
- 1883/tcp: required, Toy connects to the server via MQTT (1883/tcp)
- 8082/tcp: required, Toy downloads startup voice streams and conversation voice streams through this HTTP service port
- 8085/udp: required, Toy uploads real-time voice streams through this UDP port
- 18083/tcp: optional, HTTP port for EMQX's web management console
- 8083/tcp: optional, Websocket port for EMQX
Can't see the serial port device in Chrome/Edge browser after connecting the flashing USB cable?
Please ensure that the toy is powered on. Flashing can only be done when the device is powered on. Connecting the USB cable to the standalone circuit board alone will not work.
- Make sure your computer has the latest version of Chrome/Edge browser installed.
- If you are a Windows user, make sure you have installed the driver.
- Ensure that you are using the data cable provided with the toy or any other data transfer-capable cable (some cables are for charging only).
- Ensure that the data cable is properly connected. When selecting the device for flashing, observe if the device frequently disconnects and reconnects.
- If the browser still cannot detect the device after ensuring the above steps are correct, you can view the system's serial port devices using the following methods:
- macOS:
- Open Terminal.
- Enter the command
ls /dev/cu.*
to view all serial port devices.
- Windows:
- Open Device Manager.
- Locate "Ports (COM & LPT)" to view all serial port devices.
- macOS:
- If you find the device but the browser cannot recognize it, you can try using the esptool method to flash the device.
Facing flashing errors while using Chrome/Edge browser?
- Make sure your computer has the latest version of Chrome/Edge browser installed.
- Ensure that you are using the data cable provided with the toy or any other data transfer-capable cable (some cables are for charging only).
- Ensure that the data cable is properly connected. When selecting the device for flashing, observe if the device frequently disconnects and reconnects.
- Make sure you do not accidentally touch the device and cause it to disconnect during the flashing process.
- If you are using macOS, make sure to select a baud rate of 460800 or lower.
- If the problem persists, you can try using the esptool method to flash the device.
How to make the changes in roles.json
take effect?
Execute the following command in the folotoy-server-self-hosting directory to restart the service.
Note: After restarting the service, the toy also needs to be turned off and on again or press any role switch key once to reconnect to the server.
sudo docker compose restart folotoy
Can't find the model when using azure openai?
The model name of azure-openai is different from that of openai. Azure-openai uses deployment names, for example, when deploying gpt-3.5-turbo, you can set the deployment name as gpt-35. Therefore, in roles.json, you must use gpt-35.
{
"2": {
"model": "gpt-35",
"start_text": "Hello, I am Dongbei Rabbit. How can I help you?",
"prompt": "You are a knowledgeable and helpful intelligent robot named 'Dongbei Rabbit'. Your task is to chat with me. Please use short dialogues and speak in Chinese within 50 characters each time!",
"max_message_count": 20,
"temperature": 0.7,
"max_tokens": 800,
"top_p": 0.95,
"frequency_penalty": 0,
"presence_penalty": 0,
"voice_name":"zh-CN-liaoning-XiaobeiNeural",
"language":"zh",
"stt_type":"openai-whisper"
}
}
Already configured the key and base_uri correctly, but openai-whisper is reporting an error?
The language of openai-whisper can be left unset, but if it is set, the correct language code must be used. The language codes are different from azure-stt. For example, for Chinese in openai-whisper, use zh
. Configure the correct language code for each role in the roles.json file. Click here to view all language codes: OpenAI Whisper language 639-1 codes
{
"2": {
"model": "gpt-3.5-turbo",
"start_text": "Hello, I am Dongbei Rabbit. How can I help you?",
"prompt": "You are a knowledgeable and helpful intelligent robot named 'Dongbei Rabbit'. Your task is to chat with me using short conversations in Chinese that do not exceed 50 characters per response!",
"max_message_count": 20,
"temperature": 0.7,
"max_tokens": 800,
"top_p": 0.95,
"frequency_penalty": 0,
"presence_penalty": 0,
"voice_name":"zh-CN-liaoning-XiaobeiNeural",
"language":"zh",
"stt_type":"openai-whisper"
}
}
If using the docker image version v23.45.1.1
or above, you can also configure it like this:
{
"2": {
"start_text": "Hello, I am Dongbei Rabbit. How can I help you?",
"prompt": "You are a knowledgeable and helpful intelligent robot named 'Dongbei Rabbit'. Your task is to chat with me. Please use short conversations and speak in Chinese within 50 characters each time!",
"max_message_count": 20,
"stt_type": "openai-whisper",
"stt_config": {
"language": "zh"
},
"llm_config": {
"model": "gpt-3.5-turbo",
"temperature": 0.7,
"max_tokens": 800,
"top_p": 0.95,
"frequency_penalty": 0,
"presence_penalty": 0
},
"tts_config": {
"voice_name": "zh-CN-liaoning-XiaobeiNeural"
}
}
Has the key and region been configured correctly, but azure-stt is reporting an error?
azure-stt needs to use the correct language code. The language code for azure-stt is different from openai-whisper. For example, Chinese in azure-stt should use zh-CN
. Configure the correct language code for each role in the roles.json file. Click here to view all language codes: Azure STT language BCP-47 codes
{
"2": {
"model": "gpt-3.5-turbo",
"start_text": "Hello, I am Dongbei Rabbit. How can I help you?",
"prompt": "You are a knowledgeable and helpful intelligent robot named 'Dongbei Rabbit'. Your task is to chat with me using short conversations in Chinese, with each response not exceeding 50 characters!",
"max_message_count": 20,
"temperature": 0.7,
"max_tokens": 800,
"top_p": 0.95,
"frequency_penalty": 0,
"presence_penalty": 0,
"voice_name":"zh-CN-liaoning-XiaobeiNeural",
"language":"zh-CN",
"stt_type":"azure-stt"
}
}
If using the docker image version v23.45.1.1
or above, you can also configure it like this:
{
"2": {
"start_text": "Hello, I am Dongbei Rabbit. May I help you with anything?",
"prompt": "You are a knowledgeable and helpful intelligent robot named 'Dongbei Rabbit'. Your task is to chat with me in a short dialogue format, speaking in Chinese and each response should not exceed 50 characters!",
"max_message_count": 20,
"stt_type": "azure-stt",
"stt_config": {
"language": "zh-CN"
},
"llm_config": {
"model": "gpt-3.5-turbo",
"temperature": 0.7,
"max_tokens": 800,
"top_p": 0.95,
"frequency_penalty": 0,
"presence_penalty": 0
},
"tts_config ": {
"voice_name": "zh-CN-liaoning-XiaobeiNeural "
}
}
}
Does the conversation not support context?
Modify the parameter max_message_count
in roles.json
to a value greater than 0, for example, change it to 10
, which means that context supports 10 conversations.
After modifying roles.json
, execute the following command to restart the service in the folotoy-server-self-hosting directory for the changes to take effect.
sudo docker compose restart folotoy
After several conversations, the toy no longer responds?
Each model has its own limit on the size of context tokens. If it exceeds the limit, you can press the current role button again to clear the context. You can also adjust the values of max_message_count
and max_tokens
to roughly limit the size of the context.
Modify the parameter max_message_count
in roles.json
to a value greater than 0, for example, change it to 10
. This means that the context supports 10 conversations. Then modify max_tokens
to be 200
. After 10 rounds of conversation, the approximate size of the context is
10*200*2=4000
After making these modifications, the system will only keep the most recent 10 rounds of dialogue after more than 10 rounds of conversation.
After modifying roles.json
, you need to execute the following command in the folotoy-server-self-hosting directory for the changes to take effect.
sudo docker compose restart folotoy
Is the interval between voice conversations long or is there loss?
You can improve this situation by using AWS CloudFront CDN acceleration. The best way is to switch to a host with fast internet speed. If the ping value is below 200ms, you don't need to configure CDN.
CDN configuration video tutorials:
EMQX backend sees unknown client login?
Need to do some security configuration for EMQX, video tutorial.
How to view server logs?
Execute the following command in the deployment directory:
sudo docker compose logs -f
Location of log files: /var/lib/docker/containers/{container-id}/{container-id}-json.log
Execute the command to view the first 12 characters of container-id.
sudo docker ps
How to view device logs?
How to modify the log level of the service program to DEBUG or INFO?
Modify the docker-compose.yml
configuration, and after modification, refer to the previous steps to restart the container:
Change
LOG_LEVEL: INFO
to
LOG_LEVEL: DEBUG
The server logs show that the messages have been successfully pushed, but the device is not playing them?
- Connect the device to the computer and open the web tool to check the device logs. For detailed instructions, click here.
- Check if the device has received the pushed message.
- Verify if the pushed message was received after the device's timeout(default timeout: 30 seconds). Audio received after the timeout will not be played. You can use AT commands to modify the timeout
- If the device has not received the message, ensure that the MQTT server address and port configuration are correct:
- You can modify the MQTT server address and port by reconfiguring the network. Enter the network configuration mode: Firefly G6/G6s, Firefly F6/F6s, Mitutoyo C1.
- You can reconfigure the MQTT Broker and Port using AT commands.
Why are my Docker timestamp logs different than my machine?
Docker container timezones default to UTC. To set the timezone for your container, use the TZ
Environment Variable in your YML file. More information found at Environment Variables
Why Chrome/Edge can't recognize my device?
- Ensure that your computer has the latest version of Chrome/Edge browser installed.
- Use a data cable that can transfer both power and data (some cables are for charging only).
- Make sure the device is powered on.
- View the system's serial port devices,
- macOS:
- Open the Terminal.
- Enter the command ls
/dev/cu.*
to view all serial port devices.
- Windows:
- Open Device Manager.
- Locate "Ports (COM & LPT)" to view all serial port devices.
- macOS:
- If you can find the device, you can try flashing it using the esptool method.
- If you're still unable to find the device, please contact us for further assistance.
How to enter pair mode?
If it is the first time the device is powered on, it will automatically enter pairing mode
Manually enter pairing mode: Alilo G6/G6s, Alilo F6/F6s, Mitu C1, Octopus, or enter pairing mode through AT commands.
How to connect to Wifi and set mqtt address?
Network configure and server configure
Device doesn't work?
According to the color of the device lights, find the corresponding solution. Meanings of various light colors
What do light's colors mean?
Each color represents a different state of the device:
Color | Device Status | Solution |
---|---|---|
Solid White | Standby | The device has successfully connected to the server. If the device is unable to function properly, please check the server logs to troubleshoot. |
Solid Green | Recording in progress | - |
Solid Pink | Continuous voice detection in conversation mode | - |
Solid Red | File system mount failure / WiFi initialization failure | Please try to upgrade the firmware. |
Blinking Green | Waiting for server response for audio | If the green light blinks for a while and then returns to solid white, it indicates a server timeout. Please check the server logs to troubleshoot. |
Blinking Blue | Pairing mode | The device is in pairing mode. Please configure the device network and server. |
Rainbow Gradient | Boot initialization / Playing audio | - |
Blinking Red | Low battery | - |
Blinking Yellow | Unable to connect to the server | 1. Device server configuration error. Please reconfigure the device server. 2. Server error. Please check the server logs to troubleshoot. |