tasmota / decode-config

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

Trouble setting parameters with ESP82/32 device #91

Closed heegard closed 1 month ago

heegard commented 1 month ago

I have a new M&J smartplug:

Plug V by MJ Smart Plug Program Version 13.0.0(Smart Plug V by MJ) Build Date & Time 2023-12-07T07:44:53 Core/SDK Version 2_0_10/4.4.5.230614 ... ESP Chip Id xxxx (ESP32-C3 rev.4)

Running: decode-config -p xxx -s "my_device.xxxx.com" -i "settings.json"

Produces: INFO: Load data by http from device 'my_device.xxxx.com' ERROR 9: Restore data incompatibility: Device 'my_device.xxxx.com' hardware is 'ESP82/32', restore file 'settings.json' is for hardware 'ESP82' Premature exit - #9 Restore data error

settings.json:

{ "devicename": "Clock", "hostname": "my_device", "sta_config": 2, "sta_ssid": [ "ABCD", "ABCD XYZ" ], "sta_pwd": [ "", "xxxx" ], "mqtt_fulltopic": "tasmota/%prefix%/%topic%/", "mqtt_host": "mqtt.xxxx.com", "mqtt_pwd": "xxxx", "mqtt_topic": "my_device", "mqtt_user": "xxxx", "friendlyname": [ "my_device", "", "", "", "", "", "", "" ], "flag": { "mqtt_power_retain": 1 }, "flag5": { "mqtt_state_retain": 1 } }

curzon01 commented 1 month ago

When using json subsets for ESP32, the key config_version is required, because if it is missing, the default is assumend as 0 (which means the setting is for ESP82xx chip types).

To find out the value for your ESP32-C3 read it out

decode-config -p xxx -s my_device.xxxx.com | jq '.config_version'
1

and add the key/value pair to your JSON file, e. g.

{
"devicename": "Clock",
"hostname": "my_device",
"config_version": 1,
...
}
heegard commented 1 month ago

That was the issue. Thank you for the help! -Chris