pymil1553 is a Python simulator for the MIL‑STD‑1553 data bus. The standard is used in spacecraft for internal communication between a main computer and multiple peripherals. Typical peripherals include star trackers, flywheels, temperature sensors, and cameras. These peripherals act as Remote Terminals (RTs). The main computer acts as the Bus Controller (BC).
This repository provides a software model of the protocol for testing and integration.
This project is a restructuring of the original work by Shubhankar Kulkarni:
https://github.com/ShubhankarKulkarni/MIL-STD-1553-Simulator
MIL‑STD‑1553 defines a single Bus Controller and up to 31 Remote Terminals on one bus.
The Bus Controller starts all communication. Remote Terminals respond with status and data.
This repository contains two main components:
- Bus Controller Simulator: Parses commands from software and sends commands or data to RTs.
- Remote Terminal Simulator: Receives commands from the BC and returns status or data.
Reference material:
MIL‑STD‑1553 Tutorial and Reference
- Bus Controller and Remote Terminal emulation over TCP/IP sockets
- Mode code support (
0x00–0x1F) with state handling - Broadcast command support (RT address
0x1F) - Logging to CSV, JSON, and PCAP
- Command‑line interface
pytesttest suite
pymil1553/
Bus_Controller/
Remote_Terminal/
Simulator.py
tests/
pyproject.toml
README.md
Install in editable mode:
pip install -e .[test]Run the test suite:
pytestThe simulator uses TCP/IP sockets instead of the physical dual‑redundant bus.
It implements the message and data‑link layers.
Run the example:
python -m pymil1553.SimulatorImport in Python:
from pymil1553.Bus_Controller.BC_Simulator import BusControllerSimulator
from pymil1553.Remote_Terminal.RT_Simulator import RemoteTerminalSimulatorThe TransactionLogger records all bus activity. Logs are written to logs/ by default:
transactions.csvtransactions.jsonsimulation_traffic.pcap
Set a custom directory:
mil1553 local --log-dir custom_logs
mil1553 rt --id 01 --log-dir custom_logsThe mil1553 CLI runs BC and RT nodes.
Run a local simulation:
mil1553 localRun a standalone RT:
mil1553 rt --id 02Send data from BC to RT:
mil1553 bc --action send --rt 01 --subaddress 11 --message "Telemetry Data"Send a mode code:
mil1553 bc --action mode_code --rt 01 --mode-code 04 --data-word 1Request data from an RT:
mil1553 bc --action receive --rt 01 --subaddress 01 --words 07