UDP Server

udp.server.auto_interface

Abbreviationud s i
Accessget/set

Description

If 'auto-start' is enabled, this is the interface used when the server is set to auto-start.
If set to default, uses the interface specified in network.default_interface

Arguments

<wlan/softap/default>

Default

default

Properties

Supported Platforms

Get example

> get ud s i
R000009
default

Set example

> set ud s i softap
R000008
Set OK

udp.server.auto_start

Abbreviationud s a
Accessget/set

Description

Start server on power-up

Arguments

<true|on|1/false|off|0>

Default

0

Properties

Supported Platforms

Get example

> get ud s a
R000003
0

Set example

> set ud s a true
R000008
Set OK

udp.server.data_gpio

Abbreviationud s d
Accessget/set

Description

Specify a GPIO to be asserted HIGH when client data is available to be read.
Note: Disable by setting to -1.

See also system.oob.gpio.

Arguments

<GPIO#>

Default

-1

Properties

Supported Platforms

Get example

> get ud s d
R000004
-1

Set example

> set ud s d 3
R000008
Set OK

udp.server.lock_client

Abbreviationud s l
Accessget/set

Description

If this flag is set, the UDP server is locked to the first client from which it receives a packet. It can send data to, or receive data from, only that client.

If this flag is not set, the udp server receives data from all clients and sends to the last client from which it received a packet.

This flag is useful in stream mode when streaming to only one udp client whose IP is unknown.

Note: The variables udp.server.remote_host and udp.server.remote_port may be used to override this flag. If these variables are set then the udp server replies only to the specified host:port.

Arguments

<0/1>

Default

0

Properties

Supported Platforms

Get example

> get ud s l
0

Set example

> set ud s l 1
Set OK

udp.server.port

Abbreviationud s p
Accessget/set

Description

Default port for UDP server to bind.

Arguments

<port>

Default

3000

Properties

Supported Platforms

Get example

> get ud s p
R000006
3000

Set example

> set ud s p 5000
R000008
Set OK

udp.server.remote_host

Abbreviationud s h
Accessget/set

Description

Domain or IP address of remote udp client to auto connect. This is used in stream mode when the udp server is configured to auto-start. The stream sends data only to the configured remote host:port. See also udp.server.remote_port.

To disable, set null, i.e. set udp.server.remote_host ""

Note : If the remote_host is not configured, then the UDP server writes to the last client from which it read data (unless the destination address is specified using the udp_server write command).

Arguments

<domain/ip address>

Default

null

Properties

Supported Platforms

Get example

> get udp.server.remote_host
mydomain.com

Set example

> set ud c s mydomain.com
Set OK

udp.server.remote_port

Abbreviationud s r
Accessget/set

Description

Port of remote UDP client to auto connect. This is used in stream mode when the udp server is configured to auto-start. The stream sends data only to the configured remote host:port. See also udp.server.remote_host.

Note: If the port is 0 then use the UDP server's listening port. See udp.server.port.

Arguments

<port>

Default

3000

Properties

Supported Platforms

Get example

> get udp.server.remote_port

Set example

> set ud s r 5000
Set OK