GPS data is unable to read | Telit Cinterion IoT Developer Community
November 3, 2015 - 8:11am, 14392 views
Hi, I am using EHS8 mounted on cinterion B80 starter.
JSR 179 API is always giving timeout expired even if it didn't take more than 1 second time. Forget that, we have direct AT command.
this is the config that I have.
AT^SGPSC="Engine","3"<CR> is giving frequent output and location fix is also happening. how can I decode that to my code? Response Listener is only giving the first response. Listener is giving the buffer status. Nobody is there to give me the actual data. Now I am able to see the data, but I couldn't use it in my code.
Correct me if i am doing all it wrong and please help me read the data. i don't need A-GPS. GPS is what i need.
Thanks in Advanse,
Hi, can you please send me the sample app too?
A couple more question:
1) Using a "location = locationProvider.getLocation(1);" I get location every 4 or 5 seconds which is too slow for our application? Is it possible to get them more frequently (every second would be great)
2) Is it possible to read raw NMEA from java code?
OK, I'll send on your email.
Additionally you can see this: https://iot-developer.thalesgroup.com/showcase/cinterion-ehs8-gps-locati...
You can call locationProvider.getLocation(-1) to let the implementation set the default value. You can set up a listener and configure it to get called more frequently. But this also does not guarantee how frequently the actual posision is updated. So I think that so high frequency might be problematic in Java. Please also test with AT commands where you can set the NMEA frequency to 1 second.
As for NMEA in Java you can read it from Location instance like below:
Hi, thank you for your help. I've changed the demo application slightly to use
provider.setLocationListener(this, -1, -1, -1);
as calling provider.getLocation(-1) gets me a location every 30s or so, which is way too slow, but at least I get fresh location.
Using location listener gives me a location every 1 or 2 seconds, however the locationUpdated() method is always invoked with the same (old) location data???
A couple of my observations:
My experience with the EHS8 module (regarding accessin GPS from Java) was very frustrating so far...
Please try to set UTC time on the module (using AT+CCLK command) before invoking setLocationListener() method. Maybe it will help to solve your issue with locationUpdated() method. If it won't help, you can also try to adjust 'maxAge' parameter in setLocationListener() (but please also keep UTC time in the module). It's hard to say the correct value because it depends on the speed of the GPS fix.
Regarding rx/tx loopback I think it should work - you could send AT^SGPSC command also from Java.
You can also try to log NMEA data to the file and read in from the file in Java - however here you need to be aware that continuous writing to the module's memory can ******* the flash.
Please try firstly with UTC time.
With UTC time set I can get more or less reliable locationUpdated() with 15s intervals. Anything less (or with interval set to -1) only the first fix data is received every time. Timeout and maxAge parameters don't seem to have any effect at all. EHS8 jsr179 implementaion looks broken to me...
Unfortunately the rx/tx loopback idea is also not viable as once the ASC1 interface is claimed by java, it no longer accepts AT commands.
Using ATCommandListener to get the NMEA from the ATCommand send(AT^^SGPSC="Engine","3") also doesn't work or I don't know how to.
So I am slowly running out of options...
Good to hear that setting UTC time at least a bit improved the performance. Unfortunately, as Bartłomiej said, it can be hard to achieve higher frequency in Java.
Can you consider devoting ASC0 for loopback? In that case you could set AT^SGPSC="Nmea/Interface" to 'ASC0' instead of 'local' and start GPS Engine from any interface.