Timeout received from particle cloud when calling a function through curl

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/
-d access_token=
-d "args=<cmd 1>"
echo
sleep $DURSLEEP
curl 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/
-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

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?

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/< function>
-d access_token=< token>
-d "args=< cmd 1>"
echo
sleep $DURSLEEP
curl 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/< function>
-d access_token=< token>
-d "args=< cmd 3>"
echo

tks for your help