User Tools

Site Tools


This is an old revision of the document!

Upcoming Changes, Features and Fixes


"datetime": {
            "name": "Datum en Tijd",
            "protocol": [ "datetime" ],
            "id": [{
                "longitude": "53.XXXXXXXXXX",
                "latitude": "5.XXXXXXXXXX"
            "year": 2014,
            "month": 3,
            "day": 26,
            "hour": 23,
            "minute": 10,
            "second": 36

A protocol to execute a shell command!


Setting “sender”: or “receiver”: to -1 disables a pin.

1. This commit changes the webserver-username, webserver-password and the webserver-authentication to a single webserver-authentication setting. Instead of enabling the webserver authentication by setting the webserver-authentication setting to one, and then seperately defining the username and password for authentication, the webserver-username and webserver-password have been merged into the webserver-authentication setting. This means you now enable the webserver authentication as follows:

“webserver-authentication”: [ “username”, “password” ]

2. Before this commit, all PHP scripts were ran with root privileges. Of course, this is a great security risk. This commit changes the user the webserver runs at to www-data. A new setting has been introduced to be able to change this user:

“webserver-user”: “www-data”

Previously, pilight generated the UUID by using the mac address of (one of) the wired network adapters. Almost all mainboards have at least of one such network adapters present, except the Raspberry Pi model A. So we need a different method to generate a fixed unique ID for all pilight instances.

This new code will use the Rasbperry Pi's serial number retrieved from /proc/cpuinfo so we can also generate a UUID on model A boards. It will also dynamically retrieve network adapters and use one of them to build a UUID based on its mac address.

The old device specific settings were difficult to understand and not very clear in their naming. This commit drops the settings object you had to add to each device to change it's settings. Instead, all device specific settings are now just parameters just like the device it's own parameters.

Old situation:

"rpi": {
	"name": "Rasp. Temp.",
	"protocol": [ "rpi_temp" ],
	"id": [{
		"id": 1
	"temperature": 43312,
	"settings": {
		"interval": 10

New situation:

"rpi": {
	"name": "Rasp. Temp.",
	"protocol": [ "rpi_temp" ],
	"id": [{
		"id": 1
	"temperature": 43312,
	"poll-interval": 10,
	"gui-decimals": 2

The following new settings are supported:

Weather Stations / Sensors

  • device-decimals
  • device-temperature-offset
  • device-humidity-offset
  • poll-interval
  • gui-decimals
  • gui-show-temperature
  • gui-show-humidity
  • gui-show-battery

Contacts / Switches / Dimmers / Screens

  • gui-readonly


  • dimlevel-maximum
  • dimlevel-minimum

New features of pilight can break existing apps and plugins. By introducing the developmental version string in the version array, apps developers can implement support for each of these versions, or let users know a newer version is not yet supported.

1) All memory leaks when running the main daemon are fixed.

2) Made all threaded functions platform independent.

3) Nearly all threads will now gracefully close instead of being forced to. To allow this, some changes were made: - The socket select function needed to be woken up so it stopped blocking the execution of a thread. To allow this, several loopback connection were made to send a single bit to the socket connection when a specific library is garbage collecting. - All mutexes are unlocked and thread conditions are signaled to continue execution.

4) Some thread helper functions have been added to the protocol library. This makes protocol writing easier. It also allows threads to gracefully stop like described in point 3.

5) A special garbage collector function was added to the protocol library. When the protocols are freed the protocol specific “gc” function is called first. This allows protocols to free their local resources first. This function will only be called when it's initialized.

Install php to use this new change.(apt-get install php5-cgi)

Rewrote socket library so we don't need to use the normal and big buffer sizes. pilight can know handle socket messages of any size. Please notice that this commit will break all externally developed apps. Please check the various language examples to. see how the new implementation works.

Until pilight 2.1 two fixed socket buffers were used. One with the size of 1024 bytes and one with the size of 102400 bytes. This distinction has been dropped.

pilight will now send all streams in 1024 chunks. If these streams are shorter than 1024, everything was sent at once. If a stream is 1024 bytes, then you'll know it's a chunk of a bigger stream. In that case, read until you encounter the end of streams delimiter which is currently made up of two new lines \n\n.

If multiple streams were buffered somewhere, you can also distinct them by the double new line delimiters. An example:

{"message": "test"}\n\n
{"message": "test"}\n\n
{"message": "test"}\n\n

As you can see. pilight wanted to send three messages, but the TCP sockets concencated them to one.

The pilight socket_read function takes care of these buffered messages to check if we encountered concencated multiple streams. pilight will then convert these messages back so the output is just big stream separated by single newlines:

{"message": "test"}\n
{"message": "test"}\n
{"message": "test"}\n

You can check the various code example for more clarity.

Fixes & improvements

changes_features_fixes.1396029943.txt.gz · Last modified: 2015/11/27 21:08 (external edit)