determining your location using ONLY wifi signals? - c#

i will be working on a project that tries to determine your position using the wifi signal strength from a few access points. i was wondering if anyone knew of any similiar projects or any articles on that topic
if anyone cares: its a research project in at my university. the app is written is used as a playing ground to develop new wifi antenna that are better suited for this type of usage. i only work on the coding part of the project though. oh and its written using c# which is not optional
clarification:
its ONLY wifi. no GPS goodnes for us becaus its supposed to work indoors
the software is supposed to determine your location by using the known locations of the access points and their signal strenghts to tell you where you are. its currently at around 4-5 meters of accuracy
aside from that i already have a working prototype and was just wondering if anything similiar has been done before or if anyone has any tips or ideas for/about the project

Discarding the first 2 answers, where they need to use GPS and A-GPS in the first and a known WiFi network in the second, my answer is:
it sounds easy, but you need to do some homework first, a Survey.
you will need to measure up and create a oval shape (in a paper) with points and percentages of all wifi routers in the camp.
when, lets imagine that you compile 2 routers information, you are ready to go.
get the current wifi points and signal strengths from the user laptop/device and query the database using those values.
give the user their current location.
Example:
in the campus bar you measured that to be in that place you need to have around 55% strength of the signal provided from WiFi Router 1 and 25% of the WiFi Router 2.
To use all this in C#, you should start in this Code Project article to get the signal strengths. Then is just use those returned values with your data that you measured before when doing the first survey.
Hope it helps :) At least, that was what I would do in order to approach this problem.

We did this on a project already determining distance from Access Points, but without the signal triangulation (already covered on other answers here).
I do have a recommendation from the "man, I wish I didn't have to go back and do this" department - it would be to spend extra time on 2 areas:
An easy and repeatable method of calibration using Multiple Data Points. For example, the dropoff from being "very close" to "kinda close" will be a lot more than "really far away" to "really really far" away. It's not going to be a linear slope.
Data Smoothing. As you move, the signal strength will vary unproportionally to your movement (due to obstacles in the path). It will make your results much more accurate if you take a rolling average of the last 5-10 samples of the signal strength rather than just taking the last sample.

You might like to look at the Google Gears Geolocation API. I don't know how easy it is to use from C#, but it may be useful/relevant.
(Disclaimer: I work for Google, but haven't had anything to do with the Geolocation API.)

I wouldn't have thought that signal strength would work well: too many things interfere with it (like walls). But you might try measuring ping times, especially if you threw a hundred pings at the AP and took the average. Most of the time will be the AP digesting the ping and generating the pong, but there will also be a time-of-flight component for the signals. If the AP response time is consistent then you should be able to subtract it and hence compute the distance to the AP. By well-known hyperbolic maths you can then find your position from 3 or 4 APs.
Paul.

Skyhook springs to mind. It depends on people registering the llocation of their APs though.

Goto Wifi in positioning System(WPS), where we use multiple Wifi AP to track a location..
this is implemented by many systems like Google, horizon etc by providing extra security 4 privacy..
I too without knowing this tried on immplimenting this sort of technique..
All d best, we can simplify its complexity by various methods there-by achieving INNOVATIVE to existing infrastructure.
I recommend u to go to the wifi router add-in management & usage before pursing this.

you can try FIND3 project, here's a documentation https://www.internalpositioning.com/doc/, it's API can be used for that purpose and use learning algorithm to constantly learn your position with accuracy. They also have mobile apps (for android only). I'm looking to do something of the same nature.

Related

Measuring network traffic in C#

I'd like my application to be able to monitor how much data (I don't need the actual packages, only amount of bytes) that goes in an out of the computer (on a single interface) at all time, and also over time. In other words; I want to be able to show a number displaying current up and down speed (for instance 5kB/s) as well as a graph over the last 5 minutes, and lastly I also want to be able to show a correct amount of data that has gone out/in of the interface in the last hour.
Is this doable in a simple manner? I don't mind using third-party assemblies, or having to write my own wrapper around some win32 api, however; said third-party assemblies must be able to be used with open-source applications and must not cost money.
In fact you may easily get all network traffic using performance counters, but I do not know any way to measure network traffic of your application than opening each packet and reading it. To measure all network traffic, refer to the following:network traffic in c#
Something like DUMeter?
Look here
.
You might want to look at performance counters.
On most of these network counters you can choose the network interface that is to be monitored. You can do the same in .Net code as well.
Here's a CodeProject article that contains a forms app that does basically what you're after: http://www.codeproject.com/Articles/6259/Monitoring-network-speed

Server-Client Syncing

I've been looking up on google for this answer, and I just can't find the answer to my question. I have a 2D rpg that I want to build a client-server architecture with. How do I 'sync' things? cause with lag, things are all 'back in time' by the time data reaches the other end. Even with client side interpolation etc, how do I get a 'common time' between clients and the server? Ie, if it took 60ms to go from client->server, -how- does the server know it was 60ms, or 90, 120, etc? The only way would be to have a common time between them somehow, for I could use lag calculations to better sync things? I'm totally lost on his :(
Thanks for any help
Take a look at this question. Since it's not a first person shooter you won't need to send as much information so it should be easier to add in techniques such as prediction and interpolation.
Take a look at the Steam wiki article mentioned in the answer, it's a good starting point.

Public Transportation using Buses in City

I am developing a Journey Planner website. There are few things that are simple in this case currently i.e. Right now the website will only be able to plan bus routes, the timings of buses are not currently available. So this means we only have bus routes stored in the db and since bus timings are not available so waiting times for traveler are not relevant as well. What is available is the time and distance covered between two stops for an individual bus.
I think that using an undirected weighted graph storing the time and distance costs of each bus stop for each individual bus would be the way to go. Then I could use Dijkstra algorithm to calculate the shortest path between two locations entered by the user based on either time or distance as per user preference. I would find out whether two or three buses are required through simple C# functions if the bus routes intersect at stops and then using those intersection stops for the traveler to change the bus. But there would be an individual graph for each bus. An alternative (not sure if this is correct) way would be to use a graph containing every bus stop of city as nodes and then using this technique to find out the way to travel between two stops. Which is the correct approach? Should I use A* algorithm in place of Dijkstra algo?
A few general points for the design: I would like the app to be extensible so I could add other transportation means later when the need arises. Moreover the bus times could also be added later if possible without major changes to the website. I have seen quite a few experts here who have worked on much complex projects of transportation. So please help me out with the best way to implement this functionality in the most scalable, modular and extensible fashion.
A graph is going to have to be a directional graph - bus stops on opposite sides of the roads (even in a country like the UK that rarely has medians) are NOT the same stop!
I started a similar application last summer and never finished it, but I do have some advice on this graph, and how to structure your data.
My plan was to have each stop as a node, and a path between each of these nodes for every time a bus went through. For example, if a bus stopped every half hour over a 6 hour period, then there would be 12 paths between the two nodes. Time was the main driver behind "cost" of the path, so typically the soonest path would be the one chosen.
Before starting the application would query the database for all paths in the next 5 hours (adjust as appropriate). It would then crunch with Dijkstra's algorithm.
Other things to factor in cost are the actual money cost of the route, transfers (and their cost), stops with no roofs (if you tend to have bad weather), etc.
This plan worked well for me. I live in an area with 3 bus systems.
Finally, it may do you some good to structure your data in a similar way to the Google Transit Feed Specification, as many agencies produce this type of data that you could import.
I think the most important optimization is separating stations where you can change routes and stations where you can't. Then you just need to consider stations where you can change route as intermediate stations in your graph. This should make the graph so small that Dijkstra is fine.
I'm distinguishing nodes with only two edges by simply cutting them out of the graph and instead connecting their two neighbors with an edge of the added length. Then I do pathfinding on this reduced graph which should be much faster. i.e. only consider stations where one might switch routes.
Maybe you can have some use of paddydubs work for TransportDublin found on github.
I coded such an algorithm for a test application. I had a dictionary for each stop, as source and as destination. The algorithm was recursive. Each step of the recursion was like this: Given source and target, it would generate a list of routes going into target, list of routes leaving source. If there were any common stops, we were done, we report the route. If not, then I generate neighboring stops for source, and recurse. The next recursion generates list of neighboring stops for sink, recurse. Before recursion I recorded the previous path of course, and at the end I would have a list.
I do remember I had to place some cutoff conditions because the recursion would sometimes get stuck in certain "bad" regions.
I also looked at this paper:
www.citeulike.org/user/rchauhan/article/819528
I am interested if you managed to solve this problem in a different way.

Is TCP suitable for network game programming consisting of regular positional updates?

Suppose you were forced to use TCP sockets over UDP sockets (ie: something that Silverlight insists on). Would it be possible to create a multiplayer game that involves sending real time positional updates to up to say eight players so that each player could accurately see every other player in real time, even though UDP would be the better protocol to use? Given the option, would you wish to go as far as to select a different technology (ie: Java), simply to gain UDP support?
Thanks,
Nick
As long as a few milliseconds aren't important i see no reason to use UDP.
To receive UDP packets, you must have a public IP address.
To receive UDP packets, you need to be able to listen on a port. Not all frameworks in all environments can do this, often for security reasons and such.
As you describe Silverlight as a target platform, we can anticipate that this won't always be the case for your players.
Use TCP.
As an alternative to Silverlight, you might look at Haxe (or Flash).
(From the comments, there is mention of STUN and stuff; that's an interesting if difficult angle to pursue.)
It depends on how fast of real-time you are looking at. For example, if you try to make a space battle, and everyone is close, but moving at a high speed, then you may find that the milliseconds difference makes a difference, but, if you are doing something like an auto racing game then it won't make any difference, so TCP is fine.
So, try it, get some numbers and decide if it is acceptable.
The bigger problem will be the difference in bandwidth, so, if one person is playing over a really slow connection, and everyone else are on very fast connections, then that slower player will be a problem. You may need to scale the updates to the slowest connection, and you may find that TCP/UDP issues are not enough of a concern, as the difference in connection speeds are a far bigger problem.
So, test with various connection speeds, with differing numbers of users, each with their own connection speeds, and see if, as one user, the game is still enjoyable.
UPDATE
It is not bandwidth that will be the concern, but the latency, as was pointed out in a comment. I had picked the wrong term, as several people might be able to respond quickly and be closer to real-time, but one user may be much slower, perhaps on a congested network, slow computer, or whatever, but they may only send updates every 1000ms, whereas everyone else is doing it every 100ms.

factory floor simulation

I would like to create a simulation of a factory floor, and I am looking for ideas on how to do this. My thoughts so far are:
• A factory is a made up of a bunch of processes, some of these processes are in series and some are in parallel. Each process would communicate with it's upstream and downstream and parallel neighbors to let them know of it’s through put
• Each process would it's own basic attributes like maximum throughput, cost of maintenance as a result of through put
Obviously I have not fully thought this out, but I was hoping somebody might be able to give me a few ideas or perhaps a link to an on line resource
update:
This project is only for my own entertainment, and perhaps learn a little bit alnong the way. I am not employed as a programmer, programming is just a hobby for me. I have decided to write it in C#.
Simulating an entire factory accurately is a big job.
Firstly you need to figure out: why are you making the simulation? Who is it for? What value will it give them? What parts of the simulation are interesting? How accurate does it need to be? What parts of the process don't need to be simulated accurately?
To figure out the answers to these questions, you will need to talk to whoever it is that wants the simulation written.
Once you have figured out what to simulate, then you need to figure out how to simulate it. You need some models and some parameters for those models. You can maybe get some actual figures from real production and try to derive models from the figures. The models could be a simple linear relationship between an input and an output, a more complex relationship, and perhaps even a stochastic (random) effect. If you don't have access to real data, then you'll have to make guesses in your model, but this will never be as good so try to get real data wherever possible.
You might also want to consider to probabilities of components breaking down, and what affect that might have. What about the workers going on strike? Unavailability of raw materials? Wear and tear on the machinery causing progressively lower output over time? Again you might not want to consider these details, it depends on what the customer wants.
If your simulation involves random events, you might want to run it many times and get an average outcome, for example using a Monte Carlo simulation.
To give a better answer, we need to know more about what you need to simulate and what you want to achieve.
Since your customer is yourself, you'll need to decide the answer to all of the questions that Mark Byers asked. However, I'll give you some suggestions and hopefully they'll give you a start.
Let's assume your factory takes a few different parts and assembles them into just one finished product. A flowchart of the assembly process might look like this:
Factory Flowchart http://img62.imageshack.us/img62/863/factoryflowchart.jpg
For the first diamond, where widgets A and B are assembled, assume it takes on average 30 seconds to complete this step. We'll assume the actual time it takes the two widgets to be assembled is distributed normally, with mean 30 s and variance 5 s. For the second diamond, assume it also takes on average 30 seconds, but most of the time it doesn't take nearly that long, and other times it takes a lot longer. This is well approximated by an exponential distribution, with 30 s as the rate parameter, often represented in equations by a lambda.
For the first process, compute the time to assemble widgets A and B as:
timeA = randn(mean, sqrt(variance)); // Assuming C# has a function for a normally
// distributed random number with mean and
// sigma as inputs
For the second process, compute the time to add widget C to the assembly as:
timeB = rand()/lambda; // Assuming C# has a function for a uniformly distributed
// random number
Now your total assembly time for each iGadget will be timeA + timeB + waitingTime. At each assembly point, store a queue of widgets waiting to be assembled. If the second assembly point is a bottleneck, it's queue will fill up. You can enforce a maximum size for its queue, and hold things further up stream when that max size is reached. If an item is in a queue, it's assembly time is increased by all of the iGadgets ahead of it in the assembly line. I'll leave it up to you to figure out how to code that up, and you can run lots of trials to see what the total assembly time will be, on average. What does the resultant distribution look like?
Ways to "spice this up":
Require 3 B widgets for every A widget. Play around with inventory. Replenish inventory at random intervals.
Add a quality assurance check (exponential distribution is good to use here), and reject some of the finished iGadgets. I suggest using a low rejection rate.
Try using different probability distributions than those I've suggested. See how they affect your simulation. Always try to figure out how the input parameters to the probability distributions would map into real world values.
You can do a lot with this simple simulation. The next step would be to generalize your code so that you can have an arbitrary number of widgets and assembly steps. This is not quite so easy. There is an entire field of applied math called operations research that is dedicated to this type of simulation and analysis.
What you're describing is a classical problem addressed by discrete event simulation. A variety of both general purpose and special purpose simulation languages have been developed to model these kinds of problems. While I wouldn't recommend programming anything from scratch for a "real" problem, it may be a good exercise to write your own code for a small queueing problem so you can understand event scheduling, random number generation, keeping track of calendars, etc. Once you've done that, a general purpose simulation language will do all that stuff for you so you can concentrate on the big picture.
A good reference is Law & Kelton. ARENA is a standard package. It is widely used and, IMHO, is very comprehensive for these kind of simulations. The ARENA book is also a decent book on simulation and it comes with the software that can be applied to small problems. To model bigger problems, you'll need to get a license. You should be able to download a trial version of ARENA here.
It maybe more then what you are looking for but visual components is a good industrial simulation tool.
To be clear I do not work for them nor does the company I work for currently use them, but we have looked at them.
Automod is the way to go.
http://www.appliedmaterials.com/products/automod_2.html
There is a lot to learn, and it won't be cheap.
ASI's Automod has been in the factory simulation business for about 30 years. It is now owned by Applied Materials. The big players who work with material handling in a warehouse use Automod because it is the proven leader.

Categories

Resources