Template:NetworkServerConfig: Difference between revisions

From Phidgets Support
No edit summary
No edit summary
Line 26: Line 26:
}
}
</syntaxhighlight>
</syntaxhighlight>
|Enable the Phidget Server and provide access to Phidget channels over the network. This does not disable the WWW server, and web clients may still access Phidget channels.
|
{|class="wikitable"
!colspan="2"|phidget {
|-
|enabled||Enable the Phidget Server and provide access to Phidget channels over the network.
|}
|}
|}


Line 38: Line 43:
}
}
</syntaxhighlight>
</syntaxhighlight>
|Set a password for your Phidget Server.
|
{|class="wikitable"
!colspan="2"|auth {
|-
|password||set a password for your Phidget Server.
|}
|}
|}


Line 48: Line 58:
}
}
</syntaxhighlight>
</syntaxhighlight>
|For UNIX machines only. '''NEED MORE INFO'''
|
{|class="wikitable"
!colspan="2"|phidget {
|-
|pidfile||need more info
|}
|}
|}


{|  
{|  
Line 88: Line 102:
</syntaxhighlight>
</syntaxhighlight>
|
|
*The use of '''level''' throughout this code block refers to log level. See the Phidget Control Panel [[Phidget Control Panel#Logging|logging section]] for more information.
The use of '''level''' throughout this section refers to log level. See the Phidget Control Panel [[Phidget Control Panel#Logging|logging section]] for more information.
*'''file:''' choose the log file location and name.
*'''maxfiles:''' the maximum number of log files to keep before rotation deletes them.
*'''maxsize:''' the maximum file size of a log file before rotation.


''network''
{|class="wikitable"
*'''enabled:''' enable network logging.
!colspan="2"|logging {
*'''port:''' '''NEED MORE INFO'''
|-
|file||choose the log file location and name
|-
|maxfiles||the maximum number of log files to keep before rotation deletes them.
|-
|maxsize||the maximum file size of a log file before rotation.
|-
!colspan="2"|network {
|-
|enabled||enable network logging.
|-
|port||unknown
|}
|}
|}


{|  
{|  
Line 120: Line 142:
</syntaxhighlight>
</syntaxhighlight>
|
|
''network''
{|class="wikitable"
*'''keepalive:''' '''NEED MORE INFO'''
!colspan="2"|network {
*'''resolveaddrs:''' if addresses should be resolved to names (affects performance)
|-
 
|keepalive||unknown
''ipv4''
|-
*'''address:''' the address to bind. '''can we give more info here?'''
|resolveaddrs||if addresses should be resolved to names (affects performance)
*'''port:''' server port. '''other options for this setting?'''
|-
 
!colspan="2"|ipv4 {
''datagram''
|-
*enabled: if UDP for events is allowed. '''can we give more info here?'''
|address||the address to bind. '''need more info/better explanation'''
 
|-
''publish''
|port||server port. '''need more info/better explanation/options for port #?'''
*'''enabled:''' when ''true'', your Phidget Network Server will be published to mDNS.
|-
*'''name:''' the name of your Phidget Network Server that will be published (defaults to computer name).
!colspan="2"|datagram {
|-
|enabled||if UDP for events is allowed. '''can we give more info?'''
|-
!colspan="2"|publish {
|-
|enabled||publish your Phidget Network Server to mDNS
|-
|name||the name that will be published (defaults to computer name).
|}
|}
|}


Line 155: Line 186:
</syntaxhighlight>
</syntaxhighlight>
|
|
''control''
{|class="wikitable"
*'''enabled:'' enables the control dictionary. The control dictionary is used for '''need more info'''
!colspan="2"|control {
 
|-
''stats''
|enabled||'''what does the control dictionary do'''
*'''enabled:''' enables the stats dictionary. The stats dictionary is used for '''need more info'''
|-
 
!colspan="2"|stats {
''dictionary''
|-
*'''enabled:''' '''need more info'''
|enabled||'''what does the stats dictionary do'''
*'''directory:''' '''need more info'''
|-
!colspan="2"|dictionary{
|-
|enabled|| '''need more info'''
|-
|directory||'''need more info'''
|}
|}
|}


Line 189: Line 226:
</syntaxhighlight>
</syntaxhighlight>
|
|
{|class="wikitable"
!colspan="2"|filter {
|-
|enabled||'''what is filtering for?'''
|-
!colspan="2"|clients {
|-
|defaults||choose between ''allow'' or ''deny''. Controls if the default is to allow or deny connections.
|-
!colspan="2"|allow {
|-
|enabled||if allow rules should be processed
|-
|verbose||if clients that are allowed to cause a log message
|-
|list||list of addresses to allow
|-
!colspan="2"|deny {
|-
|enabled||if deny rules should be processed
|-
|verbose||if clients that are denied cause a log message
|-
|list||list of addresses to deny
|}
|}
|}


Line 196: Line 258:
phidget{
phidget{
     www {
     www {
     enabled: true
     enabled: true
    serverhost: 'my-pc'
     docroot: '/var/phidgets/www'
     docroot: '/var/phidgets/www'
     mimetypes: '/etc/phidgets/mimetypes.kv'
     mimetypes: '/etc/phidgets/mimetypes.kv'
Line 222: Line 285:
</syntaxhighlight>
</syntaxhighlight>
|
|
{|class="wikitable"
!colspan="2"|www {
|-
|enabled||enables the Phidget Webserver
|-
|serverhost||the host name to use for redirects etc. This should not be specified unless there is a reason to override the host name (e.g. server being accessed through a firewall)
|-
|docroot||where your webpage/files exist.
|-
|mimetypes||'''unknown'''
|-
!colspan="2"|logging {
|-
|level||See the Phidget Control Panel [[Phidget Control Panel#Logging|logging section]] for more information about different log levels.
|-
|accesslog||specify the access log location. This file lets you know '''who has accessed your webserver?'''
|-
!colspan="2"|network {
|-
|cachectrl||prevents clients from caching results (for testing) '''other options?'''
|-
!colspan="2"|ipv4 {
|-
|address||address to bind '''what does this mean?'''
|-
|port||'''more info?'''
|-
!colspan="2"|publish {
|-
|enabled||if the WWW server should be published to mDNS
|-
|name||the name to publish (defaults to computer name)
|-
!colspan="2"|phidgets {
|-
|enabled||contorls if we allow websocket upgrades for Phidgets
|-
|passwd||the server password
|}
|}
|}


Line 242: Line 344:
</syntaxhighlight>
</syntaxhighlight>
|
|
{|class="wikitable"
!colspan="2"|dictionarystore {
|-
|enabled||'''need more info'''
|-
|pidfile||'''need more info'''
|-
|sync||how often configuration changes are synced. '''what does this mean?'''
|-
!colspan="2"|database{
|-
|directory||location of database files. '''what does this mean'''
|-
!colspan="2"|logging {
|-
|level||See the Phidget Control Panel [[Phidget Control Panel#Logging|logging section]] for more information about different log levels.
|}
|}
|}

Revision as of 21:45, 30 June 2017

Configuring the Phidget Network Server

There are two different ways to configure the Phidget Network Server:

  • via the Phidget Control Panel (for Windows and macOS users). This provides a simple way for you to make changes to the Phidget Network Server, however, not all settings are available.
  • modifying the Phidget Network Server configuration file directly. All settings are available, but it is not as user-friendly.


Find the configuration file on your machine by referencing the following table:

Operating System Location
Linux /etc/phidgets/
Windows C:/ProgramData/Phidgets
macOS /Library/Preferences/Phidget22NetworkServer/

Now that you have the configuration file on hand, we will go through each setting and describe it.

Settings

phidget{
   enabled: true
}
phidget {
enabled Enable the Phidget Server and provide access to Phidget channels over the network.


phidget{
    auth {
        password: 'temp123'
    }
}
auth {
password set a password for your Phidget Server.


phidget{
    pidfile: '/var/run/phidget22networkserver.pid'
}
phidget {
pidfile need more info
phidget{
    logging {
        level: info
	file: 'c:/tmp/networkserver.log'
	maxfiles: 4
        maxsize: 1048576
	network {
	    enabled: true
	    port: 5771
	}
	source {
	    phidget22net {
	        level: info
	    }
	    _phidget22usb {
	        level: info
	    }
	    _phidget22match {
	        level: error
	    }
	    _phidget22channel {
	        level: error
	    }
	    _phidget22bridge {
		level: error
	    }
	    _phidget22disp {
		level: error
	    }
        }
    }
}

The use of level throughout this section refers to log level. See the Phidget Control Panel logging section for more information.

logging {
file choose the log file location and name
maxfiles the maximum number of log files to keep before rotation deletes them.
maxsize the maximum file size of a log file before rotation.
network {
enabled enable network logging.
port unknown
phidget{
    network {
        keepalive: 30000
	ipv4 {
	    address: localhost
	    port: 5661
	}
	datagram {
	    enabled: true
	}
	publish {
	    enabled: true
	    name: 'Phidget22 Server'
	}
	resolveaddrs: false
    }
}
network {
keepalive unknown
resolveaddrs if addresses should be resolved to names (affects performance)
ipv4 {
address the address to bind. need more info/better explanation
port server port. need more info/better explanation/options for port #?
datagram {
enabled if UDP for events is allowed. can we give more info?
publish {
enabled publish your Phidget Network Server to mDNS
name the name that will be published (defaults to computer name).


phidget{
    feature {
        control {
	    enabled: true
	}
	stats {
	    enabled: true
	}
	dictionary {
	    enabled: true
	    directory: '/etc/phidgets/dictionary.d'
	}
    }
}
control {
enabled what does the control dictionary do
stats {
enabled what does the stats dictionary do
dictionary{
enabled need more info
directory need more info


phidget{
    filter {
        enabled: true
	clients {
	    default: allow
	    allow {
	        enabled: false
		verbose: false
		list: ['192.168.2.159', '192.168.3.120' ]
	    }
	    deny {
		enabled: false
		verbose: false
		list: ['192.168.2.158', '192.168.3.119' ]
	    }
	}
    }
}
filter {
enabled what is filtering for?
clients {
defaults choose between allow or deny. Controls if the default is to allow or deny connections.
allow {
enabled if allow rules should be processed
verbose if clients that are allowed to cause a log message
list list of addresses to allow
deny {
enabled if deny rules should be processed
verbose if clients that are denied cause a log message
list list of addresses to deny


phidget{
    www {
    enabled: true
    serverhost: 'my-pc'
    docroot: '/var/phidgets/www'
    mimetypes: '/etc/phidgets/mimetypes.kv'
    logging {
        level: debug
	accesslog: '/var/log/phidget22access.log'
    }
    network {
        cachectrl: nocache
	ipv4 {
	    address: 192.168.1.1
	    port: 8080
	}
	publish {
	    enabled: true
	    name: 'Phidget22 Server'
	}
    }
    phidgets {
        enabled: true
	passwd: 'temp123'
        }
    }
}
www {
enabled enables the Phidget Webserver
serverhost the host name to use for redirects etc. This should not be specified unless there is a reason to override the host name (e.g. server being accessed through a firewall)
docroot where your webpage/files exist.
mimetypes unknown
logging {
level See the Phidget Control Panel logging section for more information about different log levels.
accesslog specify the access log location. This file lets you know who has accessed your webserver?
network {
cachectrl prevents clients from caching results (for testing) other options?
ipv4 {
address address to bind what does this mean?
port more info?
publish {
enabled if the WWW server should be published to mDNS
name the name to publish (defaults to computer name)
phidgets {
enabled contorls if we allow websocket upgrades for Phidgets
passwd the server password


phidget{
    dictionarystore {
        enabled: true
	pidfile: '/var/run/dictionarystored.pid'
	sync: 3
	database {
	    directory: '/var/phidgets/dictionary.d'
	}
	logging {
	    level: info
	}
    }	
}
dictionarystore {
enabled need more info
pidfile need more info
sync how often configuration changes are synced. what does this mean?
database{
directory location of database files. what does this mean
logging {
level See the Phidget Control Panel logging section for more information about different log levels.