piview.Network

Module Contents

Classes

Network

class piview.Network.Network[source]
static host_name()[source]

Provide the host name to the user

Return type

string

Returns

The host name of the Pi

static eth_name(_type=None)[source]

Provide the Ethernet interface name

Parameters

_type – string, possible options are: enx or eth

Return type

string

Returns

The network interface name

static mac(interface='eth0')[source]

Provides the hardware MAC address for the interface requested

Default is eth0

Parameters

interface – string, the interface name to query

Return type

string

Returns

Mac address of the selected interface

static ip(interface='eth0')[source]

Provide IP Address from the named interface

Default is eth0

Uses the ifconfig command to create a text file, then processes this file to obtain the IP address.

Parameters

interface – string, the interface to obtain the IP address for

Return type

string

Returns

IPv4 address of the selected interface