Read the statement by Michael Teeuw here.
Automatic Location Refreshed Daily
-
Hello, I think I have a good suggestion for everything weather based. I am looking to use this as a gift for some of my friends, and the issue I am running into is some of them might be moving at somepoint/ do not stay in the same city all year. I think it would be great if there was a way to get a script to run during start up (the mirror should only need new location when it is unplugged and plugged back in) to find the location name automatically. this could be fed into the location name field and be used for headers as well as both OpenWeather and WU.
I have done some research and asked around about something like this, and I got some good responses on reddit as seen in the link below:
This looks like there is already a service to return information about an ip address in XML and JSON. Would anyone be able to help me make a script to get this to work?
-
The issue with that is that it isn’t reliable. For example, my public IP says I’m in a town about an hour away because that is where Comcast’s main hub is. I’ve gone through this with a different project as well and it simply wasn’t reliable. For some people, or some cities it would work, but others it would simply put you where the service provider decide to resolve the IP, and often it’s at their main hub. You’re better off getting a cheap GPS unit for the rPi and using that. And no, that’s not a project I want to put on my plate, at least not for the foreseeable future.
-
Also, depending on where they move to, the rPi’s settings will also need to be changed, timezones for example, and if they cross a big body of water, also the LOCALE … And that’s outside the scope of this project.
-
Yeah, that is one of the things that I have heard about and that is one of my biggest concerns. However, the people that I am going to be gifting this too live in big enough cities that the IP address location I have searched of each is still within the correct city limits. I will look into adding GPS to the pi for that, but it is definitely going to increase the price of this project along with time to figure out how to make it to work.
If I were to approach this problem of using IP to get a city name, how would I go about adding that to the default/non-default weather or future modules? would it be best to use Python or Node.js?
-
@KirAsh4 Yeah, I totally see why that could cause a huge headache of a problem!
-
Unless you install a GPS module to show location… which is possible…