Fling - Not all who wander are lost


Architectural Overview
The FLING system represents a paradigm shift in mobile communication architecture, departing from the traditional client-server model to embrace a fully distributed, peer-to-peer mesh topology. At its core, FLING operates on a hybrid architecture that seamlessly bridges the convenience of modern smartphones with the resilience of radio communication. Each FLING node consists of two primary components: a mobile application running on iOS or Android devices, and a dedicated hardware module – The Ranger Node, built around the Heltec LoRa 32 (V3) development board These components communicate locally via a secure WiFi connection, with the Heltec board's integrated ESP32 acting as a wireless access point that the smartphone connects to directly and exchanges data
The system architecture divides into two primary subsystems, each designed for modularity, reliability, and scalability. The Mobile Application Subsystem serves as the user's primary interface, built using React Native with Capacitor for native functionality access. This subsystem handles user interface rendering, message composition and display, contact management through NFC, GPS location services, offline message queuing, and local encrypted storage. The app maintains a WebSocket connection to the paired FLING device, with automatic reconnection logic and message buffering to handle temporary disconnections.

The Hardware Device Subsystem (Fling Ranger Node) centers on the Heltec WiFi LoRa 32 (V3) board, chosen for its exceptional integration of all required components in a single module. This remarkable board combines an ESP32-S3 dual-core processor running at 240MHz, integrated SX1262 LoRa transceiver with superior sensitivity (-148dBm), built-in 0.96" OLED display. FLING Rannger Node utilizes ISM band frequencies (In my case I use 433 MHz) through the Heltec board's integrated SX1262 LoRa transceiver, providing an optimal balance between range, penetration, and regulatory compliance. The link layer employs LoRa modulation with adaptive spreading factors, automatically adjusting between SF7 for high-speed, short-range communication and SF12 for maximum range at reduced data rates.
Fling Ranger Architecture
The hardware is housed in a custom PLA 3D-printed enclosure, allowing for rapid prototyping and design iterations while maintaining durability for field deployment. Power is supplied by a 3000mAh lithium-polymer battery, delivering approximately 24-48 hours of continuous operation depending on transmission frequency and environmental conditions. The node features a 20cm whip antenna optimized for the 433MHz frequency band, achieving reliable communication ranges of up to 12 kilometers in optimal conditions. User interaction is facilitated through an OLED display that provides real-time status information including connection status, battery level, and message traffic, while an integrated piezo buzzer delivers auditory feedback for incoming messages and system alerts. This architecture prioritizes simplicity, reliability, and power efficiency, creating a communication device that operates independently of traditional infrastructure while remaining accessible to users through their existing smartphones.

Initial Setup and Pairing to a Fling Friend
The FLING system employs a sophisticated two-stage wireless protocol to establish secure communication between your smartphone and Ranger node. Upon launching the FLING app without an active Ranger connection, users are immediately presented with a connection error screen [see screenshot A] that provides clear guidance: "Please connect to your Ranger device WiFi network (Ranger_A, Ranger_B, etc.) using password: fling1234." This deliberate design ensures users understand that FLING operates independently of internet infrastructure—your phone must first establish a direct WiFi connection to your Ranger node, which broadcasts its own wireless access point using the ESP32-S3's integrated 802.11n capabilities. Once connected, the app automatically establishes a WebSocket connection (ws://192.168.4.1:8765) to the Ranger's embedded server, enabling real-time bidirectional communication between the app and the LoRa radio hardware [see screenshot B]

With the foundational WiFi/WebSocket connection established--you will now have access to the app- with only an emergency brodcast channel--that sends messages to anyone using a fling network. To communicate to personal contacts you need to add your fling friend to your device .Adding contacts leverages Near Field Communication (NFC) technology for revolutionary simplicity. Each Ranger node features an embedded NFC tag on its rear surface containing that device's unique identity payload: device ID, friendly name, operating frequency, spreading factor, and public encryption key . To exchange contact information, users simply tap the "Add" button in the app, which initiates NFC scanning on their smartphone [see screenshot C], then physically touch their phone to their friend's Ranger device. The 13.56 MHz NFC transmission occurs instantly (<100ms), transferring the encrypted contact payload directly to the phone's NFC controller. The FLING app parses this data, validates the cryptographic signature, and automatically adds the new contact without any manual configuration [see screenshot D] This elegant interplay of technologies—WiFi for high-bandwidth local communication and NFC for secure, zero-configuration contact exchange—eliminates the traditional complexity of radio systems while maintaining military-grade security. Once added, you will then see their name on the chat list-in my case Ranger B --[see screenshot E]. At this point you are ready to enjoy fling's ecosystem

FEATURE 1: OFF-GRID PEER-TO-PEER COMMUNICATION
Now that you have your device set up and friend added, you can begin communicating completely off-grid using FLING's revolutionary peer-to-peer radio system. When you type a message and hit send, your phone transmits the data via WebSocket to your connected Ranger node, which immediately broadcasts it as a LoRa radio packet at 433 MHz (or 868/915 MHz depending on your region). The radio waves propagate directly through the air to your friend's Ranger device up to 15 kilometers away, where their SX1262 transceiver captures the signal, demodulates the LoRa spread-spectrum transmission, and forwards the decrypted message to their phone—all in under 2 seconds

This entire process occurs without any cellular towers, internet infrastructure, WiFi routers, or satellites—just pure physics as radio waves travel at the speed of light between your devices.
Each message undergoes AES-128-CTR encryption using session keys established during your NFC pairing, ensuring that even if someone intercepts the radio transmission, they cannot read your conversation. The LoRa modulation employs chirp spread spectrum (CSS) technology, spreading each bit across multiple frequencies to achieve remarkable sensitivity down to -148 dBm—this means your messages can penetrate dense forests, concrete buildings, and urban interference that would block traditional radios. The adaptive data rate system continuously monitors link quality through RSSI (Received Signal Strength Indicator) and SNR (Signal-to-Noise Ratio) measurements, automatically adjusting spreading factors between SF7 and SF12 to optimize the balance between range and speed. At SF7 with 500 kHz bandwidth, super fast messaging perfect for when you're closer together, while switching to SF12 with 125 kHz bandwidth extends range to the maximum 15 kilometers for emergency communication across vast distances. This combination of military-grade encryption, advanced modulation techniques, and intelligent adaptation creates a communication system that remains reliable in conditions where every other technology fails—from underground parking garages to mountain valleys, from crowded festivals to remote wilderness, FLING maintains the human connection when infrastructure cannot.
FEATURE 2: DYNAMIC NAVIGATION COMPASS TO YOUR FRIENDS
FLING's navigation compass revolutionizes group coordination by creating an instant location-sharing system that guides you directly to your contacts through a sophisticated GPS-based direction finding protocol. When you tap the compass icon in an active chat, your Ranger node transmits a location request packet via LoRa to your friend's device, which prompts them to share their current GPS coordinates [see screenshot F , G and I] . Upon their acceptance, their Ranger node reads GPS data from their phone and broadcasts back a secure location packet containing latitude, longitude, and GPS accuracy metrics

Your app receives these coordinates and immediately calculates the precise bearing and distance using the haversine formula, which accounts for Earth's spherical geometry to determine the great-circle distance between two points. The interface transforms into a full-screen compass view displaying a large dynamic arrow that points directly toward your friend, updating 60 times per second as you move and rotate
The mathematical precision behind this seemingly simple arrow involves continuous sensor fusion and real-time calculations. Your phone's magnetometer provides magnetic heading data while the accelerometer and gyroscope compensate for device tilt, ensuring the arrow remains accurate whether you hold your phone flat or vertical. The bearing calculation subtracts your current GPS position from your friend's coordinates, converts the result to polar coordinates, then adjusts for magnetic declination based on your geographic location. As you move, the distance updates dynamically—displaying feet for proximity under 1000ft and automatically switching to miles for longer distances.

The arrow's movement employs quaternion mathematics to ensure smooth rotation without gimbal lock, while the heading text provides intuitive guidance ("straight ahead", "slight left", "behind you") calculated from the relative bearing angle. When you approach within close range—typically under 100 feet where visual contact should be possible but crowds or obstacles interfere—the buzz feature becomes invaluable. Pressing the buzz icon--[see bottom left of the compass UI] sends a high-priority command packet that forces their Ranger node to emit a loud beeping sequence, transforming the last few meters of navigation from frustrating search to instant recognition —GPS satellites provide position data, LoRa radios exchange coordinates, and your phone's sensors handle navigation, creating a complete off-grid solution for never losing your group again.