Cinterion EHS5-E communication problem | Telit Cinterion IoT Developer Community
December 7, 2017 - 8:55pm, 5295 views
Hi!
I'm trying to communicate with remote electric meter through GPRS-modem, based on EHS5-E chip. Sim-card installed in the modem has a static ip-adress. So,modem in TCP-server mode. I configure the modem using AT commands. The order of my actions is:
at+cgdcont=1,"IP","static.tele2.ru"
OK
at&w
OK
AT^SICS=0,CONTYPE,GPRS0
OK
at^sics=0,"apn","static.tele2.ru"
OK
AT^SISS=0,SRVTYPE,TRANSPARENT
OK
AT^SISS=0,conID,0
OK
AT^SISS=0,"address","socktcp://listener:5000;etx=26;timer=200"
OK
at^siso=0
OK
^SIS: 0,5
at^siso?
^SISO: 0,"TRANSPARENT",3,3,0,0,"90.150.68.193:5000","0.0.0.0:0"
^SISO: 1,""
^SISO: 2,""
^SISO: 3,""
^SISO: 4,""
^SISO: 5,""
^SISO: 6,""
^SISO: 7,""
^SISO: 8,""
^SISO: 9,""
A special configuration program of this electric meter allows to create a remote connection with it through GPRS in server and client mode.
In this program I have established a connection with the TCP port of the modem, but the electric meter does not respond. The electric meter is connected to the modem via the RS-485 interface.
Few questions:
What am I doing wrong?
How can I save the Internet profile in the modem so that after power on it connects to GPRS and up the TCP port on the remote site?
Thanks!
Hello,
You have set up the socket listener on the moudle and opened it. Now if the connection will come there will be URC displayed and you'll be able to accept it and the switch to transparent mode and exchange data... then switch back to command mode and close the connection... So your meter would have to be able to do all of this.
Maybe your meter is just able to set up the dial-up commection with the module as a modem in the same way as it can be done when you set up a dial-up connection in Windows OS for example.
Then the meter probably has some PPP stack implementation and maintains all the socket connections inside. You only ***** to configure APN which is probably possible in the configuration program that you have used (you also did it with AT command: at+cgdcont=1,"IP","static.tele2.ru"). Then the meter will only need to send ADT*99***1# to start the connection and the rest will be done by the PPP implementation on the meter. In case of the problems you may also need to set the authentication type with AT^SGAUTH command.
Best regards,
Bartłomiej
Bartłomiej!
Thank you for the prompt reply! Yes, the socket listener is working. I was able to connect with the meter and read the data through the socket listener in transparent mode today. The problem is: after the module power off, Internet service settings are reset.
I saved them with AT ^ sips = all,save. After the module is turned on, these settings must be loaded with AT ^ SIPS = all, load. How can I configure the module to allow auto load these settings after the module is powered on? On the remote side is only the meter and the module connected to it (RS-485). The meter does not support AT-command.
Best regards,
***
Hello,
Yes you can save the internet service profile and load it but it can't be loaded automatically.
I must admit that I still don't have the complete overview of this solution.
Can you write something about this meter - manufacturer, model etc.?
If you are using the transparent socket connection and the meter does not support AT commands and PPP how does it support network connections?
Have you also tested if it is possible to connect once again and more ***** then?
Regards,
Bartłomiej
Hi,
Thanks again! I`ll try to explane:
I connect my laptop to the modem through a USB-RS-485 adapter, start the Telnet application (Hyper-Terminal), connect to the modem and configure it using AT commands:
ati
Cinterion
EHS5-E
REVISION 03.001
ACTIVE PROFILE:
E1 Q0 V1 X4 &C1 &D2 &S0 \Q3
S0:000 S3:013 S4:010 S5:008 S6:000 S7:060 S8:000 S10:002
+CBST: 71,0,1
+CRLP: 61,61,78,6
+CR: 0
+CRC: 0
+CMGF: 0
+CNMI: 1,0,0,0,0
+CMEE: 0
+ICF: 3
+DTMF: 0
+CSMS: 0,1,1,1
+CREG: 0,1
+CLIP: 0,2
+COPS: 0,0,"TELE2 RU",2
+CGSMS: 1
at^scfg?
^SCFG: "Audio/Loop","0"
^SCFG: "Call/ECC","0"
^SCFG: "Call/Ecall/AckTimeout","5000"
^SCFG: "Call/Ecall/Callback","0"
^SCFG: "Call/Ecall/CallbackTimeout","43200000"
^SCFG: "Call/Ecall/Msd","0000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000"
^SCFG: "Call/Ecall/Pullmode","0"
^SCFG: "Call/Ecall/SessionTimeout","20000"
^SCFG: "Call/Ecall/StartTimeout","5000"
^SCFG: "Call/Speech/Codec","0"
^SCFG: "GPRS/AutoAttach","enabled"
^SCFG: "Gpio/mode/ASC1","gpio"
^SCFG: "Gpio/mode/DAI","gpio"
^SCFG: "Gpio/mode/DCD0","std"
^SCFG: "Gpio/mode/DSR0","std"
^SCFG: "Gpio/mode/DTR0","std"
^SCFG: "Gpio/mode/FSR","gpio"
^SCFG: "Gpio/mode/PULSE","gpio"
^SCFG: "Gpio/mode/PWM","gpio"
^SCFG: "Gpio/mode/RING0","std"
^SCFG: "Gpio/mode/SPI","rsv"
^SCFG: "Gpio/mode/SYNC","std"
^SCFG: "Ident/Manufacturer","Cinterion"
^SCFG: "Ident/Product","EHS5-E"
^SCFG: "MEShutdown/Fso","0"
^SCFG: "MEShutdown/sVsup/threshold","0","0"
^SCFG: "MEopMode/CFUN","0","1"
^SCFG: "MEopMode/Dormancy","0","0"
^SCFG: "MEopMode/SoR","off"
^SCFG: "Radio/Band","147"
^SCFG: "Radio/Mtpl","0"
^SCFG: "Radio/OutputPowerReduction","4"
^SCFG: "Serial/Interface/Allocation","0","0"
^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","0"
^SCFG: "Userware/DebugInterface","0.0.0.0","0.0.0.0","0"
^SCFG: "Userware/DebugMode","off"
^SCFG: "Userware/Passwd",
^SCFG: "Userware/Stdout","null",,,,"off"
^SCFG: "Userware/Watchdog","0"
OK
AT^SICS=0,CONTYPE,GPRS0
OK
at^sics=0,"apn","static.tele2.ru"
OK
at^sled=1
OK
AT^SISS=0,srvType,"Socket"
OK
AT^SISS=0,conId,0
OK
AT^SISS=0,"address","socktcp://90.150.68.193:2000"
OK
AT^SISS=0,"tcpMR","3"
OK
AT^SISS=0,"tcpOT","5555"
OK
AT^SISS=1,"srvType","Socket"
OK
AT^SISS=1,conId,0
OK
AT^SISS=1,"address","socktcp://listener:2000;etx=26;autoconnect=1"
OK
AT^SISS=1,"tcpMR","3"
OK
AT^SISS=1,"tcpOT","5555"
OK
AT^SISO=1
OK
^SIS: 1,5
AT^SISO=1,1
^SISO: 1,"Socket",3,3,0,0,"90.150.68.130:2000","0.0.0.0:0"
OK
^SISW: 1,1
^SIS: 1,3,1,"88.206.50.224:49766"
CONNECT
Hello,
Thank you for the clarification. Now I understand how it work now.
So it is a regular power meter that has RS485 interface and supports modbus protocol.
I can see that you have configured the module for autoanswering. So you can connect it to the meter and then the trnsparent connection will finally be established.
And with the dedicated software you were able to communicate with the meter via this RS-socket-RS bridge successfully.
And do you plan to prepare the production version out of this scenario? You will still need some microcontroler to mange the modem as the meter cannot do it. Or you could develop the whole solution in Java MIDlet.
Best regards,
Bartłomiej
Hi!
Hello,
So you will need to create your own solution. You won't find any complete solution but of course you'll be able to find some examples for the particular functionalities. There are some simple example MIDlets provided with the environment software for the modules like NetDemo and ATCmdDemo. Besides that there are many demo applications in our Knowledge Base. Please select Java and search. For the first proof of concept you will need to create the socket server on the module and establish a kind of pipe to the serial interface after accepting the connection.
Best regards,
Bartłomiej
Hi,
Thank you, Bartłomiej! I will look for similar solutions in the knowledge base.
Best regards, ***
Hello! Merry Christmas and a Happy New Year!
1.I saved the service settings (^ sips) and created a small MIDlet that loading these service settings and starting listener:
System.out.println("Sending asynchronous AT^SIPS="all","load"..."); this.m_Cmd.send("AT^SIPS=\"all\",\"load\"\r", new RspListener(null)); Thread.sleep(1000L); System.out.println("Sending asynchronous AT^SISO=1..."); this.m_Cmd.send("AT^SISO=1\r", new RspListener(null)); Thread.sleep(5000L); System.out.println("Sending asynchronous: AT^SISO=1,1..."); this.m_Cmd.send("AT^SISO=1,1\r", new RspListener(null)); Thread.sleep(5000L);
at^siso=1
OK
^SIS: 1,5
at^siso=1,1
^SISO: 1,"Socket",3,3,0,0,"90.150.68.193:2000","0.0.0.0:0
2. and what should I do to make the transparent mode between rs-485 and GPRS after starting socket listener and establition connection?
Best Regards, ***
Hi ***,
this will not work properly as you are using ATcmd from Java and sending Internet Service commands via m_Cmd.send.
In Java there is special API for Internet Service like in mentioned NetDemo and you schould create Midlet like this entering all data like you did in AT^SISS.
Best regards
Lukasz