🤖Have you ever tried Chat.M5Stack.com before asking??😎
    M5Stack Community
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    M5STATION USB communication with computer while RS485 is in use - how to?

    Arduino
    3
    6
    5.5k
    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.
    • C
      Caterpillaraoz
      last edited by

      Hello,
      I'm using M5Station 485 as a Modbus RTU CLient, I'd also like to have USB communications to send debug messages to the Arduino IDE.
      Is it possible?

      Is I'm not reading the schematic "wrong" the USB port at the bottom is connected "in parallel" with the 485 interface so it's not available for communication while the 485 is in use, correct?

      What about the USB port "at the top" of it?

      Thanks!

      1 Reply Last reply Reply Quote 0
      • ajb2k3A
        ajb2k3
        last edited by

        As far as I’m aware, the bottom usb is power only and the top port is data!

        UIFlow, so easy an adult can learn it!
        If I don't know it, be patient!
        I've ether not learned it or am too drunk to remember it!
        Author of the WIP UIFlow Handbook!
        M5Black, Go, Stick, Core2, and so much more it cant be fit in here!

        C 1 Reply Last reply Reply Quote 0
        • C
          Caterpillaraoz @ajb2k3
          last edited by

          @ajb2k3 Bottom USB is wired in parallel with the RS485 port & is the one to be used for FW loading, TOP usb I'm trying to figure out how to talk over it!

          1 Reply Last reply Reply Quote 0
          • felmueF
            felmue
            last edited by

            Hello @Caterpillaraoz

            I am afraid the top USB Type-A port is for power only.

            From the M5Station documentation: USB Tpye-A power supply output only, no signal pins.

            Thanks
            Felix

            GPIO translation table M5Stack / M5Core2
            Information about various M5Stack products.
            Code examples

            1 Reply Last reply Reply Quote 0
            • C
              Caterpillaraoz
              last edited by

              So you are telling me that there is NO way to use the RS485 and a computer serial communication at the same time?

              1 Reply Last reply Reply Quote 0
              • felmueF
                felmue
                last edited by felmue

                Hello @Caterpillaraoz

                you could try something like this every time you want to log something:

                  Serial.begin(115200);
                  Serial.println("Hello World");
                  Serial.end(true);
                  ModbusRTUClient.begin(115200, SERIAL_8N1);
                

                Please note that all debug output you send this way will also be sent to the Modus RTU server. This could potentially lead to unwanted results, should the parser in the Modbus RTU server choke on it.
                In addition you'll see everything the Modbus RTU server is sending back in the log as well.

                As an alternative you could use a second serial connection for debug output through one of the Groove ports using a separate USB Serial converter. E.g. like this:

                  Serial1.begin(115200, SERIAL_8N1, 16, 17);
                  Serial1.println("Hello world");
                

                Thanks
                Felix

                GPIO translation table M5Stack / M5Core2
                Information about various M5Stack products.
                Code examples

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