How does the virtual serial port over IP work?
Looking at implementing a means to send serial data over the web to a mango unit in a different geographical location. My first question is: Is there a specific format the data needs to be or some kind of handshake to make it talk?
Have tried with a RAW ser2net socket which does connect but no data comes through.
Would like to be able to implement something like the MangoTCP link if it were possible just as it would make transferring and updating of data much easier.
Hi Mr. Fox,
I'm not sure I completely know what you're asking about.
The TCP/IP data source can be used as a bridge for arbitrary TCP/IP conversations as the client.
The Serial Data Source, coupled with a Virtual Serial Server Socket (configured on the system settings page in the virtual serial port section) is the most arbitrary incoming TCP/IP data source option.
Neither of those has any specific adherence to a protocol and both can be made to work for all sorts of things.
Hi Phil, thanks for the quick reply. I'll do some more investigation - could possibly be the format of my data or something of the like. Will let you know of my findings - watch this space!
I have successfully got data firing to the mango unit, ha ha!
One problem, data isn't being loaded into the datapoint. the test string option under the datapoint shows my regex is working. checked the error logs and all I appear to be having are datasource errors:
ERROR 2017-12-18T03:15:49,518 (com.infiniteautomation.mango.io.serial.virtual.SerialServerSocketBridge$SerialServerSocketThread.run:224) - IOException buffer reading for Fox_SerialTest java.net.SocketTimeoutException: Read timed out at java.net.SocketInputStream.socketRead0(Native Method) ~[?:1.8.0_144] at java.net.SocketInputStream.socketRead(SocketInputStream.java:116) ~[?:1.8.0_144] at java.net.SocketInputStream.read(SocketInputStream.java:171) ~[?:1.8.0_144] at java.net.SocketInputStream.read(SocketInputStream.java:141) ~[?:1.8.0_144] at com.infiniteautomation.mango.io.serial.virtual.SerialServerSocketBridgeInputStream.bufferRead(SerialServerSocketBridgeInputStream.java:38) ~[mango-3.2.2.jar:?] at com.infiniteautomation.mango.io.serial.virtual.SerialServerSocketBridge$SerialServerSocketThread.run(SerialServerSocketBridge.java:209) [mango-3.2.2.jar:?]
It keeps timing out! Any thoughts? I'm only sending 7 characters plus a carriage return as the terminator. I know the data is coming due by turning the datasource off and using netcat to listen on the network port. Data is definitely reaching.
So I'm confused...
Hmm. You could share your configuration if you wanted. Are you using a catchall point? I find if you turn off the terminator, set the regex to ().* and have a point with an empty identifier, a point identifier index of 1, a value regex of .* index 0 you will get all data into that point.
Have you given your virtual serial port a timeout? You could try setting this back to 0 if you wanted, and then you would be relying on the client to close the connection. Or you can increase your timeout.
MattFox last edited by MattFox
Still nothing, Here are my settings:
Fox virtual serial:
Type: serial server
timeout (ms): 0
Port: Fox Virtual Server
Flow Control In: none
Flow Control out: none
use terminator :false
point identifier group:1
config in hex: false
max size of message:1024
value group: 0
Logging type: all data
text rendering: plain;
There must be something not handshaking to take my proverbial data and swallow it...
edit! wait I tell a lie! I have data coming in! Now why the hell isn't the regex registering...
I would guess it has something to do with the carriage returns or line feeds. Maybe you can try (?:.|\r|\n)* as your data point's regex.
MattFox last edited by MattFox
Got it, but i had to disable the datasource's regex for it to work. Datapoint regex works fine.
for some reason datasource just wouldn't work with (.* )=(.* )\r
Strange as it works with normal serial data datasources just fine....
disabled datasource regex, set timeout to 30 seconds, changed point regex to
test=(.*)(?:|\r|\n) with identifier being test and bang, in goes my values....