Notice: This forum has been recovered from an old backup, so some content, links, and dates may be outdated. The forum is currently read-only while we restore sign-in and registration functionality. Details

If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.

RFXtrx

Questions and comments specific to a particular plugin should go here.
Mastiff
Experienced User
Posts: 872
Joined: Thu May 03, 2012 10:43 am

Re: RFXtrx

Post by Mastiff »

Krambriw, I have a problem. In both my home and cabin setup I sometimes (maybe once a month, maybe a bit less) have the RFXtrx fail (maybe because I'm running a virtual machine, I don't know). Yesterday it hapened just after we went to bed, and at the moment my home office (which should be a nice 20 degrees by 08) is around 17 degrees. The bloody annoying thing is that I was half awake and just restarted EG without noting what lines the error came in! I only saved "22:30:15 Exception in thread RFXtrxThread:" :oops: But I'm pretty sure the reason is a drop in contact with the RFXtrx, which is connected to the host and then connected to the virtual machine. I am going to change that so I use an USB over TCPIP instead, I've hard that it is more reliable. I have set it to log to a file now. But after the restart I suddenly started getting this:

Code: Select all

09:42:53   RFXtrx.Type: Viking 02811 id: 28416 ' temperature: +18.5 deg C signal: 6 battery: 9'
09:42:53         Temperaturstyring av ovner
09:42:53            Kjellerkontor.: Temperatur: 18.5, termostatmodus: 1, termostattemperatur: 22, tidspunkt: Kl. 09:42, den 10.02.
09:42:53            Decoding of message failed: ['08', '50', '07', '1c', '6f', '00', '00', 'b9', '69']
Do you have any idea what this can be? One more restart didn't help, but a third helped. I'm running the last version of the plug-in and the 83 version of the RFX firmware. I'm guessing this is some kind of result of the dropout last night, but I can't really imagine how, since it took three restarts of EG to get it away.
Mastiff
Experienced User
Posts: 872
Joined: Thu May 03, 2012 10:43 am

Re: RFXtrx

Post by Mastiff »

It came back after a while as well, so I have now restarted the VM instad of just EG. I hope that will help.
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: RFXtrx

Post by krambriw »

For some reason the decoding of the correct message failed

If I try your message it gets decoded correctly in my environment (in the plugin there is an action where you can test messages)

This action with your message
Skärmklipp.PNG
gets decoded to this

Code: Select all

13:50:58   RFXtrx.Type: Viking 02811 id: 28416 ' temperature: +18.5 deg C signal: 6 battery: 9'
Since you also had a crash in a thread I will double check if it could be an issue in the code, otherwise we just have to wait and see if it comes back and then eventually can capture the error messages. You could add Pako's eminent Log redirector plugin just to be sure the log is not lost
Mastiff
Experienced User
Posts: 872
Joined: Thu May 03, 2012 10:43 am

Re: RFXtrx

Post by Mastiff »

Eminent plug-in installed and activated, sir! (Note how I handle your seniority with discipline! :lol: ) I'll let you know if it happens again. But I'm quite certain that the reason is a glitch in the connection to the RFXtrx. The thing I don't understand is why the problem appears again after restarts of EG, and only dissappears for good (well, so far, so good) after a full reboot of the VM. Can that be something in the RFXtrx driver that's messed up in memory and needs the full reboot?

Oh, and if you look at the coding corner I have asked for help on an addition to my otherwise perfectly running heater control script! So if you have a few spare minutes I would appreciate it!
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: RFXtrx

Post by krambriw »

:D great

There is now a new version of the plugin available. This version has improved monitoring of the connection status with the RFXtrx device.

Generates an event if connection is lost. If you test it by disconnecting the RFXtrx from the computer, you get a nasty error exception from the serial port module in EG but the RFXtrx plugin survives. Disabling/enabling of the plugin should be enough to recover once the device is correctly re-connected and recognized by the operating system.

So basically, you could define a macro with two actions to try to recover automatically.
Skärmklipp.PNG
Skärmklipp.PNG (5.15 KiB) Viewed 4954 times
When I tried it here it worked fine, I disconnected the device, the plugin detects the problem, generates the event, the macro runs and tries to re-establish connection. This continues until (hopefully) the device is re-connected and then everything is working again
Mastiff
Experienced User
Posts: 872
Joined: Thu May 03, 2012 10:43 am

Re: RFXtrx

Post by Mastiff »

Brilliant, thanks! I'll test that later today, at the moment I am doing some hardware mods (cables and stuff that needed to be tidied up).
Mastiff
Experienced User
Posts: 872
Joined: Thu May 03, 2012 10:43 am

Re: RFXtrx

Post by Mastiff »

I tested it now. I don't think it works as intended, but at least I think I got the same error message that I got last night and discovered this morning:

Code: Select all

17:37:10   Exception in thread RFXtrxThread:
17:37:10   Traceback (most recent call last):
17:37:10     File "threading.pyc", line 532, in __bootstrap_inner
17:37:10     File "threading.pyc", line 484, in run
17:37:10     File "C:\Program Files (x86)\EventGhost\plugins\RFXtrx\__init__.py", line 752, in ReceiveThread
17:37:10       while self.serial.inWaiting() > 0 and not self.hold:
17:37:10     File "C:\Program Files (x86)\EventGhost\eg\WinApi\serial\serialwin32.py", line 202, in inWaiting
17:37:10       flags, comstat = win32file.ClearCommError(self.hComPort)
17:37:10   error: (5, 'ClearCommError', 'Ingen tilgang.')
17:37:10   
17:37:13   System.DeviceRemoved [u'\\\\?\\FABULATECH#USBDev#4d75a2352a675dd59f73827cfb192c6c#{a5dcbf10-6530-11d2-901f-00c04fb951ed}']
But I don't see any event with lost connction with the RFX.
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: RFXtrx

Post by krambriw »

But I don't see any event with lost connction with the RFX.
Hmm, maybe the thread crashed in another section then what I was expecting.

Did you wait at least a minute after the crash to check that no event was generated?
Mastiff
Experienced User
Posts: 872
Joined: Thu May 03, 2012 10:43 am

Re: RFXtrx

Post by Mastiff »

About ten... Didn't want to repeat the silly mistake this morning. Seems like I can provoke it by disconnecting the RFXtrx from the VM, while it's connected to the host. But I'm about to change that, I'm moving it to an USB over TCPIP unit.
Mastiff
Experienced User
Posts: 872
Joined: Thu May 03, 2012 10:43 am

Re: RFXtrx

Post by Mastiff »

Tried again just now. Five minutes, and no event. Except for the "lost contact" events from sensors starting to come in. Doing the reset plugin thing didn't change anything either (note I disconnected the RFX from the USB port in the host and then cleared the log so I could see at once if something was generated):

Code: Select all

18:45:33   ---> Welcome to EventGhost <---
18:45:40   System.ClipboardChanged
18:46:35   System.Idle
18:47:16   System.UnIdle
18:49:24   System.Idle
18:49:24   System.UnIdle
18:49:40      Disable: Plugin: RFXtrx
18:49:40         Stopping and disconnecting the RFXtrx device...please wait
18:49:40         Date & Time thread ended
18:49:40         Keep Alive thread ended
18:49:40         Error starting plugin: RFXtrx
18:49:40         Traceback (most recent call last) (1691):
18:49:40           File "C:\Program Files (x86)\EventGhost\eg\Classes\PluginInstanceInfo.py", line 209, in Stop
18:49:40             self.instance.__stop__()
18:49:40           File "C:\Program Files (x86)\EventGhost\plugins\RFXtrx\__init__.py", line 574, in __stop__
18:49:40             self.serial.close()
18:49:40           File "C:\Program Files (x86)\EventGhost\eg\WinApi\serial\serialwin32.py", line 189, in close
18:49:40             win32file.SetCommTimeouts(self.hComPort, self._orgTimeouts)
18:49:40         error: (5, 'SetCommTimeouts', 'Ingen tilgang.')
18:49:40      Enable: Plugin: RFXtrx
18:49:40         Error starting plugin: RFXtrx
18:49:40         Can't open serial port!
18:50:10   Main.'Lost contact with sensor: Type: Viking 02811 id: 65024'
18:50:19   Main.'Lost contact with sensor: Type: Viking 02811 id: 62208'
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: RFXtrx

Post by krambriw »

Seems like I can provoke it by disconnecting the RFXtrx from the VM, while it's connected to the host. But I'm about to change that, I'm moving it to an USB over TCPIP unit.
Unfortunately I think the problem will still be there...once the com-port is opened you will probably get this error message when disconnecting regardless if the port is local or virtual
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: RFXtrx

Post by krambriw »

I have made a small correction, can you try the new current version?

Strangely enough, it is working fine for me. I test like this:

1) EG starts and plugin receives events, working normal

2) I disconnect the RFXtrx and receive this error message instantly
Skärmklipp.PNG
3) After a while (within a minute) I receive the following in the log
Skärmklipp1.PNG
4) It gets repeated as long as the device is gone
Skärmklipp2.PNG
Skärmklipp2.PNG (9.26 KiB) Viewed 4939 times
5) I connect the RFXtrx and wait

....see next post (can only upload 3 pictures per posting)
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: RFXtrx

Post by krambriw »

6) Within a minute I see this in the log
Skärmklipp3.PNG
7) Now RFXtrx works normal again, happy ending
Mastiff
Experienced User
Posts: 872
Joined: Thu May 03, 2012 10:43 am

Re: RFXtrx

Post by Mastiff »

And we're all for happy endings! :lol: Sure, downloading and testing. But I have changed the setup like I said, I have moved the RFX to an USB over TCPIP box (the same one I use at the cabin for the Tellstick). I'll let you know when I have tested.
Mastiff
Experienced User
Posts: 872
Joined: Thu May 03, 2012 10:43 am

Re: RFXtrx

Post by Mastiff »

Sorry, but no.

Code: Select all

20:35:50   RFXtrx.Type: Viking 02811 id: 57088 ' temperature: +22.1 deg C signal: 6 battery: 9'
20:35:50         Temperaturstyring av ovner
20:35:50            Hjornesoverom.: Temperatur: 22.1, termostatmodus: 1, termostattemperatur: 21, tidspunkt: Kl. 20:35, den 10.02.
20:35:50            
20:36:09   Exception in thread RFXtrxThread:
20:36:09   Traceback (most recent call last):
20:36:09     File "threading.pyc", line 532, in __bootstrap_inner
20:36:09     File "threading.pyc", line 484, in run
20:36:09     File "C:\Program Files (x86)\EventGhost\plugins\RFXtrx\__init__.py", line 752, in ReceiveThread
20:36:09       while self.serial.inWaiting() > 0 and not self.hold:
20:36:09     File "C:\Program Files (x86)\EventGhost\eg\WinApi\serial\serialwin32.py", line 202, in inWaiting
20:36:09       flags, comstat = win32file.ClearCommError(self.hComPort)
20:36:09   error: (5, 'ClearCommError', 'Ingen tilgang.')
20:36:09   
20:36:16   System.DeviceRemoved [u'\\\\?\\USB#Vid_0403&Pid_6001#AEVD61QP#{a5dcbf10-6530-11d2-901f-00c04fb951ed}']
20:39:08   System.ClipboardChanged
Btw should I have an action in the tree activating this function?
Post Reply