Tellstick Duo resources

Moderator: Telldus

MartinV
Posts: 277
Joined: Thu Jan 18, 2018 11:08 am
Contact:

Re: Tellstick Duo resources

Post by MartinV » Thu Jan 18, 2018 11:08 am

micke.prag wrote:[...]What was the purpose by installing 2.0.3?
The only purpose with installing 2.0.3 was to use both the standard Tellstick and the Duo in the same environment (and get the bug fixes in 2.0.3).
Martin | http://www.switchking.se
Testa Switch King Pro i din Android/iPhone/iPod: http://www.switchking.se/sv/demo

micke.prag
Site Admin
Posts: 2242
Joined: Thu Jan 18, 2018 11:08 am
Location: Lund
Contact:

Re: Tellstick Duo resources

Post by micke.prag » Thu Jan 18, 2018 11:08 am

2.0.102 will probably include the same bugfixes as 2.0.3.
Micke Prag
Software
Telldus Technologies

MartinV
Posts: 277
Joined: Thu Jan 18, 2018 11:08 am
Contact:

Re: Tellstick Duo resources

Post by MartinV » Thu Jan 18, 2018 11:08 am

micke.prag wrote:2.0.102 will probably include the same bugfixes as 2.0.3.
Downloaded 2.0.102 today.

The first thing I noted was that Telldus Center seems more responsive. When clicking fast on "Turn on"/"Turn off", the relay in the outlet reacts quicker than before. Toggling is quicker...
I'm running in a virtual environment, so it can be due to that - but still!

The second, and most important thing, is that Callbacks now seem to work in C#. I don't know if I had a problem with the previous installation, or if the new version contains some fixes that works better in C# environment, but I now get both callbacks for both RawEvents and DeviceEvents - excellent!

I've only been testing it for like half an hour, but so far so good! :clap:
Martin | http://www.switchking.se
Testa Switch King Pro i din Android/iPhone/iPod: http://www.switchking.se/sv/demo

micke.prag
Site Admin
Posts: 2242
Joined: Thu Jan 18, 2018 11:08 am
Location: Lund
Contact:

Re: Tellstick Duo resources

Post by micke.prag » Thu Jan 18, 2018 11:08 am

The code behind the callbacks got a huge cleanup and partly a rewrite between 2.0.101 and 2.0.102. Thanks to Walter Krämbring for pointing out some bugs.
I am really glad that it is working better!

One thing though I forgot to mention in the email. The signature for the raw-callback has changed. It now has an extra parameter to tell you which Duo sent the event.
Micke Prag
Software
Telldus Technologies

krambriw
Posts: 654
Joined: Thu Jan 18, 2018 11:08 am

Re: Tellstick Duo resources

Post by krambriw » Thu Jan 18, 2018 11:08 am

Hi everybody,

I don't know, still looking if I made something wrong myself but I'm not that lucky. It doesn't work for me any longer

Here is a first report:
- as long as only deviceRawEventCallback's are coming in (received) for UNCONFIGURED devices, it continues to work
- as soon as the first deviceEventCallback or deviceChangeEventCallback for a CONFIGURED device is received, further communication with the service stops
- after this, telldus center and any other application using the service needs to be terminated and the service restarted

Kind regards, Walter

Vista Home, flashed the Duo succesfully

krambriw
Posts: 654
Joined: Thu Jan 18, 2018 11:08 am

Re: Tellstick Duo resources

Post by krambriw » Thu Jan 18, 2018 11:08 am

A suggestion for weather station support could be like the following

- support events coming from the sensors/devices for temperature & humidity like this from a UPM device

Code: Select all

07:34:47   Main.UPM|HCode|8|DCode|3|Temp Celsius (°C)|22.75|RH%|59|BWarn|0
- support events coming from sensors/detectors for rain level & wind gauge
- current rain level in mm
- calculated rain levels (could be done in Telldus Center) RainLastHour, RainPreviousHour, RainToday, RainYesterday,
RainLastWeek

- current WindDirection in degrees 0-360
- calculated (could be done in Telldus Center) current WindDirection ('N', 'NNE', 'NE', 'ENE', 'E', 'ESE', 'SE', 'SSE', 'S', 'SSW', 'SW', 'WSW', 'W', 'WNW', 'NW', 'NNW'), WindDirectionPrevious, WindSpeed, WindSpeedAverage_15, WindSpeedAverage_60

The ability to allow to set trig levels for temp/humidity/wind/rain in Telldus center would make it possible to control many things connected (if temp is below xy turn device ON) etc

On the other hand, this might be better to handle in HA applications like Switch King, Homeseer or EventGhost

Best regards, Walter

MartinV
Posts: 277
Joined: Thu Jan 18, 2018 11:08 am
Contact:

Re: Tellstick Duo resources

Post by MartinV » Thu Jan 18, 2018 11:08 am

krambriw wrote:[...]
- as long as only deviceRawEventCallback's are coming in (received) for UNCONFIGURED devices, it continues to work
- as soon as the first deviceEventCallback or deviceChangeEventCallback for a CONFIGURED device is received, further communication with the service stops
- after this, telldus center and any other application using the service needs to be terminated and the service restarted
After some more testing, I'd like to add some things to my brief report...

krambriw says that there is a problem with running Telldus Center at the same time as an application using the callbacks. I can confirm this as well.
If I start my application and register for callbacks and then start Telldus Center, it takes a minute or so for Telldus Center to start and when TC is started, it's got an empty list of devices.

However... If I configure my devices in Telldus Center, closes TC and then start my application, I have no problems catching both device events and raw events. They keep coming in as they are picked up by the Duo, and I can - for example - get callbacks for different devices to the deviceEventCallback method.

The callbacks seems rather slow after a while. It can take a few seconds from that the green light on the Duo flashes until the callback event is received.

Worth noting is that I don't use a struct as parameter to my DeviceEvent callback. I use the following instead:

Code: Select all

void DeviceEvent_Occured(int deviceId,int method,string data,int callbackId, IntPtr context)
I don't really know if this has something to do with that I've got it working or not, but it might be something to try...
Martin | http://www.switchking.se
Testa Switch King Pro i din Android/iPhone/iPod: http://www.switchking.se/sv/demo

micke.prag
Site Admin
Posts: 2242
Joined: Thu Jan 18, 2018 11:08 am
Location: Lund
Contact:

Re: Tellstick Duo resources

Post by micke.prag » Thu Jan 18, 2018 11:08 am

Thank you both for this. We will look into this!
Micke Prag
Software
Telldus Technologies

MartinV
Posts: 277
Joined: Thu Jan 18, 2018 11:08 am
Contact:

Re: Tellstick Duo resources

Post by MartinV » Thu Jan 18, 2018 11:08 am

I'm having some problems with some of the calls to TelldusCore. I don't know if the problems are limited to this version, but anyway:

I try to do some adding and removal of devices (Win Server 2008 x64). The calls made directly after the service starts seem to work, but after running my application (only limited to the calls below) a few times, the service stops responding and I can see that the registry doesn't get populated with new entries.
Each call hangs a few seconds and then moves on to the next (no devices added or removed).

What I'm after is the following:

Code: Select all

tdAddDevice
tdAddDevice
tdRemoveDevice
I've tested surrounding the calls with tdInit and tdClose - both the whole block and also each call separately.
If I init and close between each call (which shouldn't be necessary):

Code: Select all

tdInit
tdAddDevice
tdClose

tdInit
tdAddDevice
tdClose

tdInit
tdRemoveDevice
tdClose
...the second call to tdAddDevice throws an exception from TelldusCore:

Code: Select all

Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
Am I doing the right thing here, or am I missing something?

(I've got a very faded memory that the problem doesn't exist in 32 bit environment - at least the exception...)
Martin | http://www.switchking.se
Testa Switch King Pro i din Android/iPhone/iPod: http://www.switchking.se/sv/demo

micke.prag
Site Admin
Posts: 2242
Joined: Thu Jan 18, 2018 11:08 am
Location: Lund
Contact:

Re: Tellstick Duo resources

Post by micke.prag » Thu Jan 18, 2018 11:08 am

tdInit should be called as soon as possible in the beginning of the application startup. tdClose should be the last call to any functions in TelldusCore. Several calls to these functions is not supported. Please note that all callbacks must be cleared (with tdUnregisterCallback) before tdClose.

The bugs you are experiencing are probably in TelldusCore. We still have some problems with the communication between TelldusCore and TelldusService to sort out, before even thinking about stabilizing this into 2.1... :?

Please continue these reports, it is a key for us to find the bugs.
Micke Prag
Software
Telldus Technologies

krambriw
Posts: 654
Joined: Thu Jan 18, 2018 11:08 am

Re: Tellstick Duo resources

Post by krambriw » Thu Jan 18, 2018 11:08 am

Test under WinXP (32 Bit)

Try this:
- start Telldus Center and it works fine, status changes are updated quickly if you use a remote to control devices
- exit Telldus Center
- start Telldus Center again (without restarting the Telldus service)
- status changes updates are very very slow

Try this:
- restart Telldus service to make it "fresh"
- start EventGhost (EG) with my Tellstick Duo plugin
- change status of devices with remote and everything is working fast and fine, events are shown in EG
- start Telldus Center
- status changes are shown in both
- exit Telldus Center
- events are not shown in EG no more or it gets very very slow

Try this:
- restart Telldus service to make it "fresh"
- start EventGhost (EG) with my Tellstick Duo plugin
- disable the Tellstick duo plugin
- enable it again and you get the following errors in the log

Code: Select all

09:25:30   Error starting plugin: TellStickDuo
09:25:30   Traceback (most recent call last) (1397):
09:25:30     File "C:\Program Files\EventGhost\eg\Classes\PluginInstanceInfo.py", line 176, in Start
09:25:30       self.instance.__start__(*self.args)
09:25:30     File "C:\Program Files\EventGhost\plugins\TellStickDuo\__init__.py", line 94, in __start__
09:25:30       self.callbackId_0 = self.dll.tdRegisterDeviceEvent(self.deviceEventProc, 0)
09:25:30   WindowsError: exception: access violation writing 0x00000005
It seems that handles to callback functions or to the service is not released correctly (I'm guessing)

Here is the link to my updated EG plugin (you need to configure it, delete the old from tree first)
http://sto.hopto.org:8080/SM/TellStickDuo.zip


Best regards, Walter

micke.prag
Site Admin
Posts: 2242
Joined: Thu Jan 18, 2018 11:08 am
Location: Lund
Contact:

Re: Tellstick Duo resources

Post by micke.prag » Thu Jan 18, 2018 11:08 am

Thank you so much for this!
Micke Prag
Software
Telldus Technologies

MartinV
Posts: 277
Joined: Thu Jan 18, 2018 11:08 am
Contact:

Re: Tellstick Duo resources

Post by MartinV » Thu Jan 18, 2018 11:08 am

krambriw wrote: [...]

Code: Select all

09:25:30   WindowsError: exception: access violation writing 0x00000005
[...]
Looks like the same exception I'm getting (earlier in the thread). Not exactly the same text, but close enough...
Unreleased handles be the cause of the problem I have as well since the exception show up after I surround multiple subsequent calls with tdInit and tdClose.
Martin | http://www.switchking.se
Testa Switch King Pro i din Android/iPhone/iPod: http://www.switchking.se/sv/demo

Post Reply