GPIO Controller command protocol
-
Hi there, I have a WiFi/Ethernet relay board (8 channels output) 3 channel input. The input is monitoring a door status using a reed switch. (open or closed status) how can I in mango have a data point for monitoring the open closed status. the relay board ships with a GPIO Controller protocol manual but is is over my head. I can post it here if it helps,
-
Hi Patd,
It definitely would take consulting the documentation to know what sort of advice to offer. I would bet that you'll be using the TCP/IP data source, or perhaps SSH. There're probably some sample protocol exchanges in the manual.
-
If you can post a link to the manual it would help.
-
Thanks ,v8dave and Phil for your responses. Here is the document. Also to tell you about the device it is fully web accessible and has setup pages including a socket setting where you can configure
Network Parameters setting(TCPB),
Port ID
Server address
TCB Time out setting -
The protocol is pretty simple and you could use TCP/IP to do this although I have not yet worked with TCP/IP on Mango so far.
The manuals English makes it a little hard to figure some things out but the protocol is quite easy and it takes a little digging to see that the parity is just an addition of all the bytes after the header.
It talks about a cloud server but no references to the URL for this. Can you talk directly to it. Are you able to write a simple C# app in Visual Studio for example to send the bytes to it over TCP/IP and see how it responds? I would start with this if you can as then you know how it works.
-
I'm trying to get this working to can get into the device and start communicating, but the protocol is too difficult for me to get my head around.
What for example would be the command to open and close relay one - the documentation lacks any examples as far as I can see. Any idea?
-
Looking at the TCP/IP data source there is no way I can see how to send binary data packets. It seems to be only able to send ASCII with a delimiter. Maybe the support guys can offer a solution to sending your packet format.
-
Hi moonmonkey,
Presuming you are referring to the document Patd posted, it looks like you could use the TCP/IP data source, with 'configuration in hex' selected, and set values as simple hex string without the 0x prefix, so if I have a write command on a TCP/IP point like:
0101
Then every time I set any value whatsoever to that point, I'll get out the binary...
0000000100000001
it would toggle that output, and it's value regex will be given a chance to parse incoming data on the socket. Here's a point that should do something (you'll need to set the host and port) but it is not a realistic expectation for me to get too deep into your documentation for the sake of answering your questions for free.
{ "dataSources":[ { "xid":"DS_082653", "name":"GPIO", "enabled":false, "type":"TcpIp", "alarmLevels":{ "POLL_ABORTED":"URGENT", "DATA_SOURCE_EXCEPTION":"URGENT", "POINT_READ_EXCEPTION":"URGENT" }, "purgeType":"YEARS", "updatePeriodType":"MINUTES", "delimiter":"", "hex":true, "host":"localhost", "port":5200, "timeout":5000, "updatePeriods":5, "editPermission":"", "purgeOverride":false, "purgePeriod":1 } ], "dataPoints":[ { "xid":"DP_646604", "name":"Toggle1", "enabled":false, "loggingType":"ON_CHANGE", "intervalLoggingPeriodType":"MINUTES", "intervalLoggingType":"INSTANT", "purgeType":"YEARS", "pointLocator":{ "dataType":"ALPHANUMERIC", "queryable":false, "readCommand":"", "settable":true, "valueIndex":1, "valueRegex":"8101([0-9A-F]{2})", "writeCommand":"0101" }, "eventDetectors":[ ], "plotType":"STEP", "unit":"", "chartColour":"blue", "chartRenderer":null, "dataSourceXid":"DS_082653", "defaultCacheSize":1, "deviceName":"access", "discardExtremeValues":false, "discardHighLimit":1.7976931348623157E308, "discardLowLimit":-1.7976931348623157E308, "intervalLoggingPeriod":15, "intervalLoggingSampleWindowSize":0, "overrideIntervalLoggingSamples":false, "purgeOverride":false, "purgePeriod":1, "readPermission":"", "setPermission":"", "textRenderer":{ "type":"PLAIN", "useUnitAsSuffix":false, "unit":"", "renderedUnit":"", "suffix":"" }, "tolerance":0.0 } ] }
Some people will, instead of writing a point for each output command, have a point with the write command %VALUE% only, such that they can have more control over the communication by passing values out through a scripting data source script setting the command point, and then focusing the definition of points on taking data in.