TUTORIAL: How to make MODBUS work with ESP32 - Arduino - RS485 - Part 1

Поделиться
HTML-код
  • Опубликовано: 11 дек 2024

Комментарии • 59

  • @sviesis
    @sviesis 6 лет назад +2

    easiest way is not to allow to handle DE/RE pins by esp32. Instead use mosfet or transistor, when there is tx or rx active then DE/RE are pulled low/high automatically. No library modifications necessary and this solution works for years in my setup.

    • @tsmartconsultant
      @tsmartconsultant 5 лет назад

      How exactly does this work? I like the idea but wondering if the transmit works also with the lower voltages if the esp to rs485

    • @tanmeowsoon5252
      @tanmeowsoon5252 2 года назад

      Hi sir use transistor can show us how it work

  • @mohamedayoubhayouni6306
    @mohamedayoubhayouni6306 5 лет назад +2

    @Antony Cartwright
    You video was very useful for me.
    there is a solution for the issue of modbus. In fact in the last esp-df version (3.2.2) we can use RTS pin in order to control DE/RE pin of the RS485 module.
    It works fine.

    • @AntonyCartwright
      @AntonyCartwright  5 лет назад

      Thanks for your comment! Where can I read more about this? Thanks!

  • @michaelgraff6978
    @michaelgraff6978 5 лет назад +3

    The A and B pins basically indicate a 0 or 1 by A being higher voltage than B, or the other way around.
    I would not connect a logic analyzer directly to them as they are not logic level. They can be negative and much higher than 5 V typical is +/- 7.

    • @AdrianElMeca
      @AdrianElMeca 4 года назад +5

      Logic analyzers normally accept +-30V.

  • @Zapo9668
    @Zapo9668 4 года назад +4

    I didnt see the solution? only the problem? Have the modbus libraries corrected this since your video?

  • @KenHeinrich
    @KenHeinrich 6 лет назад +1

    Just a note on Modbus. Modbus is not always used in the RS-485 mode, it can be use in RS-232, RS-422 or TCPIP. Modbus slave devices can only be multi dropped in RS-485, RS-422 and TCPIP.

    • @AntonyCartwright
      @AntonyCartwright  6 лет назад

      Ken Heinrich hi Ken, I think it can be used with TTL too! :)

    • @KenHeinrich
      @KenHeinrich 6 лет назад

      Yes you can use TTL as well, it can't be multi dropped or be much farther than 6 meters away. I have work on systems where there could be 40 slave devices on an RS-485 multi drop and 600 meters away for the farthest one.

    • @AntonyCartwright
      @AntonyCartwright  6 лет назад

      Oh cool! I've been working with Modbus for several hours today. I send a device a command, it sends on the A+ line, the device receives it and sends a reply... The reply is received (on both lines)... But the A+ lines receives the message with heavy distortion. The B- line is clean. The general result is garbage though. :-( Why would this happen?!?!

    • @KenHeinrich
      @KenHeinrich 6 лет назад

      With RS-485 the data is sent on both A+ and B- at the same time with respect to ground. One is going from ground to a positive 5 volts and the other is going from ground to a negative 5 volts. I one get messed up and the other one does not the data should get through that is the design of RS-485 to be able to go long distances with out total communications fail. Is there a second command being sent before the full message is received that would mess up the data.

    • @AntonyCartwright
      @AntonyCartwright  6 лет назад

      Hi, There's no second command. I've just switched over to a different RS485-TTL converter and the problem is slightly different now. Now it does transmit the message on both lines, but the received message is still corrupted on the A+ line. The message from ESP32 to the converter is perfect, so this puzzles me a bit. Why would the reply be noisy on one line from the device!?!? I'm thinking the actual wire might be damaged or dirty or something.

  • @ilhamjayamahendra5810
    @ilhamjayamahendra5810 4 года назад +1

    can you help me? i have a project, if i use esp32 sim800l how to setting slave address? and how to connect with SCADA?

  • @kasamravi4240
    @kasamravi4240 2 года назад

    why cant we connect esp32 with modbus what is the reason behind it

  • @erikson1882
    @erikson1882 3 года назад +1

    how if the esp32 work on 3.3v man?

  • @samirtaral
    @samirtaral 3 года назад

    Antony Cartwright, I have query about integration of ESp32 and GOT HMI with FX5U through RS485. If i connect Individually, I am able to read the data from PLC but when I connect it together (PLC,HMI and ESP32) It shows error on PLC. I am using ESP32 for data logging . Can you suggest what could be reason for error?

  • @VergilCola
    @VergilCola 5 лет назад +1

    Modbus is now supported on ESP32 esp-idf.

    • @MysteryElectronicz
      @MysteryElectronicz 5 лет назад

      Wish people would do idf tutorials to explain that code.

  • @qzorn4440
    @qzorn4440 2 года назад

    very clever and practical 🥳 thank you

  • @paulofernando4717
    @paulofernando4717 4 года назад +1

    One question, ESP32 works with 3V3 logic, can this Converter Board work with 3v3 logic level?

    • @joaoricardo_5236
      @joaoricardo_5236 4 года назад +1

      Paulo, procure pela interface com alimentação de 3V3 também. Assim, seu nível de tensão de equipara aos níveis do esp32.

    • @paulofernando4717
      @paulofernando4717 4 года назад

      @@joaoricardo_5236 Valeu pela resposta, testei com o ESP e um Arduino(lógica 5V) se comunicando, alimentei o barramento com 5V e funcionou legal.

  • @girefox
    @girefox 2 года назад

    Which code are you using? I'm trying to get started as well but have zero clue...

  • @yam6973
    @yam6973 Год назад

    Hi Antony, you provide interesting infos regarding modbus... is there any planing to provide a link to show wiring (schematic) and/or the code (sketch) for.. that someone else can rebuild your solution? I only found the info to patreon.... Or in an older modbus video to a not working link ;-(( regards

  • @belkocik
    @belkocik 3 года назад +2

    Are you planning to do video with esp8266 and max485 and using a library to send a command to a slave?

  • @AQUATICSLIVE
    @AQUATICSLIVE 3 года назад

    Dang, I need to order one of those analyzers. I am having a similar problem may be able to fix it without the tool but I really am curious to see it myself.

  • @electronic7979
    @electronic7979 6 лет назад

    Excellent

  • @ahmedalirm233
    @ahmedalirm233 7 месяцев назад +1

    Part 2 pls

  • @rickpercy87
    @rickpercy87 5 лет назад

    Hey! I bought one of those logic analyzers. Where did you find the software, mate?

  • @SA-oj3bo
    @SA-oj3bo Год назад +1

    the problem is not the esp32 but the program.... it should switch only from tx mode to rx mode after the serial buffer sended the last byte at the low speed which takes a while.

  • @korishan
    @korishan 6 лет назад

    AAAHHHH Get's us reeled in, laid back in my chair, and left us with a cliffhanger! :P

  • @drhdirutomich2458
    @drhdirutomich2458 Год назад

    .ino ?

  • @quagmire3594
    @quagmire3594 5 лет назад

    Long winded. Too many adverts.