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

Berry persist.save() does not save changes to arrays #22187

Open
10 of 14 tasks
andrew01144 opened this issue Sep 22, 2024 · 0 comments
Open
10 of 14 tasks

Berry persist.save() does not save changes to arrays #22187

andrew01144 opened this issue Sep 22, 2024 · 0 comments

Comments

@andrew01144
Copy link

PROBLEM DESCRIPTION

A clear and concise description of what the problem is.

In Berry, persist.save() should save the new state of of an array to _persist.json if its state has changed.
It does not.
This used to work on V12.0.2.
Does not work on V14.2.0

Workaround: update a simple variable before doing persist.save().

REQUESTED INFORMATION

Make sure your have performed every step and checked the applicable boxes before submitting your issue. Thank you!

  • Read the Contributing Guide and Policy and the Code of Conduct
  • Searched the problem in issues
  • Searched the problem in discussions
  • Searched the problem in the docs
  • Searched the problem in the chat
  • Device used (e.g., Sonoff Basic): ESP32 mini kit
  • Tasmota binary firmware version number used: 14.2.0
    • Pre-compiled
    • Self-compiled
  • Flashing tools used: WebInstaller
  • Provide the output of command: Backlog Template; Module; GPIO 255:
  Configuration output here:
13:51:22.005 CMD: Backlog Template; Module; GPIO 255
13:51:22.030 MQT: stat/esp32-dev-04/RESULT = {"NAME":"ESP32-DevKit","GPIO":[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,0,1,1,1,0,0,0,0,1,1,1,1,1,0,0,1],"FLAG":0,"BASE":1}
13:51:22.255 MQT: stat/esp32-dev-04/RESULT = {"Module":{"1":"ESP32-DevKit"}}
13:51:22.511 MQT: stat/esp32-dev-04/RESULT = {"GPIO0":{"0":"None"},"GPIO1":{"0":"None"},"GPIO2":{"0":"None"},"GPIO3":{"0":"None"},"GPIO4":{"0":"None"},"GPIO5":{"352":"Counter1"},"GPIO6":{"0":"None"},"GPIO7":{"0":"None"},"GPIO8":{"0":"None"},"GPIO9":{"0":"None"},"GPIO10":{"0":"None"},"GPIO11":{"0":"None"},"GPIO12":{"0":"None"},"GPIO13":{"0":"None"},"GPIO14":{"0":"None"},"GPIO15":{"0":"None"},"GPIO16":{"0":"None"},"GPIO17":{"0":"None"},"GPIO18":{"0":"None"},"GPIO19":{"0":"None"},"GPIO20":{"0":"None"},"GPIO21":{"0":"None"},"GPIO22":{"0":"None"},"GPIO23":{"0":"None"},"GPIO24":{"0":"None"},"GPIO25":{"0":"None"},"GPIO26":{"0":"None"},"GPIO27":{"0":"None"},"GPIO32":{"0":"None"},"GPIO33":{"0":"None"},"GPIO34":{"0":"None"},"GPIO35":{"0":"None"},"GPIO36":{"0":"None"},"GPIO37":{"0":"None"},"GPIO38":{"0":"None"},"GPIO39":{"0":"None"}}
13:51:39.961 MQT: tele/esp32-dev-04/STATE = {"Time":"2024-09-22T13:51:39","Uptime":"0T00:15:09","UptimeSec":909,"Heap":142,"SleepMode":"Dynamic","Sleep":50,"LoadAvg":19,"MqttCount":1,"Berry":{"HeapUsed":5,"Objects":65},"Wifi":{"AP":1,"SSId":"HFC046","BSSId":"74:83:C2:91:4A:AC","Channel":1,"Mode":"HT20","RSSI":62,"Signal":-69,"LinkCount":1,"Downtime":"0T00:00:04"}}
13:51:39.969 MQT: tele/esp32-dev-04/SENSOR = {"Time":"2024-09-22T13:51:39","COUNTER":{"C1":0}}
  • If using rules, provide the output of this command: Backlog Rule1; Rule2; Rule3:
  Rules output here:

  • Provide the output of this command: Status 0:
  STATUS 0 output here:
13:52:42.466 MQT: stat/esp32-dev-04/STATUS = {"Status":{"Module":1,"DeviceName":"esp32-dev-04","FriendlyName":["esp32-dev-04"],"Topic":"esp32-dev-04","ButtonTopic":"0","Power":"0","PowerLock":"0","PowerOnState":3,"LedState":1,"LedMask":"FFFF","SaveData":1,"SaveState":1,"SwitchTopic":"0","SwitchMode":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"ButtonRetain":0,"SwitchRetain":0,"SensorRetain":0,"PowerRetain":0,"InfoRetain":0,"StateRetain":0,"StatusRetain":0}}
13:52:42.473 MQT: stat/esp32-dev-04/STATUS1 = {"StatusPRM":{"Baudrate":115200,"SerialConfig":"8N1","GroupTopic":"tasmotas","OtaUrl":"http://ota.tasmota.com/tasmota32/release/tasmota32.bin","RestartReason":"Software reset CPU","Uptime":"0T00:16:12","StartupUTC":"2024-09-22T12:36:30","Sleep":50,"CfgHolder":4617,"BootCount":12,"BCResetTime":"2024-09-20T09:36:59","SaveCount":24}}
13:52:42.477 MQT: stat/esp32-dev-04/STATUS2 = {"StatusFWR":{"Version":"14.2.0(release-tasmota32)","BuildDateTime":"2024-08-14T12:39:45","Core":"3_0_4","SDK":"5.1.4.240801","CpuFrequency":160,"Hardware":"ESP32-D0WD-V3 v3.0","CR":"434/699"}}
13:52:42.481 MQT: stat/esp32-dev-04/STATUS3 = {"StatusLOG":{"SerialLog":2,"WebLog":2,"MqttLog":0,"SysLog":0,"LogHost":"","LogPort":514,"SSId":["HFC046",""],"TelePeriod":300,"Resolution":"558180C0","SetOption":["0000A009","2805C80001000600002D5A0A192800000000","00000080","00006000","00004000","00000000"]}}
13:52:42.496 MQT: stat/esp32-dev-04/STATUS4 = {"StatusMEM":{"ProgramSize":2001,"Free":878,"Heap":137,"StackLowMark":3,"PsrMax":0,"PsrFree":0,"ProgramFlashSize":4096,"FlashSize":4096,"FlashChipId":"16405E","FlashFrequency":40,"FlashMode":"DIO","Features":["0809","9F9AD7DF","0015A001","B7F7BFCF","05DA9BC4","E0360DC7","480840D2","20200000","D4BC482D","810A80B1","00000014"],"Drivers":"1,2,!3,!4,!5,7,!8,9,10,11,12,!14,!16,!17,!20,!21,!24,26,!27,29,!34,!35,38,50,52,!59,!60,62,!63,!66,!67,!68,!73,82,!86,!87,!88,!121","Sensors":"1,2,3,5,6,7,8,9,10,11,12,13,14,15,17,18,19,20,21,22,26,31,34,37,39,40,42,43,45,51,52,55,56,58,59,64,66,67,74,85,92,95,98,103,105,109,127","I2CDriver":"7,8,9,10,11,12,13,14,15,17,18,20,24,29,31,36,41,42,44,46,48,58,62,65,69,76,77,82"}}
13:52:42.505 MQT: stat/esp32-dev-04/STATUS5 = {"StatusNET":{"Hostname":"esp32-dev-04","IPAddress":"192.168.1.86","Gateway":"192.168.1.254","Subnetmask":"255.255.255.0","DNSServer1":"192.168.1.205","DNSServer2":"0.0.0.0","Mac":"C4:DE:E2:19:44:00","IP6Global":"fd1c:599b:9f05:6500:c6de:e2ff:fe19:4400","IP6Local":"fe80::c6de:e2ff:fe19:4400%st1","Ethernet":{"Hostname":"","IPAddress":"0.0.0.0","Gateway":"0.0.0.0","Subnetmask":"0.0.0.0","DNSServer1":"192.168.1.205","DNSServer2":"0.0.0.0","Mac":"00:00:00:00:00:00","IP6Global":"","IP6Local":""},"Webserver":2,"HTTP_API":1,"WifiConfig":4,"WifiPower":16.0}}
13:52:42.512 MQT: stat/esp32-dev-04/STATUS6 = {"StatusMQT":{"MqttHost":"192.168.1.201","MqttPort":1883,"MqttClientMask":"DVES_%06X","MqttClient":"DVES_194400","MqttUser":"DVES_USER","MqttCount":1,"MAX_PACKET_SIZE":1200,"KEEPALIVE":30,"SOCKET_TIMEOUT":4}}
13:52:42.518 MQT: stat/esp32-dev-04/STATUS7 = {"StatusTIM":{"UTC":"2024-09-22T12:52:42Z","Local":"2024-09-22T13:52:42","StartDST":"2024-03-31T01:00:00","EndDST":"2024-10-27T02:00:00","Timezone":99,"Sunrise":"06:48","Sunset":"18:59"}}
13:52:42.524 MQT: stat/esp32-dev-04/STATUS10 = {"StatusSNS":{"Time":"2024-09-22T13:52:42","COUNTER":{"C1":0}}}
13:52:42.531 MQT: stat/esp32-dev-04/STATUS11 = {"StatusSTS":{"Time":"2024-09-22T13:52:42","Uptime":"0T00:16:12","UptimeSec":972,"Heap":136,"SleepMode":"Dynamic","Sleep":50,"LoadAvg":19,"MqttCount":1,"Berry":{"HeapUsed":4,"Objects":62},"Wifi":{"AP":1,"SSId":"HFC046","BSSId":"74:83:C2:91:4A:AC","Channel":1,"Mode":"HT20","RSSI":60,"Signal":-70,"LinkCount":1,"Downtime":"0T00:00:04"}}}

  • Set weblog to 4 and then, when you experience your issue, provide the output of the Console log:
  Console output here:
n/a

TO REPRODUCE

Steps to reproduce the behavior:

I find this easiest to replicate by pasting each of these Berry lines, one at a time, into the Berry scripting console.

import persist
persist.a1 = [1,2,3,4]
persist.save()
# look at _persist.json - ok
persist.a1[2] = 44
persist.save()
# look at _persist.json - Error - a1[] has not been updated
persist.tx = tasmota.millis()
persist.save()
# look at _persist.json - ok, a1 has been updated
persist.a1[2] = 88
persist.tx = tasmota.millis()	# workaround, update a simple variable
persist.save()
# look at _persist.json - ok, a1 has been updated

EXPECTED BEHAVIOUR

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

persist.save() should save the new state of a1[] to _persist.json if the state has changed.
This used to work on V12.0.2.
Does not work on V14.2.0

Workaround: update a simple variable before doing persist.save().

SCREENSHOTS

If applicable, add screenshots to help explain your problem.

ADDITIONAL CONTEXT

Add any other context about the problem here.

(Please, remember to close the issue when the problem has been addressed)

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

No branches or pull requests

1 participant