lanclient – Ethernet LAN connection manager

Note

A global instance of the NetworkManager is instantiated in this module. It is strongly recommended to use this instance instead of creating a new one.

Import a global instance like this:

from lanclient import nmcli

Classes

class lanclient.NetworkManager
property ssid

Returns ‘LAN’ (constant value). This property has no meaning for this module and is provided for compatibility with the wificlient module.

property connected

Returns the LAN client connection status (True if the LAN IC is power on and has a valid IP).

property ip

Returns the IP of the board (as a string), or 0.0.0.0.

off()

Deactivates the LAN IC. The method safely be called more than once.

ifconfig()

Returns a tuple of (ip, netmask, gateway, dns) or None

defaults()

Configures the default connection: static ip 192.168.1.1 with 255.255.255.0 netmask.

connect()
Async

Tries to acquire a dynamic IP (if enabled in by the board config), or to set a static IP from the board config (if DHCP is disabled). In case of error, the default config is used (ref defaults()).

watcher()
Async

This is a stub (does nothing). Provided for compatibility with the wificlient module.