PiClock
PiClock copied to clipboard
dynamic gps updates
Love the clock.. would love to be able to update gps co-ords on the fly, as I'm on a ship.. this would be a great bridge clock. J
i can save the lat/long to a file every hour say.. I already do for various other applications maybe the clock could optionally retrieve the location from a file?
I love this issue. The use cases of PiClock are amazing. I feel pretty lame I've just got it running on a crappy laptop sitting on a shelf. Thanks again for creating this @n0bel.
I just wrote up a little in #94 about creating a timer task to update the background image. A similar approach could be done to read a file with updated GPS coordinates.
I would also recommend taking a look at GPSD, especially if there are other applications that are already looking for updated GPS coordinates. I haven't interfaced with it directly, but have created a "fake" GPSD service for applications that use it. Depending on where the GPS information comes from and the applications that are consuming it, that may be a better method of integration than writing files as it would be reading TCP data. (Just a thought, I don't know your use case)
@dankolbrs You're way more creative than I am... I read this note and came up with nothing constructive to recommend.
I can update the config file with new gps co-ords but as the clock only loads the conf on startup it means a daily restart.. which isn't that bad :)
Could the PyQtPiClock.py be changed to link to another python file/method that polls for the latest GPS coords off of a USB device? GPSd seems like the best way to do this, but I don't know where to link this into PyQtPiClock.py (see lack of comments issue).
I really only need hourly updates. I've got a kml file from google earth that i am trying to use but so far no luck :(
My previous comment linked up the issue where I provided info on how to change the background. This isn't much different.
- Create method to update location
- Create timer object calling that method
The method to update location can be another object, reading a file, reading from GPSd, etc. However you want to get the lat and long, it would then need to update the Config.wulocation data and radar markers.
Providing a more specific example than previously, getting the temperature from the sensor on the pi is set up this same way.
I'd love to see more contributions, and this would be a good one for someone to get to know the internals with.
I've managed to get GPSd to read from a UDP source, so I have the lat and long on the PI now but thats where i'm getting stuck. I'm pretty low grade at linux.. I'll soldier on though. Thanks for the tips :)
I've cracked it.. magic stuff.. thanks all :)
I use an external perl script on a cron schedule to change the background colors based on temperature. The downside of this is having a large pool of config files for each GPS location I am at when I travel with the clock. It would be nice if there was a way to put "universal" settings (gps, timezone) in a known file separate from creature comforts like image. Something akin to the way API keys are handled. This would allow for dynamic updating without reloading entire configs.