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

    ATOM RS-485 Kit - bad Rx performance?

    Scheduled Pinned Locked Moved Modules
    8 Posts 4 Posters 11.6k 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.
    • R Offline
      RoadRunnR
      last edited by

      I have two ATOM RS-485 Kits and both have trouble receiving data from the RS-485 bus from different senders.

      The RS-485 bus is running on +/- 3.3V, but according to the standards a difference of +/- 1.5V is the minimum signal level for RS-485.

      It feels like the adapter module is not good at handling low power signals. Has anyone had similar experiences?

      m5stackM 1 Reply Last reply Reply Quote 0
      • m5stackM Online
        m5stack @RoadRunnR
        last edited by

        Check if there is a shared GND between devices. and make sure the A connect to A, Bconnect to B. check your program uart init pin setup is right.

        R 1 Reply Last reply Reply Quote 0
        • T Offline
          Thrasher
          last edited by

          Shared ground isn't necessar for proper RS485 action, otherwise it makes RS485 useless

          1 Reply Last reply Reply Quote 0
          • R Offline
            RoadRunnR @m5stack
            last edited by

            @m5stack I do receive data, just not all of it and not consistently. Sometime there is not data received for several minutes, sometimes I'm missing single bytes and then it works again for some time.

            I have tested with 3 different devices. One is the device is want to talk to, one is a USB-to-RS485 converter, and the other is a RS485-to-RS232 (3.3V) converter connected to a ESP8266.

            Both of the other converters see the data in both directions consistently. Only the M5 hat does not.

            1 Reply Last reply Reply Quote 0
            • lukasmaximusL Offline
              lukasmaximus
              last edited by

              If you are using the atomicRS485 arduino sketch, it is virtually identical to the rs232 sketch and not particularly practical for any use case. I was having the same issue as you using the rs232 module to connect to a cisco switch, i.e there were parts missing from the transmission. I removed the delays, m5update(), from the sketch and it functioned correctly

              1 Reply Last reply Reply Quote 0
              • R Offline
                RoadRunnR
                last edited by

                Already tried that. I use a extremely simplified reader loop, and it still loses data and reads data that isn't on the wire.

                This is what I'm using:

                #include <M5Atom.h>
                
                void setup() {
                  M5.begin(true, false, false);
                  // Serial2.begin(unsigned long baud, uint32_t config, int8_t rxPin, int8_t txPin, bool invert)
                  Serial2.begin(115200, SERIAL_8N1, 22, 19);
                }
                
                void loop() {
                 if(M5.Btn.wasPressed()){
                    Serial2.write('a');
                 }
                
                 if(Serial2.available()) {
                   int ch = Serial2.read();
                   Serial.printf("0x%02x\n", ch);
                 }
                 
                 M5.update();
                }
                
                1 Reply Last reply Reply Quote 0
                • R Offline
                  RoadRunnR
                  last edited by

                  Arghhhhhh.... it seems that is not a hardware problem after all but a issue with the Arduino core for the ESP32.

                  After some more tests, I stumbled over reports of problems with hardware serial 2 on ESP32 systems. I was using the latest (1.0.4) release of the arduino-esp32 project.

                  Just for fun, I've tried the master branch from repo 1, and with that branch at least my initial test show no more problems.

                  1 Reply Last reply Reply Quote 0
                  • R Offline
                    RoadRunnR
                    last edited by

                    So, after many experiments I'm sorry to report that the RS-485 Atom module has very bad Rx characteristics.

                    The issue of getting corrupted data was related to problems in the serial support of the arduino-esp32 project. After moving to git version I still had several problems:

                    1. missing bytes
                    2. zero byte at end of rx block
                    3. last byte of block was sometimes corrupted

                    I've then tried replacing the RS-485 Hat with another RS485-to-RS422 adapter and since then it works flawlessly. Something in the electrical design of the RS-485 hat must be messing up the Rx data.

                    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