How mushfiq/rssi-system works
This repository is a three-tier RSSI indoor-localization system with a clear split between acquisition/processing, server-side persistence/API, and mobile visualization.
1. End-to-end data flow
Physical receivers capture RSSI from a watch/transmitter, the Java application ingests those readings, runs localization algorithms to compute position, then posts results and metadata to the REST API. The Python/Django API stores records in MongoDB and exposes them to clients, including the Android app, which fetches and renders the latest watch position.
2. comReader: the Java localization hub
This is the central processing application. It combines device I/O, algorithm execution, data persistence, and a Swing desktop UI for monitoring/configuration. It is the main boundary where raw RSSI data becomes localization output.
3. Data acquisition layer in comReader
The data package contains readers for serial/COM input and file-based input, plus runnable wrappers and writer abstractions. This suggests the system can operate live from hardware or replay from files for testing. Reading, WatchPositionData, and Controller are the main in-memory data carriers/control points.
4. Localization algorithm layer in comReader
The algorithm package holds multiple strategies: proximity-based, probability-based, and random, with a shared PositionLocalizationAlgorithm abstraction. Supporting components include Kalman filtering, convex hull math, probability maps, and weight functions. This layer is where RSSI readings are transformed into x/y estimates.
5. Map and receiver model layer in comReader
components and dao represent the map/receiver domain and data access. There are hardcoded DAO implementations as well as Mongo-backed DAOs, indicating the application can load map/receiver definitions from either static config or the database. This is the boundary between localization logic and environment configuration.
6. Desktop UI in comReader
The gui package is a full Swing client for operators: map panels, receiver panels, parameter controls, status, dialogs, and custom views. It likely visualizes live receivers, selected maps, and algorithm state while allowing map/receiver setup and parameter tuning.
7. Outbound integration from comReader to the API
The rest package and REST-related tests indicate that comReader also acts as a client to the server. It uploads maps, receivers, and computed watch positions to the Django API, making the Java app the producer of canonical localization data.
8. RESTApi: Django/Python backend
The RESTApi/restApp project is the persistence and service layer. It uses Django/WSGI, REST-style resources/views, serializers, and middleware/auth code. This is the system’s backend boundary for storage and retrieval rather than computation.
9. MongoDB as the persistence store
The API’s models/resources and the Mongo-specific scripts/tests indicate MongoDB is the primary database. The server persists maps, receiver records, and watch positions there, and the Java app has Mongo-aware DAO/wrapper code for some shared entities.
10. Server-side test and support tooling
The API includes dummy data, setup scripts, and tests for map, receiver, image retrieval, and watch records. This suggests the backend is exercised as a data service with predefined fixtures rather than complex business logic.
11. AndroidApp: mobile visualization client
The Android app is a lightweight consumer of the API. Its code centers on WatchUserActivity, a custom MapImageView, and simple data objects/parsers for map/receiver/position records. It is primarily a read/display client for the latest localization state.
12. Android app data flow
RestMapService appears to fetch remote JSON from the REST API, ResponseParser converts responses into local records, and the UI renders the position on top of a map image. The app depends on the backend for map geometry and live position updates rather than computing localization itself.
13. Cross-cutting technologies and boundaries
The project spans Java desktop/Swing, Android, and Python/Django REST services, with MongoDB underneath and hardware/serial input at the edge. Third-party jars in comReader/main/resources and the Android support library indicate the repo is self-contained and designed around those runtime boundaries.
14. What to emphasize in an architecture diagram
The main boxes should be: hardware receivers/watch input → comReader ingestion and algorithms → REST API → MongoDB → Android client, with the comReader Swing UI and backend admin/test scripts shown as auxiliary paths around the core pipeline.
Main entry points: Controller.java Controller · RoomMap.java Map Models · views.py Django API · PositionLocalizationAlgorithm.java Algorithm API
Components 21
Acquisition
Hardware ingress and live/file RSSI ingestion
- Receivers · Physical RSSI receivers capture watch signal strength
Localization Core
Java processing, algorithms, UI, and outbound sync
- COM Reader · Reads live serial/COM RSSI data from hardware
comReader/main/data/COMPortDataReader.java - File Replay · Replays RSSI input from files for testing or simulation
comReader/main/data/FileDataReader.java - Controller · Coordinates readers, processing, and output flow
comReader/main/data/Controller.java - Reading · In-memory RSSI reading model used across the pipeline
comReader/main/data/Reading.java - Algorithm API · Shared abstraction for position localization strategies
comReader/main/algorithm/PositionLocalizationAlgorithm.java - Probability Algo · Probability-based localization with maps and weighting
comReader/main/algorithm/ProbabilityBasedAlgorithm.java - Proximity Algo · Distance/proximity-oriented localization strategy
comReader/main/algorithm/ProximityAlgorithm.java - Kalman Filter · Smooths noisy RSSI or position estimates
comReader/main/algorithm/filter/KalmanFilter.java - Map Models · Rooms, receivers, and geometry used by localization
comReader/main/components/RoomMap.java - Map DAO · Loads maps from hardcoded or Mongo-backed sources
comReader/main/dao/MapDAO.java - Receiver DAO · Loads receiver definitions from hardcoded or Mongo-backed sources
comReader/main/dao/ReceiverDAO.java - Desktop UI · Operator UI for map, receiver, and parameter management
comReader/main/gui/MainFrame.java - REST Client · Uploads maps, receivers, and computed positions to the API
comReader/main/rest/MongoDatabaseReceiverWrapper.java
Backend
Django API and Mongo persistence
- Django API · REST service layer for persistence and retrieval
RESTApi/restApp/views.py - Server Models · Backend documents, serializers, and resources
RESTApi/restApp/models.py - MongoDB · Primary persistence store for maps, receivers, and watch positions
Mobile Client
Android visualization client
- REST Service · Android client service fetching remote map and position data
AndroidApp/src/services/RestMapService.java - Response Parser · Converts API responses into local records
AndroidApp/src/dataobjects/ResponseParser.java - Map View · Renders the map image and watch position overlay
AndroidApp/src/userInterface/MapImageView.java - Watch Screen · Main mobile screen for viewing the latest watch position
AndroidApp/src/userInterface/WatchUserActivity.java
Connections 25
- Receivers → COM Reader: RSSI stream · Hardware signal readings enter the Java ingestion layer
- COM Reader → Controller: raw readings · Live input is handed to the orchestration layer
- File Replay → Controller: replay data · Offline input is also routed through the controller
- Controller → Reading: normalize · Controller manages in-memory reading records
- Controller → Algorithm API: select strategy · Processing chooses a localization algorithm implementation
- Algorithm API → Probability Algo: impl · Probability-based strategy
- Algorithm API → Proximity Algo: impl · Proximity-based strategy
- Probability Algo → Kalman Filter: smooth · Probability estimates are filtered before output
- Proximity Algo → Kalman Filter: smooth · Proximity estimates can also be filtered
- Probability Algo → Map Models: uses · Localization depends on map and receiver geometry
- Proximity Algo → Map Models: uses · Proximity localization depends on environment model
- Map Models → Map DAO: load maps · Environment definitions come from DAO-backed storage
- Map Models → Receiver DAO: load receivers · Receiver definitions come from DAO-backed storage
- Controller → Desktop UI: status · Live state is shown in the Swing operator UI
- Desktop UI → Map DAO: configure · UI supports loading and editing maps
- Desktop UI → Receiver DAO: configure · UI supports loading and editing receivers
- Controller → REST Client: publish · Computed positions and metadata are posted to the server
- REST Client → Django API: REST calls · Java client synchronizes data with the backend API
- Django API → Server Models: persist · Views/resources operate on backend documents and serializers
- Server Models → MongoDB: store · Backend writes canonical data to MongoDB
- REST Service → Django API: fetch · Android retrieves maps and watch position data
- REST Service → Response Parser: json · Responses are decoded into local records
- Response Parser → Map View: render data · Parsed records drive the display layer
- Map View → Watch Screen: embed · Custom map view is hosted by the main activity
- Django API → MongoDB: query · Backend serves data from the database