-->
Page 1 of 2

Loosing lines and many reboots.

PostPosted: Sat Aug 26, 2017 6:22 am
by Lagnus
First let me say i really like espbasic. But in the last time it drives me crazy. small progs work. but if the progs get greater i loose lines when saving and there are many reboots of the module. So i waste a lot of time and nothing goes on. even if i get a greater prog running and i save this again or save it to an other module it crashes. (Alpha69) . I need help please.

Re: Loosing lines and many reboots.

PostPosted: Sat Aug 26, 2017 12:07 pm
by heckler
Hi Lagnus,

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

Re: Loosing lines and many reboots.

PostPosted: Sun Aug 27, 2017 9:06 am
by Lagnus
Thank you heckler for your fast response. Normally i use the same workflow you described in point 1 and 2.
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 ...?

Re: Loosing lines and many reboots.

PostPosted: Sun Aug 27, 2017 9:34 am
by Electroguard
If practical, use serial2 for your RS485 fan, keep serial(1) for diagnostics.

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.