Particle Function returns {"ok":false,"error":"Timed out."}

I had been invoking a Particle function on an Argon, just fine, using this form:

    <form method="POST" action="https://api.particle.io/v1/devices/ddddd/blinkFast">
        Melody: <input type="text" size="40" name="args" /><br>
        <input type="submit" value="Play Melody" />
        <input type="hidden" name="access_token" value="aaaaa" />
    </form>

But today, when I tried to run it, I get this instead:

{“ok”:false,“error”:“Timed out.”}

I tried it from Safari and Firefox. I tried restarting the Argon.

I can invoke the methods from the Particle app.

Any ideas? I saw one thread in which this turned out to be a problem on Particle’s end, but that was from a few years ago, and I am at a loss.

Thanks for any help.

Works fine for me.
What does your blinkFast function do? If it isn’t returning near immediately you will see a timeout despite the function being called successfully.

Judging by the button name “Play Melody” I could imagine you are playing some sound which may well take longer than a couple of seconds and hence cause the timeout.

1 Like

I’m glad to hear it’s my problem … sort of :grinning:

blinkFast() was just designed to make the built-in LED (D7) flash, for debugging purposes – it replaced another method, playMelody(), that would play a song using a buzzer. Both methods work from the Particle app, neither from the form. So … somehow the communication between the form and Particle cloud is the problem, or possibly the form itself – but the latter was working just fine, and I’d swear the access token and device ID are correct.

Hi @mprogers

Maybe it is time to try curl on the command line and see if the response there make more sense? Another thing to check is if the token is expired–mostly that has not been an issue for a long time now, but it could be an old token.

I tried it from curl (good idea) and got the same error:

curl -d “access_token=aaaaa&args=C4Q-D4Q” “https://api.particle.io/v1/devices/ddddd/playMelody
{“ok”:false,“error”:“Timed out.”}

It occurred to me that this worked at home … I can’t imagine that our IT people would be firewalling this, but I’ll make inquiries.

Try adding a “-v” to your curl command for verbose mode. You will see more output and may gain some insight. If that doesn’t show anything, you can try adding “–trace” but be ready to scroll.

I solved my problem. Briefly, the problem was, and I am sooooooo embarrassed to say this, I had the wrong device id. In my defense, I have about 10 of these in my home and office, and lost track of which one I was working on. Rather than delete this entire thread to conceal my stupidity, I will leave this as a potential aid to others (or possibly myself in a year or two :grinning:).

4 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.