YunClient.h / Rest- API timeout when trying to print to client (client.print)

Hi,

I'm almost finished my geofence/http garage door opener with help of an Arduino Yun as Controller and an Arduino Nano for the garage site connected via Ciseco Wireless modules. But I have one problem to receive status messages with help of the client.print- function from my arduino yun sketch back to my browser:

The http- request is broken before I got some data from a function which I want to print back to the http- client connection. The function needs about 10 seconds to have all data gathered (garage door closed/ open?).

With help of Firefox web debugger, I've recognized that the timeout from the arduino yun occurs after 5 seconds.

With this information I've found this indication: http://forum.arduino.cc/index.php?topic=198998.msg1471282#msg1471282 :

"...The (lua) code that connects to the Bridge has a 5 seconds timeout. So it shouldn't directly related to the http part of your project..."

So my question, could I adjust this "lua- code" Bridge timeout?

Thanks Andreas

Only way is by using a custom lua code. Lua code on the yun is compiled: you need to replace it with the source from the YunWebUI project https://github.com/arduino/YunWebUI/blob/master/usr/lib/lua/luci/controller/arduino/index.lua Look for "sndtimeo" and "rcvtimeo": change rcvtimeo to more than 5

Thank you for your solution, it's working! Sorry for my delayed answer!

Andreas

Good! I've opened an issue about making the timeout configurable https://github.com/arduino/YunWebUI/issues/11 I hope we can work on it in the coming weeks