Beacon
When Networks Fail, We Don’t
The problem Beacon solves
** The Impact of BEACON: Redefining Disaster Communication**
In a disaster, the "Golden Hour" is the window where medical intervention has the highest chance of preventing death. BEACON ensures that even when the world goes offline, the lifeline stays connected
.
1. Primary Use Cases: Who uses it and why?
For Trapped Survivors:
The "One-Tap" Lifeline: In high-stress situations (earthquakes, floods), users don't have time to navigate complex menus. A single tap broadcasts their GPS coordinates, battery level, and medical status to everyone nearby.
Silent Hailing: If a survivor is trapped and needs to stay quiet (e.g., in a structural collapse or security threat), they can signal for help without making a sound.
For First Responders & NGOs:
Precision Rescue: Instead of searching broad zones, rescue teams see a Heatmap of SOS signals on the Next.js Dashboard. This allows them to prioritize high-density casualty areas.
Safe Navigation: Rescuers can mark "Danger Zones" (e.g., a broken bridge) on the map, which then propagates back through the mesh to warn other survivors.
For Displaced Families:
The "I am Safe" Broadcast: Even without a signal, a user can broadcast a "Safe" status. When any phone in the mesh eventually hits a 4G/Wi-Fi zone, that status is uploaded, notifying worried family members via the web portal.
2. How BEACON Improves Existing Tasks
Existing Task Traditional Method (The Old Way) With BEACON (The New Way)
Sending an SOS Repeatedly dialing emergency numbers hoping for a signal. Automatic Propagation: The phone keeps "shouting" via Bluetooth until a neighbor hears it.
Location Tracking Rescuers guess location based on last known cell tower ping. Real-Time GPS: Precise coordinates are hopped through the mesh to the dashboard.
Information Flow Word-of-mouth or radio (limited range/expensive). Digital Mesh: High-speed data transfer across a decentralized network of smartphones.
Helping Non-Tech Users Feature phone users are completely cut off. SMS Fallback: Uses Twilio to bridge the gap between mesh signals and basic GSM.
3. Safety & Efficiency Benefits
Eliminating "Communication Black Holes"
Traditional apps are "Cloud-First." If the Cloud is unreachable, the app is a brick. BEACON is "Edge-First," meaning the intelligence lives on the device. This eliminates the silence that usually follows a infrastructure collapse.
Reducing Search Time
In floods or cyclones, visibility is low. By providing rescuers with a Mapbox-powered offline visualization, BEACON turns a "Search and Rescue" operation into a "Locate and Extract" operation—saving hours of critical time.
Power-Aware Resilience
Unlike GPS-heavy apps that drain battery, BEACON uses Bluetooth Low Energy (BLE). It is designed to stay active for days, not hours, ensuring the survivor's phone doesn't die before help arrives.
4. The "Network Effect" Safety Net
The unique strength of BEACON is that the more people use it, the safer everyone becomes.
In a crowded city, the mesh is dense and near-instant.
In rural areas, even a single IoT Beacon Node (Future Scope) at a community center acts as a permanent "Digital Lighthouse" for miles.
Challenges we ran into
** Challenges I Ran Into**
Building a decentralized communication system in a weekend came with significant technical hurdles. Here is how we navigated the most difficult parts of the build:
1. The "Native" Wall: Integrating Google Nearby with Expo
The Hurdle: We initially started with a standard Expo "Managed" workflow. However, we quickly realized that the Google Nearby Connections API requires deep access to native Android/iOS Bluetooth and Wi-Fi drivers, which are not available in the standard Expo Go app.
The Fix: We had to pivot to Expo Development Builds (using npx expo prebuild). This allowed us to write custom Native Modules and configure the AndroidManifest.xml and Info.plist with the necessary high-level permissions (Fine Location, Bluetooth Advertise, etc.) while still keeping the speed of React Native development.
2. The "Hop" Logic: Moving beyond P2P to a Mesh
The Hurdle: Google Nearby Connections is traditionally Peer-to-Peer (P2P). If Phone A connects to Phone B, and Phone B connects to Phone C, Phone A cannot "see" Phone C by default. Our goal was a true mesh where the SOS could travel across multiple "hops."
The Fix: We implemented a "Store-and-Forward" Relay Logic. We designed a packet structure that includes a Unique_SOS_ID. When a device receives a payload, it checks its local cache. If the ID is new, it stores it and immediately re-broadcasts it to all other connected neighbors. This effectively turned a simple P2P connection into a propagating mesh.
3. Battery vs. Persistence: Staying Alive in the Background
The Hurdle: Modern mobile operating systems (especially Android 12+ and iOS) are aggressive at killing background apps to save battery. For a disaster app, if the app is killed, the mesh node dies, breaking the chain for everyone else.
The Fix: We implemented Android Foreground Services with a persistent notification. This signals to the OS that the app is performing a critical life-safety task, preventing it from being put into "Deep Sleep." We also optimized the scanning interval—using a "Heartbeat" scan every 30 seconds rather than a constant drain—to balance resilience with battery life.
4. The Data Bottleneck: Handling BLE MTU Limits
The Hurdle: Bluetooth Low Energy (BLE) has a very small Maximum Transmission Unit (MTU). We initially tried to send a large JSON object containing user names, detailed coordinates, and timestamps, but the packets were frequently dropped or truncated.
The Fix: We stripped the data down to a Compact Byte Array. We mapped specific codes to medical statuses (e.g., 01 = Medical, 02 = Fire) and used Unix timestamps to keep the payload under the 256-byte limit. This ensured 99% delivery success across the mesh.
5. The "Connectivity Vacuum": Offline-First Syncing
The Hurdle: Managing the transition from "Fully Offline" to "Cloud Connected" was tricky. We needed to ensure that when a node finally hit a Wi-Fi zone, it didn't just upload its own data, but all the cached SOS signals it had picked up from others.
The Fix: We utilized Supabase with a "Queue Processing" logic. All incoming mesh signals are stored in a local SQLite database first. We created a "Network Listener" that triggers as soon as an internet handshake is detected, batch-uploading the entire local queue to the NGO Dashboard in a single transaction.
Technologies used
