This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

GPS for LM-IoT-Edge
#1
Hey,

I want to read the current GPS position from the GPS antenna that is attached to the controller.
How do i install the necessary gpsd package, it doesn't work with opkg.
Reply
#2
The only solution at this moment is to read the data using Lua serial library and then parse it. This library can be used for parsing: https://github.com/1nv1/luaGPS
Reply
#3
(04.08.2022, 06:53)admin Wrote: The only solution at this moment is to read the data using Lua serial library and then parse it. This library can be used for parsing: https://github.com/1nv1/luaGPS

And how do i read from the device? A quick test with:
Code:
require('serial')
port, err = serial.open('/dev/ttyUSB1')
log(port, err)
-- script will wait for 10 characters for 20 seconds
data, err = port:read(10, 20)
log(data, err)
Only gave me this output:
Code:
test 04.08.2022 16:41:51
* arg: 1
  * luaserial
* arg: 2
  * nil
test 04.08.2022 16:42:11
* arg: 1
  * nil
* arg: 2
  * string: timeout
Reply
#4
You need to start GPS by sending AT+CGPS=1\r\n to /dev/ttyUSB2. This has to be done on every system boot. You can also try sending AT+CGPSAUTO=1\r\n to enable automatic GPS start.
Reply


Forum Jump: