IPACK Gateway Range User Manual. P-400 & P800 Series: Internet Protocolo Lógica SL
IPACK Gateway Range User Manual. P-400 & P800 Series: Internet Protocolo Lógica SL
IPACK Gateway Range User Manual. P-400 & P800 Series: Internet Protocolo Lógica SL
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.
User Manual
Content Date Published Annotation
VERSION
Edition AVI-10.
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
©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.
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.
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
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
6.2.- Generating .bin Files and uploading the page to the Gateway P-800 ....................................................... 35
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
INDEX of ILLUSTRATIONS
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.
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
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.
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).
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.
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.
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.
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.
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.
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.
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.
NOTE:
xx is the variable number that takes values from 0 to 20
yyyy is the value, a string of 14 characters maximum
Press “Save configuration” to permanently save the parameters modified by means of this Web page. They
will be recovered after every reboot.
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.
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
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.
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.
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:
Outbound mail server of the origin mail account. Will be of the smtp.xxxxxxxx.yyy type.
Maximum 35 characters.
User:
Pass:
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.
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.
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.
xxx.xxx.xxx.xxx: A UDP packet has been received. The data comes after the colon and
after a blank space.
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.
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
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.
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.
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.
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
#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.
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) ~
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.
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.
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.
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
8.2.- J5 Connector
J5 is basically dedicated to the communications via serial port function, with the pin assignation set out in
table.
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.
8.4.-Dimensions
The IPACK P-401 gateway measures approx. 38x39 mm. We attach illustration 8 with dimensions plan, seen
from above.
9.3.-Dimensions
The IPACK P-402 measures approx. 50x45 mm
We attach illustration 9 with dimensions plan, seen from above.
10.2.- J5 Connector
J5 is basically dedicated to the communications via serial port function, with the pin assignation set out in
table.
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.
10.4.-Dimensions
The IPACK P-801 gateway measures approx. 38x50,65 mm. We attach illustration with dimensions plan,
seen from above.
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.
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.
The EV-P400 Evaluation Kit for IPACK P400 and P800 series contains the following elements. Check that you
have received the complete KIT.
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.
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.
Configure the terminal at 19200 baud 8 data bits, NO parity and one stop bit.
Type AT and the gateway will respond with OK.