
This command can be used to set the global network configuration, that is, if one or two network interfaces will be used and how they work together.
NET requires one or two arguments. The first one is the network selector and the second, optional one, enables or disables network bridging mode.
The first argument must be one of the following:
GSM
Since firmware version 6.05. Only GSM is enabled. This requires a GSM modem attached to the AVISARO module.
WLAN
Only WLAN is enabled. This is an absolute setting that does not probe for other network components.
ETH
Only Ethernet is enabled. Same as WLAN but requires an ENC28J60-chip.
NONE
All network interfaces are disabled. Networking is not possible even if a network interface exists.
AUTO
The module first probes if a WLAN interface exists. If that succeeds, WLAN will be usedas network interface. If no WLAN interface is found, the module then checks for the presence of Ethernet interface.
BOTH
Both, WLAN an Ethernet are used simultaneously. This is mandatory for bridging mode.
The second argument can be:
BRIDGE
Bridging mode is enabled. In bridging mode, Ethernet packets are transparently routed over WLAN and vice versa. Also the first argument of NET must be BOTH for this to work.
NOBR
Bridging mode is disabled.
Like the most configuration commands, NET settings are effective after next reboot.
ERR_OK (0) if command was accepted
ERR_ARGUMENT (4) if one or more arguments don't match
NET WLAN NOBR
Uses WLAN-only mode and switches previous enabled bridging off
This command has no effect, if the module has neither a WLAN nor an Ethernet interface.
With NET? the current network configuration can be queried and printed to the I/O interface. The output consists of two or three words that reflect the network configuration status. The first word is always the setting that has been made by using the NET command. The second word is the actual network configuration. For example: If NET was invoked with AUTO and the firmware found a WLAN module, then NET? will give AUTO WLAN. If the network was configured to use bridging mode (that is: NET BOTH BRIDGE), NET? will give BOTH BOTH BRIDGE, if both network devices are functional so that bridging can take place. Here are some example outputs:
AUTO WLAN
When AUTO was selected and WLAN is found
BOTH WLAN
When BOTH was selected but only WLAN is found. Potentially enabled bridging is OFF in this case, because bridging requires both interfaces but only one is active.
BOTH BOTH
When BOTH was selected without bridging and both network interfaces was found.
WLAN NONE
When WLAN was selected but can't be activated.
BOTH BOTH BRIDGE
When BOTH was selected with bridging and both interfaces are active so that bridging can be performed.
Some more combinations are possible, such as NONE NONE etc.