An archive of community.esquilo.io as of Saturday January 26, 2019.

Multiple ERPC calls?

steveb48

Hi All,

I have a nut that is reading status from my pool controller and saving, air, pool and spa temp as well as the state of the pumps and lights. My HTML code has a function called GetStatus() which runs every 5 seconds. GetStatus() issues an ERPC call to get each piece of status info. Each of these calls updates the display. This all works fine on Chrome but on Safari, my ERPC requests timeout. They occasionally work but mostly fail. If I comment out all but one of the ERPC calls, GetTime() for example, it works fine. It doesn't matter which one I comment out. More than one and I fail.

This is all probably as clear as mud. I'll try to post a simplified version of the code which shows the problem tomorrow but in the mean time, is it OK to post multiple ERPC calls? I could do this by creating a status object and passing that in a single call but I'm curious why this doesn't work.

thanks,
Steve

patrick

Hi Steve,

I'd need to do some Googling to refresh my memory, but I think Safari has a fairly small limit on the number of outstanding HTTP requests that a client app (i.e. JavaScript running in a page) can have at a time. This may be your issue.

A good work-around is to aggregate your ERPCs into one call if possible (e.g. instead of getX, getY, use getXY and return an object with both (e.g. return {x=1, y=2}.

The other approach is to chain the requests to ensure only the max number of outstanding requests are allowed at any instance.

steveb48

A bit of a rewrite to return multiple items from one call and it all works!

thanks
Steve