Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when running esp_zb_mfg_tool.py (TZ-962) #371

Open
mjdswan opened this issue Jun 22, 2024 · 5 comments
Open

Error when running esp_zb_mfg_tool.py (TZ-962) #371

mjdswan opened this issue Jun 22, 2024 · 5 comments
Labels

Comments

@mjdswan
Copy link

mjdswan commented Jun 22, 2024

Question

On attempting to run the esp_zb_mfg_tool.py using the given example command lines, I get "unsupported operand type(s)" errors.

I am using esp-zigbee-sdk/tools 1.3.0, ESP-IDF 5.2 on Windows 10.

Please suggest what might be the issue.

Additional context.

PS C:\Users\mswan.espressif\Espressif\esp-zigbee-sdk\tools\mfg_tool> python esp_zb_mfg_tool.py -i NULL -m NULL -c 0x8000 -mn Espressif -mc 0x131B
unsupported operand type(s) for +: 'NoneType' and 'str'
PS C:\Users\mswan.espressif\Espressif\esp-zigbee-sdk\tools\mfg_tool> python esp_zb_mfg_tool.py --csv ./single_device.csv
unsupported operand type(s) for +: 'NoneType' and 'str'
PS C:\Users\mswan.espressif\Espressif\esp-zigbee-sdk\tools\mfg_tool>

@github-actions github-actions bot changed the title Error when running esp_zb_mfg_tool.py Error when running esp_zb_mfg_tool.py (TZ-962) Jun 22, 2024
@xieqinan
Copy link
Contributor

@mjdswan

Please refer to this issue #237 (comment), which is similar to the one you encountered.

@mjdswan
Copy link
Author

mjdswan commented Jun 24, 2024

Hi @xieqinan, yes I saw there is a similar question there (last post) but it is not answered. Please explain?

@xieqinan
Copy link
Contributor

@mjdswan ,

The issue is caused by an invalid + operation between a NoneType data and a string. Could you help us locate the specific line where this occurs?

@mjdswan
Copy link
Author

mjdswan commented Jun 24, 2024

Hi @xieqinan, I managed to trace the Python file through to the error at line 415 in esp_zb_mfg_tool.py.
It seems that the function
mfg_gen.get_fileid_val(file_identifier, key_value_data, fileid_value)
returns a value of None and this is why the + operation fails.

I'm not really sure why this happens, hope you can please assist.

@mjdswan
Copy link
Author

mjdswan commented Jun 27, 2024

Hi @xieqinan, do you have any suggestion? Sorry but I'm quite new to Python and I'm not really sure what the above function is supposed to return.

Some background on this: we need to use the tool to create the ZB Mfr name and ID because we need to integrate our ESP32C6 based host device with a SONOFF ZB hub. I can see from sniffing that this hub requests our mfr name but we respond with "unsupported attribute". This response unfortunately causes the SONOFF hub to reboot, which makes testing impossible because we are stuck in a loop.

I am assuming that ESP ZigBee SDK responds like this because the mfr name is empty.
The response in this case would appear to be incorrect, and I would think it's a better approach to respond with a default value of "Espressif" to avoid these kinds of problems - I can open a separate issue on that if you think it's needed.
By the way, if there is some other way to create the mfr name and ID directly (without the tool), please let me know.

Would appreciate your update soonest, so we can continue our development and testing thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants