# Cli list shows device offline, exposed functions not exposed

**URL:** <https://community.particle.io/t/cli-list-shows-device-offline-exposed-functions-not-exposed/22708>\
**Category:** Troubleshooting\
**Created:** [May 6, 2016, 5:29am UTC](https://community.particle.io/t/cli-list-shows-device-offline-exposed-functions-not-exposed/22708 "2016-05-06T05:29:27Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![vinistois](https://avatars.discourse-cdn.com/v4/letter/v/e9a140/32.png) [@vinistois](https://community.particle.io/u/vinistois)\
**Post date:** [May 6, 2016, 5:29am UTC](https://community.particle.io/t/cli-list-shows-device-offline-exposed-functions-not-exposed/22708/1 "2016-05-06T05:29:27Z")

</div>

I am playing around with the CLI. I do a particle list and I get a list of my devices. They show offline, whether they are online or not. If a device is breathing cyan, shouldn’t it report as online?

If I type a particle list right after a reset, I can get an ‘online’ result (but only once). It seems like there’s a very short window where the device is reporting as online. Once it’s breathing cyan, it will always report ‘offline’. Why would that be?

When I can get it to show up online, it doesn’t list any exposed functions, even though I have a few in the code. I thought I was going crazy so I flashed the below, super simple code. Shouldn’t this work? Again I get the same result as above.

```auto
int LED = D7;

void setup(void)
    {
    pinMode(LED, OUTPUT);
    
    Particle.function("ledtest", LedTest);
    digitalWrite(LED, LOW);
    }

    int LedTest(String command){
        if (command == "on"){
           digitalWrite(LED, HIGH);
           return 1;
           }   
    }

void loop() {

}

```

---

<div class="post-metadata">

**Author:** ![kennethlimcp](https://avatars.discourse-cdn.com/v4/letter/k/c0e974/32.png) [@kennethlimcp](https://community.particle.io/u/kennethlimcp)\
**Post date:** [May 6, 2016, 5:35am UTC](https://community.particle.io/t/cli-list-shows-device-offline-exposed-functions-not-exposed/22708/2 "2016-05-06T05:35:59Z")

</div>

What device is that?

---

<div class="post-metadata">

**Author:** ![vinistois](https://avatars.discourse-cdn.com/v4/letter/v/e9a140/32.png) [@vinistois](https://community.particle.io/u/vinistois)\
**Post date:** [May 6, 2016, 6:01am UTC](https://community.particle.io/t/cli-list-shows-device-offline-exposed-functions-not-exposed/22708/3 "2016-05-06T06:01:12Z")

</div>

a photon.

---

<div class="post-metadata">

**Author:** ![kennethlimcp](https://avatars.discourse-cdn.com/v4/letter/k/c0e974/32.png) [@kennethlimcp](https://community.particle.io/u/kennethlimcp)\
**Post date:** [May 6, 2016, 7:56am UTC](https://community.particle.io/t/cli-list-shows-device-offline-exposed-functions-not-exposed/22708/4 "2016-05-06T07:56:17Z")

</div>

Are you compiling against v0.5.0? I haven’t encountered such issues with the Photon though.

Can you try loading tinker firmware and see if that happens?

---

<div class="post-metadata">

**Author:** ![peekay123](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/peekay123/32/810_2.png) [@peekay123](https://community.particle.io/u/peekay123)\
**Post date:** [May 6, 2016, 11:29am UTC](https://community.particle.io/t/cli-list-shows-device-offline-exposed-functions-not-exposed/22708/5 "2016-05-06T11:29:35Z")

</div>

@vinistois also please make sure you have the latest version of the CLI using `npm update -g particle-cli`.

---

<div class="post-metadata">

**Author:** ![vinistois](https://avatars.discourse-cdn.com/v4/letter/v/e9a140/32.png) [@vinistois](https://community.particle.io/u/vinistois)\
**Post date:** [May 6, 2016, 3:07pm UTC](https://community.particle.io/t/cli-list-shows-device-offline-exposed-functions-not-exposed/22708/6 "2016-05-06T15:07:05Z")

</div>

peekay, I did do that update right before starting my session. But the command didn’t seem to do or return anything, just a small delay and then back to the prompt. I am using 1.12 which seems to be the latest build.

I was hoping I could flash tinker from the android app but it seems to be unable to, it always gives me the message “unable to reflash tinker”. So I did it in the cli with the photon connected over usb. I tried to update the firmware but got this error:

![](https://us1.discourse-cdn.com/flex026/uploads/particle/original/2X/5/585a4bd6161d0ace44b19c4692092a0735acee06.png)

so I flashed tinker from the cli which worked:

![](https://us1.discourse-cdn.com/flex026/uploads/particle/original/2X/0/0c555747817ea564e9c5bc51442b3a41a037017b.png)

Tinker worked one time and let me get into the main tinkering screen. The behavior is the same, it will show up “online” for a couple of seconds after a reboot, but then goes back offline. Tinker shows a red dot and says “Offline”, when the photon is right here happily breathing cyan.

I should mention my photon is only a couple of feet from the router.

---

<div class="post-metadata">

**Author:** ![peekay123](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/peekay123/32/810_2.png) [@peekay123](https://community.particle.io/u/peekay123)\
**Post date:** [May 6, 2016, 4:32pm UTC](https://community.particle.io/t/cli-list-shows-device-offline-exposed-functions-not-exposed/22708/7 "2016-05-06T16:32:37Z")

</div>

@vinistois, I suggest you run `particle update` with the Photon in DFU (blinking yellow) mode. This will make sure you have the latest system parts on the device.

The flash command you got the error on assumed that you had the precompiled system parts bin files in the directory.

---

<div class="post-metadata">

**Author:** ![vinistois](https://avatars.discourse-cdn.com/v4/letter/v/e9a140/32.png) [@vinistois](https://community.particle.io/u/vinistois)\
**Post date:** [May 6, 2016, 4:41pm UTC](https://community.particle.io/t/cli-list-shows-device-offline-exposed-functions-not-exposed/22708/8 "2016-05-06T16:41:45Z")

</div>

Thanks for the help and suggestions!

Look what we have accomplished:

![](https://us1.discourse-cdn.com/flex026/uploads/particle/original/2X/5/572a044fc596d8a553b950924b29fcf6ea9c3402.png)

finally a function was exposed! However, couple of seconds later:

![](https://us1.discourse-cdn.com/flex026/uploads/particle/original/2X/d/d85cc10f250a0e0c087bff7c384aa0c14745200f.png)

still breathing cyan… I should add it breaths cyan 90% of the time. Sometimes, its blinking green for awhile, then breathes cyan again. A short while ago I had an IFTT channel pushing notifications to me when the device would go offline. It sent me 168 messages in one night so I turned it off. It seems to be resetting very often, at least every 5 minutes or so.

---

<div class="post-metadata">

**Author:** ![peekay123](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/peekay123/32/810_2.png) [@peekay123](https://community.particle.io/u/peekay123)\
**Post date:** [May 6, 2016, 4:46pm UTC](https://community.particle.io/t/cli-list-shows-device-offline-exposed-functions-not-exposed/22708/9 "2016-05-06T16:46:19Z")

</div>

@vinistois, you seem to have a bigger issue with wifi or cloud disconnecting. First, I suggest wiping your wifi credentials and resetting them.

What wifi AP are you connecting to and how (WEP, WPA, WPA2, etc)? Do you have other Photons connected to the same AP?

---

<div class="post-metadata">

**Author:** ![vinistois](https://avatars.discourse-cdn.com/v4/letter/v/e9a140/32.png) [@vinistois](https://community.particle.io/u/vinistois)\
**Post date:** [May 6, 2016, 5:37pm UTC](https://community.particle.io/t/cli-list-shows-device-offline-exposed-functions-not-exposed/22708/10 "2016-05-06T17:37:21Z")

</div>

I did exactly that just last night. I actually started seriously doubting my router, so I fired up a backup with a different ssid and reset the credentials. It didn’t help. I went back to my normal router and flashed a new firmware onto it. I was thinking the signal was too weak or somehow flakey and that was causing the dropouts. I took apart my project and brought the photon right next to the router. But I keep getting the same result.

Is there a way to see the RSSI through the CLI? I don’t have an antenna connected anymore (its attached to the project box). The photon is only plugged into usb power and nothing else, a few feet from the router.

I am connected to my regular home wifi that a dozen other devices are connected to, with wpa2 aes. This photon worked properly before, it was sending regular updates from i2c sensors to ubidots for a few weeks without issue. I don’t have any other photons connected here right now, but I have in the past.

---

<div class="post-metadata">

**Author:** ![rickkas7](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/rickkas7/32/8681_2.png) [@rickkas7](https://community.particle.io/u/rickkas7)\
**Post date:** [May 6, 2016, 5:48pm UTC](https://community.particle.io/t/cli-list-shows-device-offline-exposed-functions-not-exposed/22708/11 "2016-05-06T17:48:44Z")

</div>

Wait - you had an external antenna connected before? Did you ever use `WiFi.selectAntenna(ANT_EXTERNAL)` in the past? Because that setting is really sticky - it even stays selected in safe mode, through firmware upgrades, etc… ANT\_AUTO will fall back to the internal antenna, but ANT\_EXTERNAL will continue to use a non-existent external antenna, generally unsuccessfully.

---

<div class="post-metadata">

**Author:** ![vinistois](https://avatars.discourse-cdn.com/v4/letter/v/e9a140/32.png) [@vinistois](https://community.particle.io/u/vinistois)\
**Post date:** [May 6, 2016, 6:24pm UTC](https://community.particle.io/t/cli-list-shows-device-offline-exposed-functions-not-exposed/22708/12 "2016-05-06T18:24:31Z")

</div>

Oh I didn’t know that! Yes it was using a 5dbi external antenna because the project is about 30 feet from the router.

I added WiFi.selectAntenna(ANT\_AUTO); to the code…

It is doing much better. It still reports as offline 1/10 times that I ping it with a “particle list”. The led is also flashing green every minute or so, then back to breathing cyan. But we are definitely getting somewhere! It is much more responsive.

edit: now that I can turn the led on and off using particle call, I can see there are still major issues. about half the time, the device does not respond and the call times out, even as the photon is breathing cyan.

---

<div class="post-metadata">

**Author:** ![vinistois](https://avatars.discourse-cdn.com/v4/letter/v/e9a140/32.png) [@vinistois](https://community.particle.io/u/vinistois)\
**Post date:** [May 6, 2016, 6:40pm UTC](https://community.particle.io/t/cli-list-shows-device-offline-exposed-functions-not-exposed/22708/13 "2016-05-06T18:40:06Z")

</div>

Oh crap!

Something here does not look right.

 ![](https://us1.discourse-cdn.com/flex026/uploads/particle/original/2X/2/28f6e2ae70a26c382e1125980218f2a3797aac35.png)

---

<div class="post-metadata">

**Author:** ![peekay123](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/peekay123/32/810_2.png) [@peekay123](https://community.particle.io/u/peekay123)\
**Post date:** [May 6, 2016, 6:40pm UTC](https://community.particle.io/t/cli-list-shows-device-offline-exposed-functions-not-exposed/22708/14 "2016-05-06T18:40:58Z")

</div>

Ya, like no onboard antenna!!! Whaaaaat!

---

<div class="post-metadata">

**Author:** ![vinistois](https://avatars.discourse-cdn.com/v4/letter/v/e9a140/32.png) [@vinistois](https://community.particle.io/u/vinistois)\
**Post date:** [May 6, 2016, 6:50pm UTC](https://community.particle.io/t/cli-list-shows-device-offline-exposed-functions-not-exposed/22708/15 "2016-05-06T18:50:56Z")

</div>

haha I have no clue 😕

I had a little antenna plugged into it for weeks, then I used the larger antenna that’s mounted to the box. I have no clue when this happened, but obviously it fell off somehow. The trace that leads into it’s pad is lifted off the board as well. It must have been a mechanical impact. Crazy.

Should it still work fine with an external antenna?

I’m guessing this is for sure the source of my issues?

---

<div class="post-metadata">

**Author:** ![peekay123](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/peekay123/32/810_2.png) [@peekay123](https://community.particle.io/u/peekay123)\
**Post date:** [May 6, 2016, 6:52pm UTC](https://community.particle.io/t/cli-list-shows-device-offline-exposed-functions-not-exposed/22708/16 "2016-05-06T18:52:14Z")

</div>

@vinistois, it should work as long as your external antenna is plugged in. That is crazy!

---

<div class="post-metadata">

**Author:** ![vinistois](https://avatars.discourse-cdn.com/v4/letter/v/e9a140/32.png) [@vinistois](https://community.particle.io/u/vinistois)\
**Post date:** [May 6, 2016, 6:55pm UTC](https://community.particle.io/t/cli-list-shows-device-offline-exposed-functions-not-exposed/22708/17 "2016-05-06T18:55:54Z")

</div>

Amazing how many hours one can sink into software troubleshooting only to find out a part has been sheared off the board entirely.

Is it possible to get real-time rssi, or cloud “uptime” information to help troubleshoot connectivity issues? Perhaps over serial or an attached lcd?

Thanks very much for your assistance troubleshooting. Once we started talking about antenna issues I took a look at the board and the photos of what it should look like, otherwise I would have never noticed.

---

<div class="post-metadata">

**Author:** ![peekay123](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/peekay123/32/810_2.png) [@peekay123](https://community.particle.io/u/peekay123)\
**Post date:** [May 6, 2016, 7:02pm UTC](https://community.particle.io/t/cli-list-shows-device-offline-exposed-functions-not-exposed/22708/18 "2016-05-06T19:02:43Z")

</div>

@vinistois, there is nothing in the system firmware to display real-time RSSI. However, this can be added to your app easily. It could easily be made to drive an external LCD display via serial or I2C. 😉

---

<div class="post-metadata">

**Author:** ![vinistois](https://avatars.discourse-cdn.com/v4/letter/v/e9a140/32.png) [@vinistois](https://community.particle.io/u/vinistois)\
**Post date:** [May 6, 2016, 9:39pm UTC](https://community.particle.io/t/cli-list-shows-device-offline-exposed-functions-not-exposed/22708/19 "2016-05-06T21:39:33Z")

</div>

Ok. I have the circuit board patch antenna connected and it works so well now. It breathes cyan consistently without resetting, and I can call functions remotely without issues, and it programs much faster now. woot. back to business.
