Duet3D Logo Duet3D
    • Tags
    • Documentation
    • Order
    • Register
    • Login

    M261.2: UART read output findings

    Scheduled Pinned Locked Moved
    General Discussion
    3
    3
    89
    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.
    • wayneosdiasundefined
      wayneosdias
      last edited by

      Just an Fyi re the new M260.2/M261.2 commands in RRF 3.6. I was stuck for a couple days trying to leverage the 6HC Aux comm port to get/set parameters of a foc motor and report them back to Openpnp via the Main comm port.

      Im sending/receiving data on the Aux port as;

      M260.2 P1 B{0x52, 0x5A, 0x0D}
      G4 10
      M261.2 P1 B6
      

      The expected Rx data on the Main port is simply a byte array;

      {0x5a, 0x65, 0x72, 0x6f,0x3a, 0x5a}
      

      M261.2 indeed reports the data to the Main comm port, but is prepended with" Received (hex) " and the rx bytes are space seperated; ' ' ;

      2024-11-25 22:38:29.200 GcodeDriver$ReaderThread TRACE:
      [GcodeAsyncDriver:COM13] << Received (hex) 5a 65 72 6f 3a 5a
      

      This needs to be understood, but not explicitly stared in M261.2 if anyone is planning to parse the rx data as one would using regex. For my application the regex

      ^.*( [0-9a-f]{2}){5} (?<Value>[0-9a-f]{2})
      

      Groups the correct Value for me.

      Any rate the new commands work great now that I understand the output.

      jay_s_ukundefined dc42undefined 2 Replies Last reply Reply Quote 1
      • jay_s_ukundefined
        jay_s_uk @wayneosdias
        last edited by

        @wayneosdias one for @droftarts to document

        Owns various duet boards and is the main wiki maintainer for the Teamgloomy LPC/STM32 port of RRF. Assume I'm running whatever the latest beta/stable build is

        1 Reply Last reply Reply Quote 0
        • dc42undefined
          dc42 administrators @wayneosdias
          last edited by

          @wayneosdias we don't guarantee that the response format will never change. If you need to feed the result back to another program then you should use the V parameter to save the response into a variable, then use M118 or an echo command to format it as you wish.

          Duet WiFi hardware designer and firmware engineer
          Please do not ask me for Duet support via PM or email, use the forum
          http://www.escher3d.com, https://miscsolutions.wordpress.com

          1 Reply Last reply Reply Quote 0
          • First post
            Last post
          Unless otherwise noted, all forum content is licensed under CC-BY-SA