Issue with running huskyMcpChat.py
Ton.Van 2025-12-20 15:48:46 394 Views5 Replies Hello Everyone,
I am experiencing some issues while running the huskyMcpChat.py script from the HuskyLens2MCP repository.
My Setup
OS: Windows 10 Pro, 64-bit
Python Version: 3.12.0
HuskyLens 2 Firmware: 1.2.1
Configuration: I have correctly updated my GEMINI_API_KEY and set the SERVER_URL to my local IP (http://192.168.1.9:3000).
The Problem: Although the connection to the HuskyLens MCP is successful, I encountered two specific errors during testing:
Switch Command Error: When I try to switch the algorithm using switch Face Recognition, I receive the following error response:"error" : "unsupported command set_algorithm"
JSON/Data Processing Error: When using the ask command, the script fails with a JSON type error:[json.exception.type_error.302] type must be string, but is null
Consequently, Gemini receives invalid data and cannot process the request.
Log Output:
Connecting to SSE at http://192.168.1.9:3000...
✅ Connected to HuskyLens MCP.
...
User > switch Face Recognition
🔄 Switching to 'Face Recognition'...
✅ {
"cmd" : "set_algorithm",
"correlation_id" : "req_8_1261922470226",
"error" : "unsupported command set_algorithm",
"ret" : "error"
}
User > ask is TON around?
👀 Asking Huskylens2...
📄 Raw Data:
[json.exception.type_error.302] type must be string, but is null
🧠 Processing with Gemini...
🤖 AI ANSWER: The provided sensor data is an error message, not valid JSON.
Questions:
Is the set_algorithm command supported in firmware version 1.2.1?
What could be causing the type_error.302 (null string) when fetching data from the lens?
Are there any specific settings on the HuskyLens unit itself that I need to enable?
I would greatly appreciate any guidance or fix for these issues. Thank you very much for your help!
This looks like a firmware issue. The set_algorithm command is not supported properly in HuskyLens 2 firmware 1.2.1, which also causes the null JSON error. Downgrading to firmware 1.1.6 fixes both problems, or you can disable the MCP task-scheduler tool and wait for a firmware update.
Hung.dol The issue is related to MCP server tool “task-schedular”. It uses json scheme that Gemini doesn't accept and so Gemini blocks everything, even if you aren't using this tool in the chat. This is what chatGPT explained to me.
I solved disenabling the tool in Cherry, wainting for an update of firmware 1.2.1
Marco.Picarella P.S. I followed instructions on MCP server, showed here https://wiki.dfrobot.com/_SKU_SEN0638_Gravity_HUSKYLENS_2_AI_Camera_Vision_Sensor#9.%20MCP%20Server
I'm sorry. I meant “I solved disabling…” (not disenabling that is a contradition ;-) )
I downgrade Huskylens 2 Firmware from 1.2.1 to 1.1.6, it works fine.
Thanks all.
Ton.Van 

