I have been going over this Wifi Direct tutorial for Android:
Android Wi-Fi Peer-to-Peer
I created the Wifi Direct connection between two devices and I used java sockets to transfer a file, very much like the tutorial. However my transfer speed is usually around 11 Mbps, maybe a little less.
I was wondering if anyone has been able to get higher transfer rates(like 54 Mbps or 30Mbps) with Wifi Direct? I think it's supposed to be possible.
I am now working on some wifi-direct project and the speed really varies. Sometimes it could reach as much as 25Mbps but sometimes it is extremely slow - the worst time I experienced is that it took about 180 seconds to transfer only 2 MB. My opinion is that it highly depends on the wifi environment around the device.
Related
I and a couple of friends have got a list of requirements for a new project. This project, basically asks us to synchronize a specific directory in a laptop with the user's phone (just like dropbox does) but using BLE for the communication.
Everything is working as expected. We're using Android on the phones and a BlueGiga USB dongle on the laptop side. The only problem we're facing is that we cannot limit the distance in which the phone is detected.
We do know that we can modify the TX Power and also the Advertising mode as it's explained here (https://developer.android.com/reference/android/bluetooth/le/AdvertiseSettings.html). The real problem is that we cannot get the same max distance on every phone because of differences with the chipsets, antennas, etc throughout all the Android devices in the market.
How could we do to limit the connection distance to 1 meter for all the devices running Android? We'd need to rely on the RSSI values but I'm open to different approaches anyway.
Thank you very much in advance guys and remember that everything is working perfectly. We just need to adjust the max distance.
Thanks.
Max.
Simple answer: You can't get an absolutely exact range limitation because of the physical properties of electromagnetic radiation. There are so many things you have to take into account, which makes it a quite difficult and complex task.
What you can do is very sophisticated calculations based ony many different factors to get an approximation. As already mentioned in the comments, you might find helpful libraries with algorithms and formulas for well known devices, chipsets antennas etc. so you don't have to do all the calculations on your own.
With the help of some libraries and tools, you may be able to quite safely determine if the device is within a range of between 1 and 3 meters.
I need to stream a set of numbers, 6 floats, from an android device to a PC, to which it is connected by a USB cable. All the solutions I have found proposes using a WiFi connection. However, I have found that the latency caused by this is not acceptable. As such I have decided that I am going to hire someone to integrate the components, thus enabling direct communication. Until then, however, I want to try a variety of devices to see what works and the quickest way to "Integrate" two devices is by allowing them to share a (US)Buss. However, this is the one field I have zero experience with.
Do you make a socket and treat the connection as a network connection or is there another fancier way to achieve what I want? I have seen some talk about making a device driver for this purpose and I do not feel like crashing my OS 500 times again. I find it hard to believe that the android devices do not have some kind of driver already made that I can exploit.
The android code is written in Java, but it could be changed depending on what people suggest. The main chunk of mys system lies on the PC and is written in C++.
I need the latency of the stream to be as low as possible since the entire system needs to be as real time as possible. The limit is 15 ms between data acquisition on the device and the rendering of the simulation on the PC.
TL/DR: I need to stream data from a program on an android device to a PC with as little latency as possible; i.e. one way communication. As long as I can stream bytes I can design protocols and translate the bytes on the receiving end. My global cap is 15 ms and I need to stream continually updated 6 floats. What is the best way to achieve this?
Thank you in advance for your help.
Raw USB is probably not the way to go. USB is a device-oriented specification and cannot be used in a general send-arbitrary-bytes-across-a-wire way.
If Wi-Fi really is too slow, you could try purchasing an Android-compatible USB-Ethernet adaptor and connecting the device to the computer via a wired network connection, which might reduce the latency. Android recognises many types of these adaptors and you communicate over the network connection in the same way as other networks.
We ended up using the ADB brigde and it seems to be stable and fast enough for our purposes. All we had to do was to open a socket and connect with TCP. For some reason it fails when we try to connect with UDP, but I assume this might be due to ignorence on our part.
I'm developing an android app which is based on WiFi Direct technology(P2P), so I really need to know how many meters is the range of android WiFi direct performance.based on Android API Guides:
you can discover and connect to other devices when each device supports Wi-Fi P2P, then communicate over a speedy connection across distances much longer than a Bluetooth connection.
but knowing that is not enough for me. because of my aim I need numbers! I mean a range of distances in which Wi-Fi P2P works.
Typical Wi-Fi devices extend their signal up to 100 meters. Source
However the biggest of horror of Wi-Fi is Line of Sight (LOS) which may drop your range dramatically.
That's because Wi-Fi signals at 2.4GHz or 5GHz frequencies. These are easily disrupted by interfering obstacles such as furniture, walls or even mirrors (whose metallic layer reflects the signal) or even water that absorbs the waves. If the app is to be used mostly outside, such obstacle count is supposedly greatly decreased.
Extra:
Wi-Fi signal strength is influenced by a factor called attenuation. Here's a Cool Table displaying the materials influence on the signal.
You might also want to keep in mind that Android Wi-Fi P2P (Wi-Fi direct) is available only since API 14 (4.0 ICS).
Though Samsung allowed using the Wi-Fi Direct ability to connect to devices since API 9 (2.3 Gingerbread).
Anyhow you might want to think if users are "there yet", to be using this standard.
I also liked this Video comparing Galaxy S3 and iPhone 5 connectivity to a GoPro Hero 3 Camera. The maximum range he reached was 100 yards (~90 meters) with perfect LOS.
EDIT:
Antenna-Theory a website dedicated completely to antenna's states that:
Wi-Fi Antenna Efficiencies for handheld mobile devices are typically
on the order of -6 dB to -2 dB
While various online sources note that average laptop antenna efficiency is from -3dB to 3dB, which is not that much different from the cell phone.
You can't really figure out the actual numbers as it all really depends on the surroundings, the target's antenna and the users antenna.
Still phones tend to have lower range than that of the laptops and it's probably between 50-80 meters in clear sight.
Sorry but I can't provide more accurate information as i'm no physicist or a technician, and what you're asking for is pretty abstract :)
This site says the range of WiFi-direct of phones is about 200 feet (~60 meters) while bluetooth has a range of 30 feet (~10 meters).
The official Wi-Fi direct site (see under the point "How far does a Wi-Fi Direct connection travel?") states that the maximum range of WiFi-direct is up to 200 meters (which is 656 feet), but I highly doubt that phones already achieve this range...
"Wi-Fi Direct devices will operate at the same speeds or data rates and range as current Wi-Fi gear. This maximum of about 200 Mbps at 200 feet is much more than the 3 Mbps at 30 feet with Bluetooth. This means you can share and communicate much faster and farther with Wi-Fi Direct."
source: http://www.ciscopress.com/articles/article.asp?p=1620205&seqNum=2
I've done my research on this in the past. Similarly with the other answers, I found that the maximum distance "The Wi-Fi Alliance" claims it to reach is 656 feet. I could be wrong, but I feel that it may be possible to connect both devices to an Apple AirPort device and extend it quite a bit.. Of course you can't expect all of your app purchasers to have one, but in the testing phases it may prove to be very useful.
I've developed applications which handle a connection between a PC and an Android phone via Wi-Fi. I try to send a lot of data really often. The TCP/IP protocol, which I used, allow me to achieve just low speed - around 1 Mbit/s. I found that with 802.11n standard we can achieve speed up to 150 Mbit/s. I've set my router to use only 802.11n standard, but I didn't notice any improvement.
What level of speed should be expected? I understand that part of data is lost, but is there any better solution? Any ideas? Where can I find some information to better understand this topic?
You should expect much better performance running 11n with TCP/IP, perhaps 20 Mbit/s in a good environment. But since it is radio, the medium is shared between all users of the air so it is not easy to give a good answer that is valid everywhere.
A tool to test your network throughput is Iperf available on Google Market for your Android device and on Sourceforge. You could use this to see if it is your application or external factors that might affect performance.
If you want to debug it further, you could use Wireshark together with a Wi-Fi sniffer card to see individual packets/transmission rates and retransmission.
This question already has answers here:
Simulate low bandwidth in android
(11 answers)
Closed 8 years ago.
I need to test my application in conditions where even 2G Internet connectivity isn't at its full coverage (i.e. 2 bars instead of 4, 2G).
I prefer conducting these tests over WiFi.
Is there a way (programmatically or otherwise) to tell the Android OS on the real device to slow down or throttle Internet connection 56 Kbit/s?
Note: I know how to do this on the emulator. I'm looking for a way to do this on a real device.
Is this possible?
In one of your comments you mentioned that you have a DD-WRT router, which is really a tiny Linux box. So you may be able to get a way with the tc command:
tc qdisc add dev $DEV root handle 1: cbq avpkt 1000 bandwidth 10mbit
tc class add dev $DEV parent 1: classid 1:1 cbq rate 512kbit allot 1500 prio 5 bounded isolated
tc filter add dev $DEV parent 1: protocol ip prio 16 u32 match ip dst 195.96.96.97 flowid 1:1
It kind of depends on what you have on the upstream side. If you're transmitting some kind of test load, write a driver at the upstream end that does, in fact, slow itself down -- although sleep() is a bad choice. What you'll be writing is essentially a fairly hard real-time program if you hope to get anything resembling a real workload.
(When I say "a driver" btw , I don't mean necessarily a device driver, just some kind of driver program.)
But are you really trying to simulate a slow connection, or a degraded and noisy connection that has a low effective data rate?