Function call failed Timed out

My Electron device suddenly not working. It has been working fine for days.

Calling function always time out, and didn’t received any events subscribed

Tried the following

  1. Have made sure the firmware did not crash and still running
  2. Tried reset button did not help
  3. I can still see it online, flash it and subscribe to events, but no events arrived since then

Strange, I am having the same issue right now suddenly. Maybe the problem is with the cloud? Can anyone else confirm?

function call is working on my side. Let me try publishing…

Publishing events are also appearing for me.

This is still happening on my end. I just tried an example sketch and a function call from the command line – same result.

Can you post the error message? Does particle list online show your electron and the function?

From the command line I simply get Function call failed Timed out. When I tried from html I got: Failed to load resource: the server responded with a status of 408 (Request Time-out)

I get no result from particle list online

That’s weird then. Can you do a particle config identify, grab the access token and use a brower to do this: https://api.particle.io/v1/devices?access_token=PASTE_TOKEN_HERE

From https://api.particle.io/v1/devices?access_token=PASTE_TOKEN_HERE I get this:

    [
  {
    "id": "",
    "name": "Irrigation-Particle1",
    "last_app": null,
    "last_ip_address": "",
    "last_heard": "2017-01-19T13:46:09.906Z",
    "product_id": 10,
    "connected": false,
    "platform_id": 10,
    "cellular": true,
    "status": "normal",
    "last_iccid": "",
    "imei": "",
    "current_build_target": "0.4.9",
    "default_build_target": "0.4.9"
  }
]

Also when I try the to call my function again from the command line i am now getting a weird error:

    Function call failed { Error: connect ENETUNREACH 52.20.20.162:443 - Local (0.0.0.0:53668)
    at Object.exports._errnoException (util.js:1022:11)
    at exports._exceptionWithHostPort (util.js:1045:20)
    at connect (net.js:881:16)
    at net.js:1010:7
    at GetAddrInfoReqWrap.asyncCallback [as callback] (dns.js:62:16)
    at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:81:10)
  code: 'ENETUNREACH',
  errno: 'ENETUNREACH',
  syscall: 'connect',
  address: '52.20.20.162',
  port: 443 }

Tried it again and I got a slightly different error:

   Function call failed { Error: getaddrinfo ENOTFOUND api.particle.io api.particle.io:443
at errnoException (dns.js:28:10)
at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:76:26)
  code: 'ENOTFOUND',
  errno: 'ENOTFOUND',
  syscall: 'getaddrinfo',
  hostname: 'api.particle.io',
  host: 'api.particle.io',
  port: 443 }

Tried it a third time and I simply got

Function call failed Timed out

Did the CLI worked for you before? Seems like an issue with your machine and not the :cloud:

Everything worked fine before, this is very strange. I restarted my machine. I tried the command particle identify and I get serial: Serial timed out . So I unplug and plug in again my usb to my particle. Still getting the same result but at least particle serial list is now returning my device.
I don’t know how to begin troubleshooting this. Any suggestions welcome.

particle identify works only if your device is in listening mode (blinking blue)

Can you try to update to the latest CLI with npm install -g particle-cli?

Actually it needs to be in Listening Mode (blinking blue) for particle identify or particle serial ... - DFU Mode would be blinking yellow and that's good for things like particle update or particle flash --usb ...

1 Like

Thanks. I updated it, but still having Function call failed Timed out. I’ll continue troubleshooting…

Can you show your code of the function callback?

If you have delays or long running code in there that’ll cause the timeout.

Also this is puzzling

    "last_iccid": "",
    "imei": "",
    "current_build_target": "0.4.9",
    "default_build_target": "0.4.9"

There is no 0.4.9 system firmware for Electrons and imei and last_iccid should not be empty.

Also, is your Electron breathing cyan when executing the call?

1 Like

I’ve copy pasted the “Controlling LEDs over the Internet” example, so it shouldn’t be anything with the code of the function callback. I’m getting breathing cyan on the board. Trying again, https://api.particle.io/v1/devices?access_token=PASTE_TOKEN_HERE returns this:

[
  {
    "id": "",
    "name": "Irrigation-Particle1",
    "last_app": null,
    "last_ip_address": "",
    "last_heard": "2017-01-19T13:46:09.906Z",
    "product_id": 10,
    "connected": false,
    "platform_id": 10,
    "cellular": true,
    "status": "normal",
    "last_iccid": "",
    "imei": "",
    "current_build_target": "0.4.9",
    "default_build_target": "0.4.9"
  }
]

How did you build and flash that code to your device?

What doe you get with this

https://api.particle.io/v1/devices/450039000e51353433323633/?access_token=PASTE_TOKEN_HERE

I downloaded the firmware.bin file and then entered the command particle flash --serial firmware.bin

I get this:

{
  "id": "",
  "name": "Irrigation-Particle1",
  "last_app": null,
  "last_ip_address": "",
  "last_heard": "2017-01-19T15:52:50.840Z",
  "product_id": 10,
  "connected": true,
  "platform_id": 10,
  "cellular": true,
  "status": "normal",
  "last_iccid": "",
  "imei": "",
  "current_build_target": "0.4.9",
  "default_build_target": "0.4.9",
  "variables": {},
  "functions": [
    "led"
  ]
}

You are calling the function led then?

How about this page, does it also timeout on a call to led?
http://jordymoors.nl/interface/

1 Like

yes from the cmd line i’m calling particle call 450039000e51353433323633 led on

I logged into that page, it says this:

Irrigation-Particle1	450039000e51353433323633	offline
Core name	Core functions	Argument
Core name	Core variables	Value

I click on See Your Events which brings me to a page that says ‘:ok’ and then seems to hang on page load.