wifi

HTTP request to update rails model from arduino

好久不见. 提交于 2019-12-08 13:45:26
问题 I have a rails model called "barrel" that has an attribute "gallons". I want to update the "gallons" attribute of certain barrels from an arduino (Boarduino v2.0) and Adafruit CC3000 WiFi module. My rails app is living at port 3000 on my computer. localhost:3000/barrels I made a barrels scaffold, so it has a controller with an update method: # PUT /barrels/1 # PUT /barrels/1.json def update @barrel = Barrel.find(params[:id]) respond_to do |format| if @barrel.update_attributes(params[:barrel])

How to measure latency in a wifi network java android

本小妞迷上赌 提交于 2019-12-08 13:44:42
问题 I am developing a mobile app, I need some parameters to implement the algorithm, and I do not know how to measure latency in a wifi network. Some people says using ping, but I do not know how implement this. This is my first question, I am learning. Thank you. 回答1: Please have a look at this answer it might be what you are after you might want to try the following code sample to measure time to do something String host = "172.16.0.2"; int timeout = 3000; long beforeTime = System

Listening to WiFi packets

落花浮王杯 提交于 2019-12-08 13:37:57
问题 I'm only in the pre-first stage of the project, so the question is very straight forward and basic. I like to listen to (using Java/C++) every WiFi packets in the range of my laptop, all I care for are the message headers and the very existence of the message so encryption doesn't really play a role here. Is there a way to get that from Windows(8)/Ubuntu? I didn't manage to find any sort of API form Broadcom, so I guess accessing the card directly won't be trivial. If that's impossible then I

Require Android program to connect to a wifi printer and physically print contents

佐手、 提交于 2019-12-08 13:04:14
问题 I have an Android program that consumes an asp web service. Now I want my Android program to connect to a wifi printer and print the contents that it consumed from the web service. I have no idea where to start from and what resources to use. Any help would be highly appreciated. 回答1: i have used following code to print import java.io.IOException; import android.app.Activity; import android.app.AlertDialog; import android.content.Context; import android.os.Bundle; import android.util.Log;

Start new wifi scan after finishing the current scan

旧巷老猫 提交于 2019-12-08 11:22:06
问题 I am trying to make an apps that will store all wifi BSSID and RSS into an SQLite Database. (my SQLite table named "scanres" here is part of my code on my onCreate() : wifi = (WifiManager) getSystemService(Context.WIFI_SERVICE); //jgn lupa manifest xml nya kasih permission!!! if (wifi.isWifiEnabled() == false) { wifi.setWifiEnabled(true); } x = new BroadcastReceiver() { @Override public void onReceive(Context c, Intent intent) { results = wifi.getScanResults(); size = results.size(); if (size

Turn WiFi off using Python on Windows 10?

别等时光非礼了梦想. 提交于 2019-12-08 10:38:01
问题 I have been looking for a way to toggle my wifi on and off using a script. I figured this could be done maybe by entering airplane mode or some other method. When I was googleing for the answer though I could not find anything useful for windows, just for android and even macOS. Anyone have a 2 functions, one for turning wifi off, and one for turning it back on? Or connecting/disconnecting from a specific one works too. It is my default wifi if this is relevant. 回答1: Python does not have

Android: Send data only by WIFI

不羁的心 提交于 2019-12-08 09:37:29
问题 I have a service that runs in background and send data to a server, I want to send this data only by wifi and not another way (gprs or else) is that possible? and if it is, how can I achieve that? if you have sample codes or links that would be great. thank you. 回答1: final ConnectivityManager connMgr = (ConnectivityManager) this.getSystemService(Context.CONNECTIVITY_SERVICE); final android.net.NetworkInfo wifi = connMgr.getNetworkInfo(ConnectivityManager.TYPE_WIFI); The NetworkInfo structure

Determining a location based on WIFI APs and Signal Strength

我只是一个虾纸丫 提交于 2019-12-08 08:41:14
问题 I need to determine location based upon N number of WIFI Access Points and their signal strengths. Is the best way to do this using a least-squares fit algorithm? How would I go about implementing such an algorithm? 回答1: Least Squares fitting should work if your noise in the signal strength is Gaussian, ie. follows a normal distribution. What you are really looking for is the maximum likelihood estimator for the mean of the signal strength, and you hope that that estimation corresponds in

Find MAC Addresses of devices in range of Wifi router

China☆狼群 提交于 2019-12-08 07:54:01
问题 I'm currently working on a raspberry pi project that would require the wifi dongle (Realtek RTL8188CUS) to obtain the MAC addresses of nearby devices that have not connected to it. I had originally thought of doing this through tcpdump but those logs only seem to display the info of devices connected to the wifi network. So what I'm trying to figure out is: how to receive a log or list of MAC addresses within range of the network but are not connected to it. 回答1: I guess you need the wifi

Checking if there is internet connection

时光怂恿深爱的人放手 提交于 2019-12-08 07:24:43
问题 I would like to ask something that I don't understand in my app. I get some data from my server and display them in a recyclerview using the google's Volley library. So far so good:). Next I get those data from the list and add them to SQLite via a content provider. And finally if there is no internet connection,I should read them from the phone's repository(for now I should get a Toast message stating that there is no internet connection). Here is the thing. When I turn off the wifi the