Modbus not usable with USB serial
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- c
- Domain
- embedded-iot
Research direction
Start with apps/nshlib/nsh_usbconsole.c and the nsh_waitusbready() function to understand how USB serial removal and reconnection are handled. Then inspect Modbus handling around select() and read(), including its error handling. Done means a lost USB serial connection no longer causes an infinite loop and the serial driver can be reopened after reconnection.
Written by the indexing model from the issue text.
Description
Modbus can be used with USB serial, however, if the USB serial connection is lost, Modbus will hang in an infinite loop.
This is a problem in the handling of select() and read() and could probably resolved by studying the Modbus error handling.
A more USB-friendly solution would be to: (1) Re-connect and (2) re-open the serial drivers. That is what is done is NSH: When the serial USB device is removed, this terminates the session and NSH will then try to re-open the USB device. See the function nsh_waitusbready() in the file apps/nshlib/nsh_usbconsole.c. When the USB serial is reconnected the open() in the function will succeed and a new session will be started.
This is really an enhancement request: Modbus was never designed to work with removable serial devices.
- Dominant language
- C
- Stars
- 465
- Forks
- 782
- Avg merge
- 4d 4h
- Merged PRs (30d)
- 42
Getting set up
We have not checked this project's setup files yet. Start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from apache/nuttx-apps
-
Type: Enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
apache/nuttx-apps#3620 · 5 comments · 1 reaction ·
Maintainers usually reply within 1 day
-
Type: Enhancement
Difficulty 3/5 1-2 days Newbie friendliness 68/100
apache/nuttx-apps#3796 ·
Maintainers usually reply within 1 day
-
Type: Bug
Difficulty 4/5 3-5 days Newbie friendliness 52/100
apache/nuttx-apps#3634 · 1 comment ·
Maintainers usually reply within 1 day
-
[TODO] move graphics/input -> input.May be free again @cederom claimed this 185 days ago, and no pull request is open. Open
apache/nuttx-apps#3436 · 1 assignee ·
Maintainers usually reply within 1 day
-
[FEATURE/SECURITY/BUG] Add hash key validation to check the files downloaded from external projectsOpenType: Bug
Difficulty 4/5 3-5 days Newbie friendliness 35/100
apache/nuttx-apps#3418 ·
Maintainers usually reply within 1 day
All issues in apache/nuttx-apps
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
johnsonjh/emu2-cpm86#68 · 1 comment ·
Maintainers usually reply within 1 day
-
Zenmap CrashOpenZenmap
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 2 days
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
fastfetch-cli/fastfetch#2619 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 1 day
-
Template: Bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
betaflight/betaflight#15759 ·
Maintainers usually reply within 1 day