Replies: 5 comments 1 reply
-
Modbus uses mostly RS485. Then you require a |
Beta Was this translation helpful? Give feedback.
-
Thank you @sosi-deadeye . I think I didn't explain myself clear enough. I have 4 sensors and then 4 RS485 to TTL converters. Each of these converter has A and B terminal wired to a pair of esp32 pins. As esp32 has only 3 UART ports available, my doubt is if there will be any issue if a constantly do this for reading data from sensors 3 and 4:
|
Beta Was this translation helpful? Give feedback.
-
You'd need to ensure that the unused TX pin was set high immediately after moving the UART to another pin. So long as the sensors only transmit when requested I think it might work. If they send unsolicited messages it would be a can of worms. |
Beta Was this translation helpful? Give feedback.
-
Unless you have very tight timing requirements or your sensors aren't addressable, I don't see the point of using multiple UARTs at all. |
Beta Was this translation helpful? Give feedback.
-
Thank you @peterhinch and @karfas . It makes perfect sense. @karfas you mention a really interesting solution of using a single RS485 to TTL converter, no matter the number of sensors if you read data sequentially. I can't figure out how if you're using a single converter (and as I understand if you have 4 sensors you connect 4 wires to A pin of the converter and 4 wires to B pin of the converter) you can identify which sensor to communicate with |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I'm trying to read data from 4 sensors (via modbus RTU protocol) using an esp32. As this board has only 3 UARTs (UART0,UART1,UART2), I wonder if it would be a problem or a bad practice in the long term to share a port for two sensors and continously (once a minute) overwrite this UART port and reinitialize it with the communication parameters (pins,baudrate,parity,etc.) of the other sensor.
(I don't need to read data from sensors simultanously, it could be sequently)
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions