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

**URL:** <https://community.particle.io/t/particle-function-returns-ok-false-error-timed-out/62245>\
**Category:** Firmware\
**Created:** [March 16, 2022, 4:11pm UTC](https://community.particle.io/t/particle-function-returns-ok-false-error-timed-out/62245 "2022-03-16T16:11:10Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![mprogers](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/mprogers/32/18458_2.png) [@mprogers](https://community.particle.io/u/mprogers)\
**Post date:** [March 16, 2022, 4:11pm UTC](https://community.particle.io/t/particle-function-returns-ok-false-error-timed-out/62245/1 "2022-03-16T16:11:10Z")

</div>

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

```auto
    <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.

---

<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:** [March 16, 2022, 4:26pm UTC](https://community.particle.io/t/particle-function-returns-ok-false-error-timed-out/62245/2 "2022-03-16T16:26:24Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![mprogers](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/mprogers/32/18458_2.png) [@mprogers](https://community.particle.io/u/mprogers)\
**Post date:** [March 16, 2022, 5:49pm UTC](https://community.particle.io/t/particle-function-returns-ok-false-error-timed-out/62245/3 "2022-03-16T17:49:37Z")

</div>

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

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.

---

<div class="post-metadata">

**Author:** ![bko](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/bko/32/20704_2.png) [@bko](https://community.particle.io/u/bko)\
**Post date:** [March 16, 2022, 5:58pm UTC](https://community.particle.io/t/particle-function-returns-ok-false-error-timed-out/62245/4 "2022-03-16T17:58:26Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![mprogers](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/mprogers/32/18458_2.png) [@mprogers](https://community.particle.io/u/mprogers)\
**Post date:** [March 16, 2022, 9:24pm UTC](https://community.particle.io/t/particle-function-returns-ok-false-error-timed-out/62245/5 "2022-03-16T21:24:58Z")

</div>

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](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.

---

<div class="post-metadata">

**Author:** ![bko](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/bko/32/20704_2.png) [@bko](https://community.particle.io/u/bko)\
**Post date:** [March 16, 2022, 10:01pm UTC](https://community.particle.io/t/particle-function-returns-ok-false-error-timed-out/62245/6 "2022-03-16T22:01:39Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![mprogers](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/mprogers/32/18458_2.png) [@mprogers](https://community.particle.io/u/mprogers)\
**Post date:** [March 16, 2022, 11:49pm UTC](https://community.particle.io/t/particle-function-returns-ok-false-error-timed-out/62245/7 "2022-03-16T23:49:40Z")

</div>

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 😀).

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/particle/original/3X/6/4/64635adccc35238caa19e9b553ec3e98b163d026.png) [@system](https://community.particle.io/u/system)\
**Post date:** [April 16, 2022, 9:50am UTC](https://community.particle.io/t/particle-function-returns-ok-false-error-timed-out/62245/8 "2022-04-16T09:50:36Z")

</div>

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