ad2usb plugin discussion

Posted on
Wed Jan 11, 2012 11:29 pm
automaton offline
Posts: 91
Joined: May 23, 2008

Re: ad2usb plugin

Berkinet,

I've noticed that when adding a new zone device in Indigo, the state will be blank until the zone is faulted for the first time. After this, the state of the zone will show clear or faulted, and continues to function OK.

Is this (the initial blank state) the expected behavior?

This is not a big deal for most burglary zones, as you can easily fault most of them. In the case of fire device, it's not as easy. I have many polling loop smoke detectors that can't easily be faulted.

I'm running basic mode, plugin v 9.19.

Posted on
Wed Jan 11, 2012 11:43 pm
berkinet online
User avatar
Posts: 2444
Joined: Nov 18, 2008
Location: Berkeley, CA, USA & Mougins, France

Re: ad2usb plugin

automaton wrote:
...I've noticed that when adding a new zone device in Indigo, the state will be blank until the zone is faulted for the first time. After this, the state of the zone will show clear or faulted, and continues to function OK.

Is this (the initial blank state) the expected behavior?

Yes, this is the expected behavior. The issue is the plugin does not know the state of a zone until it sees a state change. I had not really spent much time worrying about this problem because for alarm zones it was easy enough to just go around faulting the zones as a test.

There are ways to know the state of an alarm zone with certainty even if it has never faulted... the Ready to Arm message is the clue. But for smokes, it is a bit more difficult.

I can have a zone device initially set to Clear, but, I can also add a feature for smokes that when supervision is received, they should be set to clear - that way, smoke zones would go from a null state to clear on the first supervision from the zone. That would work for Wireless smokes. But, do you know if the polling smokes also send supervision?

I will give this some thought and certainly address it once I get the first release finalized - which should be right after Indigo 5.0.3 is released.

Thanks for the post.

EDIT: Beta 0.9.22 contains code to automatically set new zones to a Clear state. See the first post in this thread for more information and a download link.
Last edited by berkinet on Thu Jan 12, 2012 3:59 pm, edited 1 time in total.

Posted on
Thu Jan 12, 2012 3:56 pm
berkinet online
User avatar
Posts: 2444
Joined: Nov 18, 2008
Location: Berkeley, CA, USA & Mougins, France

Beta 0.9.22 Available

Beta release 0.9.22 of the ad2usb plugin is now available on dropbox.

This release fixes all known problems with USB connectivity and provides an updated doc. Support for large panels (Vista-50 and higher), is provisional, some features may not work. This is due to limitations in the ad2usb board that should be addressed soon.

Here are the release notes:
    v 0.9.21 Jan 9, 2012
    Minor cosmetic changes in Advanced zone Device dialog.
    Removed error messages when changing from basic to advanced mode.
    Revised auto config and validation to resolve USB issues..

    v 0.9.22 Jan 12, 2012
  • Added forced reload when mode or interface changes.
  • Fixed a bug in the LRR configuration option.
  • Revised RFX zone state checking to use a full bitmap mask.
  • Added test for new zones to create initial state of Clear.

Depending on feedback, this will probably be the final beta release. Please post or PM any problems.

Posted on
Fri Jan 13, 2012 3:29 pm
automaton offline
Posts: 91
Joined: May 23, 2008

Re: ad2usb plugin

Berkinet,

I installed v0.9.22 and all is well so far. Thanks.

I decided to get around to starting up ser2sock with a LaunchDaemon, instead of an applescript. I used the sample provided with the plugin (by Alistair). My launchDaemon file text is at the bottom in this post.

For some reason, when the launchDaemon is started with Launchctl, I get repeating log entries that look like:

1/13/12 12:13:42 PM com.apple.launchd[1] (com.nutech.ser2sock) Throttling respawn: Will start in 10 seconds
1/13/12 12:13:52 PM com.nutech.ser2sock[2089] ser2sock[2089]: Serial 2 Socket Relay version V1.3 starting
1/13/12 12:13:52 PM com.nutech.ser2sock[2089] ser2sock[2089]: ERROR binding to server portERROR initializing listen socket
1/13/12 12:13:52 PM com.nutech.ser2sock[2089] ser2sock[2089]: :Address already in use
1/13/12 12:13:52 PM com.nutech.ser2sock[2089] ser2sock[2089]: exiting
1/13/12 12:13:52 PM com.apple.launchd[1] (com.nutech.ser2sock[2089]) Exited with exit code: 1
1/13/12 12:13:52 PM com.apple.launchd[1] (com.nutech.ser2sock) Throttling respawn: Will start in 10 seconds

It works just fine starting from an applescript, which looks like this:
do shell script ("/usr/local/bin/ser2sock -p15003 -s/dev/cu.usbserial-A5003uVz -b115200 -d -c -w 5000")

It seems like the LaunchDaemon keeps trying to launch ser2sock over and over, and because it has already started, the port is in use. Does anyone on the forum have any ideas why?

This is on a Mac Mini running Mac OS Server v10.6.8

LaunchDaemon text follows:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Disabled</key>
<true/>
<key>GroupName</key>
<string>wheel</string>
<key>KeepAlive</key>
<true/>
<key>Label</key>
<string>com.nutech.ser2sock</string>
<key>OnDemand</key>
<false/>
<key>ProgramArguments</key>
<array>
<string>/usr/local/bin/ser2sock</string>
<string>-p15003</string>
<string>-s/dev/cu.usbserial-A5003uVz</string>
<string>-b115200</string>
<string>-d</string>
<string>-c</string>
<string>-w</string>
<string>5000</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>ServiceDescription</key>
<string>AD2USB Serial Service</string>
<key>UserName</key>
<string>root</string>
</dict>
</plist>

Posted on
Fri Jan 13, 2012 4:43 pm
berkinet online
User avatar
Posts: 2444
Joined: Nov 18, 2008
Location: Berkeley, CA, USA & Mougins, France

Re: ad2usb plugin

automaton wrote:
...For some reason, when the launchDaemon is started with Launchctl, I get repeating log entries that look like:

1/13/12 12:13:42 PM com.apple.launchd[1] (com.nutech.ser2sock) Throttling respawn: Will start in 10 seconds
1/13/12 12:13:52 PM com.nutech.ser2sock[2089] ser2sock[2089]: Serial 2 Socket Relay version V1.3 starting
1/13/12 12:13:52 PM com.nutech.ser2sock[2089] ser2sock[2089]: ERROR binding to server portERROR initializing listen socket
1/13/12 12:13:52 PM com.nutech.ser2sock[2089] ser2sock[2089]: :Address already in use
1/13/12 12:13:52 PM com.nutech.ser2sock[2089] ser2sock[2089]: exiting
1/13/12 12:13:52 PM com.apple.launchd[1] (com.nutech.ser2sock[2089]) Exited with exit code: 1
1/13/12 12:13:52 PM com.apple.launchd[1] (com.nutech.ser2sock) Throttling respawn: Will start in 10 seconds

It works just fine starting from an applescript, which looks like this:
do shell script ("/usr/local/bin/ser2sock -p15003 -s/dev/cu.usbserial-A5003uVz -b115200 -d -c -w 5000")

It seems like the LaunchDaemon keeps trying to launch ser2sock over and over, and because it has already started, the port is in use. Does anyone on the forum have any ideas why?


What do you see when you do a ps? Try
ps ax|grep ser2sock
while launched is trying to restart the service.

Posted on
Sat Jan 14, 2012 6:13 pm
berkinet online
User avatar
Posts: 2444
Joined: Nov 18, 2008
Location: Berkeley, CA, USA & Mougins, France

Error in ser2sock plist

For those running ser2sock under launchd:

I have found a small error in the ser2sock plist. Because of the way the plist tags are evaluated, the net effect of the error was 0. But, it is best to have it correct. If you have installed the com.nutech.ser2sock.plist you should change it. The corrected version is below.

For those that may be interested, the error was in the string with the "-w" option. That should be a single option, but it was broken into 2 options, as:
    <string>-w</string>
    <string>5000</string>

As noted above, while this would appear as two arguments, they would still be presented to the shell in order and the command would still be evaluated exactly the same.

Here is the code:
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
        <key>Disabled</key>
        <true/>
        <key>GroupName</key>
        <string>wheel</string>
        <key>KeepAlive</key>
        <true/>
        <key>Label</key>
        <string>com.nutech.ser2sock</string>
        <key>OnDemand</key>
        <false/>
        <key>ProgramArguments</key>
        <array>
                <string>/usr/local/bin/ser2sock</string>
      <!-- EDIT THE NEXT LINE IF YOU WISH TO RUN ser2sock ON ANOTHER PORT -->
                <string>-p 15003</string>
      <!-- EDIT THE NEXT LINE FOR YOUR ad2usb's REAL PORT -->
                <string>-s /dev/tty.usbserial-xxxxxxxx</string>
                <string>-b 115200</string>
                <string>-c</string>
                <string>-w 5000</string>
        </array>
        <key>RunAtLoad</key>
        <true/>
        <key>ServiceDescription</key>
        <string>AD2USB Serial Service</string>
        <key>UserName</key>
        <string>root</string>
</dict>
</plist>

Posted on
Sun Jan 29, 2012 6:53 am
philc offline
Posts: 159
Joined: May 17, 2011

Re: ad2usb plugin

Berkinet,
Need your help. I've installed everything and everything is communicating well. However, when I fault devices, I get the following:

Jan 29, 2012 7:37:15 AM
AD2USB Alarm Interface Zone: 16 - Sliding Glass Door state changed to: (Clear) (this is when I opened the door)
AD2USB Alarm Interface Zone: 16 - Sliding Glass Door state changed to: (Clear) (this is when I closed it)

I was having the same problem with the front door, did several restarts/resets/etc, and it started working properly (i.e., fault/clear vice clear/clear). I'm having the above problem with every zone (except the front door for some inexplicable reason). Any ideas?
For further background - ad2usbmonogui shows the fault no problems.
Fantastic work, by the way!
Thanks,
Phil

Posted on
Sun Jan 29, 2012 12:00 pm
berkinet online
User avatar
Posts: 2444
Joined: Nov 18, 2008
Location: Berkeley, CA, USA & Mougins, France

Re: ad2usb plugin

philc wrote:
...when I fault devices, I get the following:
AD2USB Alarm Interface Zone: 16 - Sliding Glass Door state changed to: (Clear) (this is when I opened the door)
AD2USB Alarm Interface Zone: 16 - Sliding Glass Door state changed to: (Clear) (this is when I closed it)...

Hmmm. Well, let's start with some information:
    Which panel?
    Which version of the plugin (if not the latest, 0.9.22, you should upgrade - there have been some recent bug fixes)?
    Which plugin mode: Basic or Advanced?
    Are you using zone doubling on the main board?
    Which ad2usb firmware are you running?

Then, could you also take a sample of the message stream from a telnet session.
    From a terminal window telnet to the port you are running ser2sock. Something like:
      telnet 127.0.0.1 15003
    then enter "V" followed by a return. You will get something like:
      !VER:000004d4,V2.2a.5-beta12,TX;RX;SM;VZ;RF;ZX;RE;AU;3X;CG;DD;MF
    Then, enter "C" and return. Depending on your firmware version, you may get something like:
      !CONFIG>ADDRESS=17&CONFIGBITS=0000&LRR=N&EXP=NNNNY&REL=YYYY&MASK=ffffffff&DEDUPLICATE=Y
    And then let go fault and restore the front door and one or two zones that are showing the problem.
    Copy that session and paste it back here to this forum topic.

Hopefully this information will let us pin down the cause of the problem

Posted on
Sun Jan 29, 2012 2:31 pm
philc offline
Posts: 159
Joined: May 17, 2011

Re: ad2usb plugin

Thanks.

Panel - Vista 21IP
Plugin Version - 0.9.22
Plugin Mode - Advanced
Zone Doubling - No
AD2USB firmware - 2.2a.5 beta 12 (latest available on the website.

I can telnet to the board no problem, but the commands V and C do nothing. The ! command works, so I'm able to communicate to the board. I've turned on deduplicate in the plugin.

Let me know what else you need. I'll keep trying to capture a stream.
Phil

Posted on
Sun Jan 29, 2012 3:18 pm
berkinet online
User avatar
Posts: 2444
Joined: Nov 18, 2008
Location: Berkeley, CA, USA & Mougins, France

Re: ad2usb plugin

philc wrote:
...I can telnet to the board no problem, but the commands V and C do nothing. The ! command works, so I'm able to communicate to the board. I've turned on deduplicate in the plugin....

Its odd that the V and C commands do not work. Did you remember to press return after each one?

In any case, you can still get an event trace that should help figure out the problem. If you continue to have no luck with the telnet session, you might try using the log tab in the monogui client. You cannot copy and paste from the log, but you can select and then drag the contents to another window. You can also try sending the V and C commands from the log tab. Click the Custom button and then enter V (or C) and click Ok.

Posted on
Mon Jan 30, 2012 5:14 pm
philc offline
Posts: 159
Joined: May 17, 2011

Re: ad2usb plugin

Berkinet,
Will get back to you - v and c aren't working from monogui either. I think I need to rollback the FTDI driver and reinstall...
Will let you know what happens.
Phil

Posted on
Mon Jan 30, 2012 5:22 pm
berkinet online
User avatar
Posts: 2444
Joined: Nov 18, 2008
Location: Berkeley, CA, USA & Mougins, France

Re: ad2usb plugin

Are you using capital letters... V and C ?

Posted on
Mon Jan 30, 2012 6:06 pm
philc offline
Posts: 159
Joined: May 17, 2011

Re: ad2usb plugin

...and all was revealed! Capitals...who knew...

BTW, I rolled back the firmware on the AD2USB to the latest production version (vice beta). And ignore the Check 103 line - I have the GSM module but haven't gotten it activated yet.

Below is the paste from the telnet session, and below that is the paste from the concurrent Indigo Event Log:

Last login: Sun Jan 29 19:49:34 on ttys000
server:~ Thibodeaux$ telnet 127.0.0.1 15003
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
!SER2SOCK Connected
!SER2SOCK SERIAL_CONNECTED
[1000000100000010----],0bf,[f700000510bf001208020000000000],"CHECK 103 LngRngRadio 0005"
[1000000100000000----],008,[f70000051008001c08020000000000],"****DISARMED**** Ready to Arm "
[1000000100000010----],0bf,[f700000510bf001208020000000000],"CHECK 103 LngRngRadio 0005"
V
!VER:000006a1,V2.2a.4,TX;RX;SM;VZ;RF;ZX;RE;AU;3X;CG;DD;MF
C
!>
!CONFIG>ADDRESS=18&CODE=0000&LRR=N&EXP=NNNNN&REL=NNNN&MASK=ffffffff&DEDUPLICATE=N
[1000000100000000----],008,[f70000051008001c08020000000000],"****DISARMED**** Ready to Arm "
[1000000100000010----],0bf,[f700000510bf001208020000000000],"CHECK 103 LngRngRadio 0005"
[1000000100000000----],008,[f70000051008001c08020000000000],"****DISARMED**** Ready to Arm "
[1000000100000010----],0bf,[f700000510bf001208020000000000],"CHECK 103 LngRngRadio 0005"
[1000000100000000----],008,[f70000051008001c08020000000000],"****DISARMED**** Ready to Arm "
!RFX:0625539,80
!AUI:1606000000006063024543f531fb456cf5ec01020105
[0000000100000000----],016,[f70000051016000008020000000000],"FAULT 16 GLASS DOOR "
!RFX:0625539,00
!AUI:1606000000006263024543f531fb456cf5ec01010105
[1000000100000010----],0bf,[f700000510bf001208020000000000],"CHECK 103 LngRngRadio 0005"
!RFX:0625539,80
[0000000100000000----],016,[f70000051016000008020000000000],"FAULT 16 GLASS DOOR "
!AUI:1606000000006463024543f531fb456cf5ec01020105
!RFX:0625539,00
!AUI:1606000000006663024543f531fb456cf5ec01010105
[1000000100000010----],0bf,[f700000510bf001208020000000000],"CHECK 103 LngRngRadio 0005"
[1000000100000000----],008,[f70000051008001c08020000000000],"****DISARMED**** Ready to Arm "
[1000000100000010----],0bf,[f700000510bf001208020000000000],"CHECK 103 LngRngRadio 0005"
[1000000100000000----],008,[f70000051008001c08020000000000],"****DISARMED**** Ready to Arm "
[1000000100000010----],0bf,[f700000510bf001208020000000000],"CHECK 103 LngRngRadio 0005"

Indigo Event Log

Jan 30, 2012 7:02:56 PM

AD2USB Alarm Interface Zone: 16 - Sliding Glass Door state changed to: (Clear)
AD2USB Alarm Interface Zone: 16 - Sliding Glass Door state changed to: (Clear)
AD2USB Alarm Interface Zone: 16 - Sliding Glass Door state changed to: (Clear)
AD2USB Alarm Interface Zone: 16 - Sliding Glass Door state changed to: (Clear)

Posted on
Mon Jan 30, 2012 6:49 pm
berkinet online
User avatar
Posts: 2444
Joined: Nov 18, 2008
Location: Berkeley, CA, USA & Mougins, France

Re: ad2usb plugin

philc wrote:
...and all was revealed! Capitals...who knew...
...
!RFX:0625539,80
[0000000100000000----],016,[f70000051016000008020000000000],"FAULT 16 GLASS DOOR "
!RFX:0625539,00
[1000000100000000----],008,[f70000051008001c08020000000000],"****DISARMED**** Ready to Arm "
...


Ok! :D It looks like you just have the wireless device set to the wrong loop - It should be on loop 2, and I think you have it on loop 1. Change that and I think it will start showing the faults.

philc also wrote:
...BTW, I rolled back the firmware on the AD2USB to the latest production version (vice beta). And ignore the Check 103 line - I have the GSM module but haven't gotten it activated yet.

While you are waiting for the GSM module to be activated, you can squash those error messages by telling the ad2usb to emulate an LRR. Either use the plugin config pane, or in the ad2usb telnet session use the "!" config mode or just enter CLRR=Y<return>

Just remember to set it back to N when you are ready to get the GSM module working.

BTW: If you reinstall the latest beta, you can kill the AUI messages by setting CONFIGBITS=0000 (CCONFIGBITS=0000<return>) But, since that is the default, you don't need to do anything. I'd also suggest setting DEDUPLICATE to Yes (CDEDUPLICATE=Y<return>). There was a bug in the earlier ad2usb firmware that kept the plugin from correctly setting that, so you may need to do it via telnet.

Posted on
Mon Jan 30, 2012 7:09 pm
philc offline
Posts: 159
Joined: May 17, 2011

Re: ad2usb plugin

Dude, you are the man! Really appreciate the plugin, and for you taking the time to work with a numpty like me to get things working correctly. Keep it up - and if you ever set up a "donate" button on a website somewhere to keep your bar stocked, let me know...

Page 5 of 30 1, 2, 3, 4, 5, 6, 7, 8 ... 30

Who is online

Users browsing this forum: No registered users and 1 guest