Closed JimitD closed 1 month ago
Hello @JimitD ,
Thank you for this report. Yes, the extended options are missing in the configuration structure. This was not addressed because the esp-modbus uses the legacy function prototypes from freemodbus. This is known issue and will be addressed in feature modbus update where the whole UART configuration structure will be propagated to modbus object constructor. For now, I would recommend you to use delayed init with call the function calls: uart_set_stop_bits , uart_set_word_length, in the application code after setup of modbus here. Note: even if you setup 2 stop bits but the peer sends the frame with one stop bit the ESP32 UART will not be able to recognize absence of one stop bit.
Hi @alisitsyn,
Thank you for the input. I will check this out.
The updated serial options in v2.0.0_beta release: serial options
@JimitD , the documentation for v1.0.x will be updated to describe how to override the communication options:
Closed as solved.
Hello Team,
In '
mb_communication_info_t stuct
' there are no member given to configure 'word_length
' and 'stop_bits
'.Where should I add this parameters to function accordingly.
comm_info.mode = MB_MODE_RTU, comm_info.slave_addr = SALVE_ADDR_; comm_info.port = MB_PORT_NUM; comm_info.baudrate = BAUDRATE_; comm_info.parity = PARITY_; esp_err_t err_slave_setup = ESP_ERROR_CHECK_WITHOUT_ABORT(mbc_slave_setup((void *)&comm_info));