EHS6T ATD command using Java engine | Thales IoT Developer Community
October 17, 2016 - 3:15pm, 3635 views
Hello,
EHS6T, I am using the java engine to control the ****m. When I send the ATD**99***# command through the Java engine it always returns an error. But if I don’t use the Java engine and I write to the ****m directly then I am able to send the ATD**99***# command with no problems and data stream open. Is there a problem with using the ATD command through the Java Engine?
When doing the tests between the Java Engine and no Java engine, I initialize the ****m exactly the same from power up.
How can I get an example Java program that runs on the EHS6T that shows how to switch to and from command **** and data ****? In the current examples folder I find only the basic programs, such as “***** world”, “rs232demo”, etc… But I am looking for an example program to show how to get into and out of data ****.
Thanks,
--Thomas
Hi,
Using Java you you should use he Java primitives to achieve the connection.
you can find examples in the Knowledge base, like :
https://iot-developer.thalesgroup.com/showcase/cinterion-ehs6-concept-board-and-windmill-java-demo-sensorlogic
and
https://iot-developer.thalesgroup.com/showcase/ntp-how-use-net-time-protocol-j2me
Regards
ALopez
Somewhere over the rainbow!!! Looking for the Oz Land!!!
Please describe why you need to do that under Java. Usually this is done without Java from some external microcontroller. The PPP protocol implementation is needed to establish the connection and transmit data after CONNECT. As far as I know it will not work under Java.
Regards,
Bartłomiej
Hello,
My goal is to use the terminal modem to emulate a different modem (a wraparound). There is a microcontroller which is the master, and the terminal modem is the slave. I do not have access to the microcontroller firmware, therefore when I upgrade the previous modem to the new 3G EHS6T modem all commands and responses from the terminal modem must be the same as the previous modem.
So I wrote the java midlet application to look at each command that comes in, and if the EHS6T modem accepts this command or returns the appropriate string that the microcontroller wants, then I forward it to the EHS6T modem using the atc.send(“…\r”) with no problems. And the commands that are not supported or the response is not as it should, I use the java program to catch the command and it returns the string that the microcontroller wants. For example the +CGMI, +CGMR commands the java program must catch these and respond to the microcontroller with the respective string.
This is all fine and the AT commands work as expected. But my current problem is when the microcontroller is ready to transfer data out using the ATD command. Specifically it sends the ATD*99***1# command. When the java program forwards this to the modem, it returns with “+CME ERROR: unspecified GPRS error”. How can I fix this?
I know the terminal modem itself accepts the ATD*99***1# command because if I don’t run the AT commands through the Java engine and just run them to the modem on the terminal modem, the ATD*99***1# command works fine and the data is transferred to the other respective side.
Does anyone know why the ATD*99***1# is not working in the Java engine?
Here Is the sequence of commands sent, am I missing a command that the Java Engine *****. As I wrote previously only the java is returning the error. The modem itself on the EHS6T accepts this command fine.
ATZ
ATE1
AT+CMGF=0
ATX4
AT+CGMI
AT+CGMR
AT+MMICG=30
AT+CREG=1
AT+CREG?
AT+CMGL=4
AT+CGDCONT=1,"IP","Thomas Blanked This out"
AT+CGATT=0
AT+CGATT=1
AT+CGATT?
AT+CSQ
ATD*99***1#
--Thanks
Interesting scenario. But quite a unique one. Usually the default and recommended way of using network connections from Java MIDlet is with Java API. For dialup scenarios Java MIDlet is usually not needed. Maybe there would be some implementation problems or extra effort needed to enable such a scenario from Java - this could be a reason why it is not possible.
I think that you could try to close the serial connection in the MIDlet before the master sends ATD command to restore the external AT command interpreter but I'm not sure if it would work...
Regards,
Bartłomiej
Hello,
Just to be clear is it possible to use the ATD command within the Java Engine on the terminal modem? Can you find out for sure if the ATD command can or can’t be used within the Java Engine.
As you suggested, I can run the JAVA MIDlet for the commands that need translating and then turn the JAVA MIDlet off before the ATD command is sent so it goes to the AT command interpreter. But there is no way to get back to the JAVA midlet without a reboot/power-cycle of the terminal modem and that could be an potential unforeseen problem.
Thanks for your help,
--Thomas
Hello,
Although it is not written explicitly in a user documentation it is unfortunately impossible. It is not a typical and recommended way of using Java on the module. I have also found a similar thread - please take a look:
https://iot-developer.thalesgroup.com/threads/ehs6-embedded-java-normal-...
You could also probably try to access external interface from Java by bridging two interfaces together if it is possible in your scenario.
But generally your concept is risky because even if it would be possible to get CONNECT under Java your device would then need to communicate with the module (via the Java MIDlet) using it's PPP stack implementation (which is usually quite narrow in such devices). And as PPP frames exchange is not always identical and many scenarios are possible and probably your device was programmed for the modem that is currently used, it is possible that there would be some problems on PPP layer any you would end up parsing the PPP frames in your MIDlet.
Best regards,
Bartłomiej