Skip to content

Commit

Permalink
Merge pull request #248 from ks156/issue_172
Browse files Browse the repository at this point in the history
Fix #172 : Auto to AP when STA is not reachable
  • Loading branch information
drasko committed Oct 17, 2015
2 parents d9f88f3 + f72e751 commit f0efe87
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 2 additions & 1 deletion config.weio
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"absolut_root_path": "",
"auto_to_ap": "YES",
"debug_mode": "False",
"dependencies_path": "www",
"dns_name": "weio.local",
Expand Down Expand Up @@ -31,4 +32,4 @@
"weio_update_official_repository": "https://api.github.com/repos/nodesign/weio/releases",
"weio_update_use_official_repository": "YES",
"weio_version": "1.1"
}
}
6 changes: 5 additions & 1 deletion weioWifi/weioWifi.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@

from weioLib import weioSubprocess
from weioLib import weioIpAddress
from weioLib import weioConfig


logging.basicConfig()
Expand Down Expand Up @@ -112,7 +113,10 @@ def checkConnection(self) :
else:
self.disconnectedCounter = 0

if ( self.disconnectedCounter >= 2 or (self.mode == "sta" and weioIpAddress.getLocalIpAddress() == '') ):
config = weioConfig.getConfiguration()

if ((self.disconnectedCounter >= 2 or (self.mode == "sta" and weioIpAddress.getLocalIpAddress() == ''))
and config['auto_to_ap'] == "YES"):
# Move to Master mode
print "Trying to move to AP RESCUE mode..."
subprocess.call("scripts/wifi_set_mode.sh rescue", shell=True)
Expand Down

0 comments on commit f0efe87

Please sign in to comment.