# fanatiqs/wireless_atem_camera_control_and_tally architecture

> Architecture diagram of the GitHub repository fanatiqs/wireless_atem_camera_control_and_tally, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/fanatiqs/wireless_atem_camera_control_and_tally
- Repository: https://github.com/fanatiqs/wireless_atem_camera_control_and_tally

## Overview

WACCAT is ESP8266 firmware that connects a wireless camera receiver to an ATEM switcher, forwards camera-control and tally information, and can emit the signals over SDI and GPIO LEDs. The principal path is ATEM communication and parsing, followed by device-side control/tally output; users can also configure the device through its HTTP interface. The tree includes two separate host-side ATEM proxy implementations. Their internal links are shown only where the supplied excerpts or source index establish them; unsampled firmware wiring is not inferred.

Main entry points: [`firmware/atem_sock.c`](https://github.com/fanatiqs/wireless_atem_camera_control_and_tally/blob/master/firmware/atem_sock.c) (ATEM socket client), [`firmware/http.c`](https://github.com/fanatiqs/wireless_atem_camera_control_and_tally/blob/master/firmware/http.c) (HTTP configuration), [`proxy/atem_server.c`](https://github.com/fanatiqs/wireless_atem_camera_control_and_tally/blob/master/proxy/atem_server.c) (ATEM proxy server), [`firmware`](https://github.com/fanatiqs/wireless_atem_camera_control_and_tally/tree/master/firmware) (Firmware entrypoints)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_device["Wireless device"]
  node_sdi["SDI interface<br/>[sdi.c]"]
  node_indicators["Tally/status LEDs<br/>[led.h]"]
  node_device_config["Device configuration<br/>[user_config.h]"]
  node_device_entry["Firmware entrypoints"]
  node_wlan["WiFi networking<br/>[wlan.c]"]
  node_device_socket["ATEM socket client<br/>[atem_sock.c]"]
  node_device_http["HTTP configuration<br/>[http.c]"]
  node_http_response["HTTP responses<br/>[http_respond.c]"]
  node_dns["DNS service<br/>[dns.c]"]
  node_flash[("Flash storage<br/>[flash.h]")]
end

subgraph group_protocol["ATEM protocol"]
  node_atem_parser["ATEM protocol parser<br/>[atem.c]"]
  node_posix_adapter["POSIX adapter<br/>[atem_posix.c]"]
end

subgraph group_proxy["Host proxy"]
  node_proxy_main["Proxy event loop<br/>[main.c]"]
  node_proxy_server["ATEM proxy server<br/>[atem_server.c]"]
  node_proxy_session["Proxy sessions<br/>[atem_session.c]"]
  node_proxy_packets["Packet handling<br/>[atem_packet.c]"]
  node_proxy_cache[("ATEM cache<br/>[atem_cache.c]")]
end

subgraph group_relayproxy["Relay proxy"]
  node_relay_main["Relay event loop<br/>[main.c]"]
  node_relay_server["Proxy server<br/>[server.c]"]
  node_relay_client["Relay client<br/>[relay.c]"]
  node_relay_timer["Timer service<br/>[timer.c]"]
end

node_operator(("Operator"))
node_atem(("ATEM switcher"))
node_camera(("Blackmagic camera"))
node_browser(("Configuration browser"))

node_operator -->|"configures"| node_browser
node_browser -->|"submits settings"| node_device_http
node_device_http -->|"sends responses"| node_http_response
node_device_http -->|"uses storage"| node_flash
node_device_entry -.->|"initializes networking"| node_wlan
node_device_entry -.->|"starts ATEM client"| node_device_socket
node_device_entry -.->|"starts configuration"| node_device_http
node_device_socket -->|"uses protocol"| node_atem_parser
node_device_socket -->|"uses networking"| node_wlan
node_atem -->|"exchanges commands"| node_device_socket
node_device_socket -->|"sends camera data"| node_sdi
node_device_socket -->|"updates tally"| node_indicators
node_sdi -->|"forwards control"| node_camera
node_device_http -.->|"serves configuration access"| node_dns
node_proxy_main -->|"initializes"| node_proxy_cache
node_proxy_main -->|"initializes"| node_proxy_server
node_proxy_main -->|"dispatches socket events"| node_proxy_server
node_proxy_server -->|"manages sessions"| node_proxy_session
node_proxy_session -->|"queues packets"| node_proxy_packets
node_proxy_session -->|"uses cache"| node_proxy_cache
node_proxy_server -->|"uses protocol definitions"| node_atem_parser
node_relay_main -->|"initializes and dispatches"| node_relay_server
node_relay_main -->|"initializes and enables"| node_relay_client
node_relay_main -->|"dispatches timer events"| node_relay_timer
node_relay_server -->|"uses protocol definitions"| node_atem_parser
node_relay_server -->|"uses timers"| node_relay_timer

click node_sdi "https://github.com/fanatiqs/wireless_atem_camera_control_and_tally/blob/master/firmware/sdi.c"
click node_indicators "https://github.com/fanatiqs/wireless_atem_camera_control_and_tally/blob/master/firmware/led.h"
click node_device_config "https://github.com/fanatiqs/wireless_atem_camera_control_and_tally/blob/master/firmware/user_config.h"
click node_device_entry "https://github.com/fanatiqs/wireless_atem_camera_control_and_tally/tree/master/firmware"
click node_wlan "https://github.com/fanatiqs/wireless_atem_camera_control_and_tally/blob/master/firmware/wlan.c"
click node_device_socket "https://github.com/fanatiqs/wireless_atem_camera_control_and_tally/blob/master/firmware/atem_sock.c"
click node_device_http "https://github.com/fanatiqs/wireless_atem_camera_control_and_tally/blob/master/firmware/http.c"
click node_http_response "https://github.com/fanatiqs/wireless_atem_camera_control_and_tally/blob/master/firmware/http_respond.c"
click node_dns "https://github.com/fanatiqs/wireless_atem_camera_control_and_tally/blob/master/firmware/dns.c"
click node_flash "https://github.com/fanatiqs/wireless_atem_camera_control_and_tally/blob/master/firmware/flash.h"
click node_atem_parser "https://github.com/fanatiqs/wireless_atem_camera_control_and_tally/blob/master/core/atem.c"
click node_posix_adapter "https://github.com/fanatiqs/wireless_atem_camera_control_and_tally/blob/master/core/atem_posix.c"
click node_proxy_main "https://github.com/fanatiqs/wireless_atem_camera_control_and_tally/blob/master/proxy/main.c"
click node_proxy_server "https://github.com/fanatiqs/wireless_atem_camera_control_and_tally/blob/master/proxy/atem_server.c"
click node_proxy_session "https://github.com/fanatiqs/wireless_atem_camera_control_and_tally/blob/master/proxy/atem_session.c"
click node_proxy_packets "https://github.com/fanatiqs/wireless_atem_camera_control_and_tally/blob/master/proxy/atem_packet.c"
click node_proxy_cache "https://github.com/fanatiqs/wireless_atem_camera_control_and_tally/blob/master/proxy/atem_cache.c"
click node_relay_main "https://github.com/fanatiqs/wireless_atem_camera_control_and_tally/blob/master/proxy_server/main.c"
click node_relay_server "https://github.com/fanatiqs/wireless_atem_camera_control_and_tally/blob/master/proxy_server/server.c"
click node_relay_client "https://github.com/fanatiqs/wireless_atem_camera_control_and_tally/blob/master/proxy_server/relay.c"
click node_relay_timer "https://github.com/fanatiqs/wireless_atem_camera_control_and_tally/blob/master/proxy_server/timer.c"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_sdi,node_indicators,node_device_config,node_device_entry,node_wlan,node_device_socket,node_device_http,node_http_response,node_dns,node_flash,node_browser toneBlue
class node_atem_parser,node_posix_adapter toneAmber
class node_proxy_main,node_proxy_server,node_proxy_session,node_proxy_packets,node_proxy_cache toneMint
class node_relay_main,node_relay_server,node_relay_client,node_relay_timer toneRose
class node_operator,node_atem,node_camera toneIndigo
```

## Components

### Wireless device

- [SDI interface](https://github.com/fanatiqs/wireless_atem_camera_control_and_tally/blob/master/firmware/sdi.c): `firmware/sdi.c`
- [Tally/status LEDs](https://github.com/fanatiqs/wireless_atem_camera_control_and_tally/blob/master/firmware/led.h): `firmware/led.h`
- [Device configuration](https://github.com/fanatiqs/wireless_atem_camera_control_and_tally/blob/master/firmware/user_config.h): `firmware/user_config.h`
- [Firmware entrypoints](https://github.com/fanatiqs/wireless_atem_camera_control_and_tally/tree/master/firmware): `firmware`
- [WiFi networking](https://github.com/fanatiqs/wireless_atem_camera_control_and_tally/blob/master/firmware/wlan.c): `firmware/wlan.c`
- [ATEM socket client](https://github.com/fanatiqs/wireless_atem_camera_control_and_tally/blob/master/firmware/atem_sock.c): `firmware/atem_sock.c`
- [HTTP configuration](https://github.com/fanatiqs/wireless_atem_camera_control_and_tally/blob/master/firmware/http.c): `firmware/http.c`
- [HTTP responses](https://github.com/fanatiqs/wireless_atem_camera_control_and_tally/blob/master/firmware/http_respond.c): `firmware/http_respond.c`
- [DNS service](https://github.com/fanatiqs/wireless_atem_camera_control_and_tally/blob/master/firmware/dns.c): `firmware/dns.c`
- [Flash storage](https://github.com/fanatiqs/wireless_atem_camera_control_and_tally/blob/master/firmware/flash.h): `firmware/flash.h`

### ATEM protocol

- [ATEM protocol parser](https://github.com/fanatiqs/wireless_atem_camera_control_and_tally/blob/master/core/atem.c): `core/atem.c`
- [POSIX adapter](https://github.com/fanatiqs/wireless_atem_camera_control_and_tally/blob/master/core/atem_posix.c): `core/atem_posix.c`

### Host proxy

- [Proxy event loop](https://github.com/fanatiqs/wireless_atem_camera_control_and_tally/blob/master/proxy/main.c): `proxy/main.c`
- [ATEM proxy server](https://github.com/fanatiqs/wireless_atem_camera_control_and_tally/blob/master/proxy/atem_server.c): `proxy/atem_server.c`
- [Proxy sessions](https://github.com/fanatiqs/wireless_atem_camera_control_and_tally/blob/master/proxy/atem_session.c): `proxy/atem_session.c`
- [Packet handling](https://github.com/fanatiqs/wireless_atem_camera_control_and_tally/blob/master/proxy/atem_packet.c): `proxy/atem_packet.c`
- [ATEM cache](https://github.com/fanatiqs/wireless_atem_camera_control_and_tally/blob/master/proxy/atem_cache.c): `proxy/atem_cache.c`

### Relay proxy

- [Relay event loop](https://github.com/fanatiqs/wireless_atem_camera_control_and_tally/blob/master/proxy_server/main.c): `proxy_server/main.c`
- [Proxy server](https://github.com/fanatiqs/wireless_atem_camera_control_and_tally/blob/master/proxy_server/server.c): `proxy_server/server.c`
- [Relay client](https://github.com/fanatiqs/wireless_atem_camera_control_and_tally/blob/master/proxy_server/relay.c): `proxy_server/relay.c`
- [Timer service](https://github.com/fanatiqs/wireless_atem_camera_control_and_tally/blob/master/proxy_server/timer.c): `proxy_server/timer.c`

### Other components

- **Operator**
- **ATEM switcher**
- **Blackmagic camera**
- **Configuration browser**

## Connections

- Operator → Configuration browser: configures
- Configuration browser → HTTP configuration: submits settings (evidence: `firmware/http.c`)
- HTTP configuration → HTTP responses: sends responses (evidence: `firmware/http.c`)
- HTTP configuration → Flash storage: uses storage (evidence: `firmware/http.c`)
- Firmware entrypoints → WiFi networking: initializes networking
- Firmware entrypoints → ATEM socket client: starts ATEM client (evidence: `firmware/atem_sock.c`)
- Firmware entrypoints → HTTP configuration: starts configuration (evidence: `firmware/http.c`)
- ATEM socket client → ATEM protocol parser: uses protocol (evidence: `firmware/atem_sock.c`)
- ATEM socket client → WiFi networking: uses networking (evidence: `firmware/atem_sock.c`)
- ATEM switcher → ATEM socket client: exchanges commands
- ATEM socket client → SDI interface: sends camera data (evidence: `firmware/atem_sock.c`)
- ATEM socket client → Tally/status LEDs: updates tally (evidence: `firmware/atem_sock.c`)
- SDI interface → Blackmagic camera: forwards control
- HTTP configuration → DNS service: serves configuration access
- Proxy event loop → ATEM cache: initializes (evidence: `proxy/main.c`)
- Proxy event loop → ATEM proxy server: initializes (evidence: `proxy/main.c`)
- Proxy event loop → ATEM proxy server: dispatches socket events (evidence: `proxy/main.c`)
- ATEM proxy server → Proxy sessions: manages sessions (evidence: `proxy/atem_session.c`)
- Proxy sessions → Packet handling: queues packets
- Proxy sessions → ATEM cache: uses cache (evidence: `proxy/atem_session.c`)
- ATEM proxy server → ATEM protocol parser: uses protocol definitions
- Relay event loop → Proxy server: initializes and dispatches (evidence: `proxy_server/main.c`)
- Relay event loop → Relay client: initializes and enables (evidence: `proxy_server/main.c`)
- Relay event loop → Timer service: dispatches timer events (evidence: `proxy_server/main.c`)
- Proxy server → ATEM protocol parser: uses protocol definitions (evidence: `proxy_server/server.c`)
- Proxy server → Timer service: uses timers (evidence: `proxy_server/server.c`)
