### Managing a Digi Device with dgrp_cfg_node

The dgrp_cfg_node tool is a command-line based configuration program designed to automate a number of steps which are required in order to enable the serial ports on Digi devices for general use. The path to the dgrp_cfg_node executable is /usr/bin/dgrp/config.

The dgrp_cfg_node tool has four modes of operation:

Operation | Description
init operation | This operation can be used to add or reinitialize a Digi device in Linux.
uninit operation | This operation removes a Digi device from Linux.
stop operation | This operation stops a RealPort daemon.
start operation | This operation attempts to start a RealPort daemon.

#### About the RealPort ID

The RealPort tools refer to an individual Digi device with an ID. You must choose the ID to use for each Digi device, and this ID must be unique within your system. The dgrp_cfg_node init operation allows you to assign an ID to a Digi device.

A RealPort ID consists of one or two alphanumeric characters. The underscore character may be used in the ID.

Once an ID is assigned, the device files in the /dev directory which are created by the package will encode the ID into the device name. This allows one, by inspection, to determine which Digi device with which a particular device is associated. For more information on the device naming, see About RealPort Devices.

#### The init Operation

The init operation has the following effects:

- If necessary, it will attempt to load the driver module.
- It will determine whether a daemon is already running for the specified node. If it is not running, it will start the daemon.
- It will create all necessary device files in the /dev directory. If a device file exists, the ownership and permissions are preserved.

The standard usage requires a command like:

> `dgrp_cfg_node init ID IPaddr ports`

The parameters are defined as follows:

Parameter | Definition
init | Indicates the operation being requested
ID | Assigns the supplied ID to the Digi device. A RealPort ID consists of one or two alphanumeric characters. The underscore character may be used in the ID.
IPaddr | Either an IP address or an IP name may be assigned to the daemon via this parameter.
ports | This parameter indicates the number of device files which should be created for this particular Digi device. This does not have to match the physical number of ports, but physical ports beyond the ports value specified will be unavailable. The maximum number of ports supported by the tool is 64.

For further details, see the dgrp_cfg_node man page, which is installed with this package.

#### The uninit Operation

The uninit operation has the following effects:

- It will determine whether a daemon is running for the specified Digi device, and if so, will kill it.
- It will erase all information about this Digi device from its internal database (this distinguishes the behavior from that of stop; please see below).

The standard usage requires a command like:

> `dgrp_cfg_node uninit ID`

The parameters are defined as follows:

Parameter | Definition
uninit | Indicates the operation being requested
ID | Specifies which Digi device to unconfigure.

  Note: The command will fail if any ports are in use. Be sure to kill all applications using the Digi device ports before uninitialization.

  Note: Even if you have removed all of the Digi devices you have previously registered with the driver, the dgrp_cfg_node utility will not unload the driver module.

  For further details, see the dgrp_cfg_node man page, which is installed with this package.

#### The stop operation

The stop operation has the following effect:

- It will determine whether a daemon is running for the specified Digi device, and if so, will kill it.
- The RealPort software retains the information associated with this ID, so that the daemon can be restarted with a minimum of information.

The simplest usage requires one to execute a command with a form similar to:

`dgrp_cfg_node stop ID`

The parameters are defined as follows:

Parameter | Definition
stop | Indicates the operation being requested
ID | Specifies which Digi device's daemon to stop.

One might stop a daemon in order to change the daemon's parameters, like the IP address (i.e. stop, then restart with new parameters). For further details, please see the dgrp_cfg_node man page, which is installed with this package.

#### The Start Operation

The start operation determines whether a daemon is running for the specified node, and if not, will attempt to execute a daemon based on the supplied parameters.

The simplest usage requires one to execute a command with a form similar to:

> `dgrp_cfg_node start ID IPaddr`

The parameters are defined as follows:

Parameter | Definition
start | Indicates the operation being requested
ID | Specifies which Digi device's daemon to start.
IPaddr | The (possibly new) IP address or IP name to use when referring to the Digi device with the specified ID.

For further details, see the dgrp_cfg_node man page, which is installed with this package.