Template:NetworkServerConfig: Difference between revisions

From Phidgets Support
No edit summary
No edit summary
Line 21: Line 21:
===Settings===
===Settings===
{|  
{|  
|style="width:55%"|<syntaxhighlight>
|style="width:62%"|<syntaxhighlight>
phidget{
phidget{
   enabled: true
   enabled: true
Line 31: Line 31:


{|  
{|  
|style="width:55%"|<syntaxhighlight>
|style="width:62%"|<syntaxhighlight>
phidget{
phidget{
     auth {
     auth {
Line 43: Line 43:


{|  
{|  
|style="width:55%"|<syntaxhighlight>
|style="width:62%"|<syntaxhighlight>
phidget{
phidget{
     pidfile: '/var/run/phidget22networkserver.pid'
     pidfile: '/var/run/phidget22networkserver.pid'
Line 53: Line 53:


{|  
{|  
|style="width:55%"|<syntaxhighlight>
|style="width:62%"|<syntaxhighlight>
phidget{
     logging {
     logging {
         level: info
         level: info
Line 84: Line 85:
         }
         }
     }
     }
}
</syntaxhighlight>
</syntaxhighlight>
|
|
Line 98: Line 100:


{|  
{|  
|style="width:55%"|<syntaxhighlight>
|style="width:62%"|<syntaxhighlight>
phidget{
phidget{
     network {
     network {
Line 132: Line 134:
*'''enabled:''' when ''true'', your Phidget Network Server will be published to mDNS.
*'''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).
*'''name:''' the name of your Phidget Network Server that will be published (defaults to computer name).
|}
{|
|style="width:62%"|<syntaxhighlight>
phidget{
    feature {
        control {
    enabled: true
}
stats {
    enabled: true
}
dictionary {
    enabled: true
    directory: '/etc/phidgets/dictionary.d'
}
    }
}
</syntaxhighlight>
|
''control''
*'''enabled:'' enables the control dictionary. The control dictionary is used for '''need more info'''
''stats''
*'''enabled:''' enables the stats dictionary. The stats dictionary is used for '''need more info'''
''dictionary''
*'''enabled:''' '''need more info'''
*'''directory:''' '''need more info'''
|}
{|
|style="width:62%"|<syntaxhighlight>
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' ]
    }
}
    }
}
</syntaxhighlight>
|
|}
{|
|style="width:62%"|<syntaxhighlight>
phidget{
    www {
    enabled: true
    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'
        }
    }
}
</syntaxhighlight>
|
|}
{|
|style="width:62%"|<syntaxhighlight>
phidget{
    dictionarystore {
        enabled: true
pidfile: '/var/run/dictionarystored.pid'
sync: 3
database {
    directory: '/var/phidgets/dictionary.d'
}
logging {
    level: info
}
    }
}
</syntaxhighlight>
|
|}
|}

Revision as of 20:46, 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
}
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.


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


phidget{
    pidfile: '/var/run/phidget22networkserver.pid'
}
For UNIX machines only. 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 code block refers to log level. See the Phidget Control Panel 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

  • enabled: enable network logging.
  • port: NEED MORE INFO


phidget{
    network {
        keepalive: 30000
	ipv4 {
	    address: localhost
	    port: 5661
	}
	datagram {
	    enabled: true
	}
	publish {
	    enabled: true
	    name: 'Phidget22 Server'
	}
	resolveaddrs: false
    }
}

network

  • keepalive: NEED MORE INFO
  • resolveaddrs: if addresses should be resolved to names (affects performance)

ipv4

  • address: the address to bind. can we give more info here?
  • port: server port. other options for this setting?

datagram

  • enabled: if UDP for events is allowed. can we give more info here?

publish

  • 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).


phidget{
    feature {
        control {
	    enabled: true
	}
	stats {
	    enabled: true
	}
	dictionary {
	    enabled: true
	    directory: '/etc/phidgets/dictionary.d'
	}
    }
}

control

  • 'enabled: enables the control dictionary. The control dictionary is used for need more info

stats

  • enabled: enables the stats dictionary. The stats dictionary is used for need more info

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' ]
	    }
	}
    }
}


phidget{
    www {
    enabled: true	
    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'
        }
    }
}


phidget{
    dictionarystore {
        enabled: true
	pidfile: '/var/run/dictionarystored.pid'
	sync: 3
	database {
	    directory: '/var/phidgets/dictionary.d'
	}
	logging {
	    level: info
	}
    }	
}