Switch default flashing method to Nextion 1.1

This commit is contained in:
joBr99
2022-02-26 11:52:43 +01:00
committed by GitHub
parent 3e17ea521f
commit fc019b7c41

View File

@@ -214,7 +214,6 @@ class Nextion : Driver
#print(host,port,file) #print(host,port,file)
self.tftd = TftDownloader(host, port, file, 32768) self.tftd = TftDownloader(host, port, file, 32768)
#self.tftd = TftDownloader("192.168.75.30", 8123, "/local/test.tft", 32768)
# get size of tft file # get size of tft file
self.flash_size = self.tftd.get_file_size() self.flash_size = self.tftd.get_file_size()
@@ -265,8 +264,8 @@ class Nextion : Driver
log(str, 3) log(str, 3)
# TODO: add check for firmware versions < 126 and send proto 1.1 command for thoose # TODO: add check for firmware versions < 126 and send proto 1.1 command for thoose
if (string.find(str,"comok 2")==0) if (string.find(str,"comok 2")==0)
#self.sendnx(string.format("whmi-wri %d,115200,1",self.flash_size)) # Nextion Upload Protocol 1.1 self.sendnx(string.format("whmi-wri %d,115200,1",self.flash_size)) # Nextion Upload Protocol 1.1
self.sendnx(string.format("whmi-wris %d,115200,1",self.flash_size)) # Nextion Upload Protocol 1.2 #self.sendnx(string.format("whmi-wris %d,115200,1",self.flash_size)) # Nextion Upload Protocol 1.2
# skip to byte (upload protocol 1.2) # skip to byte (upload protocol 1.2)
elif (size(msg)==1 && msg[0]==0x08) elif (size(msg)==1 && msg[0]==0x08)