PwnLink · 2026
A phone app for a Pi in the field
In progressIndependent engineer
Running a Raspberry Pi in the field from a laptop is impractical. A generic Bluetooth terminal lacks location support, a versioned protocol, and a connection that survives the screen turning off.
The constraint
The phone and the Pi meet on a Bluetooth personal area network. There is no assumption of a stable internet path. Interface captures will be added once they exist.
Built with
KotlinBluetoothGPS
How it works
Phone and Raspberry Pi on a Bluetooth PAN. Versioned JSON over the link. GPS originates on the phone. A foreground service keeps the socket.
Architectural calls and their cost
Every design choice, the operational pressure behind it, what it bought, and the ongoing maintenance cost.
Bluetooth PAN on the local network
Field hardware often operates without local wireless networks or mobile data coverage. Any architecture that routes through a cloud relay fails the moment the signal drops.
The Android phone and the Raspberry Pi form a direct Bluetooth personal area network and connect over a local WebSocket, operating with zero dependency on cell towers, routers, or external servers.
The cost: Both ends have to sit on the same personal area network, so range is the limit.
Versioned JSON both ways
The Android app and the Pi daemon update on different schedules. An unversioned socket payload cannot detect a schema mismatch, leading to silent corruption in the field.
Every JSON message on the wire carries an explicit protocol version field and incompatible versions fail closed immediately, surfacing version mismatches with a loud warning instead of corrupting state.
The cost: Every message carries version handling, and an incompatible bump fails closed.
Foreground service
A socket owned by an activity dies when the screen turns off, and in the field the screen is off most of the time.
An Android foreground service owns the WebSocket and GPS listener, keeping telemetry and location streaming uninterrupted while the phone sits locked in a pocket during field walks.
The cost: A persistent notification while the service runs, and the host system can still reclaim the process.
Operating a headless Raspberry Pi outdoors or in industrial sites exposes three immediate problems: there is no local router to join, carrying a laptop is awkward, and standard mobile terminal apps drop their socket the second the phone screen locks.
PwnLink is a native Kotlin Android application built to control and feed location data to a field Raspberry Pi without internet access. The phone and the Pi join a shared Bluetooth personal area network, discover each other locally, and open a direct WebSocket link. Because the Pi lacks its own GPS receiver, the Android app streams hardware GPS coordinates over that same local socket to tag work on the device.
To keep the link alive while the operator walks with the phone locked in a pocket, the socket and GPS stream run inside a persistent Android foreground service. Every JSON message carries a strict protocol version so an out-of-step firmware update fails closed with a clear warning rather than corrupting state.
Current status and proof
In progress. Field hardware work: Bluetooth PAN, versioned protocol, and a foreground service for a device with no steady internet.
- The Android client and the Raspberry Pi meet on a Bluetooth personal area network with no internet path assumed.
- Location streams from the phone into the same link.
- A foreground service keeps the socket alive with the screen off.
- In progress. Interface captures will be added once they exist.
What was handed over
- Protocol version notes
- How discovery is supposed to happen
- What the foreground service is allowed to do