Hi, All
I'm trying to make OTA update of ESP32 module https://www.b4x.com/android/forum/threads/esp32-simple-ota-update-via-webserver.130576/.
.bin file is made by merging .bin files https://www.b4x.com/android/forum/threads/esp32-bin-merging-and-flashing.149181/ and this file is correctly re-flashed from 0x0 address by esptool.
SPIFFS file system is even pre-formatted (!!11)
This merged existing "update.bin" file is deleted before downloading OK.
File is downloaded from server OK into SPIFFS file system:
	
	
	
	
	
	
	
		
			
			
			
			
			
		
	
	
	
		
	
	
		
	
but the flashing always gives error #8:
How to debug ?
What correct .bin must be ?
			
			I'm trying to make OTA update of ESP32 module https://www.b4x.com/android/forum/threads/esp32-simple-ota-update-via-webserver.130576/.
.bin file is made by merging .bin files https://www.b4x.com/android/forum/threads/esp32-bin-merging-and-flashing.149181/ and this file is correctly re-flashed from 0x0 address by esptool.
SPIFFS file system is even pre-formatted (!!11)
This merged existing "update.bin" file is deleted before downloading OK.
File is downloaded from server OK into SPIFFS file system:
			
				B4X:
			
		
		
		Private Sub AppStart
    Serial1.Initialize(115200)
    Log("AppStart")
 
    For i=1 To 10
        Log("Connecting to WiFi...")
        Log(i)
     
    If wifi.Connect2("wifi","password") Then
    Log("Connected to wireless network.")
    Log("My ip: ", wifi.LocalIp)
            InitFS
            bc.ArrayCopy("http://pmaker.ru/update.bin", FullPath)
            bc.ArrayCopy("/update.bin", SaveAs) '/ is important!
            fs.Remove(bc.StringFromBytes(SaveAs))
            Log("Old update.bin - deleted")
            ListFiles
            DownloadFile
            ListFiles
            RunNative("updateFromFS", Null)
            Exit
        Else
            Log("Failed to connect...")
        End If
    Next
 
End Sub
Sub DownloadFile
    RunNative("downloadfile", Null) 
End Sub
Sub InitFS
    Log("Initializing Filesystem...")
 
    If(fs.Initialize())=False Then
        Log("Formatting Filesystem. This may take some time")
        fs.Format
        If(fs.Initialize())=True Then
            Log("Formatting succesful...")
         
        Else
            Log("Error formatting Filesystem...")
        End If
    End If
    fs.Format
    ListFiles
End Sub
Sub ListFiles
    Log("Files:")
    For Each f As File In fs.ListFiles("/")
        Log("     ",f.Name," Size: ",f.Size)
    Next
    Log("Total size: ", fs.TotalSize, " B")
    Log("Used size: ", fs.UsedSize, " B")
End Subbut the flashing always gives error #8:
BTW the SDK is installed the fresh recent v.2.0.11.E (231) psram: PSRAM ID read error: 0xffffffff
AppStart
Connecting to WiFi...
1
Connected to wireless network.
My ip: 10.1.30.45
Initializing Filesystem...
Files:
Total size: 1318001 B
Used size: 0 B
Old update.bin - deleted
Files:
Total size: 1318001 B
Used size: 0 B
Downloading from http://pmaker.ru/update.bin...
Saving as /update.bin...
[HTTP] GET...
Connected...
Filesize is 1135136
Writing File...
Total Bytes downloaded: 1135136
Files:
update.bin Size: 1135136
Total size: 1318001 B
Used size: 1144560 B
Try to start update
Written only : 0/1135136. Retry?
Error Occurred. Error #: 8
How to debug ?
What correct .bin must be ?
			
				Last edited: 
			
		
	
								
								
									
	
		
			
		
	
								
							
							 
				 
 
		 
 
		 
 
		 
 
		 
 
		