Skip to content
JaskRendixPublic

About

MIL‑STD‑1553 simulator for Python. Provides Bus Controller and Remote Terminal emulation, full mode‑code handling, TCP/IP transport, logging, PCAP export, and a CLI for testing and integration into avionics or spacecraft software.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

3 Commits

Folders and files

Repository files navigation

pymil1553

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

About

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

Features

  • 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
  • pytest test suite

Project Structure

pymil1553/
    Bus_Controller/
    Remote_Terminal/
    Simulator.py
tests/
pyproject.toml
README.md

Installation

Install in editable mode:

pip install -e .[test]

Tests

Run the test suite:

pytest

Usage

The 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.Simulator

Import in Python:

from pymil1553.Bus_Controller.BC_Simulator import BusControllerSimulator
from pymil1553.Remote_Terminal.RT_Simulator import RemoteTerminalSimulator

Logging

The TransactionLogger records all bus activity. Logs are written to logs/ by default:

  • transactions.csv
  • transactions.json
  • simulation_traffic.pcap

Set a custom directory:

mil1553 local --log-dir custom_logs
mil1553 rt --id 01 --log-dir custom_logs

Command Line Interface

The mil1553 CLI runs BC and RT nodes.

Run a local simulation:

mil1553 local

Run a standalone RT:

mil1553 rt --id 02

Send 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 1

Request data from an RT:

mil1553 bc --action receive --rt 01 --subaddress 01 --words 07

About

MIL‑STD‑1553 simulator for Python. Provides Bus Controller and Remote Terminal emulation, full mode‑code handling, TCP/IP transport, logging, PCAP export, and a CLI for testing and integration into avionics or spacecraft software.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages