• Register
    • Login
    • Search
    • Recent
    • Tags
    • Popular

    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

    Using Serial Data Source as MBUS device

    User help
    5
    29
    76
    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.
    • Turbo
      Turbo last edited by

      Greetings, all:

      I'm working on getting MBUS working on Mango V4. I understand that the MBUS data source has been dropped, and I'm therefore figuring out how to do this using the Modbus Serial Data Source.

      Thus far, I'm having a rough go of this: It seems like the serial data source should work for this, but so far, I haven't had any luck with this.

      I know the MBUS device is talking(I can see it via Minicom spitting out data on the machine running Mango via a USB interface), but so far I have had 0 luck with reading this via a the Serial Data Source.

      Can someone provide some guidance here for this?

      Right now, I'm just trying to get the entire serial string into Mango, raw and unchanged, so I can parse it with a Scripted data point. This is raw hex data (no human readable ASCII here), and the messages are less than 800 bytes or so.

      So questions:
      (1) Is the Serial Data source the best way to do this?
      (2) Any ideas on what I'm missing with just loading raw Hex data into Mango?

      I'm getting confusd by the regex stuff, I think, but even if I put the most generalized regex I can find ([^ ]+) or (*.) I still can't get anything to show up in the Point Value doing this.

      Which bit am I missing here?

      Turbo T cwangv 3 Replies Last reply Reply Quote 0
      • Turbo
        Turbo @Turbo last edited by

        @Turbo Just some additional info here: There's not even any data showing up even in the serialIO-X log files at all. All that log shows is Data source stop/start messages, but nothing actually coming over the port.

        This one's running on Linux; Is there some other serial something I need to do to make sure Mango is aware of the USB ports? The comm parameters I'm using in Mango are the same as what I was using in Minicom to look at the raw value.

        MattFox 1 Reply Last reply Reply Quote 0
        • MattFox
          MattFox @Turbo last edited by

          @Turbo
          I can help with regex if needed, the wildcard regex should be (.*), not (*.).
          Sing if you need anything!

          Fox

          Do not follow where the path may lead; go instead where there is no path.
          And leave a trail - Muriel Strode

          Turbo 1 Reply Last reply Reply Quote 0
          • Turbo
            Turbo @MattFox last edited by

            @MattFox Just updated that, and it didn't make a difference. When I open the port (/dev/ttyUSB0) in Minicom (minicom -H -w) I get this:

            af70dc45-1622-4d4c-b8a6-e926ad8dcd71-image.png

            And more and more- It spits out data ever 5-10 seconds or so.

            When I start the data source in Mango, I get nothing. Mango's not even writing any data to the SerialIO-X.log file.

            MattFox 1 Reply Last reply Reply Quote 0
            • MattFox
              MattFox @Turbo last edited by

              @Turbo Did you try restarting the datasource? I've got a stupid feeling the serial datasource is still broken...

              Do not follow where the path may lead; go instead where there is no path.
              And leave a trail - Muriel Strode

              Turbo 1 Reply Last reply Reply Quote 0
              • Turbo
                Turbo @MattFox last edited by

                @MattFox Yep. Multiple times. In fact, I'm going to restart Mango, then try restarting the data source as well.

                Turbo 1 Reply Last reply Reply Quote 0
                • Turbo
                  Turbo @Turbo last edited by

                  @Turbo Notably, it appears is if Mango isn't trying to grab control of the serial port: I just tried restarting the serial port on the Serial data source, and it didn't even try. When I was doing this before, restarting the serial data source would take over control of the port.

                  I'm still watching my data stream up Minicom, regardless of how I set up the serial data source input.

                  Does the M-Bus data source work in Mango V3 still? I may roll back to that, as this is rapidly becoming critical path for me.

                  MattFox 1 Reply Last reply Reply Quote 0
                  • MattFox
                    MattFox @Turbo last edited by

                    @Turbo get a free version and quickly find out. Alternatively, can you not redirect the output using socat and connecting to a tcp socket instead?

                    Whichever is quicker I guess...

                    Fox

                    Do not follow where the path may lead; go instead where there is no path.
                    And leave a trail - Muriel Strode

                    Turbo 1 Reply Last reply Reply Quote 0
                    • Turbo
                      Turbo @MattFox last edited by

                      @MattFox I've never used socat; I'm learning something new today! How does this work?

                      Also: Are there plans to bring MBUS back in Mango V4? We're bidding an epic pile of projects in the EU, and the fact that MBUS is mentioned on Mango's "supported drivers" page (https://radixiot.com/supported-protocols) is one of the reasons we got this job.

                      I didn't ever think about the fact that this would be removed in V04, until I went and checked up on it again.

                      Let me read about socat, as that may be a solution here.

                      MattFox 2 Replies Last reply Reply Quote 0
                      • MattFox
                        MattFox @Turbo last edited by

                        @Turbo https://fossies.org/linux/socat/EXAMPLES

                        Do not follow where the path may lead; go instead where there is no path.
                        And leave a trail - Muriel Strode

                        1 Reply Last reply Reply Quote 0
                        • MattFox
                          MattFox @Turbo last edited by

                          @Turbo said in Using Serial Data Source as MBUS device:

                          Also: Are there plans to bring MBUS back in Mango V4? We're bidding an epic pile of projects in the EU, and the fact that MBUS is mentioned on Mango's "supported drivers" page (https://radixiot.com/supported-protocols) is one of the reasons we got this job.
                          I didn't ever think about the fact that this would be removed in V04, until I went and checked up on it again.

                          @CraigWeb - need your input here

                          Do not follow where the path may lead; go instead where there is no path.
                          And leave a trail - Muriel Strode

                          Turbo 1 Reply Last reply Reply Quote 0
                          • Turbo
                            Turbo @MattFox last edited by

                            @MattFox I appreciate this; Could you maybe ping someone about if, in fact, the Serial data source in Mango is not working? Am I the only one who ever tries to do things this way?

                            MattFox 1 Reply Last reply Reply Quote 0
                            • MattFox
                              MattFox @Turbo last edited by

                              @Turbo no I used to for radio transmitters over serial. I still do for small electronics projects.
                              But it is something that needs to be looked at.

                              Fox

                              Do not follow where the path may lead; go instead where there is no path.
                              And leave a trail - Muriel Strode

                              Turbo 2 Replies Last reply Reply Quote 0
                              • Turbo
                                Turbo @MattFox last edited by

                                @MattFox Okay:

                                For folks that come through here, this appears to work for socat:
                                b45e4d18-fd36-4a9c-9467-02d5769e6511-image.png socat -d -d -d -d tcp-listen:4141,reuseaddr,fork file:/dev/ttyUSB0,nonblock,cs8,b2400,cstopb=0,raw,echo=0

                                (that's got debugging turned on)

                                But these devices are "originate only" (M-Bus just sends, no listen, just talk), so now I'm trying to figure out to to get that data into mango..

                                Same thing as before: Just see "data source started" in the TCP data souirce log file, but my little socat command status is streamalating data.. I'm now working this angle.

                                If I can't get this figured out, I'll roll back to Mango V3 and see if that M-Bus in there still works for us.

                                Turbo 1 Reply Last reply Reply Quote 0
                                • Turbo
                                  Turbo @Turbo last edited by

                                  @Turbo Also: This definitely works, btw, since if you telnet to that port I set up, you can see the data streaming in from the device. It's hex, though, not ascii, so it's not remotely human readable..

                                  When I try and select "configuration in HEX" in the TCP data source setup, it won't let the box stay checked: Each time I check it, when I refresh the page, it comes back as unchecked again.

                                  The adventure continues..

                                  Turbo 1 Reply Last reply Reply Quote 0
                                  • Turbo
                                    Turbo @Turbo last edited by

                                    @Turbo Also: When you save the TCP Data source (usually) the Select Data Source list updates automatically when you create a new datasource: In this case, the new datasource is not automatically created. New clues coming in rapid-fire here.

                                    Turbo 1 Reply Last reply Reply Quote 0
                                    • Turbo
                                      Turbo @Turbo last edited by Turbo

                                      @Turbo Well hot damn. The thing works.

                                      So now I can socat data in as a TCP point.. That's cool.

                                      For folks following along:
                                      First, do this to forward the port:
                                      79470b9a-a3e7-4957-a605-7c7910570af7-image.png

                                      socat -d -d -d -d tcp-listen:4141,reuseaddr,fork file:/dev/ttyUSB0,nonblock,cs8,b2400,cstopb=0,raw,echo=0

                                      This is a 2400 baud device.
                                      I set the timeout for 250, no delimeter, and then port 4141 (as above) and host of Localhost.

                                      Then, in the data point, I created a general placeholder with a read command of "00" and a value regex of (.*), value index 0

                                      This appears to update properly.

                                      Now to write a parser- This sure would be easier with the original M-Bus device.

                                      Thanks for your help, @MattFox .

                                      There also appears to be a bug (still) in the serial data source, at least when running on Linux- This test install is a raspberry pi, but we'll be deploying this on our IMX8's as usual, I hpoe.

                                      Turbo 1 Reply Last reply Reply Quote 1
                                      • Turbo
                                        Turbo @Turbo last edited by

                                        @Turbo Ok. One more quick question on here: Since this device is (effectively) streaming data in - There isn't even a RX pin on the device we're talking to, is there a way to set up the tcpip connector to just store data as it comes in, rather than requiring the use of the "read" command before awaiting a response?

                                        Right now, I'm just sending "00" out as a read command, but the device has no read command; It just spews data out. The read command forces a sync where none exists. I'd rather just have the tcpip point record the point when data comes into the point, rather than after the read command is issued.

                                        If I disable "queryable" I get no data at all, but I enable queries, I end up missing every third packet, since there's no way to sync the "output only" nature of the M-Bus device with Mango's need to poll and record a response.

                                        It kinda works, but I wonder if there's some secret to have Mango just store whatever comes in over that port?

                                        1 Reply Last reply Reply Quote 0
                                        • Turbo
                                          Turbo @MattFox last edited by

                                          @MattFox So: Turns out the socat solution works, but it's not really as straightforward as using the Serial device natively:
                                          Can you poke around and see if the Serial data source needs some hugs? Using a TCP forward for a USB converter serial port seems a bit silly to me, when Mango has a raw Serial device interface that (should) do the same thing.

                                          I've now had no luck with the serial data source on my ARM based IMX8 machine over hardware serial or USB to 485 serial under V3 or V4, and now am seeing the same thing under V4 on a raspberry pi.

                                          I'm happy to set up a screen share / demo video / something if you want to see what I'm seeing with this.

                                          Thanks for your help, in any event, as we now have a (mostly) working MBus data source again, although in a somewhat ridiculously rube-goldbergesque way.

                                          MattFox 1 Reply Last reply Reply Quote 0
                                          • MattFox
                                            MattFox @Turbo last edited by

                                            @Turbo sure I'll flick you a PM

                                            Do not follow where the path may lead; go instead where there is no path.
                                            And leave a trail - Muriel Strode

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