1

What we want to do is very simple

We have a check-in kiosk website (C# ASP.NET MVC), and we are trying to set up 30 kiosk stations at each building (each building is about 200 ft away from each other). Every time a person checks in at a building, we want to collect the time and the location of the check-in. (e.g. Person-A checked in at 10:00AM at Building-B).

What I'd like to know is

The most reliable way to detect/find the location given the background below:

  • the check-in system itself is a web application
  • all the 30 devices are in one OU
  • each device has a unique machine name

Method 1 : Get the domain name with Reverse DNS

Since each device has a unique machine name, I'm currently getting the host name using reverse DNS. The code used here is

    string IP = Request.UserHostName;
    IPAddress myIP = IPAddress.Parse(IP);
    IPHostEntry GetIPHost = Dns.GetHostEntry(myIP);
    List<string> deviceName = GetIPHost.HostName.ToString().Split('.').ToList();

This method is working for most cases, but we are aware that this method is not always reliable. We do have one case where the retrieved deviceName doesn't match the actual device name.

Method 2 : Each device specifies the location in URL

This can work. The website can take the LocationID via URL (e.g. https://sample.com/1, https://sample.com/2) and save the ID in a session or cookie. The only slight issue is that the device team will have to physically work with the device to set up each device for each URL, which I don't think is a big problem because the location won't change so often. The initial work is a bit of work for the device team because all the devices are under the same OU.

Method 3: Each device stores the location in cookie

This is similar to Method 2, and it will work. Again, the only slight issues is the initial work and the maintenance work (e.g. cookie got wiped, etc) by the device team.

Method 4: Find the actual location (i.e. latitude and longitude)

I haven't tried this yet but I should be able to use GoogleMap Geolocation to find the current location of each device, and figure out the check-in building based on the location. Unless there are some obvious issues that I'm missing, this may be more reliable and would not require any initial/maintenance work to the device team??

Which one would be a better method or are there any other methods that I should explore?

  • I'm not understanding why your reverse DNS method isn't always reliable, how would it give the wrong name? – xtratic Jul 27 at 18:28
  • @xtratic I think it can happen when the ip address is mapped to a wrong device. – kabichan Jul 27 at 18:44
  • Google Maps wouldn't work unless your device had some other way of knowing its location, and then you could just use that method. Google Maps isn't magic – user253751 Jul 27 at 18:55
  • @kabichan How is the address mapped incorrectly, isn't this is an internal private DNS? Is the cache stale or something, are these devices using DHCP? – xtratic Jul 27 at 19:36
  • @xtratic I'd have to ask the details to the infrastructure team, but we actually had a case where I retrieved the machine name using Method 1 and the name was the one assigned to a different machine. – kabichan Jul 27 at 20:41
2

If the device has GPS and the browser supports the geolocation api you can use that.

If not I would use a cookie and have the site ask the user to select the location, either from a dropdown of known locations or enter a postcode etc.

Have javascript check the cookie and prompt for location if its missing. Prevent the user from using functionality without entering a location

Display the location semi prominently so that if a wrong location is selected it can be noticed and corrected.

In theory the host name or IP on a network you control should be enough to identify the location. In theory.

the problem you have is that there is that extra link between network setup and your application and the network setup isn't part of the application.

  • When IPs change your app breaks.
  • Add a new store, your app breaks
  • One site has dynamic IP? app breaks
  • Need to test the app as if it is in store X?
  • etc etc

These problems are out of your control and hard to fix.

If the app includes a setup or login step where you can get a human to enter information, then you can still have problems, but the app is self contained.

  • a user enters the wrong location, you can phone up the building and get them to reset it.
  • A new location? add it to the drop down list.
  • etc
| improve this answer | |
  • sounds like geolocation is not as simple as we want it to be.. We did discuss the option of providing a dropdown of locations and ask the user to select the location, but the slight issue with it was "how can we make sure that a user selected the correct location?". But, displaying the location seems to be a way and it sounds like a good idea. If we could leave the kiosk ON, it can be set up at the initial setup, but I think it had to be shut down at the end of the day for security reasons. – kabichan Jul 27 at 20:51
  • a cookie will survive restarts. but an app might be a better way to go, rather than a website – Ewan Jul 27 at 20:57
  • that's true. the location can be saved in a cookie, and i could prompt for the location with a dropdown only when something happened to the cookie (e.g. got wiped after updates, though we could turn off auto updates..). – kabichan Jul 27 at 21:01
  • One option could be to only prompt the user for the location if the cookie is missing. You could even ask multiple times to make sure the first user didn't select a wrong location. – Frederik Banke Jul 28 at 11:49
0

I'm thinking Method 3 - Store the location in a cookie:

Although I do think the connection information is within the domain of your server I agree that network configuration and DNS is a separate domain from both client and server side of your web app. And as Ewan points out, tying your functionality to this my not be a good idea. What if you tried to deploy this system on a new network? That wouldn't be a very pleasant experience..

With this in consideration, it may be best to have an initial setup per device, locked behind authentication, which sets the device location and stores it in persistent server-encrypted cookie on the client device. If the cookie is missing then prompt for a technician to log in and set the location. The server can keep the list of valid locations and supply that list on it's device setup page.

The general steps for Setup are:

  1. GET request for Setup page, with authentication (or not if you don't care)
  2. Server returns setup page with the list of available locations (or freeform since the server can allow, restrict, or validate what it wants)
  3. Client chooses location and server sends back a cookie for that location (encrypted if you want, or any other features)

The general steps for Check-in are:

  1. GET request for Check-in page and include location cookie
  2. Server sees location cookie is missing, prompt for Setup!
  3. Otherwise continue check-in as normal..

With this approach, your only dependencies are the client and server (and connectivity between them.. and authorized setup techs), so you could deploy this anywhere. With the location stored in a persistent server-encrypted cookie you don't need to worry (as much) about someone unauthorized setting the wrong location. Also, the server has all control and can allow or restrict whatever: limit IPs, only have a set list of locations, etc.

One place I see a need for improvement is how to cut down the work for Setup.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.