tasmota / decode-config

Backup/restore and decode configuration tool for Tasmota
GNU Lesser General Public License v3.0
215 stars 32 forks source link

UnicodeEncodeError: 'latin-1' codec can't encode character '\u25a0' in position 583: ordinal not in range(256) #50

Closed scoace closed 2 years ago

scoace commented 2 years ago

Describe the bug

Command "./decode-config.py -s 192.168.11.138" raises the following error: Traceback (most recent call last): File "./decode-config.py", line 6470, in print(get_jsonstr(CONFIG['groupmapping'], ARGS.jsonsort, ARGS.jsonindent, ARGS.jsoncompact)) UnicodeEncodeError: 'latin-1' codec can't encode character '\u25a0' in position 583: ordinal not in range(256)

A clear and concise description of what the bug is.

To Reproduce

Steps to reproduce the behavior: 1. Program parameter: ./decode-config.py -s 192.168.11.138 2. Result: File "./decode-config.py", line 6470, in print(get_jsonstr(CONFIG['groupmapping'], ARGS.jsonsort, ARGS.jsonindent, ARGS.jsoncompact)) UnicodeEncodeError: 'latin-1' codec can't encode character '\u25a0' in position 583: ordinal not in range(256)

Expected behavior

A clear and concise description of what you expected to happen.

Version Information

Please complete the following information
use decode-config.py -V to retrieve the info


>>> paste output here <<<
Script:   decode-config.py
Python:   3.7.3
Platform: Linux-5.10.63-v7+-armv7l-with-debian-10.12 - armv7l
OS:       Linux 5.10.63-v7+ #1496 SMP Wed Dec 1 15:58:11 GMT 2021
Time:     2022-08-31 15:02:52

System' information of your Tasmota data

Append -g System to your decode-config parameter, e. g. decode-config.py -s myconfig.dmp -g System


>>> paste output here <<<
{"bootcount": 24, "bootcount_reset_time": 1604220613, "cfg_crc": "0x132e", "cfg_crc32": "0x98db5fc2", "cfg_holder": 4617, "cfg_size": 4096, "cfg_timestamp": 1660993002, "header": {"data": {"crc": "0xb2ff", "crc32": "0x98db5fc2", "hardware": "ESP82", "size": 4096, "version": {"id": "0xc010000", "name": "12.1.0"}}, "env": {"platform": "Linux-5.10.63-v7+-armv7l-with-debian-10.12", "python": "3.7.3", "script": "decode-config.py v12.1.1.1 [87254b6]", "system": "Linux armv7l 5.10.63-v7+ #1496 SMP Wed Dec 1 15:58:11 GMT 2021"}, "template": {"crc": "0x132e", "crc32": "0x98db5fc2", "size": 4096, "version": {"id": "0xc000204", "name": "12.0.2.4"}}, "timestamp": "2022-08-20 10:56:42"}, "version": "0xc010000"}

Additional context

That happens only on a tasmota device with shutter configuration

curzon01 commented 2 years ago

missing the version you are using e.g.

decode-config.py v12.1.1.1 [083fb72] by Norbert Richter nr@prsolution.eu

that's the very first line of decode-config.py -V

I can't reproduce it using v12.1.1.1 [083fb72], not even with a shutter device. I suspect the error is due to some string settings of your device. Pls can you provide the binary config (e.g. per mail).

scoace commented 2 years ago

decode-config.py v12.1.1.1 [87254b6] by Norbert Richter nr@prsolution.eu

Script: decode-config.py Python: 3.7.3 Platform: Linux-5.10.63-v7+-armv7l-with-debian-10.12 - armv7l OS: Linux 5.10.63-v7+ #1496 SMP Wed Dec 1 15:58:11 GMT 2021 Time: 2022-09-01 10:29:43

binary file is on the way

curzon01 commented 2 years ago

thx, can't still reproduce using

./decode-config.py -s Config_RL_AZ_11.0.0.3.dmp

Does the error already occur on your env using send dmp?

scoace commented 2 years ago

Thanks for your help. I checked it on a another Linux and it worked. It turned out that the $LANG variable on the failing device has to be set to "export LANG=de_DE.UTF-8". Than it worked.