Help with TCP/IP Data Source
-
Hello,
I have a setup where we can use Putty to hit an IP and port (Cell Modem) and can see the stream of data returning to us. We can see this data using the Telnet or Raw connection type in Putty.
Here's what the data output looks like:
We're pretty sure the lines end in \r\n
We have a TCP/IP data source created, but are unsure what parameters should be set to read the data. Any help or pointers is appreciated. We've been looking through the MA.log as well as turned on I/O logging for the data source but after looking into them, can't see anything obvious to us that we need to change.
We're running Mango 3.7.7.
Thanks,
Chad -
We did get this to work. If anyone is interested, here's how we were able to do it. I'm sure there are other, and possibly better ways, but after our struggles, we're just glad to be recording data.
The data source streams the data in the following format to us:
Here's a quick view of values we set in our data source:
We have an update period of 5 seconds, and our initial timeout wast 5 seconds, then we set it to 10. After that we were getting a lot of aborted poll errors. Setting the timeout to 500ms resolved that for us.
Here's a quick look at the data point values we set:
Understanding that the Regex needs to return capturing groups was a key for us to get this working as well, and the fact that the Value Index is really the group number.
With our Regex, we hard-code for the $SDDBT start of our data since that's fixed, then look at the value between the commas. We only need the 2nd item in the data stream, which is Value Index 2.
We also got stuck on the read command a bit. Just putting READ in there worked, but not sure if there's a more "correct" way to do it.
Hopefully this helps anyone ready to pull their hair out like we were for 3 or 4 days straight.
-
Usually it's regex that's the issue. I use regexr.com to test my matching query. Alternatively, did you ever consider trying a serial data source with a virtual socket? Mango can connect as either a server or a client and generally works quite well.
Fox
-
Hi, Fox,
We didn't think to try the serial data source with a virtual socket. I may experiment with that to see what we can get going.
Thanks for the tip.
Chad