Inspiration

In the first hours after an earthquake or flood, cell towers and the internet are the first things to fail, and that is exactly when people need to say "I'm alive" or "three of us are trapped, we need water". Every phone still has a speaker and a microphone. In the 1980s that was enough to connect the whole world: the Bell 202 modem at 1200 baud. It's a dead technology everybody remembers by its screech. We brought it back from the dead to do the most important job a phone can do.

What it does

  • One-tap SOS. Pick what's happening (trapped, injured, fire, water, medicine, children, elderly), set the number of people and add a landmark. The phone screeches a packet with your GPS position. It repeats every 60 s until a rescuer answers.
  • Every phone is a receiver. Phones in earshot decode the tones, show distance and direction to the caller, and save the message offline.
  • Every phone is a relay (mesh). A phone that hears an SOS it hasn't seen before repeats it a few seconds later, one hop further (up to 7 hops), so a call for help can travel block to block. Duplicates are suppressed, every phone listens before it talks, and the rescuer's answer hops back the same way. You can turn relaying off in Settings.
  • Rescue Mode.
    • Rescuers see every call on a radar, sorted by urgency: trapped > injured > fire > medicine, then by number of people, then by time waiting.
    • An automatic ACK tells the sender "Rescuers heard you". The rescuer then broadcasts ON THE WAY / RESOLVED.
  • Honest by design. The app never says a message was delivered unless it heard the reply.
  • 6 languages (English, Russian, Kazakh, Spanish, Turkish, Japanese), huge buttons, a high-contrast theme, and a Drill mode for schools to practise.
  • Installable PWA: open it once, and it works with zero infrastructure.

How we built it

  • The modem is written from scratch in TypeScript:
    • Bell 202 AFSK with mark at 1200 Hz and space at 2200 Hz;
    • a continuous-phase modulator;
    • a delay-domain quadrature correlator demodulator;
    • a second-order PLL for clock recovery, which survives ±2% clock mismatch between two cheap phones.
  • Link layer: HDLC framing with bit stuffing, NRZI and CRC-16/X.25. It is the same link layer as amateur-radio APRS, so a phone held to a walkie-talkie can carry the packet for kilometres.
  • Packet: a compact 17-byte binary SOS (type, 32-bit id, hop/TTL, position to ~11 m, status flags, people, battery, optional 40-byte note), so one SOS is about 0.4 s of sound.
  • Mesh relay: gossip with a random 2-8 s delay, suppression when another relay already repeated it, a 24 h dedup store in IndexedDB, listen-before-talk with exponential backoff, and RX muted while transmitting.
  • Robust mode: 300 baud with the same framing, for noisy rooms.
  • App: an AudioWorklet microphone tap (echo cancellation, noise suppression and AGC turned off, because they destroy modem tones), IndexedDB, a service worker, and Vite with no framework, to stay small and fast on old phones.

How we used Kiro

Kiro was our engineering partner from the first line. See the /.kiro folder.

  • Spec-driven development. We wrote three specs in EARS format (modem-core, mesh-relay, lifeline-app), each with requirements, design and a task list, and Kiro implemented the modem and the mesh relay task by task. Each task links back to its requirement: for example, CRC-16 maps to Req 3.3 and the PLL to Req 2.2.
  • Steering. product.md, tech.md and structure.md keep every session on-mission. modem-dsp.md loads only when DSP files are open (fileMatch: src/modem/**) and carries the sample-rate, phase-continuity and clock-skew rules a modem engineer would insist on.
  • Agent hooks. dsp-property-tests re-runs the property-based tests every time a modem or packet file is saved; i18n-sync keeps the 6 languages in step; a11y-review checks every UI change for readability under stress.
  • Property-based testing (fast-check) caught real bugs that fixed unit tests missed:
    1. The HDLC deframer leaked the leading 0 of a closing flag into the payload. The round-trip property failed. Kiro traced it bit by bit and redesigned the deframer with a pendingZero lookahead.
    2. Our first clock-skew property was vacuous: it cancelled its own skew. Once we corrected the model and fed the finding back to Kiro, a 56-case gain sweep exposed an inverted PLL integrator sign. After the fix, the PLL holds a lock at ±2% skew with noise.
    3. Mesh relay: an end-to-end test with three real browsers passing real AFSK audio (sender → relay phone → rescuer) showed the relay phone never relaying. The sender transmits each packet twice, and the second copy was treated as "another relay already repeated it". We fed the finding to Kiro: it updated Requirement 2.2, wrote the property ("a repeat at a lower hop never suppresses; a copy at our hop or higher always does") and fixed the scheduler. The same test also caught the sender relaying the ACK addressed to itself.
  • Lesson: a property test is only as good as the model inside it. Kiro and a human reviewer together got the model right.
  • Result: 150 tests green in 16 files, including a mesh simulator that proves every SOS reaches each phone in its connected component exactly once, and an end-to-end test that sends a real SOS through the modulator, a skewed and noisy channel, and the demodulator.

Challenges we ran into

  • Real phones never agree on their sample clock, so a naive demodulator loses bit sync within one packet. We needed a real PLL, and we needed a test that actually models the skew.
  • Browsers "help" by running echo cancellation and noise suppression, and those treat modem tones as noise. We had to turn them off in the AudioWorklet capture.
  • Wording for people in panic. Every screen had to be understandable in 5 seconds, in 6 languages.

Accomplishments that we're proud of

  • A working 1200-baud software modem in the browser, with property-based proof that it survives noise, offsets and clock skew.
  • A mesh that a third phone joins just by being nearby: no setup, no pairing.
  • Rescue Mode triage and the ACK loop. The person calling for help learns that someone heard them, which is the moment panic turns into waiting.

What we learned

  • Old technology is not dead technology. Bell 202 is 50 years old and is still the most robust way to move bytes over a channel nobody designed for data.
  • Spec-driven development with Kiro made a DSP project tractable: small, testable tasks, each traced to a requirement.

What's next for Dial-Up Lifeline

  • A Radio Bridge mode for walkie-talkies and CB radios.
  • Field tests with real phones in noisy rooms, then tuning the busy-channel threshold.
  • Pilots with school emergency drills and volunteer rescue groups in Kazakhstan.

Built With

  • audioworklet
  • fast-check
  • indexeddb
  • kiro
  • pwa
  • service-worker
  • typescript
  • vercel
  • vite
  • vitest
  • web-audio-api
Share this project:

Updates

Submission history