# gouthro/penlab-manta-m8p-v2 architecture

> Architecture diagram of the GitHub repository gouthro/penlab-manta-m8p-v2, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-09). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/gouthro/penlab-manta-m8p-v2
- Repository: https://github.com/gouthro/penlab-manta-m8p-v2

## Overview

##### Main Components

a. Hardware Layer:
- Ender 3 v2 Printer
- Manta M8P v2 Control Board
- ADXL345 Accelerometer
- LED System
- Print Bed

b. Firmware/Software Layer:
- Klipper Firmware
- Moonraker API Server
- KlipperScreen Interface
- Mainsail Web Interface
- Crowsnest Camera Service
- MobileRaker Remote Access

##### Connection Flows

- Bidirectional communication between Moonraker and UI layers
- Direct control flow from Klipper to hardware
- Configuration file relationships
- Sensor data flow (ADXL345)

##### Configuration Groups

Create grouped sections for related configs:
- Core configs (printer.cfg, moonraker.conf)
- Interface configs (mainsail.cfg, KlipperScreen.conf)
- Feature configs (adxl345.cfg, led_control.cfg)
- Utility configs (timelapse.cfg, print_area_bed_mesh.cfg)

##### Additional Details

- Version information for major components
- Notes about custom macro integration
- Sync points for configuration management
- Backup/restore pathways

- The central role of Klipper firmware
- The service-oriented architecture with Moonraker
- Multiple user interface options
- Hardware control and sensor integration
- Custom macro and LED control systems

Use standardized symbols:
- Rectangles for software components
- Hexagons for hardware elements
- Double lines for API interfaces

Keep the abstraction level focused on system interaction while maintaining enough detail to show the unique aspects of this specific printer configuration, especially the custom elements like LED control and ADXL345 integration.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Styles
    classDef ui fill:#a8d1f0,stroke:#333
    classDef service fill:#90EE90,stroke:#333
    classDef hardware fill:#FFB347,stroke:#333
    classDef config fill:#E6E6FA,stroke:#333

    %% User Interface Layer
    subgraph UI
        WUI["Mainsail Web UI"]:::ui
        KS["KlipperScreen"]:::ui
        MR["MobileRaker"]:::ui
    end

    %% Service Layer
    subgraph Services
        MA["Moonraker API"]:::service
        CR["Crowsnest Camera"]:::service
        TL["Timelapse"]:::service
        SM["System Monitor"]:::service
    end

    %% Firmware Layer
    subgraph Firmware
        KF["Klipper Firmware"]:::service
    end

    %% Hardware Layer
    subgraph Hardware
        E3["Ender 3 v2"]:::hardware
        MB["Manta M8P v2 Board"]:::hardware
        ADXL["ADXL345 Sensor"]:::hardware
        LED["LED System"]:::hardware
        BED["Print Bed"]:::hardware
    end

    %% Configuration Files
    subgraph Configs
        PC["printer.cfg"]:::config
        MC["moonraker.conf"]:::config
        MSC["mainsail.cfg"]:::config
        KSC["KlipperScreen.conf"]:::config
        MRC["mobileraker.conf"]:::config
        CRC["crowsnest.conf"]:::config
        TLC["timelapse.cfg"]:::config
        ADXLC["adxl345.cfg"]:::config
        LEDC["led_control.cfg"]:::config
        BMC["print_area_bed_mesh.cfg"]:::config
        HWC["ender-3v2_manta-v2.cfg"]:::config
        MAC["c-macros.cfg"]:::config
        SC["sync_config.sh"]:::config
        SMC["sonar.conf"]:::config
    end

    %% Relationships
    WUI <--> MA
    KS <--> MA
    MR <--> MA
    MA --> CR
    MA --> TL
    MA --> SM
    MA <--> KF
    KF --> MB
    MB --> E3
    MB --> ADXL
    MB --> LED
    MB --> BED

    %% Config Relationships
    PC --> KF
    MC --> MA
    MSC --> WUI
    KSC --> KS
    MRC --> MR
    CRC --> CR
    TLC --> TL
    ADXLC --> ADXL
    LEDC --> LED
    BMC --> BED
    HWC --> E3
    MAC --> KF
    SC --> MA
    SMC --> SM

    %% Click Events
    click MSC "https://github.com/gouthro/PenLab-Manta-M8P-v2/blob/master/mainsail.cfg"
    click KSC "https://github.com/gouthro/PenLab-Manta-M8P-v2/blob/master/KlipperScreen.conf"
    click MRC "https://github.com/gouthro/PenLab-Manta-M8P-v2/blob/master/mobileraker.conf"
    click MC "https://github.com/gouthro/PenLab-Manta-M8P-v2/blob/master/moonraker.conf"
    click CRC "https://github.com/gouthro/PenLab-Manta-M8P-v2/blob/master/crowsnest.conf"
    click TLC "https://github.com/gouthro/PenLab-Manta-M8P-v2/blob/master/timelapse.cfg"
    click PC "https://github.com/gouthro/PenLab-Manta-M8P-v2/blob/master/printer.cfg"
    click ADXLC "https://github.com/gouthro/PenLab-Manta-M8P-v2/blob/master/adxl345.cfg"
    click LEDC "https://github.com/gouthro/PenLab-Manta-M8P-v2/blob/master/led_control.cfg"
    click BMC "https://github.com/gouthro/PenLab-Manta-M8P-v2/blob/master/print_area_bed_mesh.cfg"
    click HWC "https://github.com/gouthro/PenLab-Manta-M8P-v2/blob/master/ender-3v2_manta-v2.cfg"
    click MAC "https://github.com/gouthro/PenLab-Manta-M8P-v2/blob/master/c-macros.cfg"
    click SC "https://github.com/gouthro/PenLab-Manta-M8P-v2/blob/master/sync_config.sh"
    click SMC "https://github.com/gouthro/PenLab-Manta-M8P-v2/blob/master/sonar.conf"
```
