Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
RS485 not receiving anything
#1
Question 
Hi,

I have the A16 wired up to a RS485 expansion board (16 inputs, 16 outputs) that is controlled by modbus RTU.

I have the ESP32 programmed with ESPHome. I can send commands to the expansion board, and I have control over the outputs (I see the onboard output-LEDs toggling), and I can see from the onboard communication LED on the expansion board that the expansion board sends a modbus response, but the ESP32 on the A16 does not receive anything on pin 16 (485RX).

I have verbose logs activated on the UART defined in ESPHome. I can see the raw bytes leaving on pin 13 (485TX), but no bytes are arriving on pin 16.
Obviously, I also cannot read the inputs of the expansion board (as that would require receiving the modbus response).

Are you sure that the RX pin number is correct? Could it be that I have a broken pcb trace?

Best regards,

Victor

P.S. Below is the relevant part of the esphome configuration

Code:
logger:
  level: VERY_VERBOSE

uart:
  id: mod_bus
  tx_pin: 13
  rx_pin: 16
  baud_rate: 9600 #115200
  stop_bits: 1
  debug:
    direction: BOTH
    dummy_receiver: false
    after:
      timeout: 1s
    sequence:
      - lambda: UARTDebug::log_hex(direction, bytes,' ');

modbus:
  id: modbus1
  send_wait_time: 250ms
  disable_crc: true

modbus_controller:
  - id: eletechsup
    ## the Modbus device addr
    address: 0x1
    modbus_id: modbus1
    setup_priority: -10

sensor:
   - platform: modbus_controller
     modbus_controller_id: eletechsup
     name: "read channel 1 state"
     id: eletech_channel1_state
     custom_command: [ 0x01, 0x03, 0x00, 0x01, 0x00, 0x01 ]
     value_type: U_WORD

switch:
  - platform: modbus_controller
    modbus_controller_id: eletechsup
    id: eletech_toggle_1
    name: "Eletech toggle 1"
    icon: "mdi:toggle-switch"
    address: 0x1
    register_type: holding
    skip_updates: 0
    lambda: |-
      return true;
    write_lambda: |-
      ESP_LOGD("main","Modbus Switch incoming state = %f",x);
      // return false ; // use this to just change the value
      payload.push_back(0x1);  // device address
      payload.push_back(0x6);  // write register
      payload.push_back(0x0);  // high byte address of the register
      payload.push_back(0x1);  // low byte address of the register
      payload.push_back(0x3);  // command (3=toggle)
      payload.push_back(0x0);  // delay (0)
      return true;
Reply


Messages In This Thread
RS485 not receiving anything - by victorclaessen - 03-28-2023, 03:53 PM
RE: RS485 not receiving anything - by admin - 03-29-2023, 12:20 AM
RE: RS485 not receiving anything - by admin - 03-31-2023, 04:55 AM
RE: RS485 not receiving anything - by admin - 03-31-2023, 01:21 PM
RE: RS485 not receiving anything - by admin - 03-31-2023, 02:11 PM
RE: RS485 not receiving anything - by admin - 04-11-2023, 01:24 PM
RE: RS485 not receiving anything - by admin - 04-12-2023, 06:19 AM
RE: RS485 not receiving anything - by admin - 04-19-2023, 12:54 AM
RE: RS485 not receiving anything - by admin - 04-20-2023, 06:34 AM
RE: RS485 not receiving anything - by admin - 05-01-2023, 11:45 AM
RE: RS485 not receiving anything - by Yocee - 01-14-2024, 03:35 PM
RE: RS485 not receiving anything - by aucirc - 10-06-2024, 03:36 PM
RE: RS485 not receiving anything - by admin - 10-07-2024, 01:10 AM

Forum Jump:


Users browsing this thread: