• No results found

By default, pilight uses a random port for its socket server. Use the port setting If you want to set this to a fixed port.

N/A
N/A
Protected

Academic year: 2021

Share "By default, pilight uses a random port for its socket server. Use the port setting If you want to set this to a fixed port."

Copied!
9
0
0

Loading.... (view fulltext now)

Full text

(1)

Settings

Settings...1 Introduction...2 Core...2 port...2 standalone...2 pid-file...2 log-file...2 log-level...2 whitelist...3 stats-enable...3 watchdog-enable...3 Module Paths...4 action-root...4 function-root...4 hardware-root...4 operator-root...4 protocol-root...4 Webserver...5 webgui-websockets...5 webserver-authentication...5 webserver-cache...5 webserver-enable...5 webserver-http-port...5 webserver-https-port...6 webserver-root...6 webserver-user...6 Firmware...7 firmware-gpio-miso...7 firmware-gpio-mosi...7 firmware-gpio-reset...7 firmware-gpio-sck...7 SMTP...8 smtp-sender...8 smtp-user...8 smtp-password...8 smtp-host...8 smtp-port...8 Miscellaneous...9 ntp-servers...9

(2)

Introduction

The way pilight functions can be altered by changing various settings. All pilight settings will be described in this chapter grouped by their respective category.

Core

port

Linux, *BSD, and Windows no default value

1 "port": 5000

By default, pilight uses a random port for its socket server. Use the port setting If you want to set this to a fixed port.

standalone

Linux, *BSD, and Windows 1 "standalone": 0

When pilight starts, it will first check if there are other instances running inside the same network. If it does, it will connect to the other pilight instance and will join or create the AdHoc network. If you want to force pilight into running as a standalone daemon, you can set the standalone setting to 1. When running pilight in standalone mode, the SSDP server will also be disabled. This means that other pilight clients will not be able to discover it using SSDP.

pid-file

Linux and *BSD 1 "pid-file": "/var/run/pilight.pid"

The pid-file is used by pilight to save the process id number of the pilight-daemon. pilight itself uses this information as one of the ways to determine if pilight is already running or not. This setting must contain a valid path to store the pid-file

log-file

Linux and *BSD Windows

1 "log-file": "/var/log/pilight.log" 2 "log-file": "c:/pilight/pilight.log"

The log-file is used by pilight to various information gathered while pilight is running. This information can be used to debug errors or gather information about triggered actions. This setting must contain a valid path to store the log-file.

log-level

Linux, *BSD, and Windows 1 "log-level": 4

The log-level tells pilight what messages it should log into the log-file. The higher the log-level the more messages are logged into the log-file. The highest log-level is 6 and the lowest is 0. These log-levels correspond to the following log types: 0 = emergency, 1 = alert, 2 = critical, 3 = error, 4 = warning, 5 = notification, and 6 = information.

(3)

whitelist

Linux, *BSD, and Windows 1 "whitelist": [ "*.*.*.*" ]

All software able to use socket connections can communicate to pilight. Such software can be pilight-receive, a user visiting the webGUI, or external pilight plugins such a provided by FHEM. If you want to limit the computers in your network that can connect to pilight, you set up a whitelist. This setting should contain a list of valid IPv4 addresses that are allowed to connect to pilight. All other IPs will be blocked. If you want to allow IPv4 ranges, you can specify them by using wildcards. For example, if we want to allow all IP addresses ranging from 192.168.1.0 to 192.168.1.254 we can add the IP address 192.168.1.* to the list. If we want to allow all IP addresses ranging from 10.0.0.0 to 10.0.254.254 we can add the IP address 10.0.*.* to the list. Each whitelist entry should contain a valid IPv4 address with or without using wildcards.

stats-enable

Linux, *BSD, and Windows 1 "stats-enable": 1

pilight monitors its own CPU and RAM resource usage. This information can be shared with external clients and is shared by default with the websockets connections. If you want to disable the display of the CPU and RAM statistics and/or want to disable the communication of these statistics over the websocket connection you can set this to 0. This setting can be either 0 or 1.

watchdog-enable

Linux, *BSD, and Windows 1 "watchdog-enable": 1

pilight monitors its own CPU and RAM resource usage. This information is used to shutdown or terminate pilight when it uses too much CPU or RAM. If want to disable this watchdog feature and therefor the automatic termination of pilight when needed, you can set this setting to 0. This setting can be either 0 or 1.

(4)

Module Paths

pilight has the possibility to load various external modules to enhance its functionality. These modules are single files and should be placed in fixed folders. However, these folders locations can be changed by altering one of the following settings.

There is generally no reason to load external modules. The latest pilight version always contains the latest protocols, hardware drivers, event operators, functions, and actions.

action-root

Linux and *BSD 1 "action-root": "/usr/local/lib/pilight/action" pilight event actions are loaded from the action-root folder. The action-root setting must contain a valid path.

function-root

Linux and *BSD 1 "function-root": "/usr/local/lib/pilight/function" pilight event function are loaded from the function-root folder. The function-root setting must contain a valid path.

hardware-root

Linux and *BSD 1 "hardware-root": "/usr/local/lib/pilight/hardware" External pilight hardware drivers are loaded from the hardware-root folder. The hardware-root setting must contain a valid path.

operator-root

Linux and *BSD 1 "operator-root": "/usr/local/lib/pilight/operator" pilight event operators are loaded from the operators-root folder. The operators-root setting must contain a valid path.

protocol-root

Linux and *BSD 1 "protocol-root": "/usr/local/lib/pilight/protocol" External pilight protocols are loaded from the protocol-root folder. The protocol-root setting must contain a valid path.

(5)

Webserver

The following settings change the way the internal webserver will serve the internal pilight webGUI or it can be disabled altogether.

webgui-websockets

Linux, *BSD, and Windows 1 "webgui-websockets": 1

By default the webGUI communicates to pilight by using websockets. This is a relatively new technique that allows us to receive all changes from pilight instead of having to poll pilight for changes. The problem is that some older devices and browsers do not support websockets, but they do support the polling technique. So to disable the websockets and use polling instead we set webgui-websockets setting to 0. This setting can be either 0 or 1.

webserver-authentication

Linux, *BSD, and Windows no default value

1 "webserver-authentication": [ "username", "password" ] By default, pilight can be controlled from the webGUI by anyone that can access it. If you want to prevent this, you can secure the webGUI with a username and password. The username should be in plain text, the password is SHA256 encrypted. Use pilight-sha256 to create the encrypted password hash. Regular SHA256 encryption tools will not work because pilight hashes the password several thousand times.

So if we want to use a username user and password admin the values should look like this:

1 [ "user", "4f32102debed8dabd87e88cf84c752ccb23a74b29f90b42edde05cbc7be41f80" ]

webserver-cache

Linux, *BSD, and Windows 1 "webserver-cache": 1

pilight has the ability to cache all files used for the webGUI. This reduces the amount of reads done from the SD card on devices like the Raspberry Pi and Hummingboard, and makes it faster to load the webGUI from devices with a slow internal storage such as routers. This setting can be either 0 or 1.

webserver-enable

Linux, *BSD, and Windows 1 "webserver-enable": 1

The pilight webserver can be turned off as a whole. This could be useful if you do not want to use the webGUI at all or if you want to use your own webserver implementation. This setting can be either 0 or 1.

webserver-http-port

Linux, *BSD, and Windows 1 "webserver-http-port": 5001

The pilight webserver runs by default on the non-standard port 5001. This is done to prevent interference with other webservers running on the default HTTP port 80. If you do want to run the webserver on port 80 or any other port, you can change this setting. The port specified must be a valid and unused port.

pi@pilight ~# pilight-sha256 -p admin

(6)

webserver-https-port

Linux, *BSD, and Windows not supported by default

1 "webserver-https-port": 5002

The webserver does not allow secure connections by default. Currently the only way to get HTTPS support is by manually compiling pilight. The pilight secure webserver runs by default on the non-standard port 5002. This is done to prevent interference with other webservers running on the default HTTPS port 443. If you do want to run the secure webserver on port 443 or any other port, you can change this setting. The port specified must be a valid and unused port.

webserver-root

Linux, *BSD, and Windows 1 "webserver-root": "/usr/local/share/pilight/"

The webserver root tells pilight where it should look for all files that should be served by the webserver. This setting must contain a valid path.

webserver-user

Linux *BSD

1 "webserver-user": "www-root" 2 "webserver-user": "www"

The webserver runs by default as a non-root user. This to prevent the execution of malicious code. If you want to force the webserver to run as the root user or any other system user, you can change this setting accordingly. This setting needs to contain a valid system user.

(7)

Firmware

pilight provides an easy tool to flash the firmware of several microcontrollers in the form of pilight-flash. pilight flashes microcontrollers by using either bitbanging or through USB. To use bitbanging we need four GPIOs. These GPIOs are by default configured for usage on a Raspberry Pi. They can however, be changed to other GPIOs according to the device you want to use. Each GPIO is named according to the SPI requirements, but any GPIO can be used because we are not actually using SPI to communicate with our microcontrollers. In pilight the SPI identifiers MISO, MOSI, Reset and SCK are only used to separate the different GPIO.

If you are unsure what valid GPIOs are on your platform, please refer to the http://www.wiringx.org

documentation.

firmware-gpio-miso

Linux and *BSD 1 "firmware-gpio-miso": 13

This setting defines the GPIO pin to be used as MISO. Any valid GPIO for your platform can be used.

firmware-gpio-mosi

Linux and *BSD 1 "firmware-gpio-mosi": 12

This setting defines the GPIO pin to be used as MOSI. Any valid GPIO for your platform can be used.

firmware-gpio-reset

Linux and *BSD 1 "firmware-gpio-reset": 10

This setting defines the GPIO pin to be used as Reset. Any valid GPIO for your platform can be used.

firmware-gpio-sck

Linux and *BSD 1 "firmware-gpio-sck": 14

(8)

SMTP

pilight has the capability to communicate with several types of mail servers. This offers pilight the possibility to use for example mail actions inside our event rules, so email messages can be sent in case of a certain event. Most users will have an email account from their internet hosting provider or free mail solutions can be used like gmail. In case of a (non-existing) gmail account named: pilight@gmail.com with password: foobar, the SMTP settings should be configured like this:

1 "smtp-sender": "pilight@gmail.com", 2 "smtp-host": "smtp.gmail.com", 3 "smtp-port": 465, 4 "smtp-user": "pilight@gmail.com", 5 "smtp-password": "foobar"

smtp-sender

Linux, *BSD, and Windows no default value

1 "smtp-sender": "...@....com"

The smtp-sender requires a valid e-mail address. As soon as a mail is sent by pilight, this e-mail address will be used as the address from with the mail was sent.

smtp-user

Linux, *BSD, and Windows no default value

1 "smtp-user": "...@....com"

The smtp-user requires a valid e-mail address. This e-mail address is used to validate the account details at the e-mail provider.

smtp-password

Linux, *BSD, and Windows no default value

1 "smtp-password": "..."

The password is used to validate the account details at the e-mail provider together with the smtp-user setting. The password should therefore be a valid password for this e-mail account.

smtp-host

Linux, *BSD, and Windows no default value

1 "smtp-host": "smtp.foo.com"

The smtp-host setting should contain a valid mail server host name. Normally, the host name is similar to name of the internet hosting provider.

smtp-port

Linux, *BSD, and Windows no default value

1 "smtp-host": "smtp.foo.com"

The smtp-port should contain a valid smtp server port. This can currently be either 25, 465, or 587. pilight will communicate over a secure connection when using port 465, when using port 25 or 587 it will depend on the server how pilight will set-up the connection.

(9)

Miscellaneous

ntp-servers

Linux, *BSD, and Windows no default value

1 "ntp-servers": [ "eu.pool.ntp.org", "uk.pool.ntp.org" ]

One important feature of any automation setup is the ability to trigger time based actions. However, these events greatly rely on a correct date and time. Problems occur when the system time is not set to the correct time (for our specific timezone). This can happen on systems like the Raspberry Pi which does not have a RTC that allows it to keep track of time when turned off. To overcome this problem pilight has the ability to retrieve the correct time by synchronizing with NTP servers. You can pick any server from

http://www.pool.ntp.org/. Any number of servers can be added to the ntp-servers list. pilight will first try to synchronize with the first server. If this fails it will try the second server etc. It will continue this process until an actual response was received.

References

Related documents