# Timeout received from particle cloud when calling a function through curl

**URL:** <https://community.particle.io/t/timeout-received-from-particle-cloud-when-calling-a-function-through-curl/31416>\
**Category:** Troubleshooting\
**Created:** [April 7, 2017, 6:37am UTC](https://community.particle.io/t/timeout-received-from-particle-cloud-when-calling-a-function-through-curl/31416 "2017-04-07T06:37:03Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jrm](https://avatars.discourse-cdn.com/v4/letter/j/3be4f8/32.png) [@jrm](https://community.particle.io/u/jrm)\
**Post date:** [April 7, 2017, 6:37am UTC](https://community.particle.io/t/timeout-received-from-particle-cloud-when-calling-a-function-through-curl/31416/1 "2017-04-07T06:37:03Z")

</div>

Hello,

I've a strange issue that I don't what to make of it.

I've the following script (that is a sample of a method to be later implemented in a php script):

> #! /bin/bash  
> DURSLEEP=1  
> DEVICE=

> curl [https://api.particle.io/v1/devices/$DEVICE/](https://api.particle.io/v1/devices/$DEVICE/)  
> -d access\_token=   
> -d "args=\<cmd 1\>"  
> echo  
> sleep $DURSLEEP  
> curl [https://api.particle.io/v1/devices/$DEVICE/](https://api.particle.io/v1/devices/$DEVICE/)  
> -d access\_token=   
> -d "args=\<cmd 2\>"  
> echo  
> sleep $DURSLEEP  
> curl [https://api.particle.io/v1/devices/$DEVICE/](https://api.particle.io/v1/devices/$DEVICE/)   
> -d access\_token=   
> -d "args=\<cmd 3\>"  
> echo

running this script, give me two results. **on plateform a:**

> {"id":"","last\_app":"","connected":true,"return\_value":0}  
> {"id":"","last\_app":"","connected":true,"return\_value":0}  
> {"id":"","last\_app":"","connected":true,"return\_value":0}

**on plateform b:**

> {"id":"","last\_app":"","connected":true,"return\_value":0}  
> {"ok":false,"error":"Timed out."}  
> {"ok":false,"error":"Timed out."}

I've repeated the test on both plateform several time at different time. I always get the same issue.

My first analysis would say that the issue is linked to curl on platform b. But the error I receive is not a curl error, but a particle cloud internal timeout error. Which should be independant from the calling plateform.

Anybody could give me a hint?

tks

---

<div class="post-metadata">

**Author:** ![ScruffR](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/scruffr/32/6952_2.png) [@ScruffR](https://community.particle.io/u/ScruffR)\
**Post date:** [April 7, 2017, 7:21am UTC](https://community.particle.io/t/timeout-received-from-particle-cloud-when-calling-a-function-through-curl/31416/2 "2017-04-07T07:21:06Z")

</div>

What is your function doing?

BTW, that `culr` command does not look like a call to a `Particle.function()`

And what are platform a & b?

---

<div class="post-metadata">

**Author:** ![jrm](https://avatars.discourse-cdn.com/v4/letter/j/3be4f8/32.png) [@jrm](https://community.particle.io/u/jrm)\
**Post date:** [April 7, 2017, 7:42am UTC](https://community.particle.io/t/timeout-received-from-particle-cloud-when-calling-a-function-through-curl/31416/3 "2017-04-07T07:42:59Z")

</div>

Hello ScruffR,

The function is putting received strings in a buffer for later processing (other functions in main loop). I haven't add any issue with this function since months. And what puzzle me is that, I'm calling the same function on the same particle (electron fw 6.0.0) from different source. my assumptions are the followings:

1)The particle device should not be the source of the problem (it seems) as it is able to correctly process all commands on plateform a

1. The plateform b send the exact same set of commands and receive a response from particle cloud from all of them (including timeouts), therefore, it seems to me the issue is in between the device and my servers... but how to troubleshoot that?

sever a is an **OSX laptop**  
server b is a linux **Debian wheezy**

You are right, the forum post stripped some of the sample code I've put in, here is the correct version:

> #! /bin/bash  
> DURSLEEP=1  
> DEVICE=\< DEVICEID\>

> curl [https://api.particle.io/v1/devices/$DEVICE/](https://api.particle.io/v1/devices/$DEVICE/)\< function\>   
> -d access\_token=\< token\>   
> -d "args=\< cmd 1\>"  
> echo  
> sleep $DURSLEEP  
> curl [https://api.particle.io/v1/devices/$DEVICE/](https://api.particle.io/v1/devices/$DEVICE/)\< function\>   
> -d access\_token=\< token\>   
> -d "args=\< cmd 2\>"  
> echo  
> sleep $DURSLEEP  
> curl [https://api.particle.io/v1/devices/$DEVICE/](https://api.particle.io/v1/devices/$DEVICE/)\< function\>   
> -d access\_token=\< token\>   
> -d "args=\< cmd 3\>"  
> echo

tks for your help
