Exemplo n.º 1
0
 def test_connect(self):
     i_a = InterfaceNetconnect(ZMQ_IFACE)
     i_a.connect({
         'lte': {
             'name': 'ppp',
             'metric': 300,
             'lte': {
                 'apn': 'internet',
                 'number': '*99#',
                 'user': None,
                 'password': None,
             }
         }
     })
Exemplo n.º 2
0
 def test_connect(self):
     i_a = InterfaceNetconnect(ZMQ_IFACE)
     i_a.connect({
         'wifi_ap': {
             'name': 'wlan0',
             'wifi_ap': {
                 'ssid': 'TESTAP',
                 'channel': 6
             },
             'ipv4': {
                 'ip': '10.10.10.10',
                 'netmask': '255.255.255.0',
             },
         }
     })
Exemplo n.º 3
0
 def test_connect(self):
     i_a = InterfaceNetconnect(ZMQ_IFACE)
     i_a.connect({
         'lan': {
             'name': 'eth0',
             'lan': {},
             'ipv4': {
                 'dhcp': True,
             },
             #'ipv4': {
             #    'ip': '192.168.1.200',
             #    'netmask': '255.255.255.0',
             #    'gw': '10.10.10.1',
             #    'dns': ['8.8.8.8', '8.8.4.4']
             #},
         }
     })
Exemplo n.º 4
0
 def test_connect(self):
     i_a = InterfaceNetconnect(ZMQ_IFACE)
     i_a.connect({
         'wifi_client': {
             'usb_port': '4-1:1.0',
             'wifi_client': {
                 'ssid': 'huawei-p10',
                 'key': 'hrnek123'
             },
             'ipv4': {
                 'dhcp': True
             },
             #'ipv4': {
             #    'ip': '10.10.10.10',
             #    'netmask': '255.255.255.0',
             #    'gw': '10.10.10.1',
             #    'dns': ['8.8.8.8', '8.8.4.4']
             #},
         }
     })
Exemplo n.º 5
0
log.info(json.dumps(config, indent=4, sort_keys=True))
store = Manager().dict()
store['config'] = config
store['counter'] = config['ap_timeout']

i_n = InterfaceNetconnect()
i_n.wait_for_ready()
ncfg = get_netconnect_config(config)
# scan for wifi network
i_n.connect({
    'wifi_client': {
        'name': 'wlan0',
        'wifi_client': {
            'ssid': 'scan'
        },
        'ipv4': {
            'dhcp': True
        }
    },
    'wifi_ap': None
})
time.sleep(1)
store['scan_result'] = i_n.wifi_scan()
# set wifi access point
ncfg = get_netconnect_config(config)
if config.get('ap_key', None) is not None:
    wifi_ap['wifi_ap']['key'] = config.get('ap_key', None)

ncfg['wifi_ap'] = wifi_ap
ncfg['wifi_client'] = None
i_n.connect(ncfg)
Exemplo n.º 6
0
 def test_disconnect(self):
     i_a = InterfaceNetconnect(ZMQ_IFACE)
     i_a.connect({'wifi_client': None})
Exemplo n.º 7
0
 def test_disconnect(self):
     i_a = InterfaceNetconnect(ZMQ_IFACE)
     i_a.connect({'lte': None})