| Name | Size | Uploaded | Xet hash |
|---|---|---|---|
| .git | 297 items | ||
| .idea | 7 items | ||
| .trunk | 8 items | ||
| android | 19,600 items | ||
| docs | 26 items | ||
| pc | 10,142 items | ||
| .DS_Store | 6.15 kB xet | 620dfd80 | |
| .gitignore | 351 Bytes xet | cbd531a0 | |
| AI‑Powered_Mouse_Smoothing_with_RNNs.md | 15.2 kB xet | e8122214 | |
| README.md | 7.14 kB xet | e2f8365c | |
| README_extra.md | 22.4 kB xet | 4dc04ab2 | |
| RELEASE_NOTES_v1.0.md | 824 Bytes xet | b825b461 | |
| RM.md | 8.57 kB xet | 5f485a6d | |
| Structure.md | 18.9 kB xet | bf912e83 | |
| grading.log | 6.88 kB xet | ecabc079 |
Air Mouse Project
Air Mouse is a two-part embedded-systems project:
- an Android app that reads motion sensors, calibrates them, detects gestures, and sends control data
- a desktop Go server that receives the data, controls the mouse cursor, and shows a live dashboard
The project is built for the University of Tehran embedded-systems assignment and is centered on:
- motion sensing
- sensor calibration
- sensor fusion
- JSON/TCP communication
- ACK-based reliability for important actions
- desktop mouse control
- logging, debugging, and trace analysis
Repository Layout
code/
├── android/ # Android Studio project
│ ├── app/
│ └── docs/ # Android-side documentation and notes
├── pc/
│ ├── airmouse_go_new/ # Go desktop server
│ └── README.md
├── README.md # This file
└── README_extra.md # Extra notes and helpers
What The Project Does
The phone acts as the input device. It reads sensor data, applies calibration and filtering, and sends motion and gesture events to the laptop.
The laptop runs the Go server. It:
- listens for Android clients
- accepts pairing and discovery requests
- parses JSON messages
- applies ACK handling for reliable commands
- controls the mouse cursor
- displays device status, protocol state, and logs in the UI
Main Capabilities
Android app
- motion-based cursor control
- click and scroll gesture detection
- calibration flow for sensors
- network discovery and pairing
- connection management
- runtime statistics and settings
- debug-friendly UI state
Go server
- TCP / WebSocket-style desktop communication
- UDP discovery support
- QR and pairing-related status views
- live dashboard with logs and device information
- mouse control on the host machine
- connection and retry state visibility
Communication Model
The current communication model is JSON-based.
Typical flow
- The Android app discovers or receives the laptop address.
- The phone opens a connection to the Go server.
- The app sends a
helloor pairing message. - The server replies with a welcome/acknowledgement message.
- Motion packets are sent continuously.
- Click and scroll packets are treated as reliable actions and are acknowledged.
Message types
Common message categories used by the project:
hellowelcomemoveclickdoubleclickrightclickscrollackping/pongproximitycontrol
For the exact payload shapes, see:
pc/airmouse_go_new/CommunicationProtocol.mdandroid/app/src/main/java/com/airmouse/network/README.md
Sensor And Control Pipeline
The Android side is designed around the assignment requirements:
- raw motion sensors are read from the device
- calibration values are collected and applied
- orientation is filtered before it drives the cursor
- cursor movement is generated from phone rotation
- click and scroll gestures are detected separately from movement
- small hand jitter is suppressed by thresholds, dead zones, and cooldowns
The assignment reference docs in docs/ include:
docs/SENSOR_FUSION_EXPLAINED.mddocs/CALIBRATION_DETAILS.mddocs/PERFETTO_ANSWERS.mddocs/Network_Protocol_Specification.mddocs/PROTOCOL_SPECIFICATION.md
These are useful for both implementation choices and the final report.
Desktop UI
The Go server UI is intended to show:
- server start/stop state
- listening ports
- connection status
- nearby or connected devices
- pairing and discovery information
- recent logs
- protocol / retry / ACK state
The UI is meant to stay readable during debugging, demoing, and pairing.
Build And Run
Android
Open the android/ folder in Android Studio and run the app on an Android 10+ device.
If you already have the Android SDK configured, you can also build an APK from the project configuration in Android Studio.
Go server
The desktop server is in pc/airmouse_go_new/.
Typical workflow:
cd pc/airmouse_go_new
make build
./airmouse-server
If you are just validating the code, run the project’s Go tests from the same folder.
Networking
For phone-to-laptop communication:
- both devices must be on the same local network
- the server IP and port must match what the Android app uses
- Android needs
INTERNETpermission and cleartext access if the project uses non-TLS local communication
Testing
The project includes both code-level and integration-style checks.
Recommended verification steps:
- build the Android app
- build and start the Go server
- confirm the phone can discover or connect to the server
- verify hello/welcome exchange
- verify cursor movement
- verify click and scroll acknowledgements
- check the live dashboard logs
For protocol-specific details, read:
Perfetto And Report Notes
The assignment also includes tracing and profiling work.
Useful references in this repo:
docs/PERFETTO_ANSWERS.mddocs/Network_Protocol_Specification.mddocs/PROJECT_COMPLETE_DOCUMENTATION.md
Use these to document:
- sensor read latency
- filter CPU cost
- scheduling behavior
- thread interaction
- sampling interval vs actual data arrival
Documentation Index
Some useful documentation files in the repo:
pc/airmouse_go_new/README.mdpc/airmouse_go_new/CommunicationProtocol.mdandroid/app/src/main/java/com/airmouse/network/README.mdandroid/app/src/main/java/com/airmouse/sensors/README.mdandroid/app/src/main/java/com/airmouse/domain/README.mdandroid/app/src/main/java/com/airmouse/presentation/calibration/README.md
Suggested Demo Flow
- Start the Go server.
- Open the Android app.
- Pair the phone and laptop.
- Show connection status on both sides.
- Calibrate sensors.
- Move the phone to move the cursor.
- Trigger click and scroll gestures.
- Open logs or dashboard status to show traffic and acknowledgements.
Notes
- The docs in this repo are intentionally more detailed than a normal README because the assignment requires a lot of explanation.
- If a folder-level README exists, use it for module-specific details.
- If code and documentation disagree, prefer the source code and update the docs to match it.
- Total size
- 5.54 GB
- Files
- 51,854
- Last updated
- Sep 12
- Pre-warmed CDN
- US EU US EU