by Electroguard » Tue Dec 19, 2023 12:13 am
Hi Oli, the videos and your commentary are helpful.
I can only suggest what I might do in similar circumstances.
Always start the device in a new window, to ensure the Editor page is created with the correct javascript code (the same goes for all device pages).
Understandably it would probably cause errors if loading an esp8266 script into an esp32 Editor window or vice versa.
Open the File Manager to create a backup zip on computer of all files from the device, then unzip them on the computer to check that all files can be loaded into a computer text editor ok, with no signs of corruption.
It is especially important to check that the bottom of the scripts are still intact ... because if a file Save fails for any reason, it can leave a partial incomplete file of that name, which may cause errors when trying to load, and certainly when trying to run.
That is why I always end my scripts with:
'-------- End ------
which makes it obvious if the end of the script is missing.
Assuming that the files all look ok on the computer, I would either Format the device files system from Config page, or re-flash the device again.
Then I would upload each required file one at a time, checking that each loaded into the Editor ok.
If any file failed, I would rename it from File Manager to prevent trying to save to that same area of file space again, then try uploading the same file again - after re-checking it loaded and looked ok on computer again... cos clearly something was either wrong with that file, or the file space.
And from bitter experience I have found that after any sort of problem, it always pays to remove and replace device power to do a complete clean startup again, so everything is refreshed... cos the interpreter can sometimes 'get its nickers in a twist'.
If I find a file that is causing a problem, it could be completely commented out so that it is inactive, then try loading it again - if it then loads ok, parts of it can be selectively un-commented until either some faulty code is found, or the script is eventually complete.
Or any particular file which may be causing a problem can be redone by adding a few lines at a time to the Editor and re-Saving.
But remember that any Save error will corrupt the previous file of that name, so Save each edit with a different suffix, ie: file3a, then file3b next, etc.
Keep the last few saves, but remember to keep deleting earlier unwanted files to avoid using up all of the precious file space.
There are only a few possible causes to diagnose:
Faulty hardware - try a different device.
Faulty or corrupt firmware or file system - try re-flashing with an older version.
Faulty file - redo the file from minimum, making any necessary correction.
User impatience - allow time for each operation to fully complete before clicking the interpreter to do more (file operations can sometimes be slow).
Hope that helps to find the cause of the problem.
Hi Oli, the videos and your commentary are helpful.
I can only suggest what I might do in similar circumstances.
Always start the device in a new window, to ensure the Editor page is created with the correct javascript code ([i]the same goes for all device pages[/i]).
Understandably it would probably cause errors if loading an esp8266 script into an esp32 Editor window or vice versa.
Open the File Manager to create a backup zip on computer of all files from the device, then unzip them on the computer to check that all files can be loaded into a computer text editor ok, with no signs of corruption.
It is especially important to check that the bottom of the scripts are still intact ... because if a file Save fails for any reason, it can leave a partial incomplete file of that name, which may cause errors when trying to load, and certainly when trying to run.
That is why I always end my scripts with:
[color=#008000]'-------- End ------[/color]
which makes it obvious if the end of the script is missing.
Assuming that the files all look ok on the computer, I would either Format the device files system from Config page, or re-flash the device again.
Then I would upload each required file one at a time, checking that each loaded into the Editor ok.
If any file failed, I would rename it from File Manager to prevent trying to save to that same area of file space again, then try uploading the same file again - after re-checking it loaded and looked ok on computer again... cos clearly something was either wrong with that file, or the file space.
And from bitter experience I have found that after any sort of problem, it always pays to remove and replace device power to do a complete clean startup again, so everything is refreshed... cos the interpreter can sometimes 'get its nickers in a twist'.
If I find a file that is causing a problem, it could be completely commented out so that it is inactive, then try loading it again - if it then loads ok, parts of it can be selectively un-commented until either some faulty code is found, or the script is eventually complete.
Or any particular file which may be causing a problem can be redone by adding a few lines at a time to the Editor and re-Saving.
But remember that any Save error will corrupt the previous file of that name, so Save each edit with a different suffix, ie: file3a, then file3b next, etc.
Keep the last few saves, but remember to keep deleting earlier unwanted files to avoid using up all of the precious file space.
There are only a few possible causes to diagnose:
Faulty hardware - try a different device.
Faulty or corrupt firmware or file system - try re-flashing with an older version.
Faulty file - redo the file from minimum, making any necessary correction.
User impatience - allow time for each operation to fully complete before clicking the interpreter to do more ([i]file operations can sometimes be slow[/i]).
Hope that helps to find the cause of the problem.