B4R Question ESP8266 Looper and astream.write

daveinhull

Active Member
Licensed User
Longtime User
Hi,

I've now managed to get my ESP8266 to act as a very simply web based control pannel to control a DC motor.
The DC motor is controlled in a Looper which reads a variable to decide what direciton to go or to stop.
I've got a physical switch, a small remote control fob and the web page to control it, any one of which can set the direciton variable or stop it.

The webside works fine when the looper is commented out, i.e. I can send HTLM to the user and collect responsoses from buttons.

However, when I enable the Looper, nothing works at the browns end, just get "unable to connection timed out"

Does the Loop work of interupts as I suspect that the Looper is interupting the astream.write and therefore incorrect HTML is being sent back to the browswer or something like that?

Anybody got any thoughts, can I stop the looper while I process the web request. I'll upload code if needed.

Thank you in advance
Dave
 

daveinhull

Active Member
Licensed User
Longtime User
HI,

OK, I think I've found out what the problem is.
It appears it is the LOG statements that I've got in the Looper.

I guess that would cause the problems šŸ˜”

Thanks
Dave
 
Upvote 0

daveinhull

Active Member
Licensed User
Longtime User
Hi Erel,

Yes and no. I had a delay in to slow things down while testing with Log statements rather than the real hardware, but I did try taking it out and it still went wrong - hence my second post about using the Log statements.

Thanks
Dave
 
Upvote 0
Top