-
Notifications
You must be signed in to change notification settings - Fork 7.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Odd parity not available for Modbus RTU slave (IDFGH-4560) #6377
Comments
Hi @devward, Thank you for this issue. This happens because of incorrect propagation of parity options from modbus controller to 0002_fix_mb_controller_parity_ussue.patch.log Please check if this fixes the issue. Thanks. |
Hi @DevArd, Could you check the fix and confirm that it works in your case? |
Hi @alisitsyn Sorry for my late reply, I only tested it on one device and it worked but as we remove odd parity from our latest release we haven't tested it properly. Cheers |
@devward , |
Closes espressif/esp-idf#6377 * Original commit: espressif/esp-idf@b554d4d
Hi,
Odd parity is not supported in slave rtu mode (maybe master as well, I didn't check). When trying to set the parity to UART_PARITY_ODD the esp32 fails:
MB_CONTROLLER_SLAVE: mbc_serial_slave_setup(79): mb wrong parity option = (0x3)
I saw in the last commit of the files
esp-idf/components/freemodbus/serial_slave/modbus_controller/mbc_serial_slave.c
andesp-idf/components/freemodbus/port/portserial.c
the code checks that the parity is not higher than UART_PARITY_EVEN which would be 0x02 in lines 78 and 187 respectively. I modified the checks and ran the app again, got no error but it wouldn't work with odd parity.Commit:
66fb5a29bbdc2482d67c52e6f66b303378c9b789
What is the reason for no odd parity?
The text was updated successfully, but these errors were encountered: