• Recent
    • Tags
    • Popular
    • Register
    • Login

    Please Note This forum exists for community support for the Mango product family and the Radix IoT Platform. Although Radix IoT employees participate in this forum from time to time, there is no guarantee of a response to anything posted here, nor can Radix IoT, LLC guarantee the accuracy of any information expressed or conveyed. Specific project questions from customers with active support contracts are asked to send requests to support@radixiot.com.

    Radix IoT Website Mango 3 Documentation Website Mango 4 Documentation Website Mango 5 Documentation Website

    Serial data source stops receiving data after a period of time.

    User help
    3
    25
    13.7k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • M
      mattonfarm
      last edited by

      Hi Terry,
      It seems like occasionally the '\r' character is not being extracted from the buffer.
      Here is an example from the logs:

      DEBUG 2014-08-11 13:24:58,217 (com.infiniteautomation.serial.rt.SerialDataSourceRT.matchPointValues:316) - Message matched regex: (([A-Z][A-Z][0-9]+.[0-9]+[a-zA-Z0-9]+=).\r)|(.\r)
      DEBUG 2014-08-11 13:24:58,218 (com.infiniteautomation.serial.rt.SerialDataSourceRT.matchPointValues:320) - Point Identified: null
      DEBUG 2014-08-11 13:24:58,222 (com.infiniteautomation.io.serial.SerialPortProxyEventTask.run:29) - Running event created at: 1407720298215
      DEBUG 2014-08-11 13:24:58,223 (com.infiniteautomation.serial.rt.SerialDataSourceRT.serialEvent:252) - Buffer after read: 534f3234312e
      DEBUG 2014-08-11 13:24:58,223 (com.infiniteautomation.io.serial.JsscSerialPortInputStream.serialEvent:119) - Serial Receive Event fired.
      DEBUG 2014-08-11 13:24:58,224 (com.infiniteautomation.io.serial.JsscSerialPortInputStream.serialEvent:128) - Recieved: 31373546524f4d3d3234312e3137350d534f3234312e313735484f50533d320d534f3234312e
      DEBUG 2014-08-11 13:24:58,225 (com.infiniteautomation.serial.rt.SerialDataSourceRT.serialEvent:281) - Terminator not found in message yet.
      DEBUG 2014-08-11 13:24:58,225 (com.infiniteautomation.io.serial.SerialPortProxyEventTask.run:29) - Running event created at: 1407720298224
      DEBUG 2014-08-11 13:24:58,226 (com.infiniteautomation.io.serial.JsscSerialPortInputStream.serialEvent:119) - Serial Receive Event fired.
      DEBUG 2014-08-11 13:24:58,226 (com.infiniteautomation.serial.rt.SerialDataSourceRT.serialEvent:252) - Buffer after read: 534f3234312e31373546524f4d3d3234312e3137350d
      DEBUG 2014-08-11 13:24:58,227 (com.infiniteautomation.io.serial.JsscSerialPortInputStream.serialEvent:128) - Recieved: 313735525353493d2d3531
      DEBUG 2014-08-11 13:24:58,227 (com.infiniteautomation.serial.rt.SerialDataSourceRT.serialEvent:274) - Matching will use UTF8: SO241.175FROM=241.175

      Here the buffer starts with 534f3234312e - "SO241."
      Data is then read from the serial port 31373546524f4d3d3234312e3137350d534f3234312e313735484f50533d320d534f3234312e
      "175FROM=241.175
      SO241.175HOPS=2
      SO241."

      The buffer is now
      "SO241.175FROM=241.175
      SO241.175HOPS=2
      SO241."

      Then the debug message "Terminator not found in message yet." however there are 2 '\r' strings sitting in the buffer.

      The two strings "SO241.175FROM=241.175\r" and "SO241.175HOPS=2\r" then get extracted from the buffer which should leave "SO241." in the buffer. The rest should follow in the next serial port read.

      It would seem like the buffer is filling up faster than the data is being extracted from it.

      Matt.

      1 Reply Last reply Reply Quote 0
      • terrypackerT
        terrypacker
        last edited by

        Matt,

        I've changed the logging to show the buffer as UTF8 instead of as Hex, this should make life a little easier. I also changed the way the terminators are matched and processed, allowing the processing of multiple messages at once. You were correct in assuming that we were "missing" some of the terminators because of the amount of data coming in on the port so quickly.

        Give this version a try and let me know how it goes.

        Thanks,
        Terry

        Attachment: download link

        1 Reply Last reply Reply Quote 0
        • M
          mattonfarm
          last edited by

          CheersTerry,
          The last module ran for a day without crashing so that's an improvement. Hopefully your last change should fix the issue of terminators being missed.

          Thank you for your help,
          Matt.

          1 Reply Last reply Reply Quote 0
          • M
            mattonfarm
            last edited by

            Hi Terry,
            That last Data Source seems to have fixed the crashing.
            How do I remove the added debug messages from the logs?
            I have removed the line from the log4j configuration file and restarted Mango but the messages keep coming.
            I am getting daily logs over 650MB in size.

            Cheers,
            Matt.

            1 Reply Last reply Reply Quote 0
            • First post
              Last post