Hardware FixRecommendedDevice not working? Your driver may be the problemCheck updates for common hardware issues.Fix DriversHalloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon US: current deals, useful picks and tech finds.Check DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PC×
Skip to content
Mountain View desk5 min

Building Resilient Edge Agents with LBH: A PWA Heartbeat System Running on Android

A browser-based WebSocket heartbeat client for a local edge node: how it reconnects on Android, what the one reported test shows, and why its server is not ready for public networks.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

LBHHeartbeatAnt is a browser-based WebSocket client that sends binary telemetry and heartbeat/ACK frames to a local Edge Node. Its most useful design choice is that it does not assume a mobile browser keeps the socket alive. When the installed PWA becomes visible again, the client checks the connection and reconnects. That is recovery logic, not a guarantee of background execution on Android. The one Android test the author describes, in which ACKs continued with the screen locked, is too thinly documented to generalize. The WebSocket server also has no authentication layer, so the prototype belongs on a trusted local network only.

The prototype is described in Cristhiam Leonardo Hernández Quiñonez’s DEV Community article, published 16 September 2026. The author frames the goal as a question: can constrained devices take part in a useful distributed architecture “without behaving like thin clients that constantly depend on a remote cloud”? That is the author’s framing, not evidence of demand, but it explains why the design centers on a local edge node.

As an Amazon Associate I earn from qualifying purchases.

What the prototype contains

The client is named LBHHeartbeatAnt in the article. It bundles four responsibilities:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • WebSocket management to a local Edge Node. The article’s example endpoint is ws://hostname:8765.
  • Binary LBH frames for telemetry and for heartbeat/ACK messages, which the author calls “Feromona.”
  • Inactivity detection that moves the client into a low-activity state.
  • Automatic reconnection when the page resumes.

Frame layout

The article describes the frame prefix as the magic bytes LA (0x4C, 0x41). The type byte is 0x01 for telemetry and 0x02 for heartbeat/ACK. The heartbeat example builds a 16-byte ArrayBuffer, writes the magic bytes, the type, and a standby flag, then writes three 32-bit values before sending it over the open socket.

#1 Best Overall
Sale
Samsung Galaxy A17 5G Smart Phone 128GB US 1 Yr Manufacturer Warranty Black | Large AMOLED, High-Res Camera, Durable Design, Super Fast Charging, Expandable Storage, Circle to Search, 2025
  • YOUR CONTENT, SUPER SMOOTH: The ultra-clear 6.7" FHD+ Super AMOLED display of Galaxy A17 5G helps bring your content to life, whether you're scrolling through recipes or video chatting with loved ones.¹
  • LIVE FAST. CHARGE FASTER: Focus more on the moment and less on your battery percentage with Galaxy A17 5G. Super Fast Charging powers up your battery so you can get back to life sooner.²
  • MEMORIES MADE PICTURE PERFECT: Capture every angle in stunning clarity, from wide family photos to close-ups of friends, with the triple-lens camera on Galaxy A17 5G.
  • NEED MORE STORAGE? WE HAVE YOU COVERED: With an improved 2TB of expandable storage, Galaxy A17 5G makes it easy to keep cherished photos, videos and important files readily accessible whenever you need them.³
  • BUILT TO LAST: With an improved IP54 rating, Galaxy A17 5G is even more durable than before.⁴ It’s built to resist splashes and dust and comes with a stronger yet slimmer Gorilla Glass Victus front and Glass Fiber Reinforced Polymer back.

The article does not publish a field table. The sizes below are inferred from the 16-byte example and should be read as this prototype’s implementation choices, not as a standardized LBH specification.

Field Inferred size What the article states
Magic bytes 2 bytes 0x4C 0x41 (“LA”)
Message type 1 byte 0x01 telemetry; 0x02 heartbeat/ACK
Standby flag 1 byte Written in the heartbeat example; its meaning is not defined
Three 32-bit values 12 bytes total Written after the flag; their meaning and byte order are not stated

The article gives no versioning scheme and no interoperability test. Any second implementation would need to agree on these details itself.

Rank #2
Tracfone Motorola Moto G 2025, 64GB, Saphire Blue (Locked to | Prepaid Smartphone- 6.6" 120Hz Display, 5G , 50MP Quad Pixel Camera, Long-Lasting Battery
  • Carrier: This phone is locked to Tracfone, which means this device can only be used on the Tracfone wireless network. Tracfone plan required, activating is easy, just 3 steps.
  • DISPLAY: Immersive viewing on a 6.7-inch super-bright 120Hz display with powerful stereo speakers and Bass Boost for cinematic entertainment.
  • CAMERA SYSTEM: Advanced 50MP Quad Pixel camera captures sharp, detailed photos and videos in any lighting condition
  • PERFORMANCE: Lightning-fast 5G connectivity paired with a powerful processor and RAM Boost for smooth multitasking.
  • BATTERY LIFE: Long-lasting 5000mAh battery with TurboPower charging technology delivers hours of power in minutes.

Hibernation after inactivity

After 30 seconds without user input, the client enters HIBERNATING but keeps the socket open. Click, touch, or keydown events leave that state. The 30-second threshold is a code parameter chosen by the author, not a measured value, and the article does not say how it was tuned.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

What happens on Android when the app is hidden

The client listens for visibilitychange. Chrome’s Page Lifecycle API guidance explains why that listener matters: browsers can freeze or discard pages under resource constraints, and the hidden state may be the last reliably observable state on mobile. Chrome recommends saving state and stopping work the user would not want running in the background.

Rank #3
Samsung Galaxy A17 5G Smart Phone 128GB, US 1 Yr Manufacturer Warranty Blue | Large AMOLED, High-Res Camera, Durable Design, Super Fast Charging, Expandable Storage, Circle to Search, 2025
  • YOUR CONTENT, SUPER SMOOTH: The ultra-clear 6.7" FHD+ Super AMOLED display of Galaxy A17 5G helps bring your content to life, whether you're scrolling through recipes or video chatting with loved ones.¹
  • LIVE FAST. CHARGE FASTER: Focus more on the moment and less on your battery percentage with Galaxy A17 5G. Super Fast Charging powers up your battery so you can get back to life sooner.²
  • MEMORIES MADE PICTURE PERFECT: Capture every angle in stunning clarity, from wide family photos to close-ups of friends, with the triple-lens camera on Galaxy A17 5G.
  • NEED MORE STORAGE? WE HAVE YOU COVERED: With an improved 2TB of expandable storage, Galaxy A17 5G makes it easy to keep cherished photos, videos and important files readily accessible whenever you need them.³
  • BUILT TO LAST: With an improved IP54 rating, Galaxy A17 5G is even more durable than before.⁴ It’s built to resist splashes and dust and comes with a stronger yet slimmer Gorilla Glass Victus front and Glass Fiber Reinforced Polymer back.

The prototype’s approach follows that model. The author puts it plainly: “The important part is not trying to fight Android’s lifecycle behavior.” Treat the socket as something that may have died while the page was frozen, and rebuild it on resume.

Resume logic, step by step

  1. The page receives visibilitychange and becomes visible.
  2. The client checks whether the socket is absent, CLOSED, or CLOSING.
  3. If the socket appears dead, the client updates its status to show that.
  4. The client calls connect().

This is resume-time recovery. It does not keep the socket running while the PWA is hidden. The article also does not describe buffering or replaying telemetry generated during the hidden period, so messages produced while the page was frozen should be assumed lost unless your own code stores them.

Rank #4
Sale
Samsung Galaxy S26 Ultra, Unlocked Android Smartphone, 512GB, Black | Privacy Display, Galaxy AI, AI Camera, Super Fast Charging 3.0, Durable Battery, 2026, US 1 Year Warranty
  • PRIVACY DISPLAY: Automatically hide your screen from those beside you. The built-in privacy display can be preset¹ to turn on when receiving notifications, typing passwords, or using specific apps
  • TYPE IT IN. TRANSFORM IT FAST: Enhance any shot in seconds on your smartphone by using Photo Assist² with Galaxy AI.³ Add objects, restore details, or apply new styles by simply typing or tapping
  • NIGHTS, CAPTURED CLEARLY: From gigs to city lights, record and capture moments after dark with clarity using Nightography so your photos and videos stay crisp and clear on your Samsung Galaxy
  • MAKE IT. EDIT IT. SHARE IT: Turn everyday moments into something personal with creative tools built right into your mobile phone, whether it’s a special contact photo, custom wallpaper, an invitation or more⁴
  • HELP THAT KEEPS UP: Stay in the moment while Now Nudge with Galaxy AI helps you respond faster and stay organized with smart suggestions⁵ that appear exactly when you need them on your phone
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

The installed-PWA test: what it shows and what it does not

The author installed the PWA on an Android device and ran it in split-screen with the Edge Node log visible. In that test, ACKs continued with the screen locked or the app in the background. That is a useful observation that the design can work in at least one real setup.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

It is still one author-reported run. The article gives no handset model, Android version, browser version, test duration, or repeat count. A reader who wants to confirm the behavior should record at least:

Best Value
Tracfone Moto g Play 2024 Prepaid Phone with a 1-Yr Plan Included | Prepaid Smartphone with Full YR Plan Included bundled with 1500 Min/Text/Data for365 days of service - Locked to Tracfone
  • Carrier: This phone is locked to Tracfone, which means this device can only be used on the Tracfone wireless network. Activating is easy, just 3 steps.
  • ACTIVATION Promotion: Includes 1500 min, 1500 texts & 1500 MB Data + add more as you need it
  • CAMERA SYSTEM: 50MP Quad Pixel camera. Capture sharper, more vibrant photos day or night with 4x the light sensitivity.
  • PERFORMANCE: Blazing-fast Qualcomm performance. Get the speed you need for great entertainment with a Snapdragon 680 processor and 4GB of RAM.
  • 64GB built-in storage. Get plenty of room for photos, movies, songs, and apps. Made for US
  • Device model, Android version, and the Chrome or WebView build used for the installed PWA.
  • How long the screen stayed locked, and how many lock and unlock cycles were tested.
  • Whether ACK timestamps on the Edge Node log show gaps, and how long each gap lasted.
  • Whether the same test repeats after a device restart and after the browser has been idle for hours.

A known reconnect race

The author reports a connection-log ordering race under rapid, repeated visibility changes. The connection guard checks for OPEN and CONNECTING, but not CLOSING. A new connection can therefore start before the previous socket’s close event is logged.

In the sequence the author describes, the server handled the case without leaked connections, corrupted frames, or protocol failure. The missing CLOSING check is listed as work still to do. It is not fixed in the prototype as described.

The fix is a single added condition: refuse to call connect() while the socket is CLOSING, and wait for its close event before opening a new one. Until that change is in place, a fast sequence of hide and show events can produce confusing logs even when the server stays stable.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Security boundary

The WebSocket server has no authentication layer. The author states: “The WebSocket server currently has no authentication layer.” Any client on the same local network can send LBH frames to it, and the article says the endpoint is not appropriate for direct public exposure in its current form. Authentication and authorization are future work, not features in the prototype.

Until those exist, network placement is the only control the article supports. Keep port 8765 off the public internet, do not forward it through a router, and do not expose it to guest or shared networks.

Before adopting this pattern

  • Confirm the target runtime. Test the installed PWA on the exact Android and Chrome versions you plan to deploy.
  • Add the CLOSING guard and test it with rapid visibility toggling.
  • Define the frame format with a version field and documented byte order before any second client depends on it.
  • Decide on message loss. If telemetry must survive the hidden period, store it locally and replay it after reconnection.
  • Add authentication before the endpoint leaves a single trusted network.

){}

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Outdated Drivers Are Slowing You DownFree scan - exact matches
Windows Errors? Fix Them Before They SpreadFree repair scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.