We have moved at community.getvera.com

Author Topic: [_CODE_] ActiveRFID Plugin  (Read 40139 times)

Offline guessed

  • Community Beta
  • Master Member
  • ******
  • Posts: 5301
  • Karma: +92/-22
  • Release compat is not a bolted-on afterthought
Re: [_CODE_] ActiveRFID Plugin
« Reply #15 on: July 27, 2010, 02:50:14 pm »
This particular WIZnet (WIZ110SR) is for wired Ethernet-to-RS232....  there are others that'll do Wireless (WIZ6000) althought I haven't tried them and, pricing wise, they're about the same as buying the equivalent iTach Wifi RS232.

Offline shady

  • Hero Member
  • *****
  • Posts: 1331
  • Karma: +11/-0
  • This monkey knows his Window Coverings!
Re: [_CODE_] ActiveRFID Plugin
« Reply #16 on: July 27, 2010, 04:19:13 pm »
Thank you, I couldn't find that exact part number on their website for clarification.
Vera3 1.5.346, Schlage (3)DB (2)Lever, Kwikset (1)Lever, RCS TZ43 Thermo, (2) Vizia RZI06-1LX 600W Dimmers, (17) Monster (Leviton) Dimmers (6) Monster (Leviton) IWC Scene Controllers (1) Etherrain-8, (3) HSM 100's (1)GE 3-Way set

Offline woodsby

  • Beta Testers
  • Sr. Member
  • *****
  • Posts: 466
  • Karma: +1/-0
Re: [_CODE_] ActiveRFID Plugin
« Reply #17 on: July 27, 2010, 08:42:11 pm »
IMHO, I'm a little uncomfortable using the wired version, since it introduces another point of failure, especially if you're not plugging the wiznet directly into a Vera eth port... I certainly wouldn't want to use a wifi connection for this. I have the wiznet working and I am testing. I will say that putting the receiver on the back wall of the garage made range worse, probably  due to the metal garage door. I will try to move it to the garage ceiling by the opener and see if it improves this.
On a different note, I have found a couple bugs, that I cannot intentionally reproduce. First, it seems that the "incoming" function (serial incoming) seems to start running before the startup function completes. @guessed (or anyone else), can you confirm if this happens with any of your plugins. One of the first statements in my startup function is to create a variable RFID_Data equal to "". In the "incoming" function, I concatenate this variable with the next character received. I get an occasional error in the log that it's trying to concatenate a nil value.
Second, I think very occasionally, it doesn't correctly enumerate child devices, and one of my child devices isn't indexed properly, so a new device is created.
I can fix the first issue with two lines of code, but it seems dumb to try to fix it instead of posting a bug report, if it is in fact happening.
The second, I can also fix by re-enumerating the child devices before adding new children, but I'll spend a little more time trying to identify the problem.
Vera1 (1.1142), Vera2 (1.1182), VRI06 (12), VRS15 (3), VRS05 (2), VRF01 (2), VRCS4 (2), ZRW113, ZRF113 (2), 45602, 45603, TZMT400 (2), FE599 (2), 99100, Thinkstick, Harmony 890Pro (2), Harmony RF Extender, Nevo S70, Nevo NC-50, Minimote, SQ Remote, SQ Blaster, EtherRain-8, Cliste ActiveRFID, TED5002

Offline guessed

  • Community Beta
  • Master Member
  • ******
  • Posts: 5301
  • Karma: +92/-22
  • Release compat is not a bolted-on afterthought
Re: [_CODE_] ActiveRFID Plugin
« Reply #18 on: July 27, 2010, 09:02:34 pm »
It's possible, but it would be unlikely I'd run into that case as each of my components [generally] will only tell me something (via <incoming>) when I ask them to send me something.

The Alarm Panel is a little different, but someone would have to Open a Window Zone and/or Move in a Motion Sensor Zone during startup for me to see that behavior. Well, ok, Technically my Onkyo amp could as well, but I dont implement anything meaningful in it's incoming block.

You'll want to open a Ticket for that, since it really shouldn't ever do that until the initializer is complete.

In the meantime, default the "local" to "" at the top, outside of all the functions....



Offline Ap15e

  • Beta Testers
  • Hero Member
  • *****
  • Posts: 1998
  • Karma: +12/-0
Re: [_CODE_] ActiveRFID Plugin
« Reply #19 on: July 28, 2010, 01:21:32 pm »
@woodsby

Yes, I can confirm that the 'incoming' function gets called before the startup function completes. IIRC, my 'solution' was to move the code that instructs my external device (a Squeezebox Server) to send bytes to Vera to the end of the startup function.

We should file a bug report/feature request.
« Last Edit: July 28, 2010, 01:23:09 pm by Ap15e »

Offline guessed

  • Community Beta
  • Master Member
  • ******
  • Posts: 5301
  • Karma: +92/-22
  • Release compat is not a bolted-on afterthought
Re: [_CODE_] ActiveRFID Plugin
« Reply #20 on: July 31, 2010, 06:37:16 pm »
@woodsby,
I haven't tried this so, take this with a grain of salt, but it may also be possible to use luup.io.intercept() to block the <incoming> calls until your startup/initialization method is finished.

It would have to be the "very first" command in your initializer, and there's still a small window of opportunity for something to slip by.  What I don't know is whether the IO ops are "queued" during this, or "dropped", so you'd need to experiment.

Offline woodsby

  • Beta Testers
  • Sr. Member
  • *****
  • Posts: 466
  • Karma: +1/-0
Re: [_CODE_] ActiveRFID Plugin
« Reply #21 on: August 30, 2010, 05:04:38 pm »
Been a while since I've been on - I have to say after about a month of leaving the plugin alone, it has worked flawlessly with a non-RSSI receiver plugged directly into vera1 using UI4.  I have not modified the code recently, but hope to get back to it soon.  I will test for 1 month using the modified RSSI receiver (modified to include a wiz110sr) and post results then.  FYI, I have posted a picture of the modified receiver housing opened up.

@guessed - when I get time to get back to coding, I will try this... or i might use the easy way out and set a variable to 0 at line 1 of startup code and to 1 at the end of the startup code, and look for 1 in the incoming function. Create yet another global variable, but it works... and what's one more anyway?

@shady - did you order hardware?
Vera1 (1.1142), Vera2 (1.1182), VRI06 (12), VRS15 (3), VRS05 (2), VRF01 (2), VRCS4 (2), ZRW113, ZRF113 (2), 45602, 45603, TZMT400 (2), FE599 (2), 99100, Thinkstick, Harmony 890Pro (2), Harmony RF Extender, Nevo S70, Nevo NC-50, Minimote, SQ Remote, SQ Blaster, EtherRain-8, Cliste ActiveRFID, TED5002

Offline santakrooz

  • Jr. Member
  • **
  • Posts: 90
  • Karma: +0/-0
Re: [_CODE_] ActiveRFID Plugin
« Reply #22 on: September 25, 2010, 01:39:16 pm »
Thanks Woodsby. I'm very interested in this solution. Definitely where I want to go with my system. What is the difference between RSSI and non-RSSI? I see they offer both at Cliste.
VeraLite UI7 fw v1.7.830 / Kwikset Deadbolt / Express Controls EZMotion HSM100x3 / Monster IWD600Sx4 / Monster AVL300 / Wayne Dalton KEP-IV / Wayne Dalton WDHA-12R / Wayne Dalton WDRR-372R / GE 45603 Dimmers / Nest Thermostat

Offline woodsby

  • Beta Testers
  • Sr. Member
  • *****
  • Posts: 466
  • Karma: +1/-0
Re: [_CODE_] ActiveRFID Plugin
« Reply #23 on: September 26, 2010, 06:52:02 am »
The RSSI receiver provides signal strength with every transmission in the form of a 2-3 digit number that I have seen range from about 70 thru 120. I was originally thinking I'd do something with this information in the plugin, but I've started thinking I might not.
It seems the 40m transmitters work better with the non-RSSI receiver and it seems that the keychains work better with the RSSI receiver, but it could just be me.
@Santakrooz, please note that this is still a "beta" plugin, so don't jump in head-first. I would appreciate the help in testing/refining the plugin.

To follow up on my last post, it seems the modified rssi/wiznet device doesn't work as well for two reasons - first, the data seems to "back up" occasionally, so a car won't read as being gone until a while after - in this scenario, if I telnet into it, it'll dump all the backed up data on the screen. I'll play around with the wiznet software and see if there's something there. The second problem with this config is that the receiver doesn't seem to get enough power from the wiznet, so signal strength suffers. I'll try powering this separately and see if it helps.  That said, the garage door opens about 95% of the time when I get home, closes about 85% of the time when I leave, and false trips about once a week at 45sec delay. The failed open/close, I attribute to lost zwave commands and backed up serial/telnet communication. The false trips are probably due to the low power to the board - I determined this by using the rssi info.
Next, I am going to try plugging directly into another computer and use serproxy and see if that works better than the wiznet combo.
« Last Edit: September 26, 2010, 07:06:34 am by woodsby »
Vera1 (1.1142), Vera2 (1.1182), VRI06 (12), VRS15 (3), VRS05 (2), VRF01 (2), VRCS4 (2), ZRW113, ZRF113 (2), 45602, 45603, TZMT400 (2), FE599 (2), 99100, Thinkstick, Harmony 890Pro (2), Harmony RF Extender, Nevo S70, Nevo NC-50, Minimote, SQ Remote, SQ Blaster, EtherRain-8, Cliste ActiveRFID, TED5002

Offline santakrooz

  • Jr. Member
  • **
  • Posts: 90
  • Karma: +0/-0
Re: [_CODE_] ActiveRFID Plugin
« Reply #24 on: September 29, 2010, 04:01:46 pm »
Thanks Woodsby. I would like to know when the cars leave and arrive the house. But for people, I'm most interested in using RFID for Keyfob triggering the Kwikset lock. The 8 meter transmitters I don't think will work for that. Any ideas on how to use ActiveRFID for a keyfob swipe? Do I just need to get lower powered RFID receiver/tags such as http://cgi.ebay.com/125kHz-RFID-USB-ID-Reader-10-Keyfob-Tag-10-Card-/280564479343?pt=LH_DefaultDomain_0&hash=item4152f2356f#ht_2650wt_914
VeraLite UI7 fw v1.7.830 / Kwikset Deadbolt / Express Controls EZMotion HSM100x3 / Monster IWD600Sx4 / Monster AVL300 / Wayne Dalton KEP-IV / Wayne Dalton WDHA-12R / Wayne Dalton WDRR-372R / GE 45603 Dimmers / Nest Thermostat

Offline woodsby

  • Beta Testers
  • Sr. Member
  • *****
  • Posts: 466
  • Karma: +1/-0
Re: [_CODE_] ActiveRFID Plugin
« Reply #25 on: September 29, 2010, 05:02:35 pm »
For the cars, you will probably need active RFID. For the keyfobs, those are passive RFID, which means they are powered off the RF signal from the receiver. You may be able to work a passive RFID system for your cars, but you'd have to do something similar to department stores that tag all their products.
Vera1 (1.1142), Vera2 (1.1182), VRI06 (12), VRS15 (3), VRS05 (2), VRF01 (2), VRCS4 (2), ZRW113, ZRF113 (2), 45602, 45603, TZMT400 (2), FE599 (2), 99100, Thinkstick, Harmony 890Pro (2), Harmony RF Extender, Nevo S70, Nevo NC-50, Minimote, SQ Remote, SQ Blaster, EtherRain-8, Cliste ActiveRFID, TED5002

Offline guessed

  • Community Beta
  • Master Member
  • ******
  • Posts: 5301
  • Karma: +92/-22
  • Release compat is not a bolted-on afterthought
Re: [_CODE_] ActiveRFID Plugin
« Reply #26 on: September 29, 2010, 05:23:57 pm »
@woodsby, you might want to have something poll Vera to see of it's responding at the times where you're seeing failures.  And by Poll, I mean calling Lu_status over a URL, not just a ping (which will give you false availability data)

The only time I've seen things backup like you describe is when Vera detects a problem and auto-restarts itself.  During these times you'll see significant delays

Offline santakrooz

  • Jr. Member
  • **
  • Posts: 90
  • Karma: +0/-0
Re: [_CODE_] ActiveRFID Plugin
« Reply #27 on: September 29, 2010, 07:09:24 pm »
For the cars, you will probably need active RFID. For the keyfobs, those are passive RFID, which means they are powered off the RF signal from the receiver.

thx. is there a known passive RFID reader that works with Vera?
VeraLite UI7 fw v1.7.830 / Kwikset Deadbolt / Express Controls EZMotion HSM100x3 / Monster IWD600Sx4 / Monster AVL300 / Wayne Dalton KEP-IV / Wayne Dalton WDHA-12R / Wayne Dalton WDRR-372R / GE 45603 Dimmers / Nest Thermostat

Offline woodsby

  • Beta Testers
  • Sr. Member
  • *****
  • Posts: 466
  • Karma: +1/-0
Re: [_CODE_] ActiveRFID Plugin
« Reply #28 on: December 14, 2010, 07:34:56 pm »
I committed a new version of the imp file today. The core code is totally redesigned.  Rather than starting a call_timer for every transmission received, I store the expire time for each transmission, and then run one repeating call_delay every 3 seconds to check for expired transmissions (untrip the "sensors").  This seems to be much more vera-friendly and seems to be working great now.
Vera1 (1.1142), Vera2 (1.1182), VRI06 (12), VRS15 (3), VRS05 (2), VRF01 (2), VRCS4 (2), ZRW113, ZRF113 (2), 45602, 45603, TZMT400 (2), FE599 (2), 99100, Thinkstick, Harmony 890Pro (2), Harmony RF Extender, Nevo S70, Nevo NC-50, Minimote, SQ Remote, SQ Blaster, EtherRain-8, Cliste ActiveRFID, TED5002

Offline woodsby

  • Beta Testers
  • Sr. Member
  • *****
  • Posts: 466
  • Karma: +1/-0
Re: [_CODE_] ActiveRFID Plugin
« Reply #29 on: December 21, 2010, 04:01:13 pm »
Just an update... Thanks to @Guessed and @Ap15e, I have committed a version of this plugin I feel really comfortable with.  Still looking for testers, but if nobody's interested, I'm happy using it in my house anyway.

Thanks again @Guessed and @Ap15e...
Vera1 (1.1142), Vera2 (1.1182), VRI06 (12), VRS15 (3), VRS05 (2), VRF01 (2), VRCS4 (2), ZRW113, ZRF113 (2), 45602, 45603, TZMT400 (2), FE599 (2), 99100, Thinkstick, Harmony 890Pro (2), Harmony RF Extender, Nevo S70, Nevo NC-50, Minimote, SQ Remote, SQ Blaster, EtherRain-8, Cliste ActiveRFID, TED5002