Skip to content

Commit

Permalink
Merge pull request #59 from emsilva/issue#56
Browse files Browse the repository at this point in the history
implements fix on issue 56
  • Loading branch information
jasbur authored Nov 18, 2018
2 parents 7b8a1fc + 9a1b83e commit 5c4c306
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 11 deletions.
1 change: 1 addition & 0 deletions libs/configuration_app/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ def create_wpa_supplicant(ssid, wifi_key):
os.system('mv wpa_supplicant.conf.tmp /etc/wpa_supplicant/wpa_supplicant.conf')

def set_ap_client_mode():
os.system('rm -f /etc/raspiwifi/host_mode')
os.system('rm /etc/cron.raspiwifi/aphost_bootstrapper')
os.system('cp /usr/lib/raspiwifi/reset_device/static_files/apclient_bootstrapper /etc/cron.raspiwifi/')
os.system('chmod +x /etc/cron.raspiwifi/apclient_bootstrapper')
Expand Down
24 changes: 13 additions & 11 deletions libs/reset_device/reset_lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,17 @@ def is_wifi_active():
return wifi_active

def reset_to_host_mode():
os.system('aplay /usr/lib/raspiwifi/reset_device/button_chime.wav')
os.system('rm -f /etc/wpa_supplicant/wpa_supplicant.conf')
os.system('rm -f /home/pi/Projects/RaspiWifi/tmp/*')
os.system('rm /etc/cron.raspiwifi/apclient_bootstrapper')
os.system('cp /usr/lib/raspiwifi/reset_device/static_files/aphost_bootstrapper /etc/cron.raspiwifi/')
os.system('chmod +x /etc/cron.raspiwifi/aphost_bootstrapper')
os.system('mv /etc/dhcpcd.conf /etc/dhcpcd.conf.original')
os.system('cp /usr/lib/raspiwifi/reset_device/static_files/dhcpcd.conf /etc/')
os.system('mv /etc/dnsmasq.conf /etc/dnsmasq.conf.original')
os.system('cp /usr/lib/raspiwifi/reset_device/static_files/dnsmasq.conf /etc/')
os.system('cp /usr/lib/raspiwifi/reset_device/static_files/dhcpcd.conf /etc/')
if not os.path.isfile('/etc/raspiwifi/host_mode'):
os.system('aplay /usr/lib/raspiwifi/reset_device/button_chime.wav')
os.system('rm -f /etc/wpa_supplicant/wpa_supplicant.conf')
os.system('rm -f /home/pi/Projects/RaspiWifi/tmp/*')
os.system('rm /etc/cron.raspiwifi/apclient_bootstrapper')
os.system('cp /usr/lib/raspiwifi/reset_device/static_files/aphost_bootstrapper /etc/cron.raspiwifi/')
os.system('chmod +x /etc/cron.raspiwifi/aphost_bootstrapper')
os.system('mv /etc/dhcpcd.conf /etc/dhcpcd.conf.original')
os.system('cp /usr/lib/raspiwifi/reset_device/static_files/dhcpcd.conf /etc/')
os.system('mv /etc/dnsmasq.conf /etc/dnsmasq.conf.original')
os.system('cp /usr/lib/raspiwifi/reset_device/static_files/dnsmasq.conf /etc/')
os.system('cp /usr/lib/raspiwifi/reset_device/static_files/dhcpcd.conf /etc/')
os.system('touch /etc/raspiwifi/host_mode')
os.system('reboot')
1 change: 1 addition & 0 deletions setup_lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ def copy_configs():
os.system('echo "# RaspiWiFi Startup" >> /etc/crontab')
os.system('echo "@reboot root run-parts /etc/cron.raspiwifi/" >> /etc/crontab')
os.system('mv /usr/lib/raspiwifi/reset_device/static_files/raspiwifi.conf /etc/raspiwifi')
os.system('touch /etc/raspiwifi/host_mode')

def update_main_config_file(entered_ssid, auto_config_choice, auto_config_delay, ssl_enabled_choice, server_port_choice):
if entered_ssid != "":
Expand Down

0 comments on commit 5c4c306

Please sign in to comment.