fix: Serial connections race condition#693
fix: Serial connections race condition#693sansmoraxz wants to merge 2 commits intoedgexfoundry:mainfrom
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #693 +/- ##
==========================================
- Coverage 45.80% 45.26% -0.55%
==========================================
Files 7 7
Lines 834 844 +10
==========================================
Hits 382 382
- Misses 400 410 +10
Partials 52 52 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Signed-off-by: Souyama <souyamadebnath@gmail.com>
674d363 to
ec2c536
Compare
Signed-off-by: Souyama <souyamadebnath@gmail.com>
ec2c536 to
a5f73a6
Compare
|
We should not be mixing baude rates, partity etc on the same port. Perhaps there can be a QOL improvement to bubble this up to the user when they are registering devices. |
|
@sansmoraxz Do you think the serial connection should be locked? Because the Modbus usually doesn't support multiple threads, the driver locks the command by address as shown below: device-modbus-go/internal/driver/driver.go Lines 112 to 119 in ba3804a |
|
It's quite odd, even with the above semaphore we were facing timeout issues with multiple devices. Not entirely sure what was happening then, might need to investigate more. |
Ensure devices registered on serial share the same client
Fixes: #685
If your build fails due to your commit message not passing the build checks, please review the guidelines here: https://github.com/edgexfoundry/device-modbus-go/blob/main/.github/Contributing.md
PR Checklist
Please check if your PR fulfills the following requirements:
BREAKING CHANGE:describing the break)Testing Instructions
Test cases. And against real hardware on same serial port.
New Dependency Instructions (If applicable)
NA