Moderator: Mmiscool
this is a known issue that has not been resolved. Mike the developer has asked for help to locate the bug.
What I do as a workaround...
1. ALWAYS save a copy of your code in a text file so you can get it back.
2. when working with and changing code I always try and open the edit window and KEEP it open.
if I want to save and run my code I use the right click mouse button and when I click the run button I do it as an "open in new tab" thus leaving the original edit window intact.
Then you can go back and do more editing and when ready to save and run, just reset the esp module and then give it a few seconds to reconnect and then save. then close the other run window and then again right click and open the run window in a new tab. Thus, again, leaving the original edit window intact.
this seems to work for me in most cases.
3. when developing and testing code I ALWAYS have a serial connection to the module and open a terminal (putty terminal) and then you get a lot of feedback from the module on its status and can see if a crash happens (evidenced by a large dump of data to the serial window)
hope these tips help
dwight
Unfortunately i can't use the serial connection for status and feedback, because i need it for rs485 connection to a fan controller. Can you tell me when this save bug occurs. When compiling? During transfer to the esp? Or when storing into the esp flash? Or ...?
Save everything twice after any rebooted save - frustrating, but will minimise interpreter malfunctions and corruption problems.
Prune out everything non-essential, including comments.
Shorten the length of var and branch names to minimal... f$ takes up less space than filename$
Squeeze your script down to the minimal size possible.
Think of the "Save" bug as a wonky wheel - to keep things moving as long as possible you need to lighten the load as much as possible.
Edit: Or better still, think of it as a leaking crack below the waterline of your boat - the only way to stay afloat is to jetison enough overboard to raise the leaky Save bug clear of the waterline, but you can still expect frequent splashing.