Skip to content

muchosun/drone-employee-connect

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

95 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DroneEmployee Connect

Ground station administrative tool stack

File wifi.py

This file contains a set of functions for connecting wifi modules directly to the docker container of the drone.

For example:

def spawn(name, wlan, ssid, password):
    c = from_env().containers.get(name)
    iwcall = 'iw phy phy{0} set netns {1}'.format(wlan[-1], c.attrs['State']['Pid'])
    wpacall = 'sh -c "wpa_passphrase {0} {1} > /tmp/wpa.conf"'.format(ssid, password)
    supcall = 'sudo wpa_supplicant -B -i {0} -c /tmp/wpa.conf'.format(wlan)
    print(system_call(iwcall))
    print(c.exec_run(wpacall))
    print(c.exec_run(supcall))
    print(c.exec_run('sudo dhcpcd {0}'.format(wlan)))

This function generates a system request to transfer the adapter to the docker container.

We use this function

...
   for name, wlan, ssid, password in links:
        spawn(name, wlan, ssid, password)

About

Ground station administrative tool stack

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • JavaScript 84.8%
  • Python 11.2%
  • HTML 2.2%
  • Shell 1.1%
  • Other 0.7%