11 GPS

Last modified by Devin Chen on 2025/11/27 21:25

1.Network Configuration

GPS function only supported by H-SG

4G网络.png

4G antenna(right) with GPS antenna(left)

天线.png

Make sure the box is online using a 4G signal

4G信号.png

2.GPS positioning

When the 4G signal is normal, select Use device base station positionning.

BOX GPS定位.png

地图显示结果.png

3.Create an address

Use a lua script to copy the latitude and longitude to the HDW address.

  • Address format is chosen as 64 bit float.
  • 4 bits between addresses

创建地址承接.png

地址间隔.png

4.Lua script

  • Longitude: addr_getdouble("@W_HSW187") (read only)
  • Latitude: addr_getdouble("@W_HSW183") (read only)

创建脚本.png

脚本程序.png

function GPS.main()

local Longitude1 = addr_getdouble("@W_HSW187")
local Latitude1 = addr_getdouble("@W_HSW183")

      addr_setdouble("@longitude",Longitude1)
      addr_setdouble("@latitude",Latitude1)
     
     print(Longitude1)
     print(Latitude1)
end

Debug 

结果显示.png