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

    ISO RS485 on M5dial

    Scheduled Pinned Locked Moved PRODUCTS
    11 Posts 3 Posters 6.5k Views
    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.
    • robskiR Offline
      robski @mukul_100_
      last edited by

      @mukul_100_ what software you planning to use?
      see uiflow2 init example
      dial_iso485.JPG

      M5StickC, M5StickCPlus, M5StickCplus2,M5GO, M5Core, M5Tough, M5Core2, M5 Demo Board, M5Dial, M5Paper, M5Atom, M5Cardputer, M5StampS3, CoreMP135, StamPLC, AirQ, M5Tab, M5CardputerAdv, M5StackChan

      M 1 Reply Last reply Reply Quote 0
      • M Offline
        mukul_100_ @robski
        last edited by

        i am using platformio right now. thanks

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

          Hello @mukul_100_

          please find an example here with M5Dial and RS485 unit controlling an ACSSR relay via Modbus protocol.

          Thanks
          Felix

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

          M 1 Reply Last reply Reply Quote 0
          • M Offline
            mukul_100_ @felmue
            last edited by

            @felmue hi felix sorry for the late reply, finally got a chance to get back to this

            i studied the example but not sure if i understood how to implement the master slave concept through this and also there is a error thrown in
            RS485Class RS485(Serial2, GPIO_NUM_1, GPIO_NUM_2, -1, -1);

            as there are only 4 arguments accepted by the class
            also serial2 needs some tweaking for esp32 right?
            thanks

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

              Hello @mukul_100_

              I linked the incorrect variants for RS485 and Modbus libraries. Sorry about that. I fixed the example. The libraries I used are the ones from M5Stack.

              https://github.com/m5stack/ArduinoModbus
              https://github.com/m5stack/ArduinoRS485

              Thanks
              Felix

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

              M 1 Reply Last reply Reply Quote 0
              • M Offline
                mukul_100_ @felmue
                last edited by

                @felmue Hi felix
                the changes you mentioned are in the same example code that is linked above?

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

                  Hello @mukul_100_

                  yes.

                  Thanks
                  Felix

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

                  M 1 Reply Last reply Reply Quote 0
                  • M Offline
                    mukul_100_ @felmue
                    last edited by

                    @felmue ,did you make any changes in the RS485.h file
                    along these line 46
                    #else
                    #ifndef RS485_DEFAULT_DE_PIN
                    #define RS485_DEFAULT_DE_PIN A6
                    #define RS485_DEFAULT_RE_PIN A5
                    #endif

                    thanks,
                    Mukul

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

                      Hello @mukul_100_

                      No.

                      I think you are still on the library I incorrectly linked to in my example before.

                      Incorrect library: https://github.com/**arduino-libraries**/ArduinoRS485

                      Library I used: https://github.com/**m5stack**/ArduinoRS485

                      Thanks
                      Felix

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

                      M 1 Reply Last reply Reply Quote 0
                      • M Offline
                        mukul_100_ @felmue
                        last edited by

                        @felmue Hi, felix i got it working finally. The issue is, on platformIO the library Arduinomodbus library and ArduinoRS485 library are the arduino ones and not the m5stack ones which is why i was getting error.
                        A fix to this was to just replace the internal files of library to the m5stack ones from github.
                        Thank you for the help.

                        1 Reply Last reply Reply Quote 0

                        Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                        Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                        With your input, this post could be even better 💗

                        Register Login
                        • First post
                          Last post