From f13aec984e919e16a844390b2be3f4d5439a7ae7 Mon Sep 17 00:00:00 2001 From: joBr99 <29555657+joBr99@users.noreply.github.com> Date: Sun, 10 Apr 2022 17:10:52 +0200 Subject: [PATCH] change speed during flashing --- tasmota/autoexec-beta.be | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tasmota/autoexec-beta.be b/tasmota/autoexec-beta.be index b91705d7..96f177f7 100644 --- a/tasmota/autoexec-beta.be +++ b/tasmota/autoexec-beta.be @@ -136,6 +136,13 @@ class Nextion : Driver if (self.flash_written==self.flash_size) log("FLH: Flashing complete - Time elapsed: %d", (tasmota.millis()-self.flash_start_millis)/1000) self.flash_mode = 0 + self.ser = nil + tasmota.gc() + self.ser = serial(17, 16, 115200, serial.SERIAL_8N1) + # this didn't help to get back to normal speed, so instead reload entire script + #load('autoexec.be') + # setting speed back to 115200 and reloading berry script both caused issues ... so just restart tasmota after flashing is complete + #tasmota.cmd("Restart 1") end end @@ -151,7 +158,9 @@ class Nextion : Driver if string.find(strv,"comok 2")>=0 log("FLH: Send (High Speed) flash start") self.flash_start_millis = tasmota.millis() - self.sendnx(string.format("whmi-wris %d,115200,res0",self.flash_size)) + #self.sendnx(string.format("whmi-wris %d,115200,res0",self.flash_size)) + self.sendnx(string.format("whmi-wris %d,921600,res0",self.flash_size)) + self.ser = serial(17, 16, 921600, serial.SERIAL_8N1) elif size(msg)==1 && msg[0]==0x08 log("FLH: Waiting offset...",3) self.awaiting_offset = 1