Template:NetworkServerConfig: Difference between revisions
From Phidgets Support
																
																								No edit summary  | 
				No edit summary  | 
				||
| Line 62: | Line 62: | ||
!colspan="2"|phidget {  | !colspan="2"|phidget {  | ||
|-  | |-  | ||
|pidfile||  | |pidfile||Where the UNIX pid file is written  | ||
|}  | |}  | ||
|}  | |}  | ||
| Line 117: | Line 117: | ||
|enabled||enable network logging.  | |enabled||enable network logging.  | ||
|-  | |-  | ||
|port||  | |port||tcp port that the server listens on  | ||
|}  | |}  | ||
|}  | |}  | ||
| Line 145: | Line 145: | ||
!colspan="2"|network {  | !colspan="2"|network {  | ||
|-  | |-  | ||
|keepalive||'  | |keepalive||the server is constantly sends keepalive packets to the client, if it doesnt get a response in the keepalive time it will close the connection (0 turns off, so server won't send keep alive)  | ||
|-  | |-  | ||
|resolveaddrs||if addresses should be resolved to names (affects performance)  | |resolveaddrs||if addresses should be resolved to names (affects performance)  | ||
| Line 189: | Line 189: | ||
!colspan="2"|control {  | !colspan="2"|control {  | ||
|-  | |-  | ||
|enabled||  | |enabled|| enables controls dictionary, which is the network one  | ||
|-  | |-  | ||
!colspan="2"|stats {  | !colspan="2"|stats {  | ||
|-  | |-  | ||
|enabled||  | |enabled|| this is going to be killed  | ||
|-  | |-  | ||
!colspan="2"|dictionary{  | !colspan="2"|dictionary{  | ||
|-  | |-  | ||
|enabled||   | |enabled|| this enables the use of dictionaries on your server  | ||
|-  | |-  | ||
|directory||  | |directory||points to the dictionary.d file  | ||
|}  | |}  | ||
|}  | |}  | ||
| Line 229: | Line 229: | ||
!colspan="2"|filter {  | !colspan="2"|filter {  | ||
|-  | |-  | ||
|enabled||  | |enabled||limits what clients are allowed to connect  | ||
|-  | |-  | ||
!colspan="2"|clients {  | !colspan="2"|clients {  | ||
| Line 294: | Line 294: | ||
|docroot||where your webpage/files exist.  | |docroot||where your webpage/files exist.  | ||
|-  | |-  | ||
|mimetypes||  | |mimetypes|| location of mimetypes file  | ||
|-  | |-  | ||
!colspan="2"|logging {  | !colspan="2"|logging {  | ||
| Line 304: | Line 304: | ||
!colspan="2"|network {  | !colspan="2"|network {  | ||
|-  | |-  | ||
|cachectrl||prevents clients from caching results (for testing)   | |cachectrl||prevents clients from caching results (for testing)    | ||
|-  | |-  | ||
!colspan="2"|ipv4 {  | !colspan="2"|ipv4 {  | ||
|-  | |-  | ||
|address||address to bind   | |address||address to bind    | ||
|-  | |-  | ||
|port||'''unknown'''  | |port||'''unknown'''  | ||
| Line 347: | Line 347: | ||
!colspan="2"|dictionarystore {  | !colspan="2"|dictionarystore {  | ||
|-  | |-  | ||
|enabled||'''  | |enabled||'''kill this part'''  | ||
|-  | |-  | ||
|pidfile||'''unknown'''  | |pidfile||'''unknown'''  | ||
Revision as of 16:34, 10 July 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{
    auth {
        password: 'temp123'
    }
} | 
  | ||||
phidget{
    pidfile: '/var/run/phidget22networkserver.pid'
} | 
  | ||||
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. 
  | ||||||||||||||
phidget{
    network {
        keepalive: 30000
	ipv4 {
	    address: localhost
	    port: 5661
	}
	datagram {
	    enabled: true
	}
	publish {
	    enabled: true
	    name: 'Phidget22 Server'
	}
	resolveaddrs: false
    }
} | 
  | ||||||||||||||||||||||
phidget{
    feature {
        control {
	    enabled: true
	}
	stats {
	    enabled: true
	}
	dictionary {
	    enabled: true
	    directory: '/etc/phidgets/dictionary.d'
	}
    }
} | 
  | ||||||||||||||
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
    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'
        }
    }
} | 
  | ||||||||||||||||||||||||||||||||||||||
phidget{
    dictionarystore {
        enabled: true
	pidfile: '/var/run/dictionarystored.pid'
	sync: 3
	database {
	    directory: '/var/phidgets/dictionary.d'
	}
	logging {
	    level: info
	}
    }	
} | 
  | ||||||||||||||||