flowchart TD
A([Start: Unbox Deco kit]) --> B["Install Deco App\n(iOS or Android)"]
B --> C[Sign in or create TP-Link ID]
C --> D[Grant permissions\nBluetooth, Location, Local Network]
D --> E[Tap: Set up a new Deco network]
E --> F[Select Deco model]
F --> G[Power on main Deco\nwait for LED]
G --> H{Internet source type?}
H -->|Modem only| I[Connect main Deco WAN to modem]
H -->|ISP gateway modem+router| J{Which approach?}
H -->|Existing router| K[Plan for Access Point mode\noptional]
%% Modem-only path
I --> L[Power cycle modem\nwait until online]
L --> M[App detects Deco via Bluetooth]
M --> N[Create Wi-Fi name and password]
N --> O[Set operating mode: Router]
O --> P[Run internet connection test]
P --> Q{Connection successful?}
Q -->|Yes| R[Update firmware if prompted]
Q -->|No| T[Troubleshoot:\ncheck cables, reboot modem,\nPPPoE or VLAN, ISP auth]
T --> P
%% ISP gateway modem+router path
J -->|Use Deco as router| I
J -->|Keep existing router| K
%% Existing router / AP mode path
K --> K1[Connect main Deco to router LAN]
K1 --> K2[Set operating mode: Access Point]
K2 --> P
%% Post-success steps
R --> S[Place main Deco centrally\nname location in app]
S --> U[Add additional Deco units]
U --> V[Power on satellite Deco]
V --> W[Place near main Deco for pairing]
W --> X[App pairs satellite]
X --> Y{Use ethernet backhaul?}
Y -->|Yes| Y1[Connect satellite via ethernet]
Y -->|No| Z[Use wireless mesh backhaul]
Y1 --> AA[Move satellite to target room]
Z --> AA
AA --> AB[Run network optimization\nor mesh test]
AB --> AC[Enable optional features\nHomeShield, QoS, Parental Controls]
AC --> AD([Done: Mesh network active])