11 GPS
Last modified by Devin Chen on 2025/11/27 21:25
1.Network Configuration

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

Make sure the box is online using a 4G signal

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


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


4.Lua script


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
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
