# Communication between demodulator and App :id=top

------

> _Doc Ver:_ 1.1  
_App Ver:_ 2.6.6.53  
_Date:_ 09/03/2026

------

> SA1 2.x can talk to a third-party program over LAN UDP, or through the web gateway after login.  
> The demodulator and the App PC must be on the same LAN and able to ping each other.  
> **TCP 7090 is localhost-only.** A PC cannot connect to 7090 directly. Use UDP **7082** / **8190**, or `/m/tcpclient.php` after login.

------

## 1. Demodulator as UDP server :id=udp_server

> The App is the UDP client.   

    1.1. LAN UDP **7082** (physical-value character / commands) is open. Point the App at this port. Do not connect to TCP 7090 from a PC.
    1.2. Control commands, see: Menu > 'Help' > 'Handbook' > 'System' > 'API & reduced commands'
    1.3. Example :id=id1
        The App needs real-time data from the demodulator. The App sends ":DATA:PVJ?" to the demodulation port and receives JSON data.
        For the JSON format, see 'Help' > 'Handbook' > 'System' > 'API & reduced commands' > '5.12'

## 2. Demodulator as TCP server  :id=tcp_server

> The App is the TCP client.
> This command TCP mode is a short connection: after the demodulator sends data, it closes the TCP connection. To get data again, establish a new TCP connection.

    2.1. On current SA1 field units, TCP **7090** listens on **127.0.0.1** only. SSH to the device and send commands to `127.0.0.1:7090`, or use the web gateway below. A LAN App cannot connect to 7090.
    2.2. Control commands, see: Menu > 'Help' > 'Handbook' > 'System' > 'API & reduced commands'
    2.3. Example
        The App needs real-time data from the demodulator. The App sends ":DATA:PVJ?" to the demodulation port and receives JSON data.
        For the JSON format, see: Menu > 'Help' > 'Handbook' > 'System' > 'API & reduced commands' > '5.12'
    2.4. Simple test (must be logged in first)
        After `/login`, open:
        `http://<device-IP>/m/tcpclient.php?cmd=:DATA:PVJ?`
        Unauthenticated requests return 401. Do not send `*CHS!` here.

## 3. Demodulator as UDP client  :id=udp_client

> The App is the UDP server.   
> UDP client mode is not enabled by default; enable it manually.

    3.1. Enable
        Menu > 'Setting' > 'Data transfer' > '2. Physical-value JSON UDP report', check '1.1'.
    3.2. Settings
        UDP broadcast: several App terminals can receive data at the same time; uncheck '1.2' and change '1.4' to the receive port configured on the App.
        UDP point-to-point transfer: check '1.2', change '1.3' to the App PC's local IP, and change '1.4' to the receive port configured on the App.
        Send data without packing: uncheck '1.6'
        Data grouping: check '3.1'
        Other: check '3.13~3.18'
        Click the 'Save' button on the current page.
    3.3. Data format
        On the current setting page, click the 'Help' button to view the data format.
    3.4. Check that it is in effect
        Menu > 'Monitor' > 'Service'; you can find status of services that are already running and enabled.
        
## 4. Demodulator as TCP client :id=tcp_client

> The App is the TCP server.    
> TCP client mode is not enabled by default; enable it manually.

    4.1. Enable
        Menu > 'Setting' > 'Data transfer' > '1. Physical-value JSON TCP report', check '1.1'.
    4.2. Settings
        Point-to-point transfer: check '1.2', change '1.3' to the App PC's local IP, and change '1.4' to the receive port configured on the App.
        Send data without packing: uncheck '1.5'
        Data sticking setting: check '1.6'; when checked, a binary start identifier is added to the data. For details, click 'Help' on the current setting page.
        Data grouping: check '3.1'
        Other: check '3.13~3.18'
        Click the 'Save' button on the current page.
    4.3. Data format
        On the current setting page, click the 'Help' button to view the data format.
    4.4. Check that it is in effect
        Menu > 'Monitor' > 'Service'; you can find status of services that are already running and enabled.

## 5. Other notes :id=caution

- When [3.](#udp_client 'UDP Client') and [4.](#tcp_client 'TCP Client') are enabled at the same time, the receive ports must not be the same.

------

### [Top](#top)
