BGS2T - EHS5T AT command difference | Thales IoT Developer Community
February 7, 2021 - 4:17pm, 8085 views
Hi,
For a long time I have been using a device (Natural Gas Volume Corrector) that manages the BGS2T device with AT commands.
I am communicating with my Natural gas volume corrector device (ModBus protocol) via BGS2T.
I want to switch to 3G or 4G due to the problems experienced in GPRS.
bought the EHS5T terminally PLS62T. But I could not communicate with both.
When I watched the communication between the Natural Gas volume correction device and EHS5T over RS485 communication, I noticed that there was an error in the AT+GMR command in the figure below.
AT+GMR function is valid for BGS2T but not for EHS5T and PLS62T. I found that AT+CMGR for EHS5T and PLS62T have the same function, but I do not have the opportunity to change the commands of the Natural gas volume corrector.
How can I resolve this situation?
Hello,
This command is not really important. Does the controller use this value for something? It would be the best if the controller could accept the error and go on. If not maybe there is a way to modify the application or script behavior. Or controller firmware update could do the job. If not I can see one more option. Please see this link: https://iot-developer.thalesgroup.com/knowledge-base?title=custom%20AT&f...
it is possible to implement own AT commands in a Java MIDlet. It works on the modules with new firmware. Should do on PLS62-W and for EHS5 it would depend on the version.
Best regards,
Bartłomiej
Hi,
There is no possibility to change the firmware of the device.
As in the example you specified, I created a Java Midlet that I can customize with AT commands coming over RS485.
I have changed the AT + GMR command to AT + CMGR.
I am currently getting the following error for the EHS5T.
I don't know the exact meaning of the commands.
In the figure below, I get an error with the ATD * 99 *** 1 # command. What would be the reason?
AT E0 Q0 V1
OK
AT+CPIN?
+CPIN: READY
OK
AT+CREG?
+CREG: 0,1
OK
AT+CGMI
Cinterion
OK
AT+CGSN
357040062916130
OK
AT+GMR
REVISION 03.001
OK
AT+CIMI
286015326331695
OK
AT+CSQ
+CSQ: 17,99
OK
AT+CGDCONT=1,"IP","mgbs"
OK
ATD*99***1#
ERROR
ATD*99***1#
ERROR
Please send AT+CMEE=2 before ATD to enable extended error information. Additionally you may check AT+CEER after the error.
Hi,
I am getting response below.
AT+CMEE=2
OK
ATD*99***1#
+CME ERROR: unspecified GPRS error
AT+CEER
+CEER: "No report available"
OK
Hello,
This error description is not that much helpful unfortunately. Please make sure that the module is registered to the network - AT+COPS?, AT+CREG? - and the signal quality is fine - AT^SMONI. Please also check AT+CFUN?, T+CGACT?, T+CGATT?. Try AT+CGATT=0 and AT+CGATT=1 and then ATD.
Regards,
Bartłomiej
Hi,
Commands and response is below.
AT+COPS?
+COPS: 0,0,"TR TURKCELL",2
OK
------------------------
AT+CREG?
+CREG: 0,1
OK
------------------------
AT^SMONI
^SMONI: 3G,10813,113,-12.0,-82,286,01,EC13,1AF9EFB,6,33,NOCONN
OK
------------------------
AT+CFUN?
+CFUN: 1,0
OK
------------------------
AT+CGACT?
+CGACT: 1,0
OK
------------------------
AT+CGATT?
+CGATT: 1
OK
------------------------
AT+CGATT=1
OK
AT+CGATT=0
OK
ATD*99***1#
ERROR
Hi,
Commands and response is below.
AT+COPS?
+COPS: 0,0,"TR TURKCELL",2
OK
------------------------
AT+CREG?
+CREG: 0,1
OK
------------------------
AT^SMONI
^SMONI: 3G,10813,113,-12.0,-82,286,01,EC13,1AF9EFB,6,33,NOCONN
OK
------------------------
AT+CFUN?
+CFUN: 1,0
OK
------------------------
AT+CGACT?
+CGACT: 1,0
OK
------------------------
AT+CGATT?
+CGATT: 1
OK
------------------------
AT+CGATT=1
OK
AT+CGATT=0
OK
ATD*99***1#
ERROR
I get the following outputs without running the Java project. Could the problem be running AT command via Java project?
AT+CGDCONT=1,"IP","mgbs"
OK
AT+CGATT=1
OK
AT+CGATT=0
OK
ATD*99***1#
CONNECT
Hello,
Could you explain a bit more how your Java MIDlet works? If it listens on the physical interface and sends all the commands inside Java with the ATCommand class it is possible that it's not supported. There is some limited set of AT commands that is not supported by ATCommand class.
The solution I proposed was to implement the own AT command which is usable on the standard physical interface like the native commands.
Regards,
Bartłomiej
Yes it is not supported as you mentioned.
The code I tested is as follows.
There was a project where approximately 700 pieces 4G terminals would be purchased. This was the reason we tried.
The company that produces the device(Natural Gas Volume Corrector) that drives the modem(with AT command) did not support this issue.
I think we will not be able to communicate due to the AT+GMR command.
Is there any other method we can try to establish communication?
Thanks.
protected void startApp() throws MIDletStateChangeException {
boolean serialPortOpened = false;
try {
String strCOM = "comm:" + comPort + ";baudrate=" + baudRate + ";bitsperchar=" + dataBit + ";stopbits=" + stopBit + ";parity=" + parity + "";
commConn = (CommConnection)Connector.open(strCOM);
inStream = commConn.openInputStream();
outStream = commConn.openOutputStream();
serialPortOpened = true;
}
catch (Exception e) {
}
if (serialPortOpened) {
while (true) {
try {
Thread.sleep(20);
int numberOfBytesToRead = inStream.available();
if (numberOfBytesToRead > 0) {
byte[] message = new byte[numberOfBytesToRead];
inStream.read(message);
messageStr = "";
for (int i = 0; i < message.length; i++) {
messageStr += (char)message[i];
}
getCommandResponse(messageStr);
}
} catch (Exception e) {
}
}
}
}
ATCommandResponseListener m_ATResponseListener = new ATCommandResponseListener() {
public void ATResponse(String response) {
try {
RS232ATCommandBridge.outStream.write(response.getBytes());
} catch (Exception e) {
}
}
};
private void getCommandResponse(String request) {
try {
if (request.length() > 1) {
if (request.indexOf("AT+GMR") > -1) {
request = request.substring(0, request.indexOf("GMR")) + "C" + request.substring(request.indexOf("GMR"), request.length());
}
synchronized (atCommand) {
try {
atCommand.cancelCommand();
} catch (Exception e) {
}
atCommand.send(request, m_ATResponseListener);
}
}
}
catch (Exception e) {
}
}
The code you pasted is not the good way to achieve your goal. Please see the link I sent you previously. It points to example projects which show how you can implement your own AT command and make it executable form the standard interface in the same way as any other native command. You could add your missing command so that your device could execute it successfully and go over. The command would be available as long as the MIDlet implementing it is running.
But this solution does not mean listening on the serial interface and execution of AT commands inside Java.
Pages