IPACK Gateway Range User Manual. P-400 & P800 Series: Internet Protocolo Lógica SL

Download as pdf or txt
Download as pdf or txt
You are on page 1of 48

IPACK Gateway Range

User Manual.
P-400 & P800 Series
Description of the P-40X & P-80X Models of
IPACK range’s Serial to Ethernet
communications gateway series – how
they work and how to use them.

Internet Protocolo Lógica SL


IPACK Gateway Range. Ref: P-40X and P-80X Models
P-400 & P-800 Series
Date: 05 November 2012
User Manual Page 2 of 48 Version v_4.00

Versions and Editions History

User Manual
Content Date Published Annotation
VERSION
Edition AVI-10.

Hw: IPACK P-401 v1.1


Unifying the family’s IPACK P-402 v0.0
3.00 10 June 2010
documentation IPACK P-401-2C v0.0
IPACK EV-P400 v0.00

Sw: v3.0
3.01 Revision on texts 17 January 2011 Edition AI-11
4.00 Serie P-800 included 05 November 2012 Edition AXI-12

IPLógiKa® is a trademark registered by Internet Protocolo Lógica SL.

©2008 and 2012, IPLógiKa. All rights reserved. No part of this document may be transmitted or
reproduced in any format or by any medium whatsoever without the written permission of the owner,
IPLógiKa.

2012. Printed in Spain.

This document may be modified by the owner without notice.

The product names cited in this document are only referred to for purposes of their identification and may be trademarks
registered by their respective owners.

IPACK Gateway Range. Confidential Information


P-400 & P-800 Series Edition AXI-12
IPACK Gateway Range. Ref: P-40X and P-80X Models
P-400 & P-800 Series
Date: 05 November 2012
User Manual Page 3 of 48 Version v_4.00

CONTENTS
1 .-Introduction........................................................................................................................................................7
1.1.- Functionalities ..................................................................................................................................................7
1.2.- Applications ......................................................................................................................................................8
1.3.- Protocols supported .........................................................................................................................................8
1.4.- Port addresses and numbers ...........................................................................................................................8
1.5.- Assigning an IP address to P-400-series IPACK gateways .............................................................................8
1.6.- Serial Port .........................................................................................................................................................9
1.7.- Serial Port in P-402 Gateway..........................................................................................................................9
1.8.- Ethernet Interface ......................................................................................................................................... 10

2.- Programmable Functions .............................................................................................................................. 11


2.1.- General Configuration Functions ................................................................................................................. 11
2.1.1.- Serial Port Speed Configuration Function ................................................................................................. 11
2.1.2.- Flow Control Function ................................................................................................................................ 11
2.1.3.- ECO Function .............................................................................................................................................. 12
2.1.4.- Verbose Mode ............................................................................................................................................ 12
2.1.5.- Reset Software ........................................................................................................................................... 12
2.1.6.- Storing Parameters Commands ................................................................................................................ 13
2.1.7.- Factory configuration ................................................................................................................................ 13
2.1.8.- Functions for the IP Address Assignation Mode....................................................................................... 13
2.1.9.- Programming of remainder of Network Parameters .............................................................................. 14
2.1.10.- Commands that identify Gateways ........................................................................................................ 15
2.2.- Web Server Mode Functions. ....................................................................................................................... 15
2.2.1.- AT commands concerning the WEB server in Gateway IPACK P-400 series .......................................... 16
2.2.2.- AT commands concerning the WEB server in Gateway IPACK P-800 series .......................................... 19
2.2.3.-Configuration Web Page ............................................................................................................................ 20
2.3.- AT Modem Mode Functions ......................................................................................................................... 20
2.3.1.-Connection modes supported by IPACK P-40X gateways ......................................................................... 21
2.4.- Functions for sending of email ..................................................................................................................... 22

3.- Sending of UDP Datagrams........................................................................................................................... 25

4.- Dedicated Port Mode ..................................................................................................................................... 27


4.1.- Client Mode ................................................................................................................................................... 28

5.- Creating and Updating the Application Web Page in P400 gateway series .......................................... 30

6.- Creating and Updating the Application Web Page in P800 gateway series .......................................... 34
6.1. Structure of the web page ............................................................................................................................. 34

IPACK Gateway Range. Confidential Information


P-400 & P-800 Series Edition AXI-12
IPACK Gateway Range. Ref: P-40X and P-80X Models
P-400 & P-800 Series
Date: 05 November 2012
User Manual Page 4 of 48 Version v_4.00

6.2.- Generating .bin Files and uploading the page to the Gateway P-800 ....................................................... 35

7.- Time functions ................................................................................................................................................ 37

8.- Electrical characteristics of P-401 ............................................................................................................... 38


8.1.- Pin Assignation .............................................................................................................................................. 38
8.2.- J5 Connector .................................................................................................................................................. 38
8.3.- J6 Connector .................................................................................................................................................. 38
8.4.-Dimensions ..................................................................................................................................................... 39
8.5.- Electrical consumptions ................................................................................................................................ 39

9.- Electrical characteristics of the P-402 ........................................................................................................ 40


9.1.- Pin Assignation .............................................................................................................................................. 40
9.2.- Serial Connector ............................................................................................................................................ 40
9.3.-Dimensions ..................................................................................................................................................... 40
9.4.- Electrical consumptions ................................................................................................................................ 40

10.- Electrical characteristics of P-801 ............................................................................................................. 42


10.1.- Pin Assignation ............................................................................................................................................ 42
10.2.- J5 Connector ................................................................................................................................................ 42
10.3.- J6 Connector ................................................................................................................................................ 42
10.4.-Dimensions ................................................................................................................................................... 43
10.5.- Electrical consumptions .............................................................................................................................. 43

11.- Updating the firmware ............................................................................................................................... 44

12.- EV-P400 Evaluation Kit ................................................................................................................................ 45


12.1.- KIT Content .................................................................................................................................................. 45
12.2.- Serial Interface ............................................................................................................................................ 46
12.3.- Power supply ............................................................................................................................................... 46
12.4.- Description of the leds ................................................................................................................................ 46
12.5.- Keypad description ..................................................................................................................................... 47
12.6.- Expansion connector ................................................................................................................................... 47
12.7.- RS232 serial port connector ....................................................................................................................... 48

IPACK Gateway Range. Confidential Information


P-400 & P-800 Series Edition AXI-12
IPACK Gateway Range. Ref: P-40X and P-80X Models
P-400 & P-800 Series
Date: 05 November 2012
User Manual Page 5 of 48 Version v_4.00

INDEX OF TABLES
Table 1. Description of P-401 and P-801 series Connection Pins ...........................................................................9
Table 2. Description of P-402 series Connection Pins .............................................................................................9
Table 3. Assignation of Ethernet Connector Pins ................................................................................................. 10
Table 4. Serial Port Speed configuration commands ........................................................................................... 11
Table 5. Flow Control Commands ......................................................................................................................... 11
Table 6. ECHO Function Commands ..................................................................................................................... 12
Table 7. Verbose Mode Commands. ..................................................................................................................... 12
Table 8. Reset Command ...................................................................................................................................... 12
Table 9. Storing Parameters Command ............................................................................................................... 13
Table10. Factory configuration reset command ................................................................................................. 13
Table 11. Commands for IP Address Assignation mode ...................................................................................... 14
Table 12. Network Parameter Commands ........................................................................................................... 14
Table 13. Identification Commands...................................................................................................................... 15
Table 14. Web Server Commands. IPACK Gateway, P400 series ........................................................................ 16
Table 15. Web Server Commands. IPACK Gateways. P800 Series ...................................................................... 19
Table 16. AT Modem Commands ......................................................................................................................... 21
Table 17. Commands concerning the sending of electronic emails .................................................................... 23
Table 18. Commands concerning the sending of UDP datagrams ..................................................................... 26
Table 19. Commands concerning dedicated port mode...................................................................................... 28
Table 20. Commands concerning Client mode .................................................................................................... 29
Table 21. Time Function Commands .................................................................................................................... 37
Table 22.Pin assignation in P-401´s J5 connector .............................................................................................. 38
Table 23. Pin assignation in P-401's J6 connector ............................................................................................... 38
Table 24. Pin assignation in P-402’s DB9 connector ........................................................................................... 40
Table 25. Pin assignation in P-801´s J5 connector ............................................................................................. 42
Table 26. Pin assignation in P-801's J6 connector .............................................................................................. 42
Table 27. Test Pins in J5 and J6 connectors.......................................................................................................... 47
Table 28. J2 and J3 expansion connectors .......................................................................................................... 47

IPACK Gateway Range. Confidential Information


P-400 & P-800 Series Edition AXI-12
IPACK Gateway Range. Ref: P-40X and P-80X Models
P-400 & P-800 Series
Date: 05 November 2012
User Manual Page 6 of 48 Version v_4.00

INDEX of ILLUSTRATIONS

Illustration 1. Ethernet Connector ........................................................................................................................ 10

Illustration 2. Application Web Page .................................................................................................................... 16

Illustration 3. Data flow ........................................................................................................................................ 18

Illustration 4. Configuration Web page ................................................................................................................ 20

Illustration 5. Image of MPFS program process .................................................................................................. 31

Illustration 6. CGI files screen ............................................................................................................................... 32

Illustration 7. End of transfer of the BIN file ........................................................................................................ 33

Illustration 8. Microchip MPFS Generator Screen................................................................................................ 36

Illustration 9. P-401 viewed from above .............................................................................................................. 39

Illustration 10. P-402 viewed from above ............................................................................................................ 41

Illustration 11. P-801 viewed from above ............................................................................................................ 43

Illustration 12. EV-400 Kit Evaluation Board........................................................................................................ 46

IPACK Gateway Range. Confidential Information


P-400 & P-800 Series Edition AXI-12
IPACK Gateway Range. Ref: P-40X and P-80X Models
P-400 & P-800 Series
Date: 05 November 2012
User Manual Page 7 of 48 Version v_4.00

1 .-Introduction
This document provides information on the series of gateways P-400 and P800, which convert physical
Ethernet Serial accesses, and belong to the IPACK family, a family of data products from the Spanish
manufacturer Internet Protocolo Lógica, IPLógiKa.

It is the reference document for integrators and developers working on the integration of these gateways in
their designs.

The P-400 Serial to Ethernet Communications gateways series from Internet Protocolo Lógica’s IPACK
family, which this manual describes, includes the following models:
IPACK P-401
IPACK P-402
IPACK P-401-2C

The IPACK P-401 model is a Serial to Ethernet Communications gateway with a pin strip base for embedding
in the client Host board.
The IPACK P-402 model has basically the same behaviour and functionality as the P-401, but is connected
via an RS232 serial port.
The IPACK P-401-2C has the same characteristics as the P-401, incorporating component networks that are
more robust with respect to EMC and ESD.

The P-800 Serial to Ethernet Communications gateway series from Internet Protocolo Lógica´s IPACK family,
which this manual describes, includes the following model:
IPACK P-801

The IPACK P-801 model is a Serial to Ethernet Communications gateway with a pin strip base for embedding
in the client Host board.

1.1.- Functionalities
IPACK P-40X and P-80X gateways have the following functionalities
 Connecting systems via TCP or UDP channels.

 They contain a web Browser enabling the user to view and modify variables on the web page.

 The P-401 and P-801 gateway models has up to four programmable input/output pins that can be
used to monitor or control systems.

IPACK Gateway Range. Confidential Information


P-400 & P-800 Series Edition AXI-12
IPACK Gateway Range. Ref: P-40X and P-80X Models
P-400 & P-800 Series
Date: 05 November 2012
User Manual Page 8 of 48 Version v_4.00

1.2.- Applications
IPACK P-40X gateways connect the following devices to the Ethernet network, via their serial interface:
 Security and access control alarms

 Telecommunications systems

 Modems

 Vending Machines

 Time For Money Machines: T4M)

1.3.- Protocols supported


 ARP, UDP, TCP, ICMP, FTP, DHCP, HTTP as NETWORK protocols

 TCP, UDP an NTP, accessible via the serial port.

 FTP for updating the web Browser.

 SMTP for sending of electronic mail (e-mail).

1.4.- Port addresses and numbers


Hardware Address.
The system’s Hardware address, (also known as MAC), is a combination of digits that univocally identifies
IPACK gateways in the Ethernet environment.
IP Address.
Any device connected to an IP network must have an IP address that identifies it within that IP network.
Port Number.
TCP connections and even UDP datagrams are always defined by an IP address and a port number. The
IPACK gateways, series P-400 and P-800, enable the user to assign a port number to the connection, via
serial port and by means of AT commands.

1.5.- Assigning an IP address to P-400 and P-800 series IPACK gateways


There are two ways to assign the IP address to IPACK gateways:

 DHCP: dynamic assignation where a DHCP server exists. The gateway will request the assignation
from the DHCP server and will take one the latter assigns.

 Fixed IP: the network administrator will assign an IP address to the IPACK gateways, which will be
entered via the serial port by means of AT commands.

IPACK Gateway Range. Confidential Information


P-400 & P-800 Series Edition AXI-12
IPACK Gateway Range. Ref: P-40X and P-80X Models
P-400 & P-800 Series
Date: 05 November 2012
User Manual Page 9 of 48 Version v_4.00

1.6.- Serial Port


Following table details the P-401 and P-801 gateway model’s serial port pins

Table 1. Description of P-401 and P-801 series Connection Pins


PIN J6 I/O Function
3 DSR I Data Set Ready. Connect to Host’s Data Terminal Ready
4 DTR_O O Data Terminal Ready. Connect to Host’s Data set Ready
5 CTS I Clear to Send. Connect to Host’s Request to Send
6 RTS_O O Request to Send. Connect to Host’s Clear to Send
7 DCD O Data carrier Detect On. If there is a TCP/UDP terminal connected
8 RI O Ring indicator On. If there is a connection request
9 TX_MOD O IPACK P-401 transmission
10 RX_MOD I IPACK P-401 reception

The IPACK P-401 and P-801 gateway’s serial port, compatible with the RS232 standard communicates with
the Host system at speeds of between 4,800bps and 115,200bps.
All its pins are 3.3V Cmos compatible and 5V tolerant (a gateway must not be connected to a serial
interface with signals between +12V and -12V).

1.7.- Serial Port in P-402 Gateway


Following table details the P-402 gateway model’s serial port pins

Table 2. Description of P-402 series Connection Pins


PIN DB9 I/O Function
1 N. C.
2 RX_MOD I IPACK P-402 reception
3 TX_MOD O IPACK P-402 transmission
4 N.C.
5 GND Earth
6 N. C.
7 RTS_O I Request To Send. Connect to Host’s Clear to Send.
8 CTS I Clear To Send. Connect to Host’s Request to Send.
9 N. C.

The IPACK P-402 gateway’s serial port, compatible with the RS232 standard communicates with the Host
system at speeds of between 4,800bps and 115,200bps.

It is designed to directly substitute the cable that joins a DTE system (computer) to a DCE system.

IPACK Gateway Range. Confidential Information


P-400 & P-800 Series Edition AXI-12
IPACK Gateway Range. Ref: P-40X and P-80X Models
P-400 & P-800 Series
Date: 05 November 2012
User Manual Page 10 of 48 Version v_4.00

1.8.- Ethernet Interface


The interface with the Ethernet network, in 10BaseT for P-400 Series and in 10/100Base T for P-800 Series,
is realised via a standard RJ45 connector, which incorporates integrated status leds and network
transformers.
The interface’s physical characteristics are set out below, in Illustration 1 and the pin assignation in table.

Illustration 1. Ethernet Connector

Table 3. Assignation of Ethernet Connector Pins

PIN Ethernet Connector I/O Function


1 TX+ TX+ Data transmission
2 TX- TX- Data transmission
3 RX+ RX+ Data reception
6 RX- RX- Data reception
4 Not used Not used Connected to 5
5 Not used Not used Connected to 4
7 Not used Not used Connected to 8
8 Not used Not used Connected to 7

IPACK Gateway Range. Confidential Information


P-400 & P-800 Series Edition AXI-12
IPACK Gateway Range. Ref: P-40X and P-80X Models
P-400 & P-800 Series
Date: 05 November 2012
User Manual Page 11 of 48 Version v_4.00

2.- Programmable Functions


The communication interface with the IPACK P-400 and P-800 series is realised by means of AT commands.
The gateway accepts upper and lower case characters indifferently and provided that it recognises a
command will respond with the “OK” character chain.
All commands addressed to IPACK Gateways must end with the Carriage Return control character "OxOd"
In the P-40X and P-80X models of the Series, 4 levels of programmable functions are distinguished:
General Configuration Functions.

Web Server Mode Functions.

AT Modem Mode Functions.

Functions for sending of email

2.1.- General Configuration Functions


2.1.1.- Serial Port Speed Configuration Function
To select the speed at which you wish to communicate with the IPACK Gateways via the serial port, the
following commands are used. See table. Default factory value is 19200.

Table 4. Serial Port Speed configuration commands


AT Command Speed Response
ATN0 4800 bps OK
ATN1 9600 bps OK
ATN2 19200 bps OK
ATN3 38400 bps OK
ATN4 57600 bps OK
ATN5 115200 bps OK
ATN? The current speed is returned

2.1.2.- Flow Control Function


To select flow control in the serial port we use the following commands in the table.
Factory default: No flow control.

Table 5. Flow Control Commands


AT Command Function Response
ATK0 No flow control OK
ATK1 Hardware flow control (RTS, CTS) OK

IPACK Gateway Range. Confidential Information


P-400 & P-800 Series Edition AXI-12
IPACK Gateway Range. Ref: P-40X and P-80X Models
P-400 & P-800 Series
Date: 05 November 2012
User Manual Page 12 of 48 Version v_4.00

2.1.3.- ECO Function


To select whether we want remote echo in the IPACK gateways we use the commands in the table. No echo
as factory default.

Table 6. ECHO Function Commands


AT Command Function Response
ATE0 Remote Echo Not Selected OK
ATE1 Remote Echo Selected OK
AT Attention command OK

If remote echo is selected (ATE1), IPACK P-40X and P-80X gateways return the characters received by the
serial port as an echo.
The IPACK gateways response to this command is OK.

2.1.4.- Verbose Mode


On certain occasions the gateway indicates certain types of information, via the serial port , in the form of
unrequested messages. These types of message can sometimes be undesired. Where we simply wish to
replace an RS232 cable with the gateway, we want the gateway to behave in the most transparent way
possible.
An example of these messages is the CONNECTED message, where a TCP or RING connection is established
when someone wishes to establish a TCP connection with the gateway.
The ATVO command means that the gateway functions in a completely transparent manner.
For the gateway to show these messages again, we must use the ATV1 command. Following table describes
how these commands work.
Verbose activated as factory default.

Table 7. Verbose Mode Commands.


AT Command Function Response
ATV0 Verbose Mode Off OK
ATV1 Verbose Mode On OK

2.1.5.- Reset Software


P-40X and P-80X gateways can be reset at any time by means of the ATRESET command. See table.

Table 8. Reset Command


AT Command Function
ATRESET Causes a reset in the Firmware

IPACK Gateway Range. Confidential Information


P-400 & P-800 Series Edition AXI-12
IPACK Gateway Range. Ref: P-40X and P-80X Models
P-400 & P-800 Series
Date: 05 November 2012
User Manual Page 13 of 48 Version v_4.00

2.1.6.- Storing Parameters Command.


IPACK Gateway P-400 and P-800 series will store, in a permanent registers, all the parameters recorded by
AT commands, trough the ATS command.

Table 9. Storing Parameters Command


AT Command Funtion
ATS Causes the permanent store of current
parameters

2.1.7.- Factory configuration


If at any time control of the gateway is lost due to erroneous programming, the AT&F command can be
used in order that the gateway reconfigure itself with the default factory values set out in this manual.
Thus, once this command has been entered, the factory default values, as set out below, are restored in the
configuration parameters of gateway IP address, Gateway, activation of functions.....

Table10. Factory configuration reset command


AT Command Function Response
AT&F Reset configuration parameters to the OK
factory default values

Default parameters in factory configuration:


IP: 192.168.1.60
Subnetwork mask: 255.255.255.0
Gateway: 192.168.1.1
Client TCP Port: 23000
UDP Port: 30502
RS232 Speed: 19200
Flow Control: NO
Echo: NO
Verbose: NO
DHCP: Yes

2.1.8.- Functions for the IP Address Assignation Mode


Table shows the commands associated with IP address assignation consultation and selection functions in
IPACK P-40X and P-80X gateway models

IPACK Gateway Range. Confidential Information


P-400 & P-800 Series Edition AXI-12
IPACK Gateway Range. Ref: P-40X and P-80X Models
P-400 & P-800 Series
Date: 05 November 2012
User Manual Page 14 of 48 Version v_4.00

Table 11. Commands for IP Address Assignation mode


AT Command Function Response
ATMODE? Consult IP address assignation mode DHCP, for FIXED dynamic
assignation, for Manual assignation
ATMODE DHCP Selects dynamic assignation OK

ATMODE FIJA Selects manual assignation OK

ATIP? Asks for currently assigned IP address XXX.XXX.XXX.XXX

ATIP Assigns the address “ XXX.XXX.XXX.XXX”


XXX.XXX.XXX.XXX
Note: Before selecting IP Address dynamic assignation make sure that a DHCP address server exists in the
network to which the IPACK P-40X gateways are connected.
Before manually assigning an IP address to IPACK gateways, consult the network administrator as to
available addresses.

2.1.9.- Programming of remainder of Network Parameters


For complete IP connectivity the gateway has to know other network parameters. The parameters to be
programmed, according to following table, are:
The Gateway’s IP address.
Subnetwork Mask.
Primary DNS Server.
Secondary DNS Server.

Table 12. Network Parameter Commands


AT Command Function Response
ATGW Assigns the Gateway’s IP address xxx.xxx.xxx.xxx OK
XXX.XXX.XXX.XXX Default value: 192.168.1.1

ATMASK Assigns the subnetwork mask value OK


Default value: 255.255.255.0
ATDNS1 Assigns the primary DNS Server’s IP address OK
xxx.xxx.xxx.xxx. Default value:
80.58.61.250
ATDNS2 Assigns the secondary DNS Server’s IP address OK
xxx.xxx.xxx.xxx.
Default value: 80.58.61.254
Note: All these parameters are automatically configured when automatic assignation of the IP address is
configured. You do not need to worry about them when this is the case.
IPACK Gateway Range. Confidential Information
P-400 & P-800 Series Edition AXI-12
IPACK Gateway Range. Ref: P-40X and P-80X Models
P-400 & P-800 Series
Date: 05 November 2012
User Manual Page 15 of 48 Version v_4.00

2.1.10.- Commands that identify Gateways


The identification commands enable us to discover, see table, the manufacturer, the model and the
hardware and software versions that P-40X and P-80X models have.

Table 13. Identification Commands.


AT Command Function Response (Possible Examples)
AT+CGMI Requests the manufacturer IPLOGIKA
AT+CGMR Requests HW and SW version IPLOGIKA HW:v1.0 SW:v2.1
AT+CGMM Requests the model IPACK P-401

2.2.- Web Server Mode Functions.


IPACK P-40X and P-80X gateways are a bridge between the Host systems in which they are embedded or
connected and the IP world (Internet).
The P-400 series gateways’ web server enables us to view the value of up to 29 variables of 14 characters
each. These variables can also contain text.
The P-800 series gateways’ web server enables us to view the value of up to 4 types of variables; each type
admits up to 50 variables.
IPACK P-401 gateways also have pins 1 of J5 and 10 of J6 pre-assigned to variables 41 and 42 respectively,
which enables us to observe the status of these two pins from the web page.
P-400 and P-800 series gateways enable us, from the web page server they incorporate, to control devices
in remote mode, because the value of the variables used can be monitored and even modified (these could,
for example, monitor: temperature, humidity, control ventilator speed, etc…) completely intuitively and
transparently.

There is a template of the application Web page available to users via its distribution channel, in the EV-
P400 evaluation kit’s documentation or from the IPLógica website.
This template is provided to help in the design of a user application web page better adapted to the needs
of the same. The appearance of the web page shown by IPACK P-40X gateways is shown in illustration
number 2.

Two groups of variables are distinguished in this example: Group I and Group 2. We can see the value each
variable has at any given time in red to the right of the variable’s name.
We can also change the value of a variable by entering the new value and clicking on “Update”.
Thus, with group 1 we could monitor the temperature of a series of motors and with group 2 we could
control the refrigeration of these motors.

IPACK Gateway Range. Confidential Information


P-400 & P-800 Series Edition AXI-12
IPACK Gateway Range. Ref: P-40X and P-80X Models
P-400 & P-800 Series
Date: 05 November 2012
User Manual Page 16 of 48 Version v_4.00

Illustration 2. Application Web Page

From the Host system side, what we have is a serial interface, which we will inform of the status of the
system or which will make requests to us inquiring as to the status of a specific parameter.

2.2.1.- AT commands concerning the WEB server in Gateway IPACK P-400 series
These are listed in table.

Table 14. Web Server Commands. IPACK Gateway, P400 series


AT Command Function Response
ATINITVARS Variables initialisation request No response
Gateway to HOST system direction.
ATCHVAR xx yyyy To change value of the xx variable No response
HOST system to gateway direction.
ATPUTVAR xx yyyy To update value of xx variable, shown on web page OK
HOST system to gateway direction.
ATERASE Deletes the content of the flash memory. OK
Flash deletion is an operation that can take up to 80
seconds. Wait for the OK response.

IPACK Gateway Range. Confidential Information


P-400 & P-800 Series Edition AXI-12
IPACK Gateway Range. Ref: P-40X and P-80X Models
P-400 & P-800 Series
Date: 05 November 2012
User Manual Page 17 of 48 Version v_4.00

NOTE:
xx is the variable number that takes values from 0 to 29
yyyy is the value, a string of 14 characters maximum

When we open the web page from a remote computer, the gateway sends an ATINITVARS request via the
serial port toward the Host system.
The HOST system should at this moment update the value shown on the WEB page of all the variables, one
by one, by means of the ATPUTVAR xx yyyy command.
The user of the web page can modify the value of a variable by writing the new value on the page and
pressing the Update key. This key will create an ATCHVAR xx yyyy request via the serial port towards the
HOST system, which once processed should confirm to the Web page user that the new value has been
updated by means of the ATPUTVAR xx yyyy command.

The HOST system can update the status of its variables, at any time, to the P-40X gateways by means of the
ATPUTVAR xx yyy command. The gateway will immediately update the information displayed on the remote
side web page.

IPACK Gateway Range. Confidential Information


P-400 & P-800 Series Edition AXI-12
IPACK Gateway Range. Ref: P-40X and P-80X Models
P-400 & P-800 Series
Date: 05 November 2012
User Manual Page 18 of 48 Version v_4.00

Illustration 3. Data flow


Remote Computer IPACK P-40X gateway

Open Browser
I/F
Serie HOST Machine

1
ATINITVARS

2 ATPUTVAR 1
Updates
Var1 and var2 13000
ATPUTVAR 2
23……..

ATCHVAR 4
3 Var 4 = 2000 and confirms
2000
ATPUTVAR 4 2000 value
4
Updates
Var4
ATPUTVAR 1 12500
5

Updates
Var1

In illustration 3 we see:

1.- When the remote computer opens the browser a variables initiation request is triggered towards the
ATINITVARS Host system.

2.- The Host system responds by initialising all the variables with the ATPUTVAR xx yyyy command so that
they are shown in the browser.

3.- The remote computer user modifies, via web, variable 4 to a value of 2000 from the update box. The
Host system receives this request as an ATCHVAR 4 2000 command and processes this request.

IPACK Gateway Range. Confidential Information


P-400 & P-800 Series Edition AXI-12
IPACK Gateway Range. Ref: P-40X and P-80X Models
P-400 & P-800 Series
Date: 05 November 2012
User Manual Page 19 of 48 Version v_4.00

4.- Once this request has been processed, the Host system, by means of an ATPUTVAR 4 2000 command,
updates the value of variable 4 in the browser’s status box.

5.- At any moment and on its initiative, the Host system updates in the browser the value of any variable;
for example, variable 1.

2.2.2.- AT commands concerning the WEB server in Gateway IPACK P-800 series.
These are listed in following table.

Table 15. Web Server Commands. IPACK Gateways. P800 Series


AT Command Function Response
ATINITVARS Variables initialisation request No
Gateway to HOST system direction. response
ATCHBOOL xx TRUE To change value of the xx variable
ATCHBOOL xx FALSE Gateway to HOST system direction.
ATCHINT xx yyyy To change value of the xx variable
Gateway to HOST system direction.
ATCHLONG xx yyyy To change value of the xx variable
Gateway to HOST system direction.
ATCHSTR xx yyyy To change value of the xx variable
Gateway to HOST system direction.
ATPUTBOOL xx To update value of boolean type xx variable shown on web OK
TRUE;1;ON page
ATPUTBOOL xx HOST system to gateway direction.
FALSE;0;OFF
ATPUTINT xx yyyy To update value of integer type xx variable shown on web page OK
HOST system to gateway direction.
ATPUTLONG xx yyyy To update value of long type xx variable shown on web page OK
HOST system to gateway direction.
ATPUTSTR xx yyyy To update value of string type xx variable shown on web page OK
HOST system to gateway direction.
ATERASE Deletes the content of the flash memory. OK
Flash deletion is an operation that can take up to 80 seconds.
Wait for the OK response.

NOTE:
xx is the variable number that takes values from 0 to 20
yyyy is the value, a string of 14 characters maximum

IPACK Gateway Range. Confidential Information


P-400 & P-800 Series Edition AXI-12
IPACK Gateway Range. Ref: P-40X and P-80X Models
P-400 & P-800 Series
Date: 05 November 2012
User Manual Page 20 of 48 Version v_4.00

2.2.3.-Configuration Web Page


In the User Application page there is a link to the Configuration page, which enables us to program certain
parameters of the IPACK gateways more easily.

Illustration 4. Configuration Web page

Press “Save configuration” to permanently save the parameters modified by means of this Web page. They
will be recovered after every reboot.

2.3.- AT Modem Mode Functions


IPACK P400 and P800 gateway series behave like a Hayes-compatible modem, making all the bothersome
Network protocols invisible to the user. In current systems, modems that use the switched telephone
network can be substituted by IPACK P400 and P800 gateway series using Ethernet connections without
having to make any change in their applications.
The commands received must begin with the AT characters sequence and end with the Carriage Return
character. The gateway will ignore any character or character sequence that does not begin with AT.

IPACK Gateway Range. Confidential Information


P-400 & P-800 Series Edition AXI-12
IPACK Gateway Range. Ref: P-40X and P-80X Models
P-400 & P-800 Series
Date: 05 November 2012
User Manual Page 21 of 48 Version v_4.00

IMPORTANT NOTE:
Characters received via the series port are retransmitted via TCP immediately after receiving a Carriage
Return or after a delay of 10msecs.
Due to the bandwidth the WEB server function consumes, the modem function is incompatible with the WEB
server. The gateway stops serving the WEB page automatically on the initiation of a TCP connection and
returns to serving it on disconnection.

When a connection is terminated or is considered disconnected, IPACK gateways return to command mode
and obey AT commands again, entered via the serial port.

Table 16. AT Modem Commands


AT Command Function
ATD xxx.xxx.xxx.xxx:YYYY Makes a connection attempt on the IP address xxx.xxx.xxx.xxx using
port YYYY.
ATA YYYY The gateway waits for a remote system to make a connection attempt
on port YYYY for 90 seconds.
ATDTR YYYY The gateway waits for a remote system to make a connection attempt
on port YYYY, although it will only accept the connection if the DTR
signal is in position in the serial interface.
+++ Escape sequence. The gateway goes from data mode to command
mode. NOTE: There should be 1 second period after each plus “+” sign
NOTE: yyyy takes values from 0 to 65,535

2.3.1.-Connection modes supported by IPACK gateways

Outbound Mode:
When the gateway makes a connection attempt on a remote system it is the remote system’s responsibility
to accept this connection. If the remote system accepts the connection, the IPACK gateways will indicate
this with the response “CONNECTED” as of which moment all characters received are sent to the remote
system transparently.
To initiate a connection in a remote system we need to know the IP address and a port on which to attempt
the connection and enter the command ATD xxx.xxx.xxx.xxx:YYYY.
Where xxx.xxx.xxx.xxx is the IP address of the system we wish to access and YYYY the port on which we wish
to establish the connection.

Inbound Mode:
We can define how the gateway should react to an inbound connection attempt from a remote system.
If we want the gateway to accept any connection attempt, we enter the command ATAyyyy. This command
puts the gateway to wait for a connection on port YYYY. Any connection attempt will be unconditionally

IPACK Gateway Range. Confidential Information


P-400 & P-800 Series Edition AXI-12
IPACK Gateway Range. Ref: P-40X and P-80X Models
P-400 & P-800 Series
Date: 05 November 2012
User Manual Page 22 of 48 Version v_4.00

accepted by the gateway. And it will be indicated by the serial port with the messages RING and
immediately afterwards CONNECTED. Data transmission will be effective as of this moment.
On the P-401 and P-801 models, we can also decide that the gateway only accepts incoming connections if
the DSR signal (pin 2 of J6) is active. Enter the command ATADTR YYYY (DTR alludes to the signal that
comes from the local Host system).
When a remote system attempts a connection with the gateway on port YYYY, the gateway indicates this
via the serial port with the message RING and waits 100 msecs for the DSR signal to be activated. If the
local host, within these 100 msecs, activates the DSR signal, the connection is accepted, this being
indicated by means of the message CONNECTED, going into data transfer mode.

Ending an established connection:


If we want to terminate the data transmission we enter the escape sequence “+++”.
The gateway will tell the remote terminal that it has terminated the session and will send the message
DISCONNECTED via the serial port.
Indicating in this way that it has gone into command mode and will obey new AT commands entered.
In the P-401 and P-801 models, if the connection was established with the command ATADTR, we can end
it by deactivating the DSR signal, in which case the gateway will immediately go into command mode
without sending any message via the serial port.
Ending the connection can also be an initiative of the remote system. If a disconnection request is received
by the gateway, the latter will automatically accept the disconnection and will indicate this with the
message DISCONNECTED, going immediately into command mode.

2.4.- Functions for sending of email


It is sometimes necessary to signal the occurrence of events without having to be connected to any system
or depend on the Web page.
In such cases, the best thing is to send an electronic mail. Even in routine cases such as sending the day’s
maximum and minimum temperatures, etc.

With the gateway it is possible to send electronic mail with no length limitations. You can also attach TEXT
FILES to your messages, without size limitations. Sending non-text attached files is not permitted. The smtp
protocol requires data to be encoded. If data is sent unencoded it will be rejected by the server. And the
email will not be delivered.
The way to do it is as follows: enter the data with the ATMAIL command, then enter the subject with the
ATSUBJECT command. The ATATTACH command enables us to enter the name of the file to attach. These
fields must be completed before sending each mail. Lastly, use the ATSEND command to send the
electronic mail.
If we don’t want to send an attached file, we send as parameter, to the ATATTACH command, the string
“no”.
Once the ATSEND command is sent, the gateway will acknowledge it and return OK, a few moments later.
Once the negotiation with the mail server is complete, it will request that the message body be entered
with the string BODY? in plain text format, with ASCI characters. Once completed, send the escape
sequence “+++”. At this moment, if we programmed a file name as attachment, the gateway will request
IPACK Gateway Range. Confidential Information
P-400 & P-800 Series Edition AXI-12
IPACK Gateway Range. Ref: P-40X and P-80X Models
P-400 & P-800 Series
Date: 05 November 2012
User Manual Page 23 of 48 Version v_4.00

sending of the file with the string ATTACH?, proceed in the same way as when the message body was sent,
The file will be finished with the escape sequence “+++”. The gateway will communicate the success of the
sending with the string SENT; or, will communicate that an error has occurred and the message has not
been delivered, with the string “Error on sending”.
The gateway keeps all the data, so that to send an electronic mail exactly the same as the one before, we
only have to repeat the ATSEND command and execute all the subsequent steps.
If the mail smtp server used does not require authentication, enter as user and as password the characters
chain “no”; this way, the gateway will not attempt the authentication with the server.

The default port for sending emails is 25. However, in some cases, and particularly when SSL sockets are
used, this port number should be modified; for this purpose, use ATMPORT and ATSSLMPORT commands.

Table 17. Commands concerning the sending of electronic emails


AT Command Function
ATMAIL Configures the basic parameters of an email: Destination address and
sender account data
ATSUBJECT Enters the message subject. Maximum 35 characters
ATATTACH Enters the file name to be sent attached to the email
If we do not want to send any attached file we enter the character chain
“no”.
ATMPORT Enters the port number over which the email will be sent when not using
SSL (Secure Socket Layer)

ATSSLMPORT Enters the port number over which the email will be sent when using SSL
(Secure Socket Layer).
ONLY for IPACK P800 serie.
ATSEND Starts sending the message. We must previously have completed, with
the above commands, all the fields of the email we want to send

ATSSLSEND Starts sending the message using SSL. As in the previous case, it requires
all email fields to be filled with the previous commands.
ONLY for IPACK P800 serie.

Syntax of AT commands
ATMAIL server user pass from to
All fields are separated with a blank space. Below we describe their characters.
 Server:

IPACK Gateway Range. Confidential Information


P-400 & P-800 Series Edition AXI-12
IPACK Gateway Range. Ref: P-40X and P-80X Models
P-400 & P-800 Series
Date: 05 November 2012
User Manual Page 24 of 48 Version v_4.00

Outbound mail server of the origin mail account. Will be of the smtp.xxxxxxxx.yyy type.
Maximum 35 characters.
 User:

User of the outbound mail account. Maximum 35 characters

 Pass:

Password, maximum 20 characters.


 From:

Mail account from which the mail is sent. Maximum 30 characters


 To:

Destination mail account of the message, maximum 30 characters

ATSUBJECT message subject. Maximum 30 characters, for the message subject


ATATTACH name of the file to be attached, for example “test.txt” if we do not want to send any attached
file we enter the character chain “no”.
ATMPORT port number for sending emails when not using SSL.
ATSSLMPORT port number for sending emails when using SSL. Only for IPACK P800 serie.
ATSEND starts sending the email, alerts when the message body must be sent and subsequently the file to
attach if this was programmed.
ATSSLSEND starts sending the email, alerts when the message body must be sent and then the file to be
attached if so programmed. To be used only if the smtp server uses SSL. Only for IPACK P800 serie.

IPACK Gateway Range. Confidential Information


P-400 & P-800 Series Edition AXI-12
IPACK Gateway Range. Ref: P-40X and P-80X Models
P-400 & P-800 Series
Date: 05 November 2012
User Manual Page 25 of 48 Version v_4.00

3.- Sending of UDP Datagrams


Sending UDP datagrams is an easy way to communicate different remote systems. To send data via the
UDP protocol all we need is the IP address of the remote system and a port to address. We don’t need to
establish any type of prior connection; we simply create the data packet to be sent and send it.

With IPACK P400 and P800 gateways we can send UDP datagrams to any IP address, to the port the
gateway has programmed.
The maximum length of these datagrams is 150 characters.

The IPACK gateways receive UDP datagrams on the port programmed and sends the datagrams it transmits
to the same port.

If we wish to establish a communication between several gateways, we program the same UDP port in all
the gateways and address each one according to their IP address.

The gateway has default programmed port 30502. To change it we use the command ATUDPPORT. We
advise using a port outside the so-called “Well Know” range. This range covers 0 to 1023.

Sending data with the command ATUDP.


ATUDP xxx.xxx.xxx.xxx data packets to send.
The data must not exceed 150 characters.
The command ends with the sending of a Carriage Return.

In this example we will send the characters chain “data packets to send” to the IP address xxx.xxx.xxx.xxx
the destination port being that programmed by ATUDPPORT.

If the gateway receives a UDP packet destined to its IP address and addressed to the port programmed with
ATUDPORT, it will send the data received by the serial port preceded by the IP address that sends it.

xxx.xxx.xxx.xxx: data packet to send.

This is what is transmitted via the serial port when a UDP packet is received.
xxx.xxx.xxx.xxx is the IP address of the person sending the packet.
Use the separator “: ” to distinguish where the IP address ends and the data starts.

IPACK Gateway Range. Confidential Information


P-400 & P-800 Series Edition AXI-12
IPACK Gateway Range. Ref: P-40X and P-80X Models
P-400 & P-800 Series
Date: 05 November 2012
User Manual Page 26 of 48 Version v_4.00

Table 18. Commands concerning the sending of UDP datagrams


AT Command Function
ATUDP Sends the data received via the serial port, up to the first carriage
xxx.xxx.xxx.xxx return, to IP address xxx.xxx.xxx.xxx and the destination port
programmed in ATUDPPORT
ATUDPPORT Configures the port the gateway will use as destination port and
remote port
ATUDPPORT? Asks what UDP port is programmed at that moment on the gateway.

xxx.xxx.xxx.xxx: A UDP packet has been received. The data comes after the colon and
after a blank space.

IPACK Gateway Range. Confidential Information


P-400 & P-800 Series Edition AXI-12
IPACK Gateway Range. Ref: P-40X and P-80X Models
P-400 & P-800 Series
Date: 05 November 2012
User Manual Page 27 of 48 Version v_4.00

4.- Dedicated Port Mode


Sometimes we will want the gateway to be able to automatically initiate and manage communications, so
that for the host system in which it is housed it behaves just like an RS232 cable.

In these cases, we use the IPACK P400 and P800 gateway series in Dedicated Port mode.
In this mode the gateway will remain permanently listening for any connection attempt by a TCP client on
the port programmed. In this case it will immediately accept the connection and will permit data flow
between gateway and remote system in a transparent manner.
Both the TCP client and the host system can terminate the connection at any time by means of the
traditional method, i.e. by the client closing the TCP connection or by the host system sending the escape
sequence via the serial port.
Immediately after the connection is closed, the gateway goes back on listen, making another connection
possible, either with the same TCP client or with any other system.
Configure dedicated port mode in the gateway and record this configuration in the flash with the command
ATS, so that even after a reboot, the gateway goes back to this mode.

Procedure for configuring dedicated port mode.


Use the command ATREALPORT to indicate the port on which the IPACK gateways will await the TCP
connection. By default the gateway uses port 23000. We advise, just as with UDP datagrams, avoiding the
so-called “Well Know” range; this range goes from 0 up to 1023.

It is possible to save this port number in the gateway’s flash so that it is used as port for establishing
dedicated port TCP connections.

Once a TCP port has been selected, activate the dedicated port by means of the command ATAUTOPORT
ATAUTOPORT START

Save in flash if necessary. As of this moment the gateway accepts TCP connections on the selected port.
This mode can be stopped by sending the command ATAUTOPORT with the parameter STOP.
ATAUTOPORT STOP

IPACK Gateway Range. Confidential Information


P-400 & P-800 Series Edition AXI-12
IPACK Gateway Range. Ref: P-40X and P-80X Models
P-400 & P-800 Series
Date: 05 November 2012
User Manual Page 28 of 48 Version v_4.00

Table 19. Commands concerning dedicated port mode


AT Command Function
ATAUTOPORT START Activates dedicated port mode
ATAUTOPORT STOP Deactivates dedicated port mode
ATAUTOPORT? Asks the gateway if dedicated port mode is activated
AUTOSI indicates that dedicated port mode is activated
AUTONO indicates that it is deactivated
ATREALPORT Configures the TCP port on which the gateway awaits the connection
ATREALPORT? Asks on which programmed TCP port the gateway awaits the TCP connection.

4.1.- Client Mode


Gateways can be programmed as TCP client. Simply program the TCP server’s IP address and the connection
port once client mode has been activated. The gateway will attempt to connect to the server indefinitely
until it succeeds.
Once the connection has been established, the gateway will be transparent to the data flow between the
server and the serial port. Deactivate Verbose mode if the application is held up by unrequested messages
indicating the status of the connection.
The TCP connection can be cancelled at any moment by introducing the escape sequence “+++”, but take
into account that the gateway will almost immediately attempt the connection with the server again.
If, while attempting a connection, the gateway cannot locate the server, the gateway will return the
message “Network Error” if it locates the server but the latter does not accept the TCP connection. The
message returned will be “NOT ANSWERING”

Configure dedicated port mode in the gateway and record this configuration in the flash with the command
ATS, so that even after a reboot, the gateway goes back to this mode.

Procedure for configuring client mode.


Use the command ATPORTCLIENT to indicate the port on which the IPACK P40o and P800 gateways will
await the TCP connection. By default the gateway uses port 25000. We advise, just as with UDP datagrams,
avoiding the so-called “Well Know” range; this range goes from 0 up to 1023.

It is possible to save this port number in the gateway’s flash so that it is used as port for establishing
dedicated port TCP connections.

Once a TCP port has been selected, tell the IPACK gateways on which IP address the TCP connection must
be attempted by means of the command ATIPCLIENT. Finally, activate client mode by means of the
command ATCLIENT
ATCLIENT START

Save in flash if necessary. As of this moment the gateway accepts TCP connections on the selected port.
IPACK Gateway Range. Confidential Information
P-400 & P-800 Series Edition AXI-12
IPACK Gateway Range. Ref: P-40X and P-80X Models
P-400 & P-800 Series
Date: 05 November 2012
User Manual Page 29 of 48 Version v_4.00

This mode can be stopped by sending the command ATCLIENT with the parameter STOP.

Table 20. Commands concerning Client mode


AT Command Function
ATCLIENT START Activates TCP client mode
ATCLIENT STOP Deactivates TCP client mode
ATCLIENT? Asks the gateway if client mode is activated
AUTOSI indicates that client mode is activated
AUTONO indicates that it is deactivated
ATPORTCLIENT Configures the TCP port on which the TCP connection will be attempted.
ATPORTCLIENT? Asks on which programmed TCP port the gateway attempts the TCP
connection.
ATIPCLIENT Configures the destination IP address of the TCP connection
ATIPCLIENT? Asks what IP address is programmed as TCP server

IPACK Gateway Range. Confidential Information


P-400 & P-800 Series Edition AXI-12
IPACK Gateway Range. Ref: P-40X and P-80X Models
P-400 & P-800 Series
Date: 05 November 2012
User Manual Page 30 of 48 Version v_4.00

5.- Creating and Updating the Application Web Page,


in P400 gateway series.
The http server implemented in IPACK P-40X gateways uses the CGI interface (Common Gateway Interface,
CGI). This is a generic protocol that enables us to extend http capacities.
Following this interface, the “HTTP client”, generally a browser, can call functions inside the HTTP server
and receive the result in WEB page form.
The Web Browser must implement a GET method, using as parameter any of the variables the gateway puts
at its disposal.
It is recommended that the web page, provided as an example to understand how this interface works and
to get the most out of the WEB server, be studied and modified for your own use.

Once we have a satisfactory WEB page design (a large part of the time used in designing a WEB page is
spent on the aesthetic appearance), we have to convert it to a format that is understandable to the
Gateway. This format is BIN (binary).
To do this, we will use the MPFS application, which converts pages in HTML format into BIN format
The syntax is as follows
MPFS < web page directory> mipagina.bin

Where:
We page directory: Is the directory where all files that make up this WEB page are to be found.
Mipagina: Is the name we want to give to the file generated by MPFS.

We have to take care that the output directory in which “mipagina.bin” is generated is not the same as the
origin directory “web page directory”, given that this means that an interminable loop is created where the
output forms part of the input ad infinitum.
The output given by the MPFS program is shown in illustration 5, in which we can see that it has processed
all the CGI files and the total size of the BIN file generated, in this case 19,208 bytes.

NOTE on the MPFS program.


MPFS is a program owned by the silicon manufacturer Microchip. It can normally be found on the website of
this manufacturer, who is offering it to developers of systems based on its microprocessors, as is the case of
the IPLógiKa’s IPACK P-400 Series gateways.

IPACK Gateway Range. Confidential Information


P-400 & P-800 Series Edition AXI-12
IPACK Gateway Range. Ref: P-40X and P-80X Models
P-400 & P-800 Series
Date: 05 November 2012
User Manual Page 31 of 48 Version v_4.00

Illustration 5. Image of MPFS program process

Inside the directory in which the web page is located the root file must be named “index.htm” and there
must be a “cgi” type file for each variable we use.
An example of this is provided in illustration 6, where we can see a folder with the “index.htm” file and the
10 “.cgi” files that accompany it.
Note that each “.cgi” file links the file name with the name we have to handle in the web page’s code. This
name can be chosen by the web page developer. Now, the content of the “.cgi” makes reference to a
certain variable that will be handled by the gateway’s firmware; i.e., for P-400 series gateways variable
number 1 is referenced with the hexadecimal code “31”; variable 2, with the hexadecimal code “32”, and so
on, up to variable 29, to which the hexadecimal “5b” corresponds.

These codes CANNOT BE CHANGED, or the Gateway will be unable to interpret the commands
sent to it by the web page

IPACK Gateway Range. Confidential Information


P-400 & P-800 Series Edition AXI-12
IPACK Gateway Range. Ref: P-40X and P-80X Models
P-400 & P-800 Series
Date: 05 November 2012
User Manual Page 32 of 48 Version v_4.00

Illustration 6. CGI files screen

List of codes permitted for “.cgi” file content


#define VAR1 (0x31) #define VAR17 (0x48)
#define VAR2 (0x32) #define VAR18 (0x49)
#define VAR3 (0x33) #define VAR19 (0x4a)
#define VAR4 (0x34) #define VAR20 (0x4b)
#define VAR5 (0x35) #define VAR21 (0x4c)
#define VAR6 (0x36) #define VAR22 (0x4d)
#define VAR7 (0x37) #define VAR23 (0x4f)
#define VAR8 (0x38) #define VAR24 (0x50)
#define VAR9 (0x39) #define VAR25 (0x51)
#define VAR10 (0x3a) #define VAR26 (0x52)
#define VAR11 (0x3b) #define VAR27 (0x53)
#define VAR12 (0x3c) #define VAR28 (0x54)
#define VAR13 (0x3d) #define VAR29 (0x55)
#define VAR14 (0x3e)
#define VAR15 (0x3F) #define VAR41 (0x5a) pre-assigned pin 1 J5 (applicable to gateway P-401)

IPACK Gateway Range. Confidential Information


P-400 & P-800 Series Edition AXI-12
IPACK Gateway Range. Ref: P-40X and P-80X Models
P-400 & P-800 Series
Date: 05 November 2012
User Manual Page 33 of 48 Version v_4.00

#define VAR16 (0x40) #define VAR42 (0x5b) pre-assigned pin 10 J6 (applicable to gateway P-401)

Once the binary file has been generated with the WEB page, the final step is to load it in the Gateway. To do
this, we will use the FTP server that incorporates the IPACK P-40X gateways. As FTP client we can use a
commands window in Windows. For example,

IMPORTANT Before sending a new WEB page we have to erase the content of the flash. To do this we use
the command ATERASE and wait for the gateway to confirm the erasure of the flash with an “OK”.

We must initiate the connection by means of ftp on the IPACK P-40X gateway’s IP address. Next, the latter
will request the user. For this application, “iplogika” will be used. Afterwards it will request the password.
The same one will be used as for the user, “iplogika”. If everything has gone right, communication will have
been established and we will be authorised to transfer the “.bin” file. Do put <file name> and the transfer
will begin. When it ends successfully, type in “bye” to end the ftp connection, as shown in illustration 7.

Illustration 7. End of transfer of the BIN file

IPACK Gateway Range. Confidential Information


P-400 & P-800 Series Edition AXI-12
IPACK Gateway Range. Ref: P-40X and P-80X Models
P-400 & P-800 Series
Date: 05 November 2012
User Manual Page 34 of 48 Version v_4.00

6.- Creating and Updating the Application Web Page,


in P800 gateway series
The P-801 gateway includes an embedded web page server that enables the interaction between the user
and the gateway by interchanging the values of the variables.
With the Web page the fan speed can be changed or the room temperature can be known from any remote
point or even by internet.
Use the template on our web page www.iplogika.es and download it to a folder on your computer. That
folder should contain exclusively files related to the web page; any other file within this folder may cause
errors or increase considerably the size of the final file.
The P-801 gateway web page enables these variable types to be controlled:
Integer Long
String Boolean

There are 20 variables available for each type.


Any of these variables can be managed dynamically.

6.1. Structure of the web page


Or a better understanding of the HTTP server it is recommended to be familiar with the Microchip TCP/IP
stack.
The website must be made of an Index.htm and a maximum of 8 pages named iplpagex.htm where x is a
number between 1 and 9.
When an iplpagex.htm type file uses any variable type among those specified an empty file must be
included in the folder with the following notation:

Variable type_forwarded page.htm

Valid examples:
Long_iplpage1.htm
Int_iplpage1.htm
Bol_iplpage1.htm
Str_iplpage1.htm

In case we want to show the value of a particular variable, just put its name between two special symbols as
in the example
~long (3) ~

For managing and handling variables the get method is used.


Example:
With a long type variable 3 the get method is used within a form.

IPACK Gateway Range. Confidential Information


P-400 & P-800 Series Edition AXI-12
IPACK Gateway Range. Ref: P-40X and P-80X Models
P-400 & P-800 Series
Date: 05 November 2012
User Manual Page 35 of 48 Version v_4.00

The variable type to be displayed on the browser is shown on the “action” field, followed by the page
to which the browser will be forwarded automatically when finishing the variab le update.

<form method="get" action="long_iplpage1.htm">


<td widht"90"><input type="text" name="long3" id="1" size="15" value=~long(3)~ /></td>
<td width="75"><input type="submit" value="Save" style="margin-top:5px;"></td>
</form>

Important notes:
Variables must not be mixed within the same form; the “action” field on the form denotes the variable type
to be updated. The “long_iplpage1.htm” file must exist on the project folder; its content is not relevant. It
can include all forms necessary within the same page or file.

6.2.- Generating .bin Files and uploading the page to the Gateway P-800

A previous step before loading the new Web page on the gateway is deleting the old one. The flash
containing the WEB page must be deleted with the ATERASE command.
Write the command and wait to the gateway to answer OK through the serial port.
Once developed the Web page a .bin file must be generated and then uploaded to the gateway, so it can be
available to any browser connected to the gateway.

For this purpose we will us the “Microchip MPFS Generator” Microchip tool.

IPACK Gateway Range. Confidential Information


P-400 & P-800 Series Edition AXI-12
IPACK Gateway Range. Ref: P-40X and P-80X Models
P-400 & P-800 Series
Date: 05 November 2012
User Manual Page 36 of 48 Version v_4.00

Illustration 8. Microchip MPFS Generator Screen

After opening the program.


Select “Webpage Directory”.
This option indicated to the program that the whole web page is included in the source directory.
Select the source directory; point 1 on the program.
Select a .bin type image to be generated; point 2 on the program.
Select the directory where the .bin image is going to be created and its name; point 3 on the program.
Check “Upload Image To”; point 4 on the program.
This option indicates the program to generate the image and upload it directly to th e gateway.
Important note: the default parameter must be modified so the program can locate the P -801
gateway. It should say:
http//admin@IPLOGIKA_P-801/ as shown on the example.
Click on “Generate and Upload”. The program will generate the .bim image and will upload it to the
gateway.

IPACK Gateway Range. Confidential Information


P-400 & P-800 Series Edition AXI-12
IPACK Gateway Range. Ref: P-40X and P-80X Models
P-400 & P-800 Series
Date: 05 November 2012
User Manual Page 37 of 48 Version v_4.00

7.- Time functions


The NTP protocol (Network Time Protocol) is a network protocol that enables us to obtain the time in Epoch
format.
Epoch time is the current time measured in number of seconds since January 1 1970 00:00:00 GMT (ISO
8601: 1970-01-01T00:00:00Z).

On the Web there are a host of links with software open to handle this type of time format.
UTC is the time system used by many Internet standards and the World Wide Web. In particular, Network
Time Protocol was designed as a way to distribute UTC time on the Internet.

The IPACK gateways incorporate an NTP client that enables us to know the exact time at any moment.
We can decide whether the gateway searches for an external time server on the world wide web or
searches for it in an IP address which has to be previously configured.
If your intranet has an NTP server, configure in the gateway the IP address at which this server should be
sought. Otherwise, provided you have an Internet connection, let the gateway search for the most suitable
time server. The gateway has a dozen URLs of standard NTP servers to obtain the time.

Table 21. Time Function Commands


AT Command Function Response
NTPMODE? Asks for the current search DNS; where searching by DNS
mode of the NTP server FIXED; for manual assignation
NTMODE DNS Selects DNS search OK
for external NTP servers
NTMODE FIJA Selects IP address assignation in manual OK
mode for NTP server
NTPIP? Asks for the assigned IP address
XXX.XXX.XXX.XXX
at which the NTP server is located
NTPIP Assigns the address “ XXX.XXX.XXX.XXX”
XXX.XXX.XXX.XXX as IP at which to locate the NTP server
ATTIME? Request the time in Epoch format Seconds since 1 January 1970 in hexadecimal
in 8 bytes. Example:45FG12AC

DNS is the default parameter of command NTPMODE?

NOTE: The Time Function requires NTP port (port 123) to be useful; if it is not the case the network
administrator should be advise to open it, if not, the Time Function will not run

IPACK Gateway Range. Confidential Information


P-400 & P-800 Series Edition AXI-12
IPACK Gateway Range. Ref: P-40X and P-80X Models
P-400 & P-800 Series
Date: 05 November 2012
User Manual Page 38 of 48 Version v_4.00

8.- Electrical characteristics of P-401


8.1.- Pin Assignation
The IPACK P-401 gateway has two J5 and J6 connectors, male pin posts of pitch 2.54”, 1 X 10; in total 20
pins.

8.2.- J5 Connector
J5 is basically dedicated to the communications via serial port function, with the pin assignation set out in
table.

Table 22.Pin assignation in P-401´s J5 connector


PIN J5 I/O Function
1 INT_I I Pin general purpose Input/Output
2 INT_O O Pin general purpose Input/Output
3 DSR I Data set Ready
4 DTR_O O Data Terminal Ready
5 CTS I Clear to Send
6 RTS_O O Request to Send
7 DCD O Data carrier Detect
8 RI O Ring indicator
9 TX_MOD I/O IPACK transmission
10 RX_MOD I/O IPACK reception

8.3.- J6 Connector
J6 is destined to power supply and input output ports, with pin assignation as shown in following table. It
can be supplied either at 5V or at 3.3V with the following restrictions:
If the gateway is powered at 5V, pins 1 and 2 can be used as 3.3V output to supply low-consumption
peripherals, 50 mA maximum. If the gateway is supplied at 3.3V, keep pins 3 and 4 unconnected.

Table 23. Pin assignation in P-401's J6 connector


PIN J6 I/O Function
1 Doesn’t Connect
2 3.3V I/O Input provided pins 3 and 4 are not used
3 5V I Power input
4 5V I Power input
5 GND I Earth
6 GND I Earth
7 GPIO1 I/O General purpose input / output pins
8 GPIO2 I/O General purpose input / output pins
9 GPIO3 I/O General purpose input / output pins
10 GPIO4 I/O General purpose input / output pins

IPACK Gateway Range. Confidential Information


P-400 & P-800 Series Edition AXI-12
IPACK Gateway Range. Ref: P-40X and P-80X Models
P-400 & P-800 Series
Date: 05 November 2012
User Manual Page 39 of 48 Version v_4.00

8.4.-Dimensions
The IPACK P-401 gateway measures approx. 38x39 mm. We attach illustration 8 with dimensions plan, seen
from above.

Illustration 9. P-401 viewed from above

8.5.- Electrical consumptions


IPACK P-401 gateways have the following consumptions:
Typical consumption ON without Ethernet traffic: 145mA
Typical consumption ON with Ethernet traffic: 155mA

IPACK Gateway Range. Confidential Information


P-400 & P-800 Series Edition AXI-12
IPACK Gateway Range. Ref: P-40X and P-80X Models
P-400 & P-800 Series
Date: 05 November 2012
User Manual Page 40 of 48 Version v_4.00

9.- Electrical characteristics of the P-402


9.1.- Pin Assignation
The IPACK P-402 gateway has an Ethernet connecter for input from the network and a DB9 connector for
connection to a DCE system.

It’s supply is 5 VDC.

9.2.- Serial Connector


The DB9 connector is a standard RS232 serial connection, whose pin assignment is shown in table

Table 24. Pin assignation in P-402’s DB9 connector


PIN DB9 I/O Function
1 No Connect
2 RXD I Data Receiving
3 TXD O Data Transmitting
4 No Connect
5 GROUND GND
6 No Connect
7 RTS O Request to Send
8 CTS I Clear to Send
9 No Connect

9.3.-Dimensions
The IPACK P-402 measures approx. 50x45 mm
We attach illustration 9 with dimensions plan, seen from above.

9.4.- Electrical consumptions


IPACK P-402 gateways have the following consumptions:
Typical consumption ON without Ethernet traffic: 145mA
Typical consumption ON with Ethernet traffic: 155mA

IPACK Gateway Range. Confidential Information


P-400 & P-800 Series Edition AXI-12
IPACK Gateway Range. Ref: P-40X and P-80X Models
P-400 & P-800 Series
Date: 05 November 2012
User Manual Page 41 of 48 Version v_4.00

Illustration 10. P-402 viewed from above

IPACK Gateway Range. Confidential Information


P-400 & P-800 Series Edition AXI-12
IPACK Gateway Range. Ref: P-40X and P-80X Models
P-400 & P-800 Series
Date: 05 November 2012
User Manual Page 42 of 48 Version v_4.00

10.- Electrical characteristics of P-801


10.1.- Pin Assignation
The IPACK P-801 gateway has two J5 and J6 connectors, male pin posts of pitch 2.54”, 1 X 10; in total 20
pins.

10.2.- J5 Connector
J5 is basically dedicated to the communications via serial port function, with the pin assignation set out in
table.

Table 25. Pin assignation in P-801´s J5 connector


PIN J5 I/O Function
1 INT_I I Pin general purpose Input/Output
2 INT_O O Pin general purpose Input/Output
3 DSR I Data set Ready
4 DTR_O O Data Terminal Ready
5 CTS I Clear to Send
6 RTS_O O Request to Send
7 DCD O Data carrier Detect
8 RI O Ring indicator
9 TX_MOD I/O IPACK transmission
10 RX_MOD I/O IPACK reception

10.3.- J6 Connector
J6 is destined to power supply and input output ports, with pin assignation as shown in table. It can be
supplied either at 5V or at 3.3V with the following restrictions:
If the gateway is powered at 5V, pins 1 and 2 can be used as 3.3V output to supply low-consumption
peripherals, 50 mA maximum. If the gateway is supplied at 3.3V, keep pins 3 and 4 unconnected.

Table 26. Pin assignation in P-801's J6 connector


PIN J6 I/O Function
1 Doesn’t Connect
2 3.3V I/O Input provided pins 3 and 4 are not used
3 5V I Power input
4 5V I Power input
5 GND I Earth
6 GND I Earth
7 GPIO1 I/O General purpose input / output pins
8 GPIO2 I/O General purpose input / output pins
9 GPIO3 I/O General purpose input / output pins
10 GPIO4 I/O General purpose input / output pins
IPACK Gateway Range. Confidential Information
P-400 & P-800 Series Edition AXI-12
IPACK Gateway Range. Ref: P-40X and P-80X Models
P-400 & P-800 Series
Date: 05 November 2012
User Manual Page 43 of 48 Version v_4.00

10.4.-Dimensions
The IPACK P-801 gateway measures approx. 38x50,65 mm. We attach illustration with dimensions plan,
seen from above.

Illustration 11. P-801 viewed from above

10.5.- Electrical consumptions


IPACK P-801 gateways have the following consumptions:
Typical consumption ON without Ethernet traffic: TBD
Typical consumption ON with Ethernet traffic: TBD

IPACK Gateway Range. Confidential Information


P-400 & P-800 Series Edition AXI-12
IPACK Gateway Range. Ref: P-40X and P-80X Models
P-400 & P-800 Series
Date: 05 November 2012
User Manual Page 44 of 48 Version v_4.00

11.- Updating the firmware


The firmware of IPACK gateways, series P400 and P800, can be updated using a TFTP server

Follow this procedure:

 Put the gateway in Boot mode. There are two ways to do this:

1.- Execute a Hardware reset (disconnect the gateway and then reconnect it). When you turn it on, it
will stay in Boot mode for 3 secs, waiting for an update file to be transferred.

2.- Enter the command ATBOOT via the serial port. The gateway will wait 15 secs for the update file.
If at the end of this time the update file has not been sent, the IPACK gateways will start up normally
without suffering any damage whatsoever

 Use the TFTP server’s put command to send the update/change file.
The syntax is as follows:
TFTP 192.168.1.60 put <file name.ipl>
In boot mode the gateway takes the fixed IP address 192.168.1.60 as default.

Once the firmware has been updated, which takes approximately 9 secs, the gateways execute a Hardware
reset.

The Bootloader cannot be damaged. If for some reason the firmware is damaged on updating, we can even
attempt the update again starting from reset for the first 3 seconds.

IPACK Gateway Range. Confidential Information


P-400 & P-800 Series Edition AXI-12
IPACK Gateway Range. Ref: P-40X and P-80X Models
P-400 & P-800 Series
Date: 05 November 2012
User Manual Page 45 of 48 Version v_4.00

12.- EV-P400 Evaluation Kit


This section provides all the information required to be used in the development phase of the IPACK P400
and P800 Series with EV-P400, Evaluation Kit.

The EV-P400 kit enables the connection between a PC via the RS232 serial port and the same PC via the
Ethernet port, which simulate the 2 sides of the communication established by IPACK gateways.
It is highly recommend to use a program as terminal simulator such as Hyperterminal included in the most
extended operative systems.

The evaluation kit includes a Quick Star Guide on how to proceed for the first usage.

12.1.- KIT Content

The EV-P400 Evaluation Kit for IPACK P400 and P800 series contains the following elements. Check that you
have received the complete KIT.

Evaluation Board EVALBOARD_IPACK V0.0


Test Gateway IPACK P-401
Power cable 230V-AC 50Hz 9VDC 500 mA
RS232 cable Terminated on DB9 connectors

The EV-P400 Evaluation kit has been designed so that the client can run and check the performances of the
IPACK P-400 gateway series’ P-40X and P-80X modules conveniently and easily, since it contains everything
required for its start-up.

External appearance:
It is a printed circuit board with a base, which the IPACK gateway is inserted into, via which the
communication pins are accessed and the power is supplied, as shown in illustration 10.
The evaluation board has an RS232-type interface towards the PC side into which a computer with any
standard data sending utility can be connected.

It also has a great number of leds that indicate the status of the P-401 gateway’s pins, with which we can
easily visually check its evolution: activity in TXD or RXD communication pins, status of CD, RING etc.

IPACK Gateway Range. Confidential Information


P-400 & P-800 Series Edition AXI-12
IPACK Gateway Range. Ref: P-40X and P-80X Models
P-400 & P-800 Series
Date: 05 November 2012
User Manual Page 46 of 48 Version v_4.00

Illustration 12. EV-400 Kit Evaluation Board

12.2.- Serial Interface


The RS232 serial converter is implemented with an RS232 driver, which converts the 3.3 V levels the P-401
gateway provides at typical RS232 levels. You require only a DB9 cable to connect the evaluation board to a
DTE system such as a PC.

12.3.- Power supply


The evaluation board comes with a power cable that connects to the 9V DC supply network, with capacity
to power the IPACK P-401 gateway and the evaluation board itself.
The evaluation board contains a serial regulator which delivers 5 regulated Vdc to the IPACK P-401 gateway.

12.4.- Description of the leds

Power indicator Leds:


D3: Marked “Power 9V”, it indicates the power input. If it stays off this is a symptom that something is
wrong in the power supply stage.
D6: Marked “Power 3.3V” it indicates that the IPACK gateway is powered and monitors the 3.3 V output it
delivers.
GPIO status indicator Leds:

IPACK Gateway Range. Confidential Information


P-400 & P-800 Series Edition AXI-12
IPACK Gateway Range. Ref: P-40X and P-80X Models
P-400 & P-800 Series
Date: 05 November 2012
User Manual Page 47 of 48 Version v_4.00

D7... D10: These leds show the activity of the IPACK P-401 Gateway’s microprocessor on communicating
with the eeprom when acting as web server.

Communication pin status indicator Leds:


D11...D19: leds that indicate the status of the pins both on the output and input of the RS232 data
interface.
Since they come on when the signals are at a high TTL level, remember that on the RS232 interface the
signal will be inverted (by approx. –12v)

RS232 interface indicator led connected:


D20: Marked “RS232” indicates that an RS232 serial interface with correct levels has been detected.

12.5.- Keypad description


It is possible to view the statuses of pins 1 of J5 and 10 of J6 from the website that serves the P-401
gateway.
By default, these pins are at high level, logical status “1”. The status of these pins can be changed by
pressing the associated key and checking its evolution via the website. See table.

Table 27. Test Pins in J5 and J6 connectors

PIN Connector KEY


1 J5 SW5
10 J6 SW4

12.6.- Expansion connectors


The evaluation board has 2 expansion connectors J2 and J3 where you can extract the signals that leave or
enter the gateway and view them on an oscilloscope or connect them to another system’s interface. The
pin assignation is as follows. See table.

Table 28. J2 and J3 expansion connectors


Pin J2 J3
1-2 INT_I 3.3V
3-4 INT_O 3.3V
5-6 DSR 5V
7-8 DTR 5V
9-10 CTS GND
11-12 RTS GND

IPACK Gateway Range. Confidential Information


P-400 & P-800 Series Edition AXI-12
IPACK Gateway Range. Ref: P-40X and P-80X Models
P-400 & P-800 Series
Date: 05 November 2012
User Manual Page 48 of 48 Version v_4.00

13-14 DCD GP I01


15-16 RI GP I02
17-18 TX GP I03
19-20 RX GP I04

12.7.- RS232 serial port connector


Connect the cable that comes with the Evaluation Kit to the DB9-type serial port connector and at the other
end to the PC. Simply open an application that emulates a VT100-type terminal and you can communicate
with the P-401 gateway.

Configure the terminal at 19200 baud 8 data bits, NO parity and one stop bit.
Type AT and the gateway will respond with OK.

IPACK Gateway Range. Confidential Information


P-400 & P-800 Series Edition AXI-12

You might also like