wifi

Python scan for WiFi

≯℡__Kan透↙ 提交于 2019-12-05 02:50:20
问题 I was searching for a program that can scan for WiFi networks and print all of the SSIDs. I tried with scapy but I failed. I am using the pyCharm editor. I tried this code: from scapy.all import * from scapy.layers.dot11 import Dot11 def packet_handler(pkt): if pkt.haslayer(Dot11) and pkt.type == 2: print(pkt.show()) scapy.sniff(iface="mon0", prn=packet_handler) 回答1: try pip install wifi then for scanning use from wifi import Cell, Scheme Cell.all('wlan0') This returns a list of Cell objects.

Android Find the device's ip address when it's hosting a hotspot

天大地大妈咪最大 提交于 2019-12-05 02:49:55
I need to find the device's ip address when it's hosting a hotspot. I've used this code so far : //if is using Hotspot for (Enumeration<NetworkInterface> en = NetworkInterface.getNetworkInterfaces(); en.hasMoreElements();) { NetworkInterface intf = en.nextElement(); if (intf.getName().contains("wlan")) { for (Enumeration<InetAddress> enumIpAddr = intf.getInetAddresses(); enumIpAddr.hasMoreElements();) { InetAddress inetAddress = enumIpAddr.nextElement(); if (!inetAddress.isLoopbackAddress() && (inetAddress.getAddress().length == 4)) { return inetAddress.getHostAddress(); } } } } This works

iOS: Can I manually associate wifi network with geographic location?

独自空忆成欢 提交于 2019-12-05 02:20:39
问题 Is it possible to make the phone to "know" that a specific wifi network is at specific geographic location? if (answer == YES) { than how? } else { can the phone figure this out by himself? } Another similar question: is there any way to start monitor a region with accuracy of ~100m but telling the CLLocationManager to use only by wifi networks and cellular antenas? Because I don't want to power up the GPS no matter what... Thanks! 回答1: iPhone positioning sucks and there is nothing you can do

iOS UIBackgroundMode remote-notification doesn't work on 4G

試著忘記壹切 提交于 2019-12-05 02:09:54
I'm testing push notifications with content-available=1, and they don't seem to be delivered to the app in the background unless on Wi-Fi. I have a simple log statement at the beginning of the push notification handler: - (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^) (UIBackgroundFetchResult))completionHandler { NSLog(@"Notification received: %@", userInfo); completionHandler(UIBackgroundFetchResultNewData); } Here is my test: Run the app, then press the home button to put the app in the background. Send a

is p2p0 a wireless interface for WIFI DIRECT in android?

╄→гoц情女王★ 提交于 2019-12-05 01:25:34
问题 when i print all interfaces in my android device: 03-10 19:50:15.484: I/System.out(22415): lo 03-10 19:50:15.494: I/System.out(22415): upnlink0 03-10 19:50:15.504: I/System.out(22415): svnet0 03-10 19:50:15.504: I/System.out(22415): rmnet0 03-10 19:50:15.514: I/System.out(22415): rmnet1 03-10 19:50:15.524: I/System.out(22415): rmnet2 03-10 19:50:15.534: I/System.out(22415): sit0 03-10 19:50:15.544: I/System.out(22415): ip6tnl0 03-10 19:50:15.554: I/System.out(22415): p2p0 03-10 19:50:15.564:

Start Androids WiFi-Manager by sending an intent?

半城伤御伤魂 提交于 2019-12-05 01:06:59
问题 I´m developing an application, where I´d like to have a button, which opens Androids built-in WiFi menu... (I don´t really want to implement scanning and connecting code by myself). Is there any Intent I can send which opens this menu? 回答1: You should use ACTION_PICK_WIFI_NETWORK action: startActivity(new Intent(WifiManager.ACTION_PICK_WIFI_NETWORK)); 回答2: Also, if you want to implement it yourself (so it looks like your app), the Android SDK offers the WifiManager-class, which should do most

Cannot program ESP8266

孤街浪徒 提交于 2019-12-05 00:45:12
问题 Blue led is blinking after powering up the module, the red one stays on, I can even connect to it via wifi. But I cannot program it. I tried Arduino IDE, different firmware flashers (Like NodeMCU, XTCOM). I'm using Arduino Mega. Here's my initial setup: VCC - 3.3 V on Arduino RST - nothing CH_PD - 3.3 V on Arduino TX - RX on Arduino (TX is transmitting data to RX, so I don't need a voltage divider, right?) RX - voltage divider (R1 = 10K, R2 = 20K) - TX on Arduino GPIO0 - GND on Arduino GPIO2

Android wifimanager always returns true

大城市里の小女人 提交于 2019-12-05 00:39:32
问题 This is killing me and any help would be greatly appreciated. I want to connect to an open network using wifi manager. The problem I am having is that the code claims connection to any network - even non-existing ones. Below is the entire code that gets executed and gets called with the SSID of a network. It does not matter what string you pass to it as the SSID of a network, even if no such network exists in any shape or form, the enableNetwork claims returns true, which I believe means it

Can I prevent iPhone from using 3G under any circumstances?

非 Y 不嫁゛ 提交于 2019-12-05 00:08:35
I'm writing a travel guide related app that will download large databases (60meg) potentially overseas, with the reachability code I can tell when a host is reachable via wifi or 3g BUT I'm worried that if for some reason the wifi connection breaks for a minute or so as some DSL connections are likely to do on occasion the iphone will switch transparently to 3G and without realising I could be racking up someones phone bill with overseas data charges! So I'm wondering if anyone has any experience, in the event of such break in wifi connectivity (wifi still works but it's connection to the net

get internet speed (WIFI & Data)

落花浮王杯 提交于 2019-12-04 21:24:34
I am making an App and I need to get the internet speed!I can find the wifi speed with WifiInfo clasd but I couldn't find any code or library to get the mobile data speed! Should I use libraries or there is classes in Android available? Gira It is hard to determine the mobile speed precisely, but you can estimate the speed based on the connectivity type (EDGE, HSPA): public static boolean isConnectedFast(final Context context) { final NetworkInfo info = getNetworkInfo(context); return (info != null) && info.isConnected() && isConnectionFast(info.getType(), info.getSubtype()); } public static