Error calling function: 'led': Timed out

I'm doing the Read your photo sensor hardware tutorial https://docs.particle.io/getting-started/hardware-tutorials/hardware-examples/#read-your-photo-sensor-function-and-variable

I not using a sim just USB. When running the command: particle call device_name led on from the command line I get : Error calling function: led: Timed out.

The code (that I copied and pasted from your site) compiles and flashes successfully.

What I am confused about is this: >>>>

As for your Particle.variable, the API request will look something like this:

GET /v1/devices/{DEVICE_ID}/analogvalue

# EXAMPLE REQUEST IN TERMINAL
# Core ID is 0123456789abcdef
# Your access token is 123412341234
curl -G https://api.particle.io/v1/devices/0123456789abcdef/analogvalue \
  -d access_token=123412341234

You can see a JSON output of your Particle.variable() call by going to:

https://api.particle.io/v1/devices/your-device-ID-goes-here/analogvalue?access_token=your-access-token-goes-here

<<<<
Is this something I need to do or does it happen in the background?

What do you mean by that?

The cloud APIs will only work when connected to the cloud and an Electron without SIM will not be.
Your Electron needs be be breathing cyan in order to process HTTP requests.

I have the electron connected directly to the computer via USB. According to the Hardware tutorial

You can turn the LED on and off from the console or the CLI, same as before:

particle call device_name led on
<<<

You can use CLI to issue a web request but it will not send that request via USB.

BTW, a CLI call request would issue an HTTP POST not a HTTP GET as in your original post.

1 Like

I am so lost. I guess the easiest solution is to get a sim and hopefully get it working that way.

Usually an Electron comes with SIM

Got mine from a friend so its not new.