marcoschwartz / aREST

A RESTful environment for Arduino
http://aREST.io/
Other
1.2k stars 279 forks source link

aREST Functions to control servos causes hang #144

Open kevboldt opened 7 years ago

kevboldt commented 7 years ago

I created a sketch to automate my blinds, but when I call any fourth servo, causes esp to hang for a few minutes, and no servos can move. However, I am still getting a 'success' response from the ESP.

I have a URL for each blind and I can modify the params to open and close the blinds. as below.

http://IP/Blind1?params=180 http://IP/Blind2?params=180 http://IP/Blind3?params=180 http://IP/Blind4?params=180

Each blind is a function for aRest. I can open and close any single blind every second, many times, no delay. No issues. All blinds work as expected.

As soon as I call Blind1--> Blind2--->Blind3--> Blind4, I have issues on the fourth blind. If I call Blind 4 first, Blind 1 doesn't open. The servo (Blind) doesn't matter...seems to be the request.

I am using a home automation controller to call a single request to each blind. If I leave a 10min delay on the last blind, it will work.

I do know that the fourth blind is getting the request because it starts to want to open, but then something cuts it off, and then no blind functions until minutes pass. Then we are back to 'normal' again.

kevboldt commented 7 years ago

Just an update.--- I have inserted Serial.println throughout to narrow this problem down.

Here is what I found.

When the servo does not respond:

Everything that I see is functioning normal during a 'hung' state. Yet, servos do not move. After 5 mins, servos move again.

I can create this problem by 'post'ing a URL before the first servo has completed. If I post http://IP/**Blind1**?params=180 then http://IP/**Blind2**?params=180 I can repeat the problem all day long.

If Post to the same URL with a different params...I can never get it to fail. ie) http://IP/Blind2?params=180 and http://IP/Blind2?params=1 - Never fails, and it doesn't matter how fast I switch between the URL's.