PDA

View Full Version : Global Cache Flex w/Relay & Sensor cable



caseyp
April 12th, 2016, 02:40 PM
Hi Ron or anyone else that can help,
Since I didn't have any luck with the Wayne Dalton Homelink bridge I posted on previously I'm taking a different approach. I just received a Global Cache Flex with a Relay & Sensor cable. I'm wanting to attach the sensors to a garage door opener receiver I have so I can detect the contact closure from each of the 3 channels the receiver has. Adding the flex device to the Device Manager when in IR mode brings up the device tree with IR 1:1 below. Setting it to Relay/Sensor mode or Serial mode brings up nothing underneath the device. So I decided to try SimpleTransport and while I can send commands to actuate each relay and poll each sensor I cannot seem to get any sensor feedback without polling. The problem with polling is that the garage door receiver relay isn't going to be closed very long so polling would likely miss it and if I'm polling fairly quickly I'd think I'd be flooding my network, especially when I'm polling 3 different sensors. Any input would be greatly appreciated. The following links will give some info on the product and it's protocols.

The flex (I have the WiFi version): http://www.globalcache.com/products/itachflex/
The relay & sensor cable: http://www.globalcache.com/products/itachflex/flc-rsspec/ & the tech sheet: https://app.box.com/s/kza7mlqyn4kwekm28iyd3dpfv46pd814
The flex TCP API: http://www.globalcache.com/files/releases/flex-16/API-Flex_TCP_1.6.pdf

Thanks,
Casey

caseyp
April 12th, 2016, 04:13 PM
I've done a little more research and found that the device will supply notifications via UDP and I don't know if Girder is currently capable of monitoring UDP connections. To enable this feature on the flex you have to send the set_SENSORNOTIFY command as follows:



Request:set_SENSORNOTIFY,<module>:<sensor port>,<notify port (UDP)>,<notify interval>

where:
<module>= 2
<sensor port> = 1 through 4
<notify port (UDP)> = 0|…|65535 ( ‘0’ = all beacons disabled ) (recommended ports 9132 - 9159)
<notify interval> = 0|…|65535 ( ‘0’ = periodic beacon disabled ) (not of any use to me)

I sent the following to the device successfully however I don't know how I can subscribe to the UDP notifications as simpleTransport appears to only handle TCP and Serial connections.

I Sent: set_SENSORNOTIFY,2:1,9132,0

Response: SENSORNOTIFY,2:1,9132,0

Ron
April 13th, 2016, 03:59 PM
It would be cool if we can extend the simple transport to do UDP I agree. Let me investigate.

caseyp
April 13th, 2016, 04:44 PM
Thanks Ron, I'd sure appreciate it. I've been trying to figure out how to write a translator app in .net that would receive the udp packets and send the corresponding tcp text commands to the girder webserver but so far the udp part has me confused. I've never worked with it before.

Ron
April 14th, 2016, 04:29 PM
Done! Get version 6.0.17.1 and you'll find a UDP tab. Set the local port to whatever port number you tell the GC (in your example 9132) and check the generate events checkbox.

caseyp
April 14th, 2016, 04:49 PM
I've installed 6.0.17.1 and I haven't gotten it to work yet Ron. The flex broadcasts all UDP messages at 239.255.250.250 (the same IP global cache devices use for a locate beacon) and you can set up to 4 different ports, 1 for each sensor if you choose however in my case I set them all to the same port because I couldn't see having them on separate ports.

1. I tried plugging the IP above into Hostname field and I tried it in Multicast Address field (which seems to be the most likely on)

2. I also tried plugging the port number into the listen port field and remote port field.

No matter what I do I've yet to see any events raised. I did get my Translator app working and I am subscribed to both the address and port shown above so I can confirm it does work. Any ideas on what I'm doing wrong?

Thanks,
Casey

Ron
April 14th, 2016, 04:52 PM
1. place the port number in the local port.
2. keep remote port empty
3. keep hostname empty
4. enter 239.255.250.250 in multicast

Note that you must use a port that is not in use by something else.... Check your Girder log for errors.

caseyp
April 14th, 2016, 05:01 PM
No luck so far Ron. Do I have to do anything with the Device Manager or is this all in the Simple Transport plugin?

Ron
April 14th, 2016, 06:20 PM
Found the bug. It wasn't doing the multicast joining properly. I have that fixed and will try to run an new build after dinner.

Ron
April 14th, 2016, 11:19 PM
I've updated the release to 6.0.17.2. I've also attached the .tcf file that setups a simple transport for you. Just change the local port number to match your configured GC port number.

caseyp
April 15th, 2016, 07:57 AM
I've got it up and running Ron, the only issue I see is this message I'm getting in the Logger...

07:40:52, Source=UDPConnection, Message=No destination address available, packet not sent.

Everything seems so far to be working so I don't know what this is all about.

Thanks and as always, good work!

Casey

Ron
April 15th, 2016, 10:00 AM
That message is generated when you try to send data out over the UDP connection without a hostname filled in. Which means the it has no idea where to send it.

caseyp
April 15th, 2016, 01:59 PM
What should I have in the hostname field Ron? I thought that in this case it was all one way traffic.

Ron
April 15th, 2016, 02:44 PM
In this case since you don't need to send anything to the iTach, you can leave it blank. Just make sure you are indeed not trying to send data from some action.

caseyp
April 15th, 2016, 02:47 PM
As far as I know I'm only listening to the events it generates. If it's going to continue to generate warnings maybe there should be a way to suppress them or something.

Ron
April 15th, 2016, 02:50 PM
Let me see if I can make that warning show which action is creating that send. Then you can fix it at the source vs. ignoring it.

Ron
April 15th, 2016, 04:47 PM
I've released 6.0.17.3, this now add a log message that points to which action attempted to do the failed send. (simply double click on the error message with the wrench icon).

caseyp
April 15th, 2016, 05:12 PM
Ron, it looks like there is another bug. It looks like it's complaining about TCP commands I'm sending to the device to actuate the relays (which no longer work). In fact I even created a second device strictly for UDP and removed the UDP address and port from the first one and it's still throwing the error. The command I was sending was setstate,1:1,1 then setstate,1:1,0 (to blink the relay) which is sent to the devices IP address, not to the UDP port. I also have the following command(s) set_SENSORNOTIFY,2:1,9132,0 (1 for each sensor) set to run on the devices connection to ensure each port is broadcasting on the proper port and this is now throwing up errors. So basically there's an issue with sending commands to devices that are both TCP and UDP. These are commands I added to the predefined area so maybe there could be a radio button in there to select if it's a TCP or UDP command so Girder sends it to the appropriate location. I hope this makes sense.

Ron
April 16th, 2016, 08:45 AM
Can you send me plugin_704.cfg from C:\Users\<YOURACCOUNT>AppData\Local\Promixis\Girder 6

caseyp
April 16th, 2016, 09:35 AM
Sure Ron, here it is....


{"transports":{"{c892d7c4-0972-4df6-86dc-08d4cab91ad6}":{"receiveDataAsHex":false,"port":1,"hostname":"","createEventsDevice":1024,"transport":"Serial","enabled":true,"commands":{},"baud":9600,"status":1,"parser":"Terminated","name":"Denon AVR (Patio Audio Receiver)","flowControl":"None","uuid":"{c892d7c4-0972-4df6-86dc-08d4cab91ad6}","portname":"Com2","parity":"NONE","interCommandWait":0,"stopBits":0,"dataBits":8,"terminator":"0x0D","fixedLength":1,"createEvents":true},"{c7c8d99c-a3d5-4dbc-85a1-2aca9df9d868}":{"receiveDataAsHex":false,"port":31339,"hostname":"192.168.1.31","terminator":"0D","parity":"NONE","uuid":"{c7c8d99c-a3d5-4dbc-85a1-2aca9df9d868}","baud":9600,"createEvents":true,"createEventsDevice":1026,"status":1,"flowControl":"None","interCommandWait":0,"parser":"Terminated","enabled":true,"name":"TiVo Roamio","stopBits":0,"dataBits":8,"portname":"","fixedLength":1,"transport":"Tcp"},"{6905a8f2-7605-4fd0-9dbf-9f70a335d756}":{"processor":"-- Simple Parser. Data that has arrived is available in 'data' variable.","receiveDataAsHex":false,"transport":"Udp","port":4998,"udpHostname":"","hostname":"192.168.1.32","terminator":"0D","createEventsDevice":1025,"enabled":true,"status":1,"parity":"NONE","commands":[{"uuid":"{0c060704-9dd3-4b9f-9c56-228f7a9b778d}","name":"GetSensor1State","heartBeat":false,"method":0,"heartBeatTimeout":300,"data":"getstate,2:1","sendOnConnect":false},{"uuid":"{667a9a0d-3f64-488e-ba25-b3bca0ccf6d4}","name":"GetSensor2State","heartBeat":false,"method":0,"heartBeatTimeout":300,"data":"getstate,2:2","sendOnConnect":false},{"uuid":"{150d4941-a928-4848-aeed-c2d4e2525656}","name":"GetSensor3State","heartBeat":false,"method":0,"heartBeatTimeout":300,"data":"getstate,2:3","sendOnConnect":false},{"uuid":"{8f218207-e589-48fb-8b4d-26df52db6e71}","name":"GetSensor4State","heartBeat":false,"method":0,"heartBeatTimeout":300,"data":"getstate,2:4","sendOnConnect":false},{"uuid":"{2f678029-3d92-483f-8294-655325e12f08}","name":"GetNetworkSettings","heartBeat":false,"method":0,"heartBeatTimeout":300,"data":"get_NET,0:1","sendOnConnect":false},{"uuid":"{295f8428-b12b-448e-8d02-032bdccaadc8}","name":"SetSensor1Notify","heartBeat":false,"method":0,"heartBeatTimeout":300,"data":"set_SENSORNOTIFY,2:1,9132,0","sendOnConnect":true},{"uuid":"{812a02a5-4d5f-4299-8e20-04c874c00f2a}","name":"SetSensor2Notify","heartBeat":false,"method":0,"heartBeatTimeout":300,"data":"set_SENSORNOTIFY,2:2,9132,0","sendOnConnect":true},{"uuid":"{19abc69d-c8ed-41f1-807b-9363340409b5}","name":"SetSensor3Notify","heartBeat":false,"method":0,"heartBeatTimeout":300,"data":"set_SENSORNOTIFY,2:3,9132,0","sendOnConnect":true},{"uuid":"{e17df3d0-a523-4cfb-a6df-db3fd6b9a7f7}","name":"SetSensor4Notify","heartBeat":false,"method":0,"heartBeatTimeout":300,"data":"set_SENSORNOTIFY,2:4,9132,0","sendOnConnect":true},{"uuid":"{9b57f3bd-679c-4fa8-861f-87d1d708583e}","name":"SetRelay1OFF","heartBeat":false,"method":0,"heartBeatTimeout":300,"data":"setstate,1:1,0","sendOnConnect":false},{"uuid":"{ca1d4698-4027-480e-a5b4-716d5f0fd9b7}","name":"SetRelay1ON","heartBeat":false,"method":0,"heartBeatTimeout":300,"data":"setstate,1:1,1","sendOnConnect":false}],"baud":9600,"udpMulticastAddress":"","name":"GC flex w/ sensor cable - Utility Room","parser":"Terminated","flowControl":"None","udpPort":0,"portname":"","uuid":"{6905a8f2-7605-4fd0-9dbf-9f70a335d756}","interCommandWait":300,"stopBits":0,"dataBits":8,"udpLocalPort":0,"fixedLength":1,"createEvents":true},"{e5bade38-7d14-4f9d-897a-071d0d5e52d4}":{"receiveDataAsHex":false,"port":1,"transport":"Udp","hostname":"","terminator":"0D","udpHostname":"","status":1,"createEventsDevice":1030,"parity":"NONE","uuid":"{e5bade38-7d14-4f9d-897a-071d0d5e52d4}","baud":9600,"udpMulticastAddress":"239.255.250.250","enabled":true,"name":"GC Flex w/sensor cable - Utility Room - LISTENER","flowControl":"None","udpPort":0,"portname":"","parser":"Terminated","interCommandWait":0,"stopBits":0,"dataBits":8,"udpLocalPort":9132,"fixedLength":1,"createEvents":true},"{10934e60-c9f3-4a9e-9cff-9732fd155d0b}":{"receiveDataAsHex":false,"port":4998,"hostname":"192.168.1.30","terminator":"0D","parity":"NONE","uuid":"{10934e60-c9f3-4a9e-9cff-9732fd155d0b}","baud":9600,"createEvents":true,"createEventsDevice":1027,"status":1,"flowControl":"None","interCommandWait":300,"parser":"Terminated","enabled":true,"name":"GC itach IP2IR - Living Room","stopBits":0,"dataBits":8,"portname":"","fixedLength":1,"transport":"Tcp"}}}

Ron
April 17th, 2016, 10:45 AM
Looking at your config file there you have set "GC flex w/ sensor cable - Utility Room" to Udp, you probably meant to have that on Tcp....

caseyp
April 17th, 2016, 11:59 AM
Ron does that mean that whatever tab is left visible is the connection type selected? If so I'd suggest you change that a bit to better reflect what's going on. I'd recommend a drop down box labeled connection type and a panel that changes accordingly so it's obvious what's going on.

Thanks,
Casey

Ron
April 17th, 2016, 12:13 PM
I'll consider your request!

Ron
April 19th, 2016, 10:06 AM
Request implemented. Both connection type and parser type now use a drop-down instead of the tab to select it's setting. Thanks for the feedback.

caseyp
April 19th, 2016, 11:38 AM
No problem at all Ron. I'm glad to be of help and happy to see girder progressing.

Casey