Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds comprehensive interface management to NomadNet. It allows the user to create, edit, disable / enable, and monitor interfaces in realtime under the
[ Interfaces ]
tab. Currently it's submitted as a draft for review and feedback.Adding interfaces
Ctrl + A lets the user add a new interface. The user selects in a dialog the interface type, then proceeds to the
AddInterfaceView
. TheINTERFACE_FIELDS
dict defines the behavior for how input is validated and transformed based interface on type. Common interface fields are defined inCOMMON_INTERFACE_OPTIONS
which display under "Show more options" in the add dialog.A set of Urwid form widget classes has been added in
FormWidgets.py
for this purpose. This can also be extended to allow the user to edit the NomadNet, LXMF, or RNS config interactively from the application itself.Certain interface types will have custom options inside of the Add and Edit views. For example, interfaces with a port field have an interactive port picker with the option to refresh ports and when

pyserial
is available. The RNodeInterface has a built in on-air parameter calculator that updates as the fields are changed, showing bitrate and link budget calculations.Each interface type in
INTERFACE_FIELDS
can haveadditional_options
which are shown undre "Show more options".All fields are validated based on an array of set rules, for example
['required', 'float']
. Any validation errors will be shown to the user. The behavior of the values from each FormWidget input is described in thetransform
key. For example, on the RNodeInterfacefrequency
is entered in MHz as opposed to Hz for ease of use. The transform key is:"transform": lambda x: int(float(x.strip()) * 1000000)
Viewing interfaces
Pressing "Enter" on the selected interface will bring you to the ShowInterface view. This view contains the Interface information and interactive charts that display the RX and TX traffic over a set history length.

From here the interface can be enabled / disabled, and edited. The shortcuts are displayed below in the shortcut bar.
The chart system is derived from pyasciichart and supports both unicode and plain characters. It is also supported on lower-width terminals. Pressing
v
will toggle a vertical view, while pressingh
will toggle a horizontal view. This may be expanded in the future to contain more interactive charts, such as noise floor and channel capacity for RNodes.Editing interfaces
Editing interfaces is identical to adding interfaces, except the fields are automatically populated.
EditInterfaceView
is a child ofAddInterfaceView
Interfaces can also be edited and removed directly from the list using keyboard shortcuts when they are selected.

Remaining Tasks:
If there are any features you want added or changed, let me know. Thanks!