TCP Server
tcp.server.auto_interface
Abbreviation
tc s i
Access
get/set
Description
Wireless interface used for the TCP server if auto-start is enabled.
If set to
default
, uses the interface specified in
network.default_interface
.
Arguments
wlan/softap/default
Default
default
Platforms
- WGM160P
Properties
- network_restart to apply change
Gecko OS Plugin
Get example
> get tc s i
R000009
default
Set example
> set tc s i softap
R000008
Set OK
tcp.server.auto_start
Abbreviation
tc s a
Access
get/set
Description
Enable/disable TCP server auto-start on bootup.
Arguments
1|true|on/0|false|off
where
-
0
orfalse
oroff
: auto-start disabled -
1
ortrue
oron
: auto-start enabled
Default
0
Platforms
- WGM160P
Properties
- network_restart to apply change
Gecko OS Plugin
Get example
> get tc s a
R000003
0
Set example
> set tc s a true
R000008
Set OK
tcp.server.connected_gpio
Abbreviation
tc s c
Access
get/set
Description
The GPIO used to indicate whether a client is connected to the TCP server.
See also system.oob.gpio .
Arguments
<[GPIO#]/[-1]>
Default
-1
Platforms
- WGM160P
Properties
- network_restart to apply change
Gecko OS Plugin
Get example
> get tc s c
R000004
-1
Set example
> set tc s c 12
R000008
Set OK
tcp.server.data_gpio
Abbreviation
tc s d
Access
get/set
Description
The GPIO used to indicate whether a connected client has data available to read.
Note
: Disable by setting to -1.
See also system.oob.gpio .
Arguments
<GPIO#>
Default
-1
Platforms
- WGM160P
Properties
- network_restart to apply change
Gecko OS Plugin
Get example
> get tc s d
R000004
-1
Set example
> set tc s d 13
R000008
Set OK
tcp.server.idle_timeout
Abbreviation
tc s t
Access
get/set
Description
Maximum client idle time in seconds before the client is automatically disconnected.
Setting
tcp.server.idle_timeout
to
0
turns off timeout completely: TCP server does not disconnect idle clients.
Arguments
<seconds>
Range:
0 - 65535
Default
60
Platforms
- WGM160P
Properties
- network_restart to apply change
Gecko OS Plugin
Get example
> get tc s t
R000004
60
Set example
> set tc s t 30
R000008
Set OK
tcp.server.max_clients
Abbreviation
tc s m
Access
get/set
Description
Specify maximum number of clients that may be simultaneously connected to the tcp server.
This variable applies only when
bus.mode
=
command
.
If
bus.mode
=
stream
, max TCP server clients =
1
.
Arguments
<max #>
where:
-
<max #>
is the maximum number of TCP server clients, valid range:0 - 8
. -
0
is a deprecated value: iftcp.server.max_clients
=0
and bus.mode =command
, then max TCP server clients =8
Default
0
Platforms
- WGM160P
Properties
- network_restart to apply change
Gecko OS Plugin
Get example
> > get tc s m
0
Set example
> set tc s m 5
Set OK
tcp.server.port
Abbreviation
tc s p
Access
get/set
Description
TCP server port to listen on.
Arguments
<port>
Default
3000
Platforms
- WGM160P
Properties
- network_restart to apply change
Gecko OS Plugin
Get example
> get tc s p
R000006
3000
Set example
> set tc s p 3001
R000008
Set OK
tcp.server.tls_cert
Abbreviation
tc s n
Access
get/set
Description
The server TLS CA certificate filename.
Arguments
<filename>
Default
None
Platforms
- WGM160P
Properties
- network_restart to apply change
Gecko OS Plugin
Get example
> get tc s n
R000012
mycert.pem
Set example
> set tc s n mycert.pem
R000008
Set OK
tcp.server.tls_enabled
Abbreviation
tc s u
Access
get/set
Description
Enable server TLS certificate. This is used with the tcp.server.auto_start option.
Arguments
1|true|on/0|false|off
where
-
0
orfalse
oroff
: disabled -
1
ortrue
oron
: enabled
Default
False
Platforms
- WGM160P
Properties
- network_restart to apply change
Gecko OS Plugin
Get example
> get tc s u
R000003
0
Set example
> set tc s u false
R000008
Set OK
tcp.server.tls_key
Abbreviation
tc s k
Access
get/set
Description
The server TLS certificate key filename.
Arguments
<filename>
Default
None
Platforms
- WGM160P
Properties
- network_restart to apply change
Gecko OS Plugin
Get example
> get tc s k
R000012
mycert.key
Set example
> set tc s k mycert.key
R000008
Set OK
tcp.server.tls_peer_cert
Abbreviation
tc s e
Access
get/set
Description
This variable specifies the HTTP server's TLS client certificate chain.
In typical setups, there are two certificate chains:
-
Server -
root CA -> server intermediate cert(s) -> server cert
- Specify the server root chain file with tcp.server.tls_cert . -
Client -
root CA -> client intermediate cert(s) -> client cert
- Specify the client root chain file withtcp.server.tls_peer_cert
.
Use
tcp.server.tls_peer_cert
to specify the client chain file, when it is different to the server chain file.
For details of creating certificates and chain files, see the HTTPS Intermediate Certificates example app .
Notes :
If
tcp.server.tls_peer_cert
is null then
tcp.server.tls_cert
is used for the client certificate chain. This is the legacy behavior.
To use this variable, set the variable
tcp.server.tls_verify_peer
to
1
.
Arguments
<cert_filename>
where:
-
<cert_filename>
is the path to the client certificate chain file.
Leave
null
to use
tcp.server.tls_cert
as the client certificate chain. To set the variable to
null
, set to the empty string:
set tcp.server.tls_peer_cert ""
Default
<null>
Platforms
- WGM160P
Gecko OS Plugin
Example
set tcp.server.tls_peer_cert my_client_chain.pem
tcp.server.tls_verify_peer
Abbreviation
tc s v
Access
get/set
Description
When this variable is set, a connecting client must provide a valid TLS certificate that the server validates. The client is disconnected if the provided certifcate is invalid.
Note : The tcp.server.tls_cert variable must be set if using this feature.
Arguments
1|true|on/0|false|off
where
-
0
orfalse
oroff
: disabled -
1
ortrue
oron
: enabled
Default
0
Platforms
- WGM160P
Properties
- network_restart to apply change
Gecko OS Plugin
Get example
> get tc s v
0
Set example
> set tc s v 1
Set OK