User Tools

Site Tools


changes_features_fixes

This is an old revision of the document!


Upcoming Changes, Features and Fixes

Features

Changes

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

Dimmers

  • 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.1394309927.txt.gz · Last modified: 2015/11/27 21:08 (external edit)