EHS8 Java programming for GPS | Thales IoT Developer Community
December 2, 2014 - 10:29am, 9317 views
Hello Everyone,
I'm a begginer on Gemalto and working on Java CMTK.
For managing GPS I saw a class called GpsApiMngr, it is to set the GPS settings, right? I can see the related methods, but couldn't find any example or description for arg in those APIs. Is there any guide how can I use those APIs?
By using which class I can get the location and GPS information (those from NMEA)? I saw some classes in the Location class of com/cinterion/location package, which one and where I should use them?
Thanks~
Hello Everybody,
So far I was able to activate the GPS by using the GpsApiMngr class, and it starts to issue the NMEA on the GPS default com port.
Does anyone know that how can I read the GPS information in Java code? I don't want GPS releasing the NMEA out also, I think one of those APIs like NmeaOutputModeChange could be used, but really don't know how can I buffer the GPS data and read the buffer.
Thanks~
Hello,
The EHS8 module you are using is not yet a released product and therefore the documentation is also not yet completed.
It would be probably the best to ask these questions to the local technical sales from whom you have got this module.
Best regards,
Bartłomiej
Dear Bartłomiej,
Noted, thanks for the kind response and support.
Cheers~
Dear Mehrdad,
I'm sorry I cannot provide you the satisfactory help here.
As the product is not yet released, the documentation is not yet ready. So I also have no documentation for the GpsApiMngr class.
But besides this class the product also supports JSR 179. And for this standard API you can find more API descriptions and examples on the internet.
It should be possible to get the location information you need with this standard API.
Best regards,
Bartłomiej
Hello Bartłomiej,
Merry Christmas,
Thanks for the comment, After long time I have back to EHS8. I would like to know if I use JSR179, then how can link the GPS to the location class in JSR179! Does it need to turn on the GPS beforehand? How can I connect the location_provider to the GPS?
I'm really appreciated if you help me in this class for the EHS8.
Thanks again!
Mehrdad Fallahpour.
Hi Mehrdad,
Like Bartek already wrote this module is not released yet. Therefore there is no official support for it yet. Any specific questions you should address directly to the source from where you got the module from. We would like to support you more, but official customer support we can provide only basing on the released materials.
When this product will be released we will definitely be able to provide specific examples and guides on how to use all the features.
Meanwhile I would like to wish you a Merry Christmas as well!
Hi,
I'm also trying to get the GPS position in Java code. As it seems there is not still any support for GPS in this module, I'm trying to open a commconnection profile with the USB port in which GPS is outputting the NMEA strings, but, I don't receive any character. I'm not sure if this should work.
Thanks!
Hello,
This thread was created a year ago. The GPS should be working now.
Here you can find an example for GPS usage with AT commands:
https://iot-developer.thalesgroup.com/threads/ehs8-gps-configuration
If you want to get the position from the Java MIDlet you should use the Java API and get the instance of LocationProvider class.
Regards,
Bartłomiej
Thanks for the answer, but I din't manage it. I want to get the position from the Java API, so I made an instance of the LocationProvider class with no success: location could not be retrieved. I think it's because I'm not switching on the GPS correctly. Although I've not found any documentation about the GpsApiMngr, I made some dummy interaction, but it's not working.
GpsApiMngr gam = new GpsApiMngr();
gam.GpsEngineModeSet(3,0);
System.out.println("GAM engine:" + gam.GpsEngineModeGet()); --> ERROR, it returns 0, so it's off
gam.NmeaFreqSet(5);
System.out.println("GAM nmeafreqget:" + gam.NmeaFreqGet()); --> ERROR, it returns 1
Any ideas?
By the way, I also tried to switch the GPS on using the AT command class instead using GPSApiMngr. After sending: AT^sgpsc="Engine","3" and configuring the nmea output through "local" interface, we have created a timertask in which every minute we get an instance of the LocationProvider class. The problem is that it throws the following LocationException: Provider is temporarily unavailable or timeout expired.
By the way, if we send the AT commands through the usb serial communication, the nmea frames are received with a correct GPS position.
Pages