Hi,
I work with a Tellstick Duo + Raspberry (server web php mysql).
I am trying to build a XPL hub, each time device/sensor change status, I send an xpl trigger message on the network.
To do it I use an infinity loop with a sleep function to check status every seconde.
while($flagtellstick) {
$mapDevice = array_filter(explode("\n", shell_exec('"' . $this->tdtoolpath . '" --list-devices')));
$mapSensor = array_filter(explode("\n", shell_exec('"' . $this->tdtoolpath . '" --list-sensors')));
$mapDevice = array_map(function($val){ return explode("\t", $val); }, $mapDevice);
$mapSensor = array_map(function($val){ return array_slice(explode("\t", $val), 0, -2); }, $mapSensor);
$currentMap = array_merge($mapDevice, $mapSensor);
unset($mapDevice);
unset($mapSensor);
/*
compare new data to old data ...
*/
...
sleep(1)
}
After working about 2 hours the raspberry colapse (processus delldusd takes too much resources).
Do you have any idea to fixe that issue ?
THanks in advance.
Sevy
---------------------------
spanaer.com
TellStick Duo - memory leak ?
Moderator: Telldus
Re: TellStick Duo - memory leak ?
Haven't tried the duo with a raspi, but can't you write it with the telldus core script hooks. I do something similar with the sensor events over to MQTT that way.
Re: TellStick Duo - memory leak ?
Thanks for your rely Zapper,
I have tested my software on Windows as well and I get the same issue.
After about 2 hours the tellstick Duo return an empty array.
I didn't know for the script hooks on telldus core.
My software is fully PHP, multi-plateformes and I wish to keep it like that.
Tellstick Duo doesn't seem to work well when a lot queries (one every second) are sent throw the "tdtool".
Any idea will wellcome.
Software is here:
http://spanaer.com
I have tested my software on Windows as well and I get the same issue.
After about 2 hours the tellstick Duo return an empty array.
I didn't know for the script hooks on telldus core.
My software is fully PHP, multi-plateformes and I wish to keep it like that.
Tellstick Duo doesn't seem to work well when a lot queries (one every second) are sent throw the "tdtool".
Any idea will wellcome.
Software is here:
http://spanaer.com