potential fix for #601

This commit is contained in:
joBr99
2022-11-29 17:44:46 +01:00
committed by GitHub
parent 737b6c369d
commit 3d5970f0a3

View File

@@ -138,8 +138,7 @@ class Nextion : Driver
if (self.flash_written==self.flash_size) if (self.flash_written==self.flash_size)
log("FLH: Flashing complete - Time elapsed: %d", (tasmota.millis()-self.flash_start_millis)/1000) log("FLH: Flashing complete - Time elapsed: %d", (tasmota.millis()-self.flash_start_millis)/1000)
self.flash_mode = 0 self.flash_mode = 0
self.ser = nil self.ser.deinit()
tasmota.gc()
self.ser = serial(17, 16, 115200, serial.SERIAL_8N1) self.ser = serial(17, 16, 115200, serial.SERIAL_8N1)
end end
@@ -163,6 +162,7 @@ class Nextion : Driver
self.sendnx(string.format("whmi-wris %d,%d,res0",self.flash_size,self.flash_proto_baud)) self.sendnx(string.format("whmi-wris %d,%d,res0",self.flash_size,self.flash_proto_baud))
end end
if self.flash_proto_baud != 115200 if self.flash_proto_baud != 115200
self.ser.deinit()
self.ser = serial(17, 16, self.flash_proto_baud, serial.SERIAL_8N1) self.ser = serial(17, 16, self.flash_proto_baud, serial.SERIAL_8N1)
end end
elif size(msg)==1 && msg[0]==0x08 elif size(msg)==1 && msg[0]==0x08