setup_pilot

Run as a module as root.

Creates a npyscreen.SplitForm to prompt the user in the command line for parameters to set up a Pilot

Prompts user to create a run script or a systemd service.

Sets the following params:

  • NAME - The name used by networking objects to address this Pilot

  • BASEDIR - The base directory for autopilot files (/usr/autopilot)

  • PUSHPORT - Router port used by the Terminal we connect to.

  • TERMINALIP - IP Address of our upstream Terminal.

  • MSGPORT - Port used by our own networking object

  • PINS - Any hardware and its mapping to GPIO pins. No pins are required to be set, instead each task defines which pins it needs. Currently the default configuration asks for

  • AUDIOSERVER - Which type, if any, audio server to use (‘jack’, ‘pyo’, or ‘none’)

  • NCHANNELS - Number of audio channels

  • FS - Sampling rate of audio output

  • JACKDSTRING - string used to start the jackd server, see the jack manpages eg:

    jackd -P75 -p16 -t2000 -dalsa -dhw:sndrpihifiberry -P -rfs -n3 -s &
    
  • PIGPIOMASK - Binary mask of pins for pigpio to control, see the pigpio docs , eg:

    1111110000111111111111110000
    
  • PULLUPS - Pin (board) numbers to pull up on boot

  • PULLDOWNS - Pin (board) numbers to pull down on boot.

class autopilot.setup.setup_pilot.PilotSetupForm(name=None, parentApp=None, framed=None, help=None, color='FORMDEFAULT', widget_list=None, cycle_widgets=False, *args, **keywords)[source]

Bases: npyscreen.fmForm.Form

create()[source]

Programmers should over-ride this in derived classes, creating widgets here

afterEditing()[source]
class autopilot.setup.setup_pilot.HardwareForm(name=None, parentApp=None, framed=None, help=None, color='FORMDEFAULT', widget_list=None, cycle_widgets=False, *args, **keywords)[source]

Bases: npyscreen.fmForm.Form

create()[source]

Programmers should over-ride this in derived classes, creating widgets here

afterEditing()[source]
class autopilot.setup.setup_pilot.SetupApp[source]

Bases: npyscreen.apNPSApplicationManaged.NPSAppManaged

onStart()[source]

Override this method to perform any initialisation.

autopilot.setup.setup_pilot.unfold_values(v)[source]

Unfold nested values from the SetupForm. Called recursively.

Parameters:v (dict) – unfolded values
autopilot.setup.setup_pilot.make_dir(adir)[source]

Make a directory if it doesn’t exist and set its permissions to 0777

Parameters:adir (str) – Path to the directory