Example of using EHS6T with dotnet (C#) | Telit Cinterion IoT Developer Community
November 15, 2016 - 4:19pm, 3698 views
Can any one provide a simple example of how to connect to the LAN interface of a "EHS6T LAN" using dotnet (C# / VB.NET) and sending simple AT commands?
I have previously used Cinterion TC65 and Siemens M20 with RS232 for sending and receiving SMS (text messages), but with the LAN option of EHS6T I would like to switch to TCP connection if possible.
All help appreciated.
Hello,
To access the module via TCP you need to establish a Telnet connection to dedicated port “1234”. The default address is 192.168.1.1.
Then you have a direct link to the EHS6 module’s COM port and with that to the EHS6 Java platform.
Over this interface it is possible to control the Java module, to send AT commands and receive URCs in the same way as with the physical access to the module's port.
I don't have any dotnet example unfortunately.
Regards,
Bartłomiej
I ordered a unit and connected a normal LAN-cable to my laptop.
Then I connected to 192.168.1.1:1234 with System.Net.Sockets.TcpClient.
The rest was easy-peasy with Write and Read commands... :-)
Great to hear that!
Now the connection seemed to work fine. I can send and receive AT commands using C#.
Next problem is, that when I send a SMS (text message) to the equipment, then it is automatically deleted.
If I continuously check the storage with AT+CPMS? then it correctly shows:
+CPMS: "ME",0,4,"ME",0,4,"ME",0,4
Now when I send a text to it, then it briefly shows:
+CPMS: "ME",1,4,"ME",1,4,"ME",1,4
But after a few seconds the message is gone, and it goes back to:
+CPMS: "ME",0,4,"ME",0,4,"ME",0,4
I did NOT read the message my self. It simply vanishes in the modem!
I have tried to change AT+CNMI from 1,0,0,0,0 to 2,0,0,0,0 to see if that would help, but this setting also reverts to 1,0,0,0,0 after a few seconds. I have tried to persist it with AT&W, but it doesn't help. AT&W can persist other settings like AT+CMGF=0.
Please advise??
AT&V shows this result:
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: 7,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,"Telia-Telenor DK",2
+CGSMS: 1
ATI1 shows this result:
Cinterion
EHS6
REVISION 03.001
A-REVISION 00.000.42
at^scfg? shows this result:
^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","00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
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","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/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","EHS6"
^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","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","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"
Hello,
I'll clarify this SMS auto delete and back to you.
Best regards
Lukasz