kopia lustrzana https://github.com/km4ack/pi-build
add file
rodzic
5aba7a5de8
commit
d1ec27aaa0
|
|
@ -0,0 +1,23 @@
|
|||
#!/usr/bin/env ruby
|
||||
|
||||
require 'gpsd_client'
|
||||
require 'maidenhead'
|
||||
require 'socket'
|
||||
require 'json'
|
||||
|
||||
ft8call_port = 2237
|
||||
|
||||
gpsd = GpsdClient::Gpsd.new()
|
||||
gpsd.start()
|
||||
apicmd = {}
|
||||
|
||||
# get maidenhead if gps is ready
|
||||
if gpsd.started?
|
||||
pos = gpsd.get_position
|
||||
maid = Maidenhead.to_maidenhead(pos[:lat], pos[:lon], precision = 5)
|
||||
# puts "lat = #{pos[:lat]}, lon = #{pos[:lon]}, grid = #{maid}"
|
||||
apicmd = {:type => "STATION.SET_GRID", :value => maid}
|
||||
end
|
||||
|
||||
puts "#{maid}"
|
||||
|
||||
Ładowanie…
Reference in New Issue