Telit Cinterion IoT Developer Community
Concept Board: Internet Services - basics
Tutorial, March 25, 2014 - 1:07pm, 30162 views
This is part of tutorial series for Internet Services usage on Gemalto Concept Board:
- Concept Board: Internet Services - basics
- Concept Board: Internet Services - HTTP
- Concept Board: Internet Services - Transparent Socket
General overview
EHS6 has an embedded TCP/IP stack that is driven by AT commands and enables the host application to easily access the Internet. The advantage of this solution is that it eliminates the need for the application manufacturer to implement own TCP/IP and PPP stacks, thus minimizing cost and time to integrate Internet connectivity into a new or existing host application.
Please note that although other Gemalto products also offer Internet Services feature, the configuration and usage may vary. Feel free to inspire with this tutorial, but always refer to corresponding AT Command Set when configuring Internet Service for other products.
With EHS6 following Internet Services may be used:
- Non-Transparent/Transparent TCP client
- Non-Transparent/Transparent TCP listener
- Non-Transparent/Transparent UDP client
- Non-Transparent UDP endpoint
- FTP client
- HTTP client
- SMTP client
How to start?
As an example we will configure Non-Transparent TCP client accessing Internet over GPRS0. According to AT Command Set documentation there are generally two strategies in using Internet Services - polling mode and URC-driven mode. For example purposes URC-driven mode will be used, so before start, please make sure that AT^SCFG="Tcp/WithURCs" is set to "on".
All Internet Services are configured and used according to following scheme:
- Configuring Internet Connection and Internet Service
- Opening Internet Service
- Reading from/writing to internet service
- Closing Internet Service
Please find step by step instruction below.
Configuration of Internet Connection
Before Internet network resources can be accessed, connection profile must be configured.
Connection profile determines which access technology will be used for establishing Internet connection (for EHS6 only GPRS0 is available) and defines APN. User and password may also be passed if required.
Up to six connection profiles may be configured (under ids from range 0-5).
AT^SICS command is used to configure connection profile. General syntax for this command is as follows:
AT^SICS=<conProfileId>,<conParmTag>,<conParmValue>
where:
- <conProfileId> is the id of the connection,
- <conParmTag> is connection parameter name,
- <conParmValue> is value of above parameter.
Please input below AT commands to setup the connection:
AT^SICS=0,"conType","GPRS0"
Above command sets the 0th profile to access network over GPRS0.
AT^SICS=0,"apn","internet"
Above command sets the 0th profile to use access point name equal "internet" (quotes omitted).
If network operator doesn't require passing user and password, after setting proper APN the connection should work. For other configuration options, please refer to description of <conParmTag> in AT command set.
Configuration of Internet Service
As Internet Connection has been already configured, you can setup Internet Service. As an example TCP client will be used. To setup Internet Service AT^SISS command is used. General syntax for this command is as follows:
AT^SISS=<srvProfileId>,<srvParmTag>,<srvParmValue>
where:
- <srvProfileId> is the id of the service (don't mix up with connection id),
- <srvParmTag> is service parameter name,
- <srvParmValue> is value of above parameter.
First you need to define which type of Internet Service will be used:
AT^SISS=2,"srvType","Socket"
Above command sets socket client to be accessible under service profile id equal 2.
Now let's setup the address of the server:
AT^SISS=2,"address","socktcp://x.x.x.x:p"
Above command sets destination address x.x.x.x and port p.
Finally you have to assign service profile to connection profile:
AT^SISS=2,"conId",0
After above command execution, the service will be assigned to access the Internet using connection profile on id equal 0, which was configured in section "Configuration of Internet Connection".
It is worth mentioning that up to 10 services may be created (under ids from range 0-9). Various Internet Services may use the same Internet Connection.
Opening Internet Service
As configuration is over, Internet Service may be open with following command:
AT^SISO=2
After above command Internet Connection will be established (if not established yet) and the service will start working. URCs will signalize that new data may be put or received.
Reading and writing
When the module is ready to accept new data, following URC appears:
^SISW: 2,1
Above URC notifies that Internet Service with id = 2 is ready for new data. Let's write 5 bytes to the service using:
AT^SISW=2,10
After ^SISW: 2,10,0 intermediate result code the module waits for 10 bytes. 1500 bytes can be written at once.
When the module receives new data, following URC appears:
^SISR: 2,1
This means that there is new data in buffer waiting to be flushed. Use following command to read the data (log with answer):
AT^SISR=2,100
^SISR: 2,10
1234567890
OK
AT^SISR command performs non-blocking query. It returns received data up to requested limit. If no sufficient amount of data is provided it will return all the data from the buffer. Intermediate return code informs how much data will be flushed.
Closing Internet Service
If Internet Service is no longer needed, it may be closed with:
AT^SISC=2
After above command execution the socket will be closed and Internet Connection will be dropped after inactivity timeout's expiration if no other active Internet Services are assigned to this Connection.
Monitoring connection state
For connection and service monitoring following commands can be used:
AT^SICI? - monitoring state of Internet Connections,
AT^SISI? - monitoring state of Internet Services
AT^SISO? - as above
Monitoring commands report state with numerical codes. The values may be looked up in corresponding AT Command Set sections.
Summary
Internet Services may be powerful tool in developer's hands. With only few commands Internet Connection may be set to be used in embedded applications without the necessity of network stack implementation - hence application designer may focus on his strict goals. For more details refer to Concept Board documentation page in Knowledge Base, AT Command Set is especially helpful.
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
Have you finished the HTTP connection with java tutorial yet?
Hi everyone,
I'm using the EHS6 board and I don't get any URC when I send AT^SISO=0 eventhough I previously sent AT^SCFG="Tcp/WithURCs","on". I only get OK...
I have configured the connection profile and the internet service successfully (I can use SISR/SISW without any problem). I just can't get the URC to tell me when the connection is established...
Any idea why?
Thanks for your help!
EDIT: I restarted the device and now it's working... I don't think it is mentioned in the documentation that we have to restart it after sending AT^SCFG, small bug(?)
Hi,
I've been following this tutorial for few days without any success. Everytime, I type AT^SISO=2, the following message pops up in the screen:
^SIS: 2,0,94, "PDP; connection failed".
I obtained my IP address from myipaddress.com. I port forwarded port 747 first, then 80. I downloaded the SocketTest Application to listened to port 747. Then tried port 80. Both failed.
What did I do wrong? How can I finish this tutorial successfully? Thanks in advance.
Eric.
Pages