-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add tools folder with systemd service and script * Add fixes in WiFiControl module * Update repo
- Loading branch information
1 parent
8a77201
commit 90b8dba
Showing
7 changed files
with
117 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,14 +2,20 @@ | |
|
||
setup( | ||
name='wificontrol', | ||
version='0.3.2', | ||
author='Ivan Sapozhkov', | ||
author_email='[email protected]', | ||
version='0.4.0', | ||
author='Ivan Sapozhkov, Denis Changin', | ||
author_email='[email protected], [email protected]', | ||
packages=['wificontrol', 'wificontrol.utils'], | ||
license='GPLv3', | ||
url='https://github.com/emlid/reach-wifi-configurator.git', | ||
description='Module for control WiFi connections with host(AP) and client(WPA) modes.', | ||
tests_require="nose", | ||
test_suite="nose.collector", | ||
install_requires=[ | ||
'reachstatus', | ||
'sysdmanager', | ||
'netifaces' | ||
], | ||
extras_require={ | ||
'test': ['pytest', 'pytest-cov'], | ||
}, | ||
long_description=open('README.md').read() | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/usr/bin/python | ||
import signal | ||
from reachstatus import StateClient | ||
from wificontrol import WiFiMonitor | ||
from reach_setup import configure_logging | ||
|
||
|
||
def main(): | ||
configure_logging() | ||
|
||
def handler(signum, frame): | ||
wifi_monitor.shutdown() | ||
|
||
wifi_monitor = WiFiMonitor() | ||
|
||
wifi_monitor.register_callback(wifi_monitor.HOST_STATE, StateClient.set_network_host_state) | ||
wifi_monitor.register_callback(wifi_monitor.CLIENT_STATE, StateClient.set_network_client_state) | ||
wifi_monitor.register_callback(wifi_monitor.OFF_STATE, StateClient.set_network_disabled_state) | ||
wifi_monitor.register_callback(wifi_monitor.SCAN_STATE, StateClient.set_network_scan_state) | ||
wifi_monitor.register_callback(wifi_monitor.REVERT_EVENT, | ||
StateClient.send_revert_connect_notify) | ||
wifi_monitor.register_callback(wifi_monitor.SUCCESS_EVENT, | ||
StateClient.send_success_connect_notify) | ||
|
||
signal.signal(signal.SIGINT, handler) | ||
signal.signal(signal.SIGTERM, handler) | ||
|
||
wifi_monitor.run() | ||
|
||
|
||
if __name__ == '__main__': | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
[Unit] | ||
Description=Reach WiFi Status Monitor | ||
After=reach_status.service | ||
|
||
[Service] | ||
Type=simple | ||
ExecStart=/usr/bin/wifimonitor | ||
Restart=always | ||
RestartSec=1 | ||
|
||
[Install] | ||
WantedBy=multi-user.target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters