Best practise to check if Tellstick Duo is still connected?

Moderator: Telldus

Post Reply
polarlight
Posts: 4
Joined: Fri Mar 17, 2023 9:45 am
Location: Finland

Best practise to check if Tellstick Duo is still connected?

Post by polarlight »

hi,

I have Tellstick Duo with TuxRail v2.0 single board computer running Debian Squeeze
(armel architecture, ARM9 core @450MHz). My telldus core version is 2.1.1 and it is installed using
package manager (not built from sources). I am using only Nexa 433.92MHz
devices (PIR sensors, remote controllable sockets, remote controllers..).

I currently have some issue which may not be related to Tellstick Duo at all, but
for some reason sometimes my own software (C-code) using telldus core API
"looses contact" with the the Tellstick i.e. no RF events are received when I know there
should be them.
When I then test the system from commandline tool 'tdtool' it reports
error message "Tellstick not found".

Here is partial /var/log/user.log possibly related to the issue:
Apr 12 19:11:22 tuxrail telldusd: Received SIGPIPE signal.
Apr 12 19:59:54 tuxrail telldusd: TellStick query: Error in communication with TellStick, resetting USB
Apr 12 19:59:59 tuxrail telldusd: Disconnected TellStick (1781/C31) with serial A600JMQW
Apr 12 20:00:00 tuxrail smsd: Writing stats file 120412.200000
Apr 12 20:39:00 tuxrail telldusd: Trying to execute action, but no controller found. Rescanning USB ports
Apr 12 20:39:01 tuxrail telldusd: No contoller (TellStick) found after one retry. Giving up.
Apr 12 21:00:00 tuxrail smsd: Writing stats file 120412.210000
Apr 12 21:30:00 tuxrail telldusd: Trying to execute action, but no controller found. Rescanning USB ports
Apr 12 21:30:01 tuxrail telldusd: No contoller (TellStick) found after one retry. Giving up.
Apr 12 21:30:02 tuxrail telldusd: Trying to execute action, but no controller found. Rescanning USB ports
Apr 12 21:30:03 tuxrail telldusd: No contoller (TellStick) found after one retry. Giving up.
Apr 12 21:49:33 tuxrail telldusd: Trying to execute action, but no controller found. Rescanning USB ports
Apr 12 21:49:34 tuxrail telldusd: No contoller (TellStick) found after one retry. Giving up.
Apr 12 21:50:15 tuxrail telldusd: Received SIGTERM or SIGINT signal.
Apr 12 21:50:15 tuxrail telldusd: Shutting down
Apr 12 21:50:24 tuxrail telldusd: telldusd daemon exited
Apr 12 21:50:25 tuxrail telldusd: telldusd daemon starting up
Apr 12 21:50:40 tuxrail telldusd: Trying to execute action, but no controller found. Rescanning USB ports
Apr 12 21:50:41 tuxrail telldusd: No contoller (TellStick) found after one retry. Giving up.
Apr 12 21:51:38 tuxrail telldusd: Trying to execute action, but no controller found. Rescanning USB ports
Apr 12 21:51:39 tuxrail telldusd: No contoller (TellStick) found after one retry. Giving up.
Apr 12 21:52:00 tuxrail telldusd: Trying to execute action, but no controller found. Rescanning USB ports
Apr 12 21:52:01 tuxrail telldusd: No contoller (TellStick) found after one retry. Giving up.
Apr 12 21:52:18 tuxrail telldusd: Trying to execute action, but no controller found. Rescanning USB ports
Apr 12 21:52:19 tuxrail telldusd: No contoller (TellStick) found after one retry. Giving up.
Apr 12 21:54:02 tuxrail telldusd: Trying to execute action, but no controller found. Rescanning USB ports
Apr 12 21:54:03 tuxrail telldusd: No contoller (TellStick) found after one retry. Giving up.
Apr 12 21:55:47 tuxrail telldusd: Trying to execute action, but no controller found. Rescanning USB ports
Apr 12 21:55:48 tuxrail telldusd: No contoller (TellStick) found after one retry. Giving up.
Apr 12 21:58:41 tuxrail shutdown[9641]: shutting down for system reboot
Apr 12 21:58:45 tuxrail telldusd: Received SIGTERM or SIGINT signal.
Apr 12 21:58:45 tuxrail telldusd: Shutting down
Apr 12 21:58:53 tuxrail telldusd: telldusd daemon exited
Apr 12 22:03:01 tuxrail smsd: Writing stats file 700101.030000


The best and final solution is to find the real problem for this, but meanwhile
what would be the best practice to test if tellstick is still present ?
Can this info be got from source code API? What function/what return value?
(remember most of the time the software is just waiting for callback events
and not actively calling any functions)

My current way of handling this is using crontab for sending message to
non-existent (dummy) RF socket every 5 minutes, but I don't like this
since it causes my house to send a steady radio beacon and because it
can cause interference so that some other control signal may not reach
their destination when this test is reserving the air time.
(BTW, related to some other signal transmission blocking another
I have asked Nexa if their devices have collision avoidance i.e.
RF-level RX/TX capability in each device whether at device-level
it is a "receiver" or "sender" but at least the person replying me could not
say for sure, except that he "believed" so.).
---------
DreamPlug*2/Debian Squeeze (ARM9) , TuxRail*1/Debian Squeeze (ARM9), Win7 Ultimate 64-bit @Intel Core i7-980x, GA-X58A-UD7, 12GB DDR3, Intel510 250GB SSD, AMD HD 6990, 2TB WDGreen HD, APC SmartUPS 1500VA, 27"ACER LED, ...
micke.prag
Site Admin
Posts: 2243
Joined: Fri Mar 17, 2023 9:45 am
Location: Lund
Contact:

Re: Best practise to check if Tellstick Duo is still connect

Post by micke.prag »

From version 2.1.2 there will be an API for listing connected controllers.
polarlight wrote:I have asked Nexa if their devices have collision avoidance i.e.
RF-level RX/TX capability in each device whether at device-level
it is a "receiver" or "sender" but at least the person replying me could not
say for sure, except that he "believed" so.).
No, they have not. The remote controls doesn't contain any receiver, only transmitter.
Micke Prag
Software
Telldus Technologies
polarlight
Posts: 4
Joined: Fri Mar 17, 2023 9:45 am
Location: Finland

Re: Best practise to check if Tellstick Duo is still connect

Post by polarlight »

Thanks for information, Micke!

In addition to the new API func, I suggest you would put this checking available into tdtool executable also, so that it would return well checkable error code/errno/"errorlevel" (for shell scripting) when the list of controllers is queried and none is found..or if it suits better, it could also return value could directly indicate the number of controllers found.

For example I have various system checks and their corrective or alarm invocation actions implemented as crontab (bash) shell scripts in my home automation system:
- is the Tellstick (Duo) and telldusd ok (RF-controller interface - internal comms.)
- is the internet connection alive (Internet IP-interface - external comms1.)
- is the Gsm/sms interface alive (Gsm/sms- interface - external comms2)
- etc
---------
DreamPlug*2/Debian Squeeze (ARM9) , TuxRail*1/Debian Squeeze (ARM9), Win7 Ultimate 64-bit @Intel Core i7-980x, GA-X58A-UD7, 12GB DDR3, Intel510 250GB SSD, AMD HD 6990, 2TB WDGreen HD, APC SmartUPS 1500VA, 27"ACER LED, ...
micke.prag
Site Admin
Posts: 2243
Joined: Fri Mar 17, 2023 9:45 am
Location: Lund
Contact:

Re: Best practise to check if Tellstick Duo is still connect

Post by micke.prag »

tdtool already returns the errorcode from telldus-core.
Micke Prag
Software
Telldus Technologies
Post Reply