Skip to content
This repository was archived by the owner on Oct 7, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion mapadroid/mitm_receiver/MITMReceiver.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,8 @@ def __init__(self, listen_ip, listen_port, mitm_mapper, args_passed, mapping_man
data_processor.start()
self.worker_threads.append(data_processor)

self.__mitmreceiver_startup_time: float = time.time()

def shutdown(self):
logger.info("MITMReceiver stop called...")
logger.info("Adding None to queue")
Expand Down Expand Up @@ -260,6 +262,7 @@ def proto_endpoint(self, origin: str, data: Union[dict, list]):
origin_logger = get_origin_logger(logger, origin=origin)
origin_logger.debug2("Receiving proto")
origin_logger.debug4("Proto data received {}", data)

if isinstance(data, list):
# list of protos... we hope so at least....
origin_logger.debug2("Receiving list of protos")
Expand All @@ -284,10 +287,12 @@ def __handle_proto_data_dict(self, origin: str, data: dict) -> None:
return

timestamp: float = data.get("timestamp", int(time.time()))
if self.__application_args.mitm_ignore_pre_boot is True and timestamp < self.__mitmreceiver_startup_time:
return

location_of_data: Location = Location(data.get("lat", 0.0), data.get("lng", 0.0))
if (location_of_data.lat > 90 or location_of_data.lat < -90 or
location_of_data.lng > 180 or location_of_data.lng < -180):
origin_logger.warning("Received invalid location in data: {}", location_of_data)
location_of_data: Location = Location(0, 0)
self.__mitm_mapper.update_latest(origin, timestamp_received_raw=timestamp,
timestamp_received_receiver=time.time(), key=proto_type, values_dict=data,
Expand Down
2 changes: 2 additions & 0 deletions mapadroid/utils/walkerArgs.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ def parse_args():
help='Port to listen on for proto data (MITM data). Default: 8000.')
parser.add_argument('-mrdw', '--mitmreceiver_data_workers', type=int, default=2,
help='Amount of workers to work off the data that queues up. Default: 2.')
parser.add_argument('-mipb', '--mitm_ignore_pre_boot', default=False, type=bool,
help='Ignore MITM data having a timestamp pre MAD\'s startup time.')

# WEBSOCKET
parser.add_argument('-wsip', '--ws_ip', required=False, default="0.0.0.0", type=str,
Expand Down