OC
OceanRemote
Low-code IoT platform
โ† Back to Tutorials
โ† Previous Next โ†’

Tutorial 26: Understanding Device Status (Online/Away/Offline)

๐Ÿ“– What You'll Learn in This Tutorial:
  • โœ“ What each status color means
  • โœ“ How OceanRemote determines device status
  • โœ“ Understanding the difference between ONLINE, AWAY, and OFFLINE
  • โœ“ How session expiry affects status
  • โœ“ Troubleshooting status issues

Device Status Overview

OceanRemote displays three status indicators for each device. Understanding these helps you quickly assess your device's health.

Status Indicators:
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  ๐ŸŸข ONLINE (Green)  โ†’ Device is communicating normally     โ”‚
โ”‚  ๐ŸŸก AWAY (Yellow)   โ†’ Device missed a few polls            โ”‚
โ”‚  ๐Ÿ”ด OFFLINE (Red)   โ†’ Device has not communicated recently โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

How Status is Calculated

OceanRemote determines device status based on the time since the last communication:

Status Time Since Last Seen What It Means
๐ŸŸข ONLINE Less than 10 seconds Device is actively polling, ready to receive commands
๐ŸŸก AWAY 10 to 300 seconds (5 minutes) Device missed 1-2 polls. May have brief WiFi interruption.
๐Ÿ”ด OFFLINE More than 300 seconds (5 minutes) Device is not communicating. Check power and WiFi.
๐Ÿ“Š Polling Frequency:

OceanRemote devices poll the server every 5 seconds (configurable in firmware). A device that misses 1 poll may be temporarily busy, but 2+ missed polls indicate a problem.

Status in the Dashboard

Device Card Example:
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  Kitchen Controller                    ๐ŸŸข  NLINE               โ”‚ โ”‚
โ”‚  โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€        โ”‚
โ”‚  WiFi: MyHomeWiFi                                                 โ”‚
โ”‚  IP: 192.168.1.100                                                โ”‚
โ”‚  Last Seen: just now                                              โ”‚
โ”‚  โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€        โ”‚
โ”‚  RELAYS                                                           โ”‚
โ”‚  [ Lights OFF ] [ Fan OFF ] [ Pump OFF ] [ Heater OFF ]           โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

What Each Status Means in Practice

๐ŸŸข ONLINE (Green) - Device is Healthy

  • Device is polling normally (every 5 seconds)
  • Commands will be executed immediately
  • Session is active and refreshing
  • No action needed

๐ŸŸก AWAY (Yellow) - Device May Be Having Issues

  • Device missed 1-2 polls (10-20 seconds since last communication)
  • Possible causes:
    • Temporary WiFi interference
    • Device busy with sensor reading (DHT22 takes 2 seconds)
    • Brief network congestion
    • Device rebooting
  • Commands may be delayed but should still execute
  • Monitor the device; if it returns to ONLINE, no action needed

๐Ÿ”ด OFFLINE (Red) - Device is Not Communicating

  • No communication for over 5 minutes
  • Commands will not reach the device
  • Possible causes:
    • Device unplugged or powered off
    • WiFi disconnected (router issue, password changed)
    • Device crashed or in boot loop
    • Server connectivity issue (rare)
    • IP address changed (should auto-recover)
  • Action required: Check device power and WiFi
โš ๏ธ Important:

An OFFLINE device will NOT receive commands. The dashboard button will update the server state, but the device won't execute until it reconnects.

Session Expiry and Status

Each device has an active session that expires after a configurable time (default 60 minutes). The session refreshes automatically with each poll.

Session Status Device Status Can Control?
Active (refreshing) ๐ŸŸข ONLINE โœ… Yes
Expired, device polling ๐ŸŸก AWAY or ๐Ÿ”ด OFFLINE โŒ No (device needs new session)
No session (device deleted) ๐Ÿ”ด OFFLINE โŒ No (re-flash required)
๐Ÿ” Session Auto-Renewal:

Sessions refresh automatically every poll. As long as your device is ONLINE, the session stays active. You don't need to manually renew sessions.

Status Transitions

How Status Changes Over Time:

Device powers on
    โ†“
Connects to WiFi
    โ†“
Registers with server
    โ†“
๐ŸŸข ONLINE (device active)
    โ†“
WiFi disconnected (30 seconds)
    โ†“
๐ŸŸก AWAY (device missed polls)
    โ†“
Still disconnected (5+ minutes)
    โ†“
๐Ÿ”ด OFFLINE (device unreachable)
    โ†“
WiFi reconnects
    โ†“
๐ŸŸข ONLINE (device resumes polling)

Session expiry timer resets on each poll.

Troubleshooting by Status

Device Stuck at AWAY (Yellow)

Possible Cause Solution
Weak WiFi signal Move device closer to router, check RSSI in debug
WiFi interference Change WiFi channel, reduce interference sources
Device overloaded Reduce polling frequency (modify firmware)
Router issues Restart router, check for firmware updates

Device Shows OFFLINE (Red) But Serial Monitor Shows Activity

  • Cause: Device registered but dashboard not updating
  • Fix:
    • Refresh dashboard (Ctrl+F5)
    • Check that device ID matches
    • Verify you're logged into the correct account
    • Clear browser cache

Device Shows ONLINE But Commands Don't Work

  • Check relay logic (Positive vs Negative)
  • Verify GPIO pin connections
  • Check relay VCC (needs 5V)
  • Test relay with a simple blink sketch

Device Cycles Between ONLINE and OFFLINE

  • Cause: Power supply insufficient or device rebooting
  • Fix:
    • Use external 5V 2A+ power supply
    • Add capacitor (1000ยตF) across power pins
    • Check for electrical interference
๐Ÿ’ก Debug Console:

Use the Debug page (/debug/) to see real-time device status, last seen times, and session expiry for all your devices.

Understanding "Last Seen" Timestamps

The "Last Seen" field shows when your device last communicated with the server.

Last Seen Examples:
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  Last Seen: just now        โ†’ Device is ONLINE                   โ”‚
โ”‚  Last Seen: 2s ago          โ†’ Device is ONLINE                   โ”‚
โ”‚  Last Seen: 15s ago         โ†’ Device is AWAY (or just turned on) โ”‚
โ”‚  Last Seen: 2m ago          โ†’ Device is AWAY                     โ”‚
โ”‚  Last Seen: 10m ago         โ†’ Device is OFFLINE                  โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Session Info Display

The dashboard shows session information for each device:

Session Display:
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  ๐Ÿ“… Session: โœ“ 1 hours    โ†’ Session active, 1 hour left              โ”‚  
โ”‚  ๐Ÿ“… Session: โš ๏ธ 5 minutes  โ†’ Session expiring soon                   โ”‚
โ”‚  ๐Ÿ“… Session: โœ— Expired     โ†’ Session expired (device may reconnect) 
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
๐Ÿ”„ Session Renewal:

When a device polls, it automatically refreshes its session. A healthy ONLINE device will always show "โœ“ X hours" (where X is the configured session duration).

Common Status Questions

Q: Why does my device show AWAY after waking from deep sleep?

A: Devices in deep sleep don't poll. When they wake up, the status will update to ONLINE on the next poll (within 5 seconds).

Q: Can a device be ONLINE but not receive commands?

A: Yes, if the session expired but the device is still polling. The dashboard will show ONLINE but commands won't execute. The device will automatically get a new session on the next poll.

Q: How long does it take for OFFLINE to become ONLINE?

A: Within 5-10 seconds of the device reconnecting to WiFi and polling the server.

Q: Does the dashboard auto-refresh?

A: Yes, the dashboard automatically refreshes device status every 3 seconds (via the debug API).

Status Summary Table

Status Color Last Seen Action Required
ONLINE ๐ŸŸข Green < 10 seconds None - device working
AWAY ๐ŸŸก Yellow 10-300 seconds Monitor, may resolve itself
OFFLINE ๐Ÿ”ด Red > 300 seconds Check power and WiFi
๐ŸŽฏ Pro Tip:

Use the Debug page (/debug/) to see detailed status information including exact last seen times and session expiry for all your devices at a glance.

Next Steps

Now that you understand device status:

  • Tutorial 27: How to Claim and Manage Devices
  • Tutorial 25: Common Connection Issues and Fixes
  • Tutorial 29: WiFi Connection Troubleshooting
  • Use the Debug page to monitor your devices in real-time
๐Ÿ“Š Quick Status Check:

If your device is ONLINE, it's working. If it's AWAY, wait a minute. If it's OFFLINE for more than 5 minutes, check power and WiFi.