Offline device works as expected?

One of my devices shows as offline in the IDE, but both when I write code and runs it, and when I send commands from the agent to it, it works exactly as it should like if it was online. Still it continues to show as offline on the site, any idea why that is happening?

Mine does the same. It’s really not offline.

Yes, it’s not really offline. There’s a known bug in the Erlang server (which everyone is on now) which can cause devices to show in the IDE as offline.

Yes it’s happening to me on day 1 of my imp learning. Disconcerting to read: Device: xxxxxx (offline)

    • Hmmmm, this is more complicated for me.
  1. I make a few changes in the Agent Code
  2. then Build and Force Restart
  3. the device is still (offline)
  4. unplug the board from USB and then plug in again
  5. wait for blinking red status to change to green
  6. I note now the Device: (Online)
  7. then my commands from browser “…?led=0” or “…?led=1” are accepted as expected
    8)I’m working my way through https://developer.electricimp.com/gettingstarted/imp006-hello-world and changing some elements of the suggested code. And on checking my code I always receive message “Your code syntax checks out.”

If you’re saying that there are intentional syntax errors in your code and the syntax checker is missing them, that’s an issue. Otherwise your code look good — though may not run due to non-syntax errors, of course.

Re. the offline/online thing, are you on cellular? Depending on the network you’re actually connected to at any given time and location, your device may go on and offline. impCentral checks periodically so there will be a lag if it’s registering a device as online and you yank the power.

In a real application, you might use server.isconnected() in your device code to check status; the equivalent call on the agent is device.isconnected() (use device.onconnect() and device.ondisconnect() to register callbacks for notifications on device connection state). These operate almost immediately, unlike impCentral.