cloudmesh-common.cloudmesh.common.wifi

Implementation of a function the set the WIFI configuration. This function is primarily developed for a Raspberry PI

Module Contents

Classes

Wifi

The class is used to group a number of useful variables and functions so

class cloudmesh-common.cloudmesh.common.wifi.Wifi

The class is used to group a number of useful variables and functions so it is easier to program and manage Wifi configurations.

The default location for the configuration file is

/etc/wpa_supplicant/wpa_supplicant.conf

location = /etc/wpa_supplicant/wpa_supplicant.conf
template_key
template_psk
template
static set(ssid=None, password=None, country='US', psk=True, location=location, sudo=False)

Sets the wifi. Only works for psk based wifi

Parameters
  • ssid (str) – The ssid

  • password (str) – The password

  • country (str) – Two digit country code

  • psk (bool) – If true uses psk authentication

  • location (str) – The file where the configuration file should be written to

  • sudo (bool) – If tru the write will be done with sudo

Returns

True if success

Return type

bool