We have moved at community.getvera.com

Author Topic: AD2USB over network / ethernet  (Read 17909 times)

Offline hugheaves

  • Full Member
  • ***
  • Posts: 241
  • Karma: +11/-0
AD2USB over network / ethernet
« on: August 21, 2014, 10:42:20 am »
I recently moved my Vera Lite to a location that doesn't have access to my alarm bus wiring. Rather than rewire, I decided to use an extra Raspberry Pi as a USB to ethernet bridge, and then patched the AD2USB plug-in to communicate over the network to the Raspberry Pi  / AD2USB. (All credit goes to @futzle for the code to make this work - the patch was almost a straight cut and paste job from the Caddix plugin)

My alarm  system connection now looks like this:

[Vista 20P]   <---Alarm Bus--->   [AD2USB]   <---USB--->   [Raspberry Pi ]  <---Ethernet---> [Vera Lite]

Everything's been up and running for a couple of weeks now without any issues.

To set this up, I had to install ser2net on the Raspberry Pi. As I'm running Raspbian, I just used apt to install the package:

Code: [Select]
# apt-get install ser2net

Once ser2net was installed, I added a line to /etc/ser2net.conf to make the AD2USB available over the network:

Code: [Select]
9999:raw:600:/dev/ttyUSB0:115200 8DATABITS NONE 1STOPBIT

On the Vera side,  once running the patched AD2USB plugin, I set the IP address of my raspberry Pi, and the port number from the ser2net config above in the IP address field of the plug-in configuration. I also needed to clear the "IODevice" field. See the attached screenshots showing where to set these values.

I've attached a patched L_VistaAlarmPanel1.lua (and a patch file) below. If anyone else gives this a try, upload the L_VistaAlarmPanel1.lua to your Vera, and let me know if it works.

Note that the patched file is for UI5 only. I don't have a UI4 device to develop or test with.

Hugh
« Last Edit: September 04, 2014, 08:05:31 am by hugheaves »
The HA "collection" so far: MiCasaVerde: 1x VeraLite, RTCOA: 3x 3M-50, GE: 1x 45606, 3x 45613, 5x 54614, Kwikset: 1x 99100-004, Intermatic: 6x CA3000, 6x CA600, 8x HA01, 2x HA02, 12x HA03, 2x HA04, 3x HA05,  6x HA07, 7x HA09, Honeywell: 1x Vista 20P, NuTech: 1x AD2USB

Offline pentium

  • Full Member
  • ***
  • Posts: 198
  • Karma: +11/-0
Re: AD2USB over network / ethernet
« Reply #1 on: August 21, 2014, 12:36:13 pm »
This is awesome.  Thank you so much for sharing. 

If I could ask one more thing.  I have the vista 20 p, the ad2usb, and the veralite.  What else would I have to buy to do this.  And by that I am requesting any model number or source or identifying information that I would need to duplicate your system.  Would I need to program the raspberry? 

Offline hugheaves

  • Full Member
  • ***
  • Posts: 241
  • Karma: +11/-0
Re: AD2USB over network / ethernet
« Reply #2 on: August 21, 2014, 02:02:33 pm »
This is awesome.  Thank you so much for sharing. 

If I could ask one more thing.  I have the vista 20 p, the ad2usb, and the veralite.  What else would I have to buy to do this.  And by that I am requesting any model number or source or identifying information that I would need to duplicate your system.  Would I need to program the raspberry?

You'd just need a raspberry pi board, and possibly a USB power supply, SD card, and case if you don't already have them. The raspberry pi can be found many places for around $35. Googling will show up sources for a case as well.

It's very easy to setup / program. More information is on the official website:

http://www.raspberrypi.org/

If you're going to buy one, I'd recommend getting the "B+" model, which is the latest version. It fixes some power supply issues that the older models suffered from.

Once you have one, there are a number of other "automation" tasks you can do with it. I use mine to control a sprinkler system as well.
« Last Edit: August 21, 2014, 02:08:47 pm by hugheaves »
The HA "collection" so far: MiCasaVerde: 1x VeraLite, RTCOA: 3x 3M-50, GE: 1x 45606, 3x 45613, 5x 54614, Kwikset: 1x 99100-004, Intermatic: 6x CA3000, 6x CA600, 8x HA01, 2x HA02, 12x HA03, 2x HA04, 3x HA05,  6x HA07, 7x HA09, Honeywell: 1x Vista 20P, NuTech: 1x AD2USB

Offline pentium

  • Full Member
  • ***
  • Posts: 198
  • Karma: +11/-0
Re: AD2USB over network / ethernet
« Reply #3 on: August 22, 2014, 05:41:37 pm »
thank you again, please stay tuned.  I have a raspberry kit on the way that will be here sunday.  hoping to have this working by the next friday.  if you think of any tips or tricks, please feel free to load me up before i start.

Offline pentium

  • Full Member
  • ***
  • Posts: 198
  • Karma: +11/-0
Re: AD2USB over network / ethernet
« Reply #4 on: August 24, 2014, 07:26:17 pm »
I received my new PI, and followed your instructions.  It was easier than I thought.

My problem right now is that there is nothing on the screen when i choose to set the serial configuration.

Also when it is rebooting, it says that the alarm connection is down.

I think I am really close and just need a way to input the information into the serial configuration screen that was there when it was connected directly.

Regarding the lua file that you attached, i downloaded it, and then went to the luup files option, and uploaded the file.  Not sure if i selected reload, so i went back and did that.

Any suggestions?

Offline xuniman

  • Sr. Newbie
  • *
  • Posts: 36
  • Karma: +0/-1
Re: AD2USB over network / ethernet
« Reply #5 on: September 03, 2014, 08:18:35 pm »
I have a similar setup with a AD2USB plugged into the USB port of a Raspberry PI and the Pi on my network. I was able to get the Vera3 to see the PI by loading ser2net on the Pi using hugheaves instructions in this post.

My one problem was that even when using the modified lua file I wasn't able to get the Vera to see the pi on the ip:port. I needed to go into my serial setup field and enter the Raspberry Pi ip:port (and the 115200,N,8,1) into the GC100 serial port information section that was created when I added a GC100 unit to the system. The Vera3 doesn't actually talk to the GC100 serial port, it goes directly the the ser2net connection on the pi and all of the communications work.

I don't know if you can install the GC100 app on a Vera3 without actually having the device. If it's possible that would solve the issue of needing to have the USB port active.

Offline hugheaves

  • Full Member
  • ***
  • Posts: 241
  • Karma: +11/-0
Re: AD2USB over network / ethernet
« Reply #6 on: September 04, 2014, 07:50:14 am »
I received my new PI, and followed your instructions.  It was easier than I thought.

My problem right now is that there is nothing on the screen when i choose to set the serial configuration.

Also when it is rebooting, it says that the alarm connection is down.

I think I am really close and just need a way to input the information into the serial configuration screen that was there when it was connected directly.

Regarding the lua file that you attached, i downloaded it, and then went to the luup files option, and uploaded the file.  Not sure if i selected reload, so i went back and did that.

Any suggestions?

Hey pentium. Very sorry for the late reply. I didn't get notice that you'd responded to this thread.

I've added a couple of screen shots to the first post that should help. You've got to set the IP address / port and also clear the "IODevice" field in the advanced settings.

Give that a try, and let me know if that fixes it for you.

Hugh
The HA "collection" so far: MiCasaVerde: 1x VeraLite, RTCOA: 3x 3M-50, GE: 1x 45606, 3x 45613, 5x 54614, Kwikset: 1x 99100-004, Intermatic: 6x CA3000, 6x CA600, 8x HA01, 2x HA02, 12x HA03, 2x HA04, 3x HA05,  6x HA07, 7x HA09, Honeywell: 1x Vista 20P, NuTech: 1x AD2USB

Offline hugheaves

  • Full Member
  • ***
  • Posts: 241
  • Karma: +11/-0
Re: AD2USB over network / ethernet
« Reply #7 on: September 04, 2014, 07:59:07 am »
I have a similar setup with a AD2USB plugged into the USB port of a Raspberry PI and the Pi on my network. I was able to get the Vera3 to see the PI by loading ser2net on the Pi using hugheaves instructions in this post.

My one problem was that even when using the modified lua file I wasn't able to get the Vera to see the pi on the ip:port. I needed to go into my serial setup field and enter the Raspberry Pi ip:port (and the 115200,N,8,1) into the GC100 serial port information section that was created when I added a GC100 unit to the system. The Vera3 doesn't actually talk to the GC100 serial port, it goes directly the the ser2net connection on the pi and all of the communications work.
they'
I don't know if you can install the GC100 app on a Vera3 without actually having the device. If it's possible that would solve the issue of needing to have the USB port active.

xuniman,

Thanks for the feedback. I'm guessing what happened was that the AD2USB plugin may have still had an "IODevice" set in it's configuration, even though it was using the IP address / port. I haven't tried it, but if you configured an IO Port in the GC10 plugin, it may have "grabbed" the port settings from the AD2USB plugin and cleared them.

In reality, you can forget about the GC100. All you have to do is clear the "IODevice" field in the advanced settings of the AD2USB plugin.

Hugh
The HA "collection" so far: MiCasaVerde: 1x VeraLite, RTCOA: 3x 3M-50, GE: 1x 45606, 3x 45613, 5x 54614, Kwikset: 1x 99100-004, Intermatic: 6x CA3000, 6x CA600, 8x HA01, 2x HA02, 12x HA03, 2x HA04, 3x HA05,  6x HA07, 7x HA09, Honeywell: 1x Vista 20P, NuTech: 1x AD2USB

Offline roquej

  • Sr. Newbie
  • *
  • Posts: 35
  • Karma: +0/-0
Re: AD2USB over network / ethernet
« Reply #8 on: September 04, 2014, 08:48:39 am »
Works!!  Thank you! 

JR

Offline xuniman

  • Sr. Newbie
  • *
  • Posts: 36
  • Karma: +0/-1
Re: AD2USB over network / ethernet
« Reply #9 on: September 05, 2014, 11:54:16 am »
Yes, the IO port has been cleared and I no longer need the GC100 entry for the communications to work. Thanks for the plug in modifications.

Offline kevinnutech

  • Jr. Member
  • **
  • Posts: 55
  • Karma: +2/-0
Re: AD2USB over network / ethernet
« Reply #10 on: September 05, 2014, 04:05:49 pm »
Just a note from us at Nu Tech/AlarmDecoder:   You are able to use ser2sock from our raspberry pi image with the ser2net connection from the Vera.  To achieve this, you run ser2sock in raw device mode (via configuration file or -0 on command line).   Benefits of ser2sock over ser2net is multiple connection support - so many devices can connect in and use the AD2 device with ser2sock.

Offline chasiu

  • Jr. Member
  • **
  • Posts: 67
  • Karma: +0/-0
Re: AD2USB over network / ethernet
« Reply #11 on: September 25, 2014, 03:22:26 pm »
Has anyone noticed the Pin Code not being saved after a reboot?  I don't recall having to enter it in again after rebooting the Vera before I loaded the patch L_VistaAlarmPanel1.lua. 

Can I try this with UI7?  I couldn't use the AD2USB before with UI7 because I couldn't get the serial port to configure.  But now it is using network I thought maybe it may work.  Will the patch work with UI7 or can anyone make a modified patch?

Offline pentium

  • Full Member
  • ***
  • Posts: 198
  • Karma: +11/-0
Re: AD2USB over network / ethernet
« Reply #12 on: September 25, 2014, 03:25:26 pm »
Just in case it applies, i have this in my startup lua, changing the xxxx with my actual pin number.  and the device number replacing my 34.

luup.call_action("urn:micasaverde-com:serviceId:VistaAlarmPanel1", "StorePinCode", "xxxx", 34)

Offline chasiu

  • Jr. Member
  • **
  • Posts: 67
  • Karma: +0/-0
Re: AD2USB over network / ethernet
« Reply #13 on: September 25, 2014, 03:31:09 pm »
So do I click on Edit Startup Lua and enter the code and hit GO?  And is the device number the keypad number?

Just in case it applies, i have this in my startup lua, changing the xxxx with my actual pin number.  and the device number replacing my 34.

luup.call_action("urn:micasaverde-com:serviceId:VistaAlarmPanel1", "StorePinCode", "xxxx", 34)

Offline pentium

  • Full Member
  • ***
  • Posts: 198
  • Karma: +11/-0
Re: AD2USB over network / ethernet
« Reply #14 on: September 25, 2014, 03:38:53 pm »
The device number is the number assigned to your device ademco vista partion 1.  look on the left in the advanced tab.

i think the answer to the other question is yes.  i didn't remember the go part, but pretty sure the save button will light up and you will need to click that.  Then refresh your browser.