EHS8 GPS with Java API | Telit Cinterion IoT Developer Community
March 22, 2017 - 4:37pm, 7207 views
Hi,
i'm trying to get GPS coordinates via the JAVA API. The code is the following:
LocationProvider locProvider = null;
Criteria crit = new Criteria();
crit.setSpeedAndCourseRequired(false);
crit.setAltitudeRequired(false);
crit.setCostAllowed(false);
crit.setHorizontalAccuracy(1); // accuracy in meters
crit.setVerticalAccuracy(1);
locProvider = LocationProvider.getInstance(crit);
Location loc = locProvider.getLocation(60);
_longval = loc.getQualifiedCoordinates().getLongitude();
_latval = loc.getQualifiedCoordinates().getLatitude();
When i try to run this i get the following exception:
location could not be retrieved or timeout expired
Is there any configuration which should be done before using the EHS8-GPS?
I found the ^SCFG: "Gpio/mode/GPSANT","std" are there more such settings to adjust to get it work?
BR
Andy
Hi Andy,
Here is an AT command based EHS8 example:
https://iot-developer.thalesgroup.com/threads/ehs8-gps-configuration
Another link to handle the EHS8 always ON issue:
https://iot-developer.thalesgroup.com/tutorial/ehs8-and-gps-receiver
How to use ASC0 for AT and NMEA:
https://iot-developer.thalesgroup.com/tutorial/ehs8-use-gps-and-command-...
EHS8 does not output GPS information:
https://iot-developer.thalesgroup.com/threads/ehs8-unit-does-not-output-gps
I hope these links help.
Best Regards,
Antero
Antero Markkula
Communication and Mechatronics
Enkom Active Oy – www.enkom-active.fi
Upseerinkatu 3 A, 02600 Espoo, Finland
Mobile: +358 400 411368
Office: +358 10 204 0000
Fax: +358 10 204 0010
E-mail: antero.markkula@enkom-active.fi
Hi,
Thanks allot.
But i want to use the Java API.
BR
Andy
Hello,
Have you tried with AT commands. If you have activated the GPS with AT command it will not work in Java.
Please also try to set greater timeout in getLocation() method just for test or set -1 which is the implementation default value.
Maybe there's a problem with the antenna or it does not see the sky.
Regards,
Bartłomiej
Hello,
no, i haven't. I prefer using java for this. Should i try?
I've tried also timeout -1 because i've found a sample of you with that settings but unfortunately it doesn't work either. In one of the thread mentioned from Antero above there are some rumors of power saving settings, could you confirm this as a possible reason?
BR
Andy
Hello,
The background was just to make sure that you haven't activated the GPS with AT command.
Of course you can try it for test to check if the GPS will work if you are not sure about the correctness of your Java code.
I think that the reason is somewhere else because you don't even get the first fix. Could you please paste the AT^SGPSC?, ATI1 and AT^SCFG? outputs?
One of the reasons could be that JRC is not running. Or you can have problems with the GPS antenna. Are you sure that is is correctly connected?
Regards,
Bartłomiej
Hello ,
AT^SGPSC?
^SGPSC: "Engine","0"
^SGPSC: "Nmea/Output","on"
^SGPSC: "Nmea/Freq","1"
^SGPSC: "Nmea/Data","GGA,GSA,GSV,RMC,VTG"
^SGPSC: "Nmea/Interface","local"
^SGPSC: "Power/Antenna","auto"
^SGPSC: "Mode/Antenna","0"
^SGPSC: "Assist/Address","<NO ADDRESS TYPE>","<NO ADDRESS>","<NO PORT>"
^SGPSC: "Assist/Data"
^SGPSC: "Assist/Connection"
ati1
Cinterion
EHS8
REVISION 03.001
A-REVISION 00.000.14
at^scfg?
^SCFG: "Audio/Loop","0"
^SCFG: "Call/ECC","0"
^SCFG: "Call/Speech/Codec","0"
^SCFG: "GPRS/AutoAttach","enabled"
^SCFG: "Gpio/mode/ASC1","std"
^SCFG: "Gpio/mode/DAI","gpio"
^SCFG: "Gpio/mode/DCD0","gpio"
^SCFG: "Gpio/mode/DSR0","gpio"
^SCFG: "Gpio/mode/DTR0","gpio"
^SCFG: "Gpio/mode/FSR","gpio"
^SCFG: "Gpio/mode/GPSANT","std"
^SCFG: "Gpio/mode/HSIC","rsv"
^SCFG: "Gpio/mode/PULSE","gpio"
^SCFG: "Gpio/mode/PWM","gpio"
^SCFG: "Gpio/mode/RING0","gpio"
^SCFG: "Gpio/mode/SPI","rsv"
^SCFG: "Gpio/mode/SYNC","std"
^SCFG: "Ident/Manufacturer","Cinterion"
^SCFG: "Ident/Product","EHS8"
^SCFG: "MEShutdown/Fso","0"
^SCFG: "MEShutdown/sVsup/threshold","0","0"
^SCFG: "MEopMode/CFUN","0","1"
^SCFG: "MEopMode/SoR","off"
^SCFG: "Radio/Band","511"
^SCFG: "Radio/Mtpl","0"
^SCFG: "Radio/OutputPowerReduction","4"
^SCFG: "Serial/Interface/Allocation","1","1"
^SCFG: "Serial/USB/DDD","0","0","0409","1E2D","0058","Cinterion Wireless Modules","EHx",""
^SCFG: "Tcp/IRT","3"
^SCFG: "Tcp/MR","10"
^SCFG: "Tcp/OT","6000"
^SCFG: "Tcp/WithURCs","on"
^SCFG: "Trace/Syslog/OTAP","0"
^SCFG: "URC/Ringline","local"
^SCFG: "URC/Ringline/ActiveTime","2"
^SCFG: "Userware/Autostart","1"
^SCFG: "Userware/Autostart/Delay","350"
^SCFG: "Userware/DebugInterface","0.0.0.0","0.0.0.0","0"
^SCFG: "Userware/DebugMode","off"
^SCFG: "Userware/Passwd",
^SCFG: "Userware/Stdout","usb4",,,,"off"
^SCFG: "Userware/Watchdog","0"
at^sjam=5
^SJAM: "a:/JRC-1.56.30.jad","Java Remote Control MIDlet Suite","Cinterion","1.56.30",1
^SJAM: "a:/Test.jad","Test MIDlet Suite","WBR","0.1.10",1
JRC is running.
Meanwhile i think also it is a problem with the GPS Antenna because when running this on a MC89-GPS (EHS8-Terminal) it works. But on our own hardware with the EHS8-Module not.
Do you have any hints to check if antenna is working correctly?
BR
Andy
Hello,
If you are testing with the same antenna in both cases the problem could only be in the connection. Do you have EVAL BOARD with the module soldered to it (maybe the antenna is plugged to the wrong connector) or the module is soldered directly to your hardware (maybe there's HW problem)?
What type of antenna are you using? The module is configured for passive antenna.
If you are using the same application the code is probably also not a problem.
There is a delay for autostart 35 seconds configured. So JRC and any other application enabled for autostart will be started with this delay but this should not be a problem if you don't start your test application just after booting the module.
I think that you should also try with AT commands to make sure that it is possible to start the GPS engine and to see the NMEA data.
Regards,
Bartłomiej
Hello Bartłomiej,
it was indeed a HW Problem. Thanks allot.
BR
Andy
Hi Bartlomiej.
I have eval board EHS8 with sdk B80, and I want to use GPS but in the eval board there are 5 ufl connector, Where Have I connect the pig tail to GPS Antenna, and if is possible you can send me a sample of java midlet using GPS, thank you very much and best kind regards
Lenin Morejon
Hello,
Please see on the picture where to connect the GPS antenna on eval board:
I'll send you Java example MIDlet on your email.
Best regards,
Bartłomiej
Pages