How can a Wifi access point give me a location? - mobile

If I'm connected to a Wifi access point on a mobile device that doesn't have GPS or 3G how can a location-based service get my location? Does the access point provide a standard way of querying its lat/long or is there a database of locations of IP addresses?
I'm interested in any standards for doing this, rather than technically possible methods.

The only way I've found of doing this is using gpsd. If the Wifi access point is running OpenWRT then you can use this article GPS receiver in OpenWrt but it should be possible to use the gpsd standard on any access point.

Related

Synchronize sqlite files without a public IP

I'm trying to come up with a way to sync a sqlite database between two computers.
If this were on a machine with a public IP this would not be difficult but I'm trying to find a way to make this work for ANY two devices, and most computers don't have a static IP.
What are some of the ways I can tackle this problem?
Assuming you just need to find the peers IP address...
Broadcast a Udp packet onto Lan, if machines are same lan segment. You can also try using admin scoped multicast, but mileage will vary according to the network setup and gear in use.
If trying to find two machines across the internet (assuming you can solve the NAT address translation issue), you need to bounce off a node that will hold info for you. Eg write a packet to dweet.io or sparkfun or other website that will hold store and forward data. You can also read twitter feeds etc, basically you need a known reference point to both talk too. Look into how malware create command and control networks for some ideas. Or search for rendezvous servers and protocols.
If the address range is small, probe all possible addresses. But be careful as you might trigger anti virus or ISP action
If wanting more browser based, look at webrtc, not quite what you are after but some of the techniques for discovery might be interesting.
If you have access, you can play with your DNS records. Essentially this is a variation of (2).
There are more options too, but that get more special purpose or become a bit too stelthy for general use. Also see how mesh networks are formed.

ZigBee Gateway Clarification?

I am working on setting up a project where I should be able to control my ZigBee End Device (ZDO or ZED) from an IP gateway. On having a detailed study, I understood on having a setup established.
However, I need to confirm if ZigBee devices from different vendors will be able communicate with each other?
If they can communicate, can a common (generic) Gateway be used for accessing or controlling the end devices (from different vendors) from a IP network?
Kindly lend me your suggestions. Also, your advice on the devices already available or how to progress?
Yes, the concept of a ZigBee Gateway is to provide an IP interface to a ZigBee network. All certified ZigBee devices of a given profile (Smart Energy, Home Automation, etc.) should be able to join a network that you can then access with a Gateway.
Just make sure you're using a certified ZigBee Gateway.
Other companies, like Digi International make devices with IP and ZigBee interfaces that you may be able to use, if you're not interested in using the Gateway Standard.

emulating a network interface

Can someone possibly explain (within the size of a stackoverflow answer) the code required in order to emulate a network interface? I just know that there is virtualization software out there like Qemu that does this specific type of hardware emulation, but have no idea how this would work. Lots of books will show you how to create a program that listens on a TCP socket, but not create a host that gets its own IP address.
VirtualBox is open source. As a VM, with networking support, it should be sufficient to demonstrate to you what to do, along with a working implementation. https://www.virtualbox.org/wiki/Downloads
It's really depends what do you mean and what do you want to achieve. If you want emulate some real hardware you need via hypervisor's primitive emulate the most aspects mentioned in datasheet of corresponding adapter, if you want introduce some service, e.g. DNS or HTTP service visible in internal network: you need port teach some user land stack (e.g. LWIP or Slirp, or part if you need UDP only or lower) to communicate with hypervisor's internal network.

Using WiFi to triangulate instead of GPS

I know its probably possible, but is it practical and doable to try and geo-position someone using WiFi to triangulate...
Thinking if I was underground and didn't have access to GPS, could I setup WiFi spots around the place to help locate someone.
Or if I was on a plane or a train (which is constantly moving), could I setup WiFi spots around the place to help locate someone.
Where would I start in doing this? Is there software components/infrastructure? If not would it be possible to do this... i.e. at a router level add location information to the packets about which router the incoming message was coming from and then the server being able to pick up on this...
This is exactly how the Skyhook database (built into many phones) works. It uses cell towers and WiFi points to triangulate the position in the absence of a GPS signal.
Google also does this with their street view vans—they look for open wi-fi networks as they go, and record their positions.
This is already widely available. Google the terms wifi location aware.
This is how laptop "Lo Jack" theft recovery systems work, for example.

wireless networks c program

I would like to create a wireless network from a laptop. If laptops come within range, I would like it to send them a welcome message and send them a goodbye message when they leave the wifi range. Is it possible to do this in C?
Please help me out with this.
It is possible, but it is a very complex task and I don't think that programming language choice is the first thing to look into.
As a start, you can read up on Wikipedia on Wireless ad-hoc networks.
How should your messages be received and displayed on the remote side? If you want to use some existing protocol over TCP/IP, or create your own (deploying custom applications on the remote machines), you will need to mess with networks and this is not always possible as one machine can be a part of only one network. So the machines need to be not connected to anything and somehow allow you to connect to them, it involves changing network settings on all that machines (for example, setting them to join the ad-hoc network with predefined name).
If all machines automatically join the existing network, this question has nothing to do with wireless (physical layer) but with Avahi, Netbios or whatever other services allowing you to get notifications and/or enumerate devices in the network.

Resources